c8a2ce20be850ed99e8b7fb0d3ff48ec025fb4f0,iot/api-client/manager/manager.py,,list_devices,#Any#Any#Any#Any#,286

Before Change


    print("Listing devices")
    registry_path = "projects/{}/locations/{}/registries/{}".format(
            project_id, cloud_region, registry_id)
    client = get_client(service_account_json)
    devices = client.projects().locations().registries().devices(
            ).list(parent=registry_path).execute().get("devices", [])

    for device in devices:
        print("Device: {} : {}".format(
                device.get("numId"),
                device.get("id")))

    return devices

After Change


    // [START iot_list_devices]
    print("Listing devices")

    client = iot_v1.DeviceManagerClient()
    registry_path = client.registry_path(project_id, cloud_region, registry_id)

    devices = list(client.list_devices(parent=registry_path))
    for device in devices:
        print("Device: {} : {}".format(device.num_id, device.id))

    return devices
    // [END iot_list_devices]
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 15

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: list_devices


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: list_devices


Project Name: GoogleCloudPlatform/python-docs-samples
Commit Name: 223abdede96295f7fba58a1d1e1fb63a961c33f5
Time: 2019-10-09
Author: gguuss@gmail.com
File Name: iot/api-client/manager/manager.py
Class Name:
Method Name: list_gateways


Project Name: GoogleCloudPlatform/python-docs-samples
Commit Name: 14995eb1b0921a5afbfb094993aeb0485f3f4d55
Time: 2019-10-18
Author: gguuss@gmail.com
File Name: iot/api-client/manager/manager.py
Class Name:
Method Name: get_config_versions