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(