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)

After Change


        service_account_json, api_key, project_id, cloud_region,
        pubsub_topic, registry_id)

    if (response is ""):
        // Device registry already exists
        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)

Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 6

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