Skip to content

Instantly share code, notes, and snippets.

@bcoe
Created September 28, 2023 00:19
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bcoe/a3c6ec96f7cfea8d5464614d46eea0c7 to your computer and use it in GitHub Desktop.
Save bcoe/a3c6ec96f7cfea8d5464614d46eea0c7 to your computer and use it in GitHub Desktop.
testing cached discovery
from googleapiclient import discovery
api_scopes = ["https://www.googleapis.com/auth/cloud-platform"]
api_version = "v1"
discovery_api = "https://cloudiot.googleapis.com/$discovery/rest"
service_name = "cloudiot"
discovery_url = "{}?version={}".format(discovery_api, api_version)
client = discovery.build(
service_name,
api_version,
discoveryServiceUrl=discovery_url,
credentials=scoped_credentials,
cache_discovery=True,
devices = client.projects().locations().registries().devices()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment