Class: Google::Apis::CloudkmsV1::CloudKMSService

Inherits:
Google::Apis::Core::BaseService show all
Defined in:
generated/google/apis/cloudkms_v1/service.rb

Overview

Cloud Key Management Service (KMS) API

Manages keys and performs cryptographic operations in a central cloud service, for direct use by other cloud resources and applications.

Examples:

require 'google/apis/cloudkms_v1'

Cloudkms = Google::Apis::CloudkmsV1 # Alias the module
service = Cloudkms::CloudKMSService.new

See Also:

Instance Attribute Summary collapse

Attributes inherited from Google::Apis::Core::BaseService

#authorization, #base_path, #batch_path, #client, #client_options, #request_options, #root_url, #upload_path

Instance Method Summary collapse

Methods inherited from Google::Apis::Core::BaseService

#batch, #batch_upload, #fetch_all, #http

Methods included from Google::Apis::Core::Logging

#logger

Constructor Details

#initializeCloudKMSService


46
47
48
49
# File 'generated/google/apis/cloudkms_v1/service.rb', line 46

def initialize
  super('https://cloudkms.googleapis.com/', '')
  @batch_path = 'batch'
end

Instance Attribute Details

#keyString


39
40
41
# File 'generated/google/apis/cloudkms_v1/service.rb', line 39

def key
  @key
end

#quota_userString


44
45
46
# File 'generated/google/apis/cloudkms_v1/service.rb', line 44

def quota_user
  @quota_user
end

Instance Method Details

#asymmetric_crypto_key_version_decrypt(name, asymmetric_decrypt_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::CloudkmsV1::AsymmetricDecryptResponse

Decrypts data that was encrypted with a public key retrieved from GetPublicKey corresponding to a CryptoKeyVersion with CryptoKey.purpose ASYMMETRIC_DECRYPT.

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Raises:


727
728
729
730
731
732
733
734
735
736
737
# File 'generated/google/apis/cloudkms_v1/service.rb', line 727

