Skip to content

Commit 0fc7a44

Browse files
hjfreyerJon Wayne Parrott
authored andcommitted
A few fixes in the quickstart (#754)
* Use camelCase when accessing the fields. * Rename zone -> location, and fix an incorrect statement about how "global" works.
1 parent fa8bc81 commit 0fc7a44

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

kms/api/quickstart.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,22 +22,22 @@ def run_quickstart():
2222
# Your Google Cloud Platform project ID
2323
project_id = 'YOUR_PROJECT_ID'
2424

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

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

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

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

38-
if 'key_rings' in response and len(response['key_rings']):
38+
if 'keyRings' in response and response['keyRings']:
3939
print('Key rings:')
40-
for key_ring in response['key_rings']:
40+
for key_ring in response['keyRings']:
4141
print(key_ring['name'])
4242
else:
4343
print('No key rings found.')

0 commit comments

Comments
 (0)