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

Returns a new instance of CloudKMSService.


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

Returns API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.

Returns:

  • (String)

    API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.


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

def key
  @key
end

#quota_userString

Returns Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

Returns:

  • (String)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.


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.

Parameters:

  • name (String)

    Required. The resource name of the CryptoKeyVersion to use for decryption.

  • asymmetric_decrypt_request_object (Google::Apis::CloudkmsV1::AsymmetricDecryptRequest) (defaults to: nil)
  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:


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

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.

Parameters:

  • name (String)

    Required. The resource name of the CryptoKeyVersion to use for signing.

  • asymmetric_sign_request_object (Google::Apis::CloudkmsV1::AsymmetricSignRequest) (defaults to: nil)
  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:


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

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.

Parameters:

  • parent (String)

    Required. The resource name of the location associated with the KeyRings, in the format projects/*/locations/*.

  • key_ring_object (Google::Apis::CloudkmsV1::KeyRing) (defaults to: nil)
  • key_ring_id (String) (defaults to: nil)

    Required. It must be unique within a location and match the regular expression [a-zA-Z0-9_-]1,63``

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

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, skip_initial_version_creation: 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.

Parameters:

  • parent (String)

    Required. The name of the KeyRing associated with the CryptoKeys.

  • crypto_key_object (Google::Apis::CloudkmsV1::CryptoKey) (defaults to: nil)
  • crypto_key_id (String) (defaults to: nil)

    Required. It must be unique within a KeyRing and match the regular expression [a-zA-Z0-9_-]1,63``

  • skip_initial_version_creation (Boolean) (defaults to: nil)

    If set to true, the request will create a CryptoKey without any CryptoKeyVersions. You must manually call CreateCryptoKeyVersion or ImportCryptoKeyVersion before you can use this CryptoKey.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:


384
385
386
387
388
389
390
391
392
393
394
395
396
# File 'generated/google/apis/cloudkms_v1/service.rb', line 384

def create_project_location_key_ring_crypto_key(parent, crypto_key_object = nil, crypto_key_id: nil, skip_initial_version_creation: 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['skipInitialVersionCreation'] = skip_initial_version_creation unless skip_initial_version_creation.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.

Parameters:

  • parent (String)

    Required. The name of the CryptoKey associated with the CryptoKeyVersions.

  • crypto_key_version_object (Google::Apis::CloudkmsV1::CryptoKeyVersion) (defaults to: nil)
  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:


832
833
834
835
836
837
838
839
840
841
842
# File 'generated/google/apis/cloudkms_v1/service.rb', line 832

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

#create_project_location_key_ring_import_job(parent, import_job_object = nil, import_job_id: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::CloudkmsV1::ImportJob

Create a new ImportJob within a KeyRing. ImportJob.import_method is required.

Parameters:

  • parent (String)

    Required. The name of the KeyRing associated with the ImportJobs.

  • import_job_object (Google::Apis::CloudkmsV1::ImportJob) (defaults to: nil)
  • import_job_id (String) (defaults to: nil)

    Required. It must be unique within a KeyRing and match the regular expression [a-zA-Z0-9_-]1,63``

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:


1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
# File 'generated/google/apis/cloudkms_v1/service.rb', line 1131

def create_project_location_key_ring_import_job(parent, import_job_object = nil, import_job_id: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'v1/{+parent}/importJobs', options)
  command.request_representation = Google::Apis::CloudkmsV1::ImportJob::Representation
  command.request_object = import_job_object
  command.response_representation = Google::Apis::CloudkmsV1::ImportJob::Representation
  command.response_class = Google::Apis::CloudkmsV1::ImportJob
  command.params['parent'] = parent unless parent.nil?
  command.query['importJobId'] = import_job_id unless import_job_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

#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.

Parameters:

  • name (String)

    Required. The resource name of the CryptoKey to use for decryption. The server will choose the appropriate version.

  • decrypt_request_object (Google::Apis::CloudkmsV1::DecryptRequest) (defaults to: nil)
  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:


421
422
423
424
425
426
427
428
429
430
431
# File 'generated/google/apis/cloudkms_v1/service.rb', line 421

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.

Parameters:

  • name (String)

    Required. The resource name of the CryptoKeyVersion to destroy.

  • destroy_crypto_key_version_request_object (Google::Apis::CloudkmsV1::DestroyCryptoKeyVersionRequest) (defaults to: nil)
  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:


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

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.

Parameters:

  • name (String)

    Required. The resource name of the CryptoKey or CryptoKeyVersion to use for encryption. If a CryptoKey is specified, the server will use its primary version.

  • encrypt_request_object (Google::Apis::CloudkmsV1::EncryptRequest) (defaults to: nil)
  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:


457
458
459
460
461
462
463
464
465
466
467
# File 'generated/google/apis/cloudkms_v1/service.rb', line 457

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.

Parameters:

  • name (String)

    Resource name for the location.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

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.

Parameters:

  • name (String)

    Required. The name of the KeyRing to get.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

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.

Parameters:

  • name (String)

    Required. The name of the CryptoKey to get.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:


490
491
492
493
494
495
496
497
498
# File 'generated/google/apis/cloudkms_v1/service.rb', line 490

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.

Parameters:

  • name (String)

    Required. The name of the CryptoKeyVersion to get.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:


902
903
904
905
906
907
908
909
910
# File 'generated/google/apis/cloudkms_v1/service.rb', line 902

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.

Parameters:

  • name (String)

    Required. The name of the CryptoKeyVersion public key to get.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:


933
934
935
936
937
938
939
940
941
# File 'generated/google/apis/cloudkms_v1/service.rb', line 933

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, options_requested_policy_version: nil, 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.

Parameters:

  • resource (String)

    REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field.

  • options_requested_policy_version (Fixnum) (defaults to: nil)

    Optional. The policy format version to be returned. Valid values are 0, 1, and

    1. Requests specifying an invalid value will be rejected. Requests for policies with any conditional bindings must specify version 3. Policies without any conditional bindings may specify any valid value or leave the field unset. To learn which resources support conditions in their IAM policies, see the IAM documentation.
  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:


530
531
532
533
534
535
536
537
538
539
# File 'generated/google/apis/cloudkms_v1/service.rb', line 530

def get_project_location_key_ring_crypto_key_iam_policy(resource, options_requested_policy_version: nil, 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['options.requestedPolicyVersion'] = options_requested_policy_version unless options_requested_policy_version.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, options_requested_policy_version: nil, 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.

Parameters:

  • resource (String)

    REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field.

  • options_requested_policy_version (Fixnum) (defaults to: nil)

    Optional. The policy format version to be returned. Valid values are 0, 1, and

    1. Requests specifying an invalid value will be rejected. Requests for policies with any conditional bindings must specify version 3. Policies without any conditional bindings may specify any valid value or leave the field unset. To learn which resources support conditions in their IAM policies, see the IAM documentation.
  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:


218
219
220
221
222
223
224
225
226
227
# File 'generated/google/apis/cloudkms_v1/service.rb', line 218

def get_project_location_key_ring_iam_policy(resource, options_requested_policy_version: nil, 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['options.requestedPolicyVersion'] = options_requested_policy_version unless options_requested_policy_version.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(name, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::CloudkmsV1::ImportJob

Returns metadata for a given ImportJob.

Parameters:

  • name (String)

    Required. The name of the ImportJob to get.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:


1164
1165
1166
1167
1168
1169
1170
1171
1172
# File 'generated/google/apis/cloudkms_v1/service.rb', line 1164

def get_project_location_key_ring_import_job(name, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v1/{+name}', options)
  command.response_representation = Google::Apis::CloudkmsV1::ImportJob::Representation
  command.response_class = Google::Apis::CloudkmsV1::ImportJob
  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_import_job_iam_policy(resource, options_requested_policy_version: nil, 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.

Parameters:

  • resource (String)

    REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field.

  • options_requested_policy_version (Fixnum) (defaults to: nil)

    Optional. The policy format version to be returned. Valid values are 0, 1, and

    1. Requests specifying an invalid value will be rejected. Requests for policies with any conditional bindings must specify version 3. Policies without any conditional bindings may specify any valid value or leave the field unset. To learn which resources support conditions in their IAM policies, see the IAM documentation.
  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:


1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
# File 'generated/google/apis/cloudkms_v1/service.rb', line 1204

def get_project_location_key_ring_import_job_iam_policy(resource, options_requested_policy_version: nil, 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['options.requestedPolicyVersion'] = options_requested_policy_version unless options_requested_policy_version.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

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

Imports a new CryptoKeyVersion into an existing CryptoKey using the wrapped key material provided in the request. The version ID will be assigned the next sequential id within the CryptoKey.

Parameters:

  • parent (String)

    Required. The name of the CryptoKey to be imported into.

  • import_crypto_key_version_request_object (Google::Apis::CloudkmsV1::ImportCryptoKeyVersionRequest) (defaults to: nil)
  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:


966
967
968
969
970
971
972
973
974
975
976
# File 'generated/google/apis/cloudkms_v1/service.rb', line 966

def import_crypto_key_version(parent, import_crypto_key_version_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'v1/{+parent}/cryptoKeyVersions:import', options)
  command.request_representation = Google::Apis::CloudkmsV1::ImportCryptoKeyVersionRequest::Representation
  command.request_object = import_crypto_key_version_request_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

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

Lists CryptoKeyVersions.

Parameters:

  • parent (String)

    Required. The resource name of the CryptoKey to list, in the format projects/* /locations/*/keyRings/*/cryptoKeys/*.

  • filter (String) (defaults to: nil)

    Optional. Only include resources that match the filter in the response. For more information, see Sorting and filtering list results.

  • order_by (String) (defaults to: nil)

    Optional. Specify how the results should be sorted. If not specified, the results will be sorted in the default order. For more information, see Sorting and filtering list results.

  • page_size (Fixnum) (defaults to: nil)

    Optional. Optional limit on the number of CryptoKeyVersions to include in the response. Further CryptoKeyVersions can subsequently be obtained by including the ListCryptoKeyVersionsResponse.next_page_token in a subsequent request. If unspecified, the server will pick an appropriate default.

  • page_token (String) (defaults to: nil)

    Optional. Optional pagination token, returned earlier via ListCryptoKeyVersionsResponse.next_page_token.

  • view (String) (defaults to: nil)

    The fields to include in the response.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:


1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
# File 'generated/google/apis/cloudkms_v1/service.rb', line 1018

def list_project_location_key_ring_crypto_key_crypto_key_versions(parent, filter: nil, order_by: nil, 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['filter'] = filter unless filter.nil?
  command.query['orderBy'] = order_by unless order_by.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, filter: nil, order_by: nil, page_size: nil, page_token: nil, version_view: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::CloudkmsV1::ListCryptoKeysResponse

Lists CryptoKeys.

Parameters:

  • parent (String)

    Required. The resource name of the KeyRing to list, in the format projects/*/ locations/*/keyRings/*.

  • filter (String) (defaults to: nil)

    Optional. Only include resources that match the filter in the response. For more information, see Sorting and filtering list results.

  • order_by (String) (defaults to: nil)

    Optional. Specify how the results should be sorted. If not specified, the results will be sorted in the default order. For more information, see Sorting and filtering list results.

  • page_size (Fixnum) (defaults to: nil)

    Optional. Optional limit on the number of CryptoKeys to include in the response. Further CryptoKeys can subsequently be obtained by including the ListCryptoKeysResponse.next_page_token in a subsequent request. If unspecified, the server will pick an appropriate default.

  • page_token (String) (defaults to: nil)

    Optional. Optional pagination token, returned earlier via ListCryptoKeysResponse.next_page_token.

  • version_view (String) (defaults to: nil)

    The fields of the primary version to include in the response.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:


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

def list_project_location_key_ring_crypto_keys(parent, filter: nil, order_by: nil, 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['filter'] = filter unless filter.nil?
  command.query['orderBy'] = order_by unless order_by.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_ring_import_jobs(parent, filter: nil, order_by: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::CloudkmsV1::ListImportJobsResponse

Lists ImportJobs.

Parameters:

  • parent (String)

    Required. The resource name of the KeyRing to list, in the format projects/*/ locations/*/keyRings/*.

  • filter (String) (defaults to: nil)

    Optional. Only include resources that match the filter in the response. For more information, see Sorting and filtering list results.

  • order_by (String) (defaults to: nil)

    Optional. Specify how the results should be sorted. If not specified, the results will be sorted in the default order. For more information, see Sorting and filtering list results.

  • page_size (Fixnum) (defaults to: nil)

    Optional. Optional limit on the number of ImportJobs to include in the response. Further ImportJobs can subsequently be obtained by including the ListImportJobsResponse.next_page_token in a subsequent request. If unspecified, the server will pick an appropriate default.

  • page_token (String) (defaults to: nil)

    Optional. Optional pagination token, returned earlier via ListImportJobsResponse.next_page_token.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:


1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
# File 'generated/google/apis/cloudkms_v1/service.rb', line 1253

def list_project_location_key_ring_import_jobs(parent, filter: nil, order_by: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v1/{+parent}/importJobs', options)
  command.response_representation = Google::Apis::CloudkmsV1::ListImportJobsResponse::Representation
  command.response_class = Google::Apis::CloudkmsV1::ListImportJobsResponse
  command.params['parent'] = parent unless parent.nil?
  command.query['filter'] = filter unless filter.nil?
  command.query['orderBy'] = order_by unless order_by.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_location_key_rings(parent, filter: nil, order_by: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::CloudkmsV1::ListKeyRingsResponse

Lists KeyRings.

Parameters:

  • parent (String)

    Required. The resource name of the location associated with the KeyRings, in the format projects/*/locations/*.

  • filter (String) (defaults to: nil)

    Optional. Only include resources that match the filter in the response. For more information, see Sorting and filtering list results.

  • order_by (String) (defaults to: nil)

    Optional. Specify how the results should be sorted. If not specified, the results will be sorted in the default order. For more information, see Sorting and filtering list results.

  • page_size (Fixnum) (defaults to: nil)

    Optional. Optional limit on the number of KeyRings to include in the response. Further KeyRings can subsequently be obtained by including the ListKeyRingsResponse.next_page_token in a subsequent request. If unspecified, the server will pick an appropriate default.

  • page_token (String) (defaults to: nil)

    Optional. Optional pagination token, returned earlier via ListKeyRingsResponse. next_page_token.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:


267
268
269
270
271
272
273
274
275
276
277
278
279
# File 'generated/google/apis/cloudkms_v1/service.rb', line 267

def list_project_location_key_rings(parent, filter: nil, order_by: nil, 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['filter'] = filter unless filter.nil?
  command.query['orderBy'] = order_by unless order_by.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.

Parameters:

  • name (String)

    The resource that owns the locations collection, if applicable.

  • filter (String) (defaults to: nil)

    The standard list filter.

  • page_size (Fixnum) (defaults to: nil)

    The standard list page size.

  • page_token (String) (defaults to: nil)

    The standard list page token.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

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.

Parameters:

  • name (String)

    Output only. The resource name for this CryptoKey in the format projects/*/ locations/*/keyRings/*/cryptoKeys/*.

  • crypto_key_object (Google::Apis::CloudkmsV1::CryptoKey) (defaults to: nil)
  • update_mask (String) (defaults to: nil)

    Required. List of fields to be updated in this request.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:


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

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.

Parameters:

  • name (String)

    Output only. The resource name for this CryptoKeyVersion in the format projects/*/locations/*/keyRings/*/cryptoKeys/*/cryptoKeyVersions/*.

  • crypto_key_version_object (Google::Apis::CloudkmsV1::CryptoKeyVersion) (defaults to: nil)
  • update_mask (String) (defaults to: nil)

    Required. List of fields to be updated in this request.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:


1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
# File 'generated/google/apis/cloudkms_v1/service.rb', line 1059

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.

Parameters:

  • name (String)

    Required. The resource name of the CryptoKeyVersion to restore.

  • restore_crypto_key_version_request_object (Google::Apis::CloudkmsV1::RestoreCryptoKeyVersionRequest) (defaults to: nil)
  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:


1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
# File 'generated/google/apis/cloudkms_v1/service.rb', line 1095

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. Can return NOT_FOUND, INVALID_ARGUMENT, and PERMISSION_DENIED errors.

Parameters:

  • resource (String)

    REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field.

  • set_iam_policy_request_object (Google::Apis::CloudkmsV1::SetIamPolicyRequest) (defaults to: nil)
  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:


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

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. Can return NOT_FOUND, INVALID_ARGUMENT, and PERMISSION_DENIED errors.

Parameters:

  • resource (String)

    REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field.

  • set_iam_policy_request_object (Google::Apis::CloudkmsV1::SetIamPolicyRequest) (defaults to: nil)
  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:


1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
# File 'generated/google/apis/cloudkms_v1/service.rb', line 1291

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. Can return NOT_FOUND, INVALID_ARGUMENT, and PERMISSION_DENIED errors.

Parameters:

  • resource (String)

    REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field.

  • set_iam_policy_request_object (Google::Apis::CloudkmsV1::SetIamPolicyRequest) (defaults to: nil)
  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:


305
306
307
308
309
310
311
312
313
314
315
# File 'generated/google/apis/cloudkms_v1/service.rb', line 305

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.

Parameters:

  • resource (String)

    REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field.

  • test_iam_permissions_request_object (Google::Apis::CloudkmsV1::TestIamPermissionsRequest) (defaults to: nil)
  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:


695
696
697
698
699
700
701
702
703
704
705
# File 'generated/google/apis/cloudkms_v1/service.rb', line 695

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.

Parameters:

  • resource (String)

    REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field.

  • test_iam_permissions_request_object (Google::Apis::CloudkmsV1::TestIamPermissionsRequest) (defaults to: nil)
  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:


1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
# File 'generated/google/apis/cloudkms_v1/service.rb', line 1329

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.

Parameters:

  • resource (String)

    REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field.

  • test_iam_permissions_request_object (Google::Apis::CloudkmsV1::TestIamPermissionsRequest) (defaults to: nil)
  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:


343
344
345
346
347
348
349
350
351
352
353
# File 'generated/google/apis/cloudkms_v1/service.rb', line 343

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.

Parameters:

  • name (String)

    Required. The resource name of the CryptoKey to update.

  • update_crypto_key_primary_version_request_object (Google::Apis::CloudkmsV1::UpdateCryptoKeyPrimaryVersionRequest) (defaults to: nil)
  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:


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

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