def asymmetric_crypto_key_version_decrypt(name, asymmetric_decrypt_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command =  make_simple_command(:post, 'v1/{+name}:asymmetricDecrypt', options)
  command.request_representation = Google::Apis::CloudkmsV1::AsymmetricDecryptRequest::Representation
  command.request_object = asymmetric_decrypt_request_object
  command.response_representation = Google::Apis::CloudkmsV1::AsymmetricDecryptResponse::Representation
  command.response_class = Google::Apis::CloudkmsV1::AsymmetricDecryptResponse
  command.params['name'] = name unless name.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#asymmetric_crypto_key_version_sign(name, asymmetric_sign_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::CloudkmsV1::AsymmetricSignResponse

Signs data using a CryptoKeyVersion with CryptoKey.purpose ASYMMETRIC_SIGN, producing a signature that can be verified with the public key retrieved from GetPublicKey.

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Raises:


762
763
764
765
766
767
768
769
770
771
772
# File 'generated/google/apis/cloudkms_v1/service.rb', line 762

def asymmetric_crypto_key_version_sign(name, asymmetric_sign_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command =  make_simple_command(:post, 'v1/{+name}:asymmetricSign', options)
  command.request_representation = Google::Apis::CloudkmsV1::AsymmetricSignRequest::Representation
  command.request_object = asymmetric_sign_request_object
  command.response_representation = Google::Apis::CloudkmsV1::AsymmetricSignResponse::Representation
  command.response_class = Google::Apis::CloudkmsV1::AsymmetricSignResponse
  command.params['name'] = name unless name.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#create_project_location_key_ring(parent, key_ring_object = nil, key_ring_id: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::CloudkmsV1::KeyRing

Create a new KeyRing in a given Project and Location.

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Raises:


145
146
147
148
149
150
151
152
153
154
155
156
# File 'generated/google/apis/cloudkms_v1/service.rb', line 145

def create_project_location_key_ring(parent, key_ring_object = nil, key_ring_id: nil, fields: nil, quota_user: nil, options: nil, &block)
  command =  make_simple_command(:post, 'v1/{+parent}/keyRings', options)
  command.request_representation = Google::Apis::CloudkmsV1::KeyRing::Representation
  command.request_object = key_ring_object
  command.response_representation = Google::Apis::CloudkmsV1::KeyRing::Representation
  command.response_class = Google::Apis::CloudkmsV1::KeyRing
  command.params['parent'] = parent unless parent.nil?
  command.query['keyRingId'] = key_ring_id unless key_ring_id.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#create_project_location_key_ring_crypto_key(parent, crypto_key_object = nil, crypto_key_id: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::CloudkmsV1::CryptoKey

Create a new CryptoKey within a KeyRing. CryptoKey.purpose and CryptoKey.version_template.algorithm are required.

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Raises:


364
365
366
367
368
369
370
371
372
373
374
375
# File 'generated/google/apis/cloudkms_v1/service.rb', line 364

def create_project_location_key_ring_crypto_key(parent, crypto_key_object = nil, crypto_key_id: nil, fields: nil, quota_user: nil, options: nil, &block)
  command =  make_simple_command(:post, 'v1/{+parent}/cryptoKeys', options)
  command.request_representation = Google::Apis::CloudkmsV1::CryptoKey::Representation
  command.request_object = crypto_key_object
  command.response_representation = Google::Apis::CloudkmsV1::CryptoKey::Representation
  command.response_class = Google::Apis::CloudkmsV1::CryptoKey
  command.params['parent'] = parent unless parent.nil?
  command.query['cryptoKeyId'] = crypto_key_id unless crypto_key_id.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#create_project_location_key_ring_crypto_key_crypto_key_version(parent, crypto_key_version_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::CloudkmsV1::CryptoKeyVersion

Create a new CryptoKeyVersion in a CryptoKey. The server will assign the next sequential id. If unset, state will be set to ENABLED.

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Raises:


799
800
801
802
803
804
805
806
807
808
809
# File 'generated/google/apis/cloudkms_v1/service.rb', line 799

def create_project_location_key_ring_crypto_key_crypto_key_version(parent, crypto_key_version_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command =  make_simple_command(:post, 'v1/{+parent}/cryptoKeyVersions', options)
  command.request_representation = Google::Apis::CloudkmsV1::CryptoKeyVersion::Representation
  command.request_object = crypto_key_version_object
  command.response_representation = Google::Apis::CloudkmsV1::CryptoKeyVersion::Representation
  command.response_class = Google::Apis::CloudkmsV1::CryptoKeyVersion
  command.params['parent'] = parent unless parent.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#decrypt_crypto_key(name, decrypt_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::CloudkmsV1::DecryptResponse

Decrypts data that was protected by Encrypt. The CryptoKey.purpose must be ENCRYPT_DECRYPT.

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Raises:


400
401
402
403
404
405
406
407
408
409
410
# File 'generated/google/apis/cloudkms_v1/service.rb', line 400

def decrypt_crypto_key(name, decrypt_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command =  make_simple_command(:post, 'v1/{+name}:decrypt', options)
  command.request_representation = Google::Apis::CloudkmsV1::DecryptRequest::Representation
  command.request_object = decrypt_request_object
  command.response_representation = Google::Apis::CloudkmsV1::DecryptResponse::Representation
  command.response_class = Google::Apis::CloudkmsV1::DecryptResponse
  command.params['name'] = name unless name.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#destroy_crypto_key_version(name, destroy_crypto_key_version_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::CloudkmsV1::CryptoKeyVersion

Schedule a CryptoKeyVersion for destruction. Upon calling this method, CryptoKeyVersion.state will be set to DESTROY_SCHEDULED and destroy_time will be set to a time 24 hours in the future, at which point the state will be changed to DESTROYED, and the key material will be irrevocably destroyed. Before the destroy_time is reached, RestoreCryptoKeyVersion may be called to reverse the process.

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Raises:


841
842
843
844
845
846
847
848
849
850
851
# File 'generated/google/apis/cloudkms_v1/service.rb', line 841

def destroy_crypto_key_version(name, destroy_crypto_key_version_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command =  make_simple_command(:post, 'v1/{+name}:destroy', options)
  command.request_representation = Google::Apis::CloudkmsV1::DestroyCryptoKeyVersionRequest::Representation
  command.request_object = destroy_crypto_key_version_request_object
  command.response_representation = Google::Apis::CloudkmsV1::CryptoKeyVersion::Representation
  command.response_class = Google::Apis::CloudkmsV1::CryptoKeyVersion
  command.params['name'] = name unless name.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#encrypt_crypto_key(name, encrypt_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::CloudkmsV1::EncryptResponse

Encrypts data, so that it can only be recovered by a call to Decrypt. The CryptoKey.purpose must be ENCRYPT_DECRYPT.

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Raises:


438
439
440
441
442
443
444
445
446
447
448
# File 'generated/google/apis/cloudkms_v1/service.rb', line 438

def encrypt_crypto_key(name, encrypt_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command =  make_simple_command(:post, 'v1/{+name}:encrypt', options)
  command.request_representation = Google::Apis::CloudkmsV1::EncryptRequest::Representation
  command.request_object = encrypt_request_object
  command.response_representation = Google::Apis::CloudkmsV1::EncryptResponse::Representation
  command.response_class = Google::Apis::CloudkmsV1::EncryptResponse
  command.params['name'] = name unless name.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#get_project_location(name, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::CloudkmsV1::Location

Gets information about a location.

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Raises:


71
72
73
74
75
76
77
78
79
# File 'generated/google/apis/cloudkms_v1/service.rb', line 71

def get_project_location(name, fields: nil, quota_user: nil, options: nil, &block)
  command =  make_simple_command(:get, 'v1/{+name}', options)
  command.response_representation = Google::Apis::CloudkmsV1::Location::Representation
  command.response_class = Google::Apis::CloudkmsV1::Location
  command.params['name'] = name unless name.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#get_project_location_key_ring(name, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::CloudkmsV1::KeyRing

Returns metadata for a given KeyRing.

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Raises:


178
179
180
181
182
183
184
185
186
# File 'generated/google/apis/cloudkms_v1/service.rb', line 178

def get_project_location_key_ring(name, fields: nil, quota_user: nil, options: nil, &block)
  command =  make_simple_command(:get, 'v1/{+name}', options)
  command.response_representation = Google::Apis::CloudkmsV1::KeyRing::Representation
  command.response_class = Google::Apis::CloudkmsV1::KeyRing
  command.params['name'] = name unless name.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#get_project_location_key_ring_crypto_key(name, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::CloudkmsV1::CryptoKey

Returns metadata for a given CryptoKey, as well as its primary CryptoKeyVersion.

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Raises:


471
472
473
474
475
476
477
478
479
# File 'generated/google/apis/cloudkms_v1/service.rb', line 471

def get_project_location_key_ring_crypto_key(name, fields: nil, quota_user: nil, options: nil, &block)
  command =  make_simple_command(:get, 'v1/{+name}', options)
  command.response_representation = Google::Apis::CloudkmsV1::CryptoKey::Representation
  command.response_class = Google::Apis::CloudkmsV1::CryptoKey
  command.params['name'] = name unless name.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#get_project_location_key_ring_crypto_key_crypto_key_version(name, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::CloudkmsV1::CryptoKeyVersion

Returns metadata for a given CryptoKeyVersion.

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Raises:


873
874
875
876
877
878
879
880
881
# File 'generated/google/apis/cloudkms_v1/service.rb', line 873

def get_project_location_key_ring_crypto_key_crypto_key_version(name, fields: nil, quota_user: nil, options: nil, &block)
  command =  make_simple_command(:get, 'v1/{+name}', options)
  command.response_representation = Google::Apis::CloudkmsV1::CryptoKeyVersion::Representation
  command.response_class = Google::Apis::CloudkmsV1::CryptoKeyVersion
  command.params['name'] = name unless name.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#get_project_location_key_ring_crypto_key_crypto_key_version_public_key(name, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::CloudkmsV1::PublicKey

Returns the public key for the given CryptoKeyVersion. The CryptoKey.purpose must be ASYMMETRIC_SIGN or ASYMMETRIC_DECRYPT.

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Raises:


907
908
909
910
911
912
913
914
915
# File 'generated/google/apis/cloudkms_v1/service.rb', line 907

def get_project_location_key_ring_crypto_key_crypto_key_version_public_key(name, fields: nil, quota_user: nil, options: nil, &block)
  command =  make_simple_command(:get, 'v1/{+name}/publicKey', options)
  command.response_representation = Google::Apis::CloudkmsV1::PublicKey::Representation
  command.response_class = Google::Apis::CloudkmsV1::PublicKey
  command.params['name'] = name unless name.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#get_project_location_key_ring_crypto_key_iam_policy(resource, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::CloudkmsV1::Policy

Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set.

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Raises:


504
505
506
507
508
509
510
511
512
# File 'generated/google/apis/cloudkms_v1/service.rb', line 504

def get_project_location_key_ring_crypto_key_iam_policy(resource, fields: nil, quota_user: nil, options: nil, &block)
  command =  make_simple_command(:get, 'v1/{+resource}:getIamPolicy', options)
  command.response_representation = Google::Apis::CloudkmsV1::Policy::Representation
  command.response_class = Google::Apis::CloudkmsV1::Policy
  command.params['resource'] = resource unless resource.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#get_project_location_key_ring_iam_policy(resource, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::CloudkmsV1::Policy

Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set.

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Raises:


211
212
213
214
215
216
217
218
219
# File 'generated/google/apis/cloudkms_v1/service.rb', line 211

def get_project_location_key_ring_iam_policy(resource, fields: nil, quota_user: nil, options: nil, &block)
  command =  make_simple_command(:get, 'v1/{+resource}:getIamPolicy', options)
  command.response_representation = Google::Apis::CloudkmsV1::Policy::Representation
  command.response_class = Google::Apis::CloudkmsV1::Policy
  command.params['resource'] = resource unless resource.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#get_project_location_key_ring_import_job_iam_policy(resource, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::CloudkmsV1::Policy

Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set.

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Raises:


1065
1066
1067
1068
1069
1070
1071
1072
1073
# File 'generated/google/apis/cloudkms_v1/service.rb', line 1065

def get_project_location_key_ring_import_job_iam_policy(resource, fields: nil, quota_user: nil, options: nil, &block)
  command =  make_simple_command(:get, 'v1/{+resource}:getIamPolicy', options)
  command.response_representation = Google::Apis::CloudkmsV1::Policy::Representation
  command.response_class = Google::Apis::CloudkmsV1::Policy
  command.params['resource'] = resource unless resource.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#list_project_location_key_ring_crypto_key_crypto_key_versions(parent, page_size: nil, page_token: nil, view: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::CloudkmsV1::ListCryptoKeyVersionsResponse

Lists CryptoKeyVersions.

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Raises:


949
950
951
952
953
954
955
956
957
958
959
960
# File 'generated/google/apis/cloudkms_v1/service.rb', line 949

def list_project_location_key_ring_crypto_key_crypto_key_versions(parent, page_size: nil, page_token: nil, view: nil, fields: nil, quota_user: nil, options: nil, &block)
  command =  make_simple_command(:get, 'v1/{+parent}/cryptoKeyVersions', options)
  command.response_representation = Google::Apis::CloudkmsV1::ListCryptoKeyVersionsResponse::Representation
  command.response_class = Google::Apis::CloudkmsV1::ListCryptoKeyVersionsResponse
  command.params['parent'] = parent unless parent.nil?
  command.query['pageSize'] = page_size unless page_size.nil?
  command.query['pageToken'] = page_token unless page_token.nil?
  command.query['view'] = view unless view.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#list_project_location_key_ring_crypto_keys(parent, page_size: nil, page_token: nil, version_view: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::CloudkmsV1::ListCryptoKeysResponse

Lists CryptoKeys.

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Raises:


545
546
547
548
549
550
551
552
553
554
555
556
# File 'generated/google/apis/cloudkms_v1/service.rb', line 545

def list_project_location_key_ring_crypto_keys(parent, page_size: nil, page_token: nil, version_view: nil, fields: nil, quota_user: nil, options: nil, &block)
  command =  make_simple_command(:get, 'v1/{+parent}/cryptoKeys', options)
  command.response_representation = Google::Apis::CloudkmsV1::ListCryptoKeysResponse::Representation
  command.response_class = Google::Apis::CloudkmsV1::ListCryptoKeysResponse
  command.params['parent'] = parent unless parent.nil?
  command.query['pageSize'] = page_size unless page_size.nil?
  command.query['pageToken'] = page_token unless page_token.nil?
  command.query['versionView'] = version_view unless version_view.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#list_project_location_key_rings(parent, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::CloudkmsV1::ListKeyRingsResponse

Lists KeyRings.

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Raises:


250
251
252
253
254
255
256
257
258
259
260
# File 'generated/google/apis/cloudkms_v1/service.rb', line 250

def list_project_location_key_rings(parent, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
  command =  make_simple_command(:get, 'v1/{+parent}/keyRings', options)
  command.response_representation = Google::Apis::CloudkmsV1::ListKeyRingsResponse::Representation
  command.response_class = Google::Apis::CloudkmsV1::ListKeyRingsResponse
  command.params['parent'] = parent unless parent.nil?
  command.query['pageSize'] = page_size unless page_size.nil?
  command.query['pageToken'] = page_token unless page_token.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#list_project_locations(name, filter: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::CloudkmsV1::ListLocationsResponse

Lists information about the supported locations for this service.

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Raises:


107
108
109
110
111
112
113
114
115
116
117
118
# File 'generated/google/apis/cloudkms_v1/service.rb', line 107

def list_project_locations(name, filter: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
  command =  make_simple_command(:get, 'v1/{+name}/locations', options)
  command.response_representation = Google::Apis::CloudkmsV1::ListLocationsResponse::Representation
  command.response_class = Google::Apis::CloudkmsV1::ListLocationsResponse
  command.params['name'] = name unless name.nil?
  command.query['filter'] = filter unless filter.nil?
  command.query['pageSize'] = page_size unless page_size.nil?
  command.query['pageToken'] = page_token unless page_token.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#patch_project_location_key_ring_crypto_key(name, crypto_key_object = nil, update_mask: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::CloudkmsV1::CryptoKey

Update a CryptoKey.

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Raises:


582
583
584
585
586
587
588
589
590
591
592
593
# File 'generated/google/apis/cloudkms_v1/service.rb', line 582

def patch_project_location_key_ring_crypto_key(name, crypto_key_object = nil, update_mask: nil, fields: nil, quota_user: nil, options: nil, &block)
  command =  make_simple_command(:patch, 'v1/{+name}', options)
  command.request_representation = Google::Apis::CloudkmsV1::CryptoKey::Representation
  command.request_object = crypto_key_object
  command.response_representation = Google::Apis::CloudkmsV1::CryptoKey::Representation
  command.response_class = Google::Apis::CloudkmsV1::CryptoKey
  command.params['name'] = name unless name.nil?
  command.query['updateMask'] = update_mask unless update_mask.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#patch_project_location_key_ring_crypto_key_crypto_key_version(name, crypto_key_version_object = nil, update_mask: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::CloudkmsV1::CryptoKeyVersion

Update a CryptoKeyVersion's metadata. state may be changed between ENABLED and DISABLED using this method. See DestroyCryptoKeyVersion and RestoreCryptoKeyVersion to move between other states.

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Raises:


991
992
993
994
995
996
997
998
999
1000
1001
1002
# File 'generated/google/apis/cloudkms_v1/service.rb', line 991

def patch_project_location_key_ring_crypto_key_crypto_key_version(name, crypto_key_version_object = nil, update_mask: nil, fields: nil, quota_user: nil, options: nil, &block)
  command =  make_simple_command(:patch, 'v1/{+name}', options)
  command.request_representation = Google::Apis::CloudkmsV1::CryptoKeyVersion::Representation
  command.request_object = crypto_key_version_object
  command.response_representation = Google::Apis::CloudkmsV1::CryptoKeyVersion::Representation
  command.response_class = Google::Apis::CloudkmsV1::CryptoKeyVersion
  command.params['name'] = name unless name.nil?
  command.query['updateMask'] = update_mask unless update_mask.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#restore_crypto_key_version(name, restore_crypto_key_version_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::CloudkmsV1::CryptoKeyVersion

Restore a CryptoKeyVersion in the DESTROY_SCHEDULED state. Upon restoration of the CryptoKeyVersion, state will be set to DISABLED, and destroy_time will be cleared.

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Raises:


1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
# File 'generated/google/apis/cloudkms_v1/service.rb', line 1030

def restore_crypto_key_version(name, restore_crypto_key_version_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command =  make_simple_command(:post, 'v1/{+name}:restore', options)
  command.request_representation = Google::Apis::CloudkmsV1::RestoreCryptoKeyVersionRequest::Representation
  command.request_object = restore_crypto_key_version_request_object
  command.response_representation = Google::Apis::CloudkmsV1::CryptoKeyVersion::Representation
  command.response_class = Google::Apis::CloudkmsV1::CryptoKeyVersion
  command.params['name'] = name unless name.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#set_crypto_key_iam_policy(resource, set_iam_policy_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::CloudkmsV1::Policy

Sets the access control policy on the specified resource. Replaces any existing policy.

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Raises:


618
619
620
621
622
623
624
625
626
627
628
# File 'generated/google/apis/cloudkms_v1/service.rb', line 618

def set_crypto_key_iam_policy(resource, set_iam_policy_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command =  make_simple_command(:post, 'v1/{+resource}:setIamPolicy', options)
  command.request_representation = Google::Apis::CloudkmsV1::SetIamPolicyRequest::Representation
  command.request_object = set_iam_policy_request_object
  command.response_representation = Google::Apis::CloudkmsV1::Policy::Representation
  command.response_class = Google::Apis::CloudkmsV1::Policy
  command.params['resource'] = resource unless resource.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#set_import_job_iam_policy(resource, set_iam_policy_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::CloudkmsV1::Policy

Sets the access control policy on the specified resource. Replaces any existing policy.

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Raises:


1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
# File 'generated/google/apis/cloudkms_v1/service.rb', line 1098

def set_import_job_iam_policy(resource, set_iam_policy_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command =  make_simple_command(:post, 'v1/{+resource}:setIamPolicy', options)
  command.request_representation = Google::Apis::CloudkmsV1::SetIamPolicyRequest::Representation
  command.request_object = set_iam_policy_request_object
  command.response_representation = Google::Apis::CloudkmsV1::Policy::Representation
  command.response_class = Google::Apis::CloudkmsV1::Policy
  command.params['resource'] = resource unless resource.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#set_key_ring_iam_policy(resource, set_iam_policy_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::CloudkmsV1::Policy

Sets the access control policy on the specified resource. Replaces any existing policy.

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Raises:


285
286
287
288
289
290
291
292
293
294
295
# File 'generated/google/apis/cloudkms_v1/service.rb', line 285

def set_key_ring_iam_policy(resource, set_iam_policy_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command =  make_simple_command(:post, 'v1/{+resource}:setIamPolicy', options)
  command.request_representation = Google::Apis::CloudkmsV1::SetIamPolicyRequest::Representation
  command.request_object = set_iam_policy_request_object
  command.response_representation = Google::Apis::CloudkmsV1::Policy::Representation
  command.response_class = Google::Apis::CloudkmsV1::Policy
  command.params['resource'] = resource unless resource.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#test_crypto_key_iam_permissions(resource, test_iam_permissions_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::CloudkmsV1::TestIamPermissionsResponse

Returns permissions that a caller has on the specified resource. If the resource does not exist, this will return an empty set of permissions, not a NOT_FOUND error. Note: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may "fail open" without warning.

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Raises:


657
658
659
660
661
662
663
664
665
666
667
# File 'generated/google/apis/cloudkms_v1/service.rb', line 657

def test_crypto_key_iam_permissions(resource, test_iam_permissions_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command =  make_simple_command(:post, 'v1/{+resource}:testIamPermissions', options)
  command.request_representation = Google::Apis::CloudkmsV1::TestIamPermissionsRequest::Representation
  command.request_object = test_iam_permissions_request_object
  command.response_representation = Google::Apis::CloudkmsV1::TestIamPermissionsResponse::Representation
  command.response_class = Google::Apis::CloudkmsV1::TestIamPermissionsResponse
  command.params['resource'] = resource unless resource.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#test_import_job_iam_permissions(resource, test_iam_permissions_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::CloudkmsV1::TestIamPermissionsResponse

Returns permissions that a caller has on the specified resource. If the resource does not exist, this will return an empty set of permissions, not a NOT_FOUND error. Note: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may "fail open" without warning.

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Raises:


1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
# File 'generated/google/apis/cloudkms_v1/service.rb', line 1137

def test_import_job_iam_permissions(resource, test_iam_permissions_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command =  make_simple_command(:post, 'v1/{+resource}:testIamPermissions', options)
  command.request_representation = Google::Apis::CloudkmsV1::TestIamPermissionsRequest::Representation
  command.request_object = test_iam_permissions_request_object
  command.response_representation = Google::Apis::CloudkmsV1::TestIamPermissionsResponse::Representation
  command.response_class = Google::Apis::CloudkmsV1::TestIamPermissionsResponse
  command.params['resource'] = resource unless resource.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#test_key_ring_iam_permissions(resource, test_iam_permissions_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::CloudkmsV1::TestIamPermissionsResponse

Returns permissions that a caller has on the specified resource. If the resource does not exist, this will return an empty set of permissions, not a NOT_FOUND error. Note: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may "fail open" without warning.

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Raises:


324
325
326
327
328
329
330
331
332
333
334
# File 'generated/google/apis/cloudkms_v1/service.rb', line 324

def test_key_ring_iam_permissions(resource, test_iam_permissions_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command =  make_simple_command(:post, 'v1/{+resource}:testIamPermissions', options)
  command.request_representation = Google::Apis::CloudkmsV1::TestIamPermissionsRequest::Representation
  command.request_object = test_iam_permissions_request_object
  command.response_representation = Google::Apis::CloudkmsV1::TestIamPermissionsResponse::Representation
  command.response_class = Google::Apis::CloudkmsV1::TestIamPermissionsResponse
  command.params['resource'] = resource unless resource.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#update_project_location_key_ring_crypto_key_primary_version(name, update_crypto_key_primary_version_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::CloudkmsV1::CryptoKey

Update the version of a CryptoKey that will be used in Encrypt. Returns an error if called on an asymmetric key.

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Raises:


691
692
693
694
695
696
697
698
699
700
701
# File 'generated/google/apis/cloudkms_v1/service.rb', line 691

def update_project_location_key_ring_crypto_key_primary_version(name, update_crypto_key_primary_version_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command =  make_simple_command(:post, 'v1/{+name}:updatePrimaryVersion', options)
  command.request_representation = Google::Apis::CloudkmsV1::UpdateCryptoKeyPrimaryVersionRequest::Representation
  command.request_object = update_crypto_key_primary_version_request_object
  command.response_representation = Google::Apis::CloudkmsV1::CryptoKey::Representation
  command.response_class = Google::Apis::CloudkmsV1::CryptoKey
  command.params['name'] = name unless name.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end