Skip to content

Migrate IoT to Cloud Client library #2396

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
gguuss opened this issue Sep 12, 2019 · 3 comments
Closed

Migrate IoT to Cloud Client library #2396

gguuss opened this issue Sep 12, 2019 · 3 comments
Assignees
Labels
Data Analytics / ML / IoT 🚨 This issue needs some love. triage me I really want to be triaged.

Comments

@gguuss
Copy link
Contributor

gguuss commented Sep 12, 2019

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]
@gguuss gguuss self-assigned this Sep 12, 2019
@JustinBeckwith JustinBeckwith added 🚨 This issue needs some love. triage me I really want to be triaged. labels Oct 3, 2019
@gguuss
Copy link
Contributor Author

gguuss commented Oct 9, 2019

We're pretty close here, after this PR closes, we'll just have the Cloud => Device functionality remaining.

@gguuss
Copy link
Contributor Author

gguuss commented Oct 16, 2019

We can close this when this PR merges.

@gguuss
Copy link
Contributor Author

gguuss commented Oct 18, 2019

Resolved!

@gguuss gguuss closed this as completed Oct 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Data Analytics / ML / IoT 🚨 This issue needs some love. triage me I really want to be triaged.
Projects
None yet
Development

No branches or pull requests

3 participants