fcaf37ca034fecabeda10af7e5fe3c92760c2b48,iot/api-client/manager/manager.py,,open_registry,#Any#Any#Any#Any#Any#Any#,249

Before Change


        registry_id):
    Gets or creates a device registry.
    print("Creating registry")
    client = get_client(service_account_json, api_key)
    registry_parent = "projects/{}/locations/{}".format(
            project_id,
            cloud_region)
    body = {
        "eventNotificationConfig": {
            "pubsubTopicName": pubsub_topic
        },
        "id": registry_id
    }
    request = client.projects().locations().registries().create(
        parent=registry_parent, body=body)

    try:
        response = request.execute()
        print("Created registry", registry_id)
        print(response)
    except HttpError as e:
        if e.resp.status == 409:

After Change


        print(
            "Registry {} already exists - looking it up instead.".format(
                registry_id))
        response = get_registry(
            service_account_json, api_key, project_id, cloud_region,
            registry_id)

    print("Registry {} opened: ".format(response.get("name")))
    print(response)


def patch_es256_auth(
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 9

Instances


Project Name: GoogleCloudPlatform/python-docs-samples
Commit Name: fcaf37ca034fecabeda10af7e5fe3c92760c2b48
Time: 2017-09-12
Author: gguuss@gmail.com
File Name: iot/api-client/manager/manager.py
Class Name:
Method Name: open_registry


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: 223abdede96295f7fba58a1d1e1fb63a961c33f5
Time: 2019-10-09
Author: gguuss@gmail.com
File Name: iot/api-client/manager/manager.py
Class Name:
Method Name: bind_device_to_gateway