Skip to content

A few fixes in the quickstart #754

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

Merged
merged 1 commit into from
Jan 11, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions kms/api/quickstart.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,22 +22,22 @@ def run_quickstart():
# Your Google Cloud Platform project ID
project_id = 'YOUR_PROJECT_ID'

# The "global" zone lists all keys. It can be a specific zone if desired.
zone = 'global'
# Lists keys in the "global" location.
location = 'global'

# Instantiates a client
kms_client = discovery.build('cloudkms', 'v1beta1')

# The resource name of the location associated with the KeyRings
parent = 'projects/{}/locations/{}'.format(project_id, zone)
parent = 'projects/{}/locations/{}'.format(project_id, location)

# Lists key rings
request = kms_client.projects().locations().keyRings().list(parent=parent)
response = request.execute()

if 'key_rings' in response and len(response['key_rings']):
if 'keyRings' in response and response['keyRings']:
print('Key rings:')
for key_ring in response['key_rings']:
for key_ring in response['keyRings']:
print(key_ring['name'])
else:
print('No key rings found.')
Expand Down