Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Migrate IoT to Cloud Client library #2396

Copy link
Copy link
Closed
@gguuss

Description

@gguuss
Issue body actions

It's easier to instantiate the client using the newer Cloud Client library so it's a good idea to migrate.

The following example code shows how to do it:

def list_registries(service_account_json, project_id, cloud_region):
    """List all registries in the project."""
    # [START iot_list_registries]
    print('Listing Registries')
    client = iot_v1.DeviceManagerClient()

    parent = client.location_path(project_id, cloud_region)

    registries = client.list_device_registries(parent)

    for registry in registries:
        print('id: {}\n\tname: {}'.format(
            registry.id,
            registry.name))

    return registries
    # [END iot_list_registries]

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    Morty Proxy This is a proxified and sanitized view of the page, visit original site.