6f9eacfd1d5f6ebf961d134f538e7613c0b9fc25,kms/api-client/snippets.py,,create_key_ring,#Any#Any#Any#,24
Before Change
Creates a KeyRing in the given location (e.g. global).
// Creates an API client for the KMS API.
kms_client = googleapiclient.discovery.build("cloudkms", "v1")
// The resource name of the location associated with the KeyRing.
parent = "projects/{}/locations/{}".format(project_id, location_id)
// Create KeyRing
request = kms_client.projects().locations().keyRings().create(
parent=parent, body={}, keyRingId=key_ring_id)
response = request.execute()
print("Created KeyRing {}.".format(response["name"]))
// [END kms_create_keyring]
After Change
// The keyring object template
keyring_name = client.key_ring_path(project_id, location_id, key_ring_id)
keyring = {"name": keyring_name}
// Create a KeyRing
response = client.create_key_ring(parent, key_ring_id, keyring)
print("Created KeyRing {}.".format(response.name))
return response
// [END kms_create_keyring]
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 12
Instances
Project Name: GoogleCloudPlatform/python-docs-samples
Commit Name: 6f9eacfd1d5f6ebf961d134f538e7613c0b9fc25
Time: 2019-01-07
Author: d.sanche14@gmail.com
File Name: kms/api-client/snippets.py
Class Name:
Method Name: create_key_ring
Project Name: GoogleCloudPlatform/python-docs-samples
Commit Name: 6f9eacfd1d5f6ebf961d134f538e7613c0b9fc25
Time: 2019-01-07
Author: d.sanche14@gmail.com
File Name: kms/api-client/snippets.py
Class Name:
Method Name: enable_crypto_key_version
Project Name: GoogleCloudPlatform/python-docs-samples
Commit Name: 6f9eacfd1d5f6ebf961d134f538e7613c0b9fc25
Time: 2019-01-07
Author: d.sanche14@gmail.com
File Name: kms/api-client/snippets.py
Class Name:
Method Name: disable_crypto_key_version