c8a2ce20be850ed99e8b7fb0d3ff48ec025fb4f0,iot/api-client/manager/manager.py,,get_state,#Any#Any#Any#Any#Any#,267
Before Change
device_id):
Retrieve a device"s state blobs.
// [START iot_get_device_state]
client = get_client(service_account_json)
registry_name = "projects/{}/locations/{}/registries/{}".format(
project_id, cloud_region, registry_id)
device_name = "{}/devices/{}".format(registry_name, device_id)
devices = client.projects().locations().registries().devices()
state = devices.states().list(name=device_name, numStates=5).execute()
print("State: {}\n".format(state))
return state
After Change
device_id):
Retrieve a device"s state blobs.
// [START iot_get_device_state]
client = iot_v1.DeviceManagerClient()
device_path = client.device_path(
project_id, cloud_region, registry_id, device_id)
device = client.get_device(device_path)
print("Last state: {}".format(device.state))
print("State history")
states = client.list_device_states(device_path).device_states
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 12
Instances
Project Name: GoogleCloudPlatform/python-docs-samples
Commit Name: c8a2ce20be850ed99e8b7fb0d3ff48ec025fb4f0
Time: 2019-09-26
Author: gguuss@gmail.com
File Name: iot/api-client/manager/manager.py
Class Name:
Method Name: get_state
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: patch_rsa256_auth
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: patch_es256_auth