900900b869f3327d932b5fb9bdefcf475b0f7f24,iot/api-client/manager/manager.py,,create_es256_device,#Any#Any#Any#Any#Any#Any#,113

Before Change


    registry_name = "projects/{}/locations/{}/registries/{}".format(
            project_id, cloud_region, registry_id)

    client = get_client(service_account_json)
    with io.open(public_key_file) as f:
        public_key = f.read()

    // Note: You can have multiple credentials associated with a device.
    device_template = {
        "id": device_id,
        "credentials": [{
            "publicKey": {
                "format": "ES256_PEM",
                "key": public_key
            }
        }]
    }

    devices = client.projects().locations().registries().devices()
    return devices.create(parent=registry_name, body=device_template).execute()
    // [END iot_create_es_device]


def create_device(

After Change


    Create a new device with the given id, using ES256 for
    authentication.
    // [START iot_create_es_device]
    client = iot_v1.DeviceManagerClient()

    parent = client.registry_path(project_id, cloud_region, registry_id)

    with io.open(public_key_file) as f:
        public_key = f.read()

    // Note: You can have multiple credentials associated with a device.
    device_template = {
        "id": device_id,
        "credentials": [{
            "public_key": {
                "format": "ES256_PEM",
                "key": public_key
            }
        }]
    }

    return client.create_device(parent, device_template)
    // [END iot_create_es_device]


def create_device(
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 14

Instances


Project Name: GoogleCloudPlatform/python-docs-samples
Commit Name: 900900b869f3327d932b5fb9bdefcf475b0f7f24
Time: 2019-10-07
Author: gguuss@gmail.com
File Name: iot/api-client/manager/manager.py
Class Name:
Method Name: create_es256_device


Project Name: GoogleCloudPlatform/python-docs-samples
Commit Name: 900900b869f3327d932b5fb9bdefcf475b0f7f24
Time: 2019-10-07
Author: gguuss@gmail.com
File Name: iot/api-client/manager/manager.py
Class Name:
Method Name: create_unauth_device


Project Name: GoogleCloudPlatform/python-docs-samples
Commit Name: 900900b869f3327d932b5fb9bdefcf475b0f7f24
Time: 2019-10-07
Author: gguuss@gmail.com
File Name: iot/api-client/manager/manager.py
Class Name:
Method Name: create_rs256_device