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

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

Overview

Google Cloud Key Management Service (KMS) API

Manages encryption for your cloud services the same way you do on-premises. You can generate, use, rotate, and destroy AES256 encryption keys.

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

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

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

  • fields (String)

    Selector specifying which fields to include in a partial response.

  • quota_user (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.

  • options (Google::Apis::RequestOptions)

    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, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::CloudkmsV1::CryptoKey

Create a new CryptoKey within a KeyRing. CryptoKey.purpose is 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)

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

  • fields (String)

    Selector specifying which fields to include in a partial response.

  • quota_user (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.

  • options (Google::Apis::RequestOptions)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



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

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.

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)

    Selector specifying which fields to include in a partial response.

  • quota_user (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.

  • options (Google::Apis::RequestOptions)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



719
720
721
722
723
724
725
726
727
728
729
# File 'generated/google/apis/cloudkms_v1/service.rb', line 719

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.

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)

    Selector specifying which fields to include in a partial response.

  • quota_user (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.

  • options (Google::Apis::RequestOptions)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



397
398
399
400
401
402
403
404
405
406
407
# File 'generated/google/apis/cloudkms_v1/service.rb', line 397

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)

    The resource name of the CryptoKeyVersion to destroy.

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

    Selector specifying which fields to include in a partial response.

  • quota_user (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.

  • options (Google::Apis::RequestOptions)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



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

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.

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)

    Selector specifying which fields to include in a partial response.

  • quota_user (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.

  • options (Google::Apis::RequestOptions)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



433
434
435
436
437
438
439
440
441
442
443
# File 'generated/google/apis/cloudkms_v1/service.rb', line 433

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)

    Selector specifying which fields to include in a partial response.

  • quota_user (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.

  • options (Google::Apis::RequestOptions)

    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)

    The name of the KeyRing to get.

  • fields (String)

    Selector specifying which fields to include in a partial response.

  • quota_user (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.

  • options (Google::Apis::RequestOptions)

    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)

    The name of the CryptoKey to get.

  • fields (String)

    Selector specifying which fields to include in a partial response.

  • quota_user (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.

  • options (Google::Apis::RequestOptions)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



466
467
468
469
470
471
472
473
474
# File 'generated/google/apis/cloudkms_v1/service.rb', line 466

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)

    The name of the CryptoKeyVersion to get.

  • fields (String)

    Selector specifying which fields to include in a partial response.

  • quota_user (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.

  • options (Google::Apis::RequestOptions)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



793
794
795
796
797
798
799
800
801
# File 'generated/google/apis/cloudkms_v1/service.rb', line 793

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

Parameters:

  • resource (String)

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

  • fields (String)

    Selector specifying which fields to include in a partial response.

  • quota_user (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.

  • options (Google::Apis::RequestOptions)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



499
500
501
502
503
504
505
506
507
# File 'generated/google/apis/cloudkms_v1/service.rb', line 499

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.

Parameters:

  • resource (String)

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

  • fields (String)

    Selector specifying which fields to include in a partial response.

  • quota_user (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.

  • options (Google::Apis::RequestOptions)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

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

#list_project_location_key_ring_crypto_key_crypto_key_versions(parent, page_size: nil, page_token: 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/*.

  • page_size (Fixnum)

    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)

    Optional pagination token, returned earlier via ListCryptoKeyVersionsResponse.next_page_token.

  • fields (String)

    Selector specifying which fields to include in a partial response.

  • quota_user (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.

  • options (Google::Apis::RequestOptions)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



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

def list_project_location_key_ring_crypto_key_crypto_key_versions(parent, page_size: nil, page_token: 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['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, 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/*.

  • page_size (Fixnum)

    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)

    Optional pagination token, returned earlier via ListCryptoKeysResponse.next_page_token.

  • fields (String)

    Selector specifying which fields to include in a partial response.

  • quota_user (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.

  • options (Google::Apis::RequestOptions)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



538
539
540
541
542
543
544
545
546
547
548
# File 'generated/google/apis/cloudkms_v1/service.rb', line 538

def list_project_location_key_ring_crypto_keys(parent, page_size: nil, page_token: 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['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.

Parameters:

  • parent (String)

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

  • page_size (Fixnum)

    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)

    Optional pagination token, returned earlier via ListKeyRingsResponse.next_page_token.

  • fields (String)

    Selector specifying which fields to include in a partial response.

  • quota_user (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.

  • options (Google::Apis::RequestOptions)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

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.

Parameters:

  • name (String)

    The resource that owns the locations collection, if applicable.

  • filter (String)

    The standard list filter.

  • page_size (Fixnum)

    The standard list page size.

  • page_token (String)

    The standard list page token.

  • fields (String)

    Selector specifying which fields to include in a partial response.

  • quota_user (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.

  • options (Google::Apis::RequestOptions)

    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)

    Required list of fields to be updated in this request.

  • fields (String)

    Selector specifying which fields to include in a partial response.

  • quota_user (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.

  • options (Google::Apis::RequestOptions)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



574
575
576
577
578
579
580
581
582
583
584
585
# File 'generated/google/apis/cloudkms_v1/service.rb', line 574

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)

    Required list of fields to be updated in this request.

  • fields (String)

    Selector specifying which fields to include in a partial response.

  • quota_user (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.

  • options (Google::Apis::RequestOptions)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



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

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)

    The resource name of the CryptoKeyVersion to restore.

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

    Selector specifying which fields to include in a partial response.

  • quota_user (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.

  • options (Google::Apis::RequestOptions)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



913
914
915
916
917
918
919
920
921
922
923
# File 'generated/google/apis/cloudkms_v1/service.rb', line 913

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.

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)

    Selector specifying which fields to include in a partial response.

  • quota_user (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.

  • options (Google::Apis::RequestOptions)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



610
611
612
613
614
615
616
617
618
619
620
# File 'generated/google/apis/cloudkms_v1/service.rb', line 610

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

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)

    Selector specifying which fields to include in a partial response.

  • quota_user (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.

  • options (Google::Apis::RequestOptions)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

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.

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)

    Selector specifying which fields to include in a partial response.

  • quota_user (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.

  • options (Google::Apis::RequestOptions)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



649
650
651
652
653
654
655
656
657
658
659
# File 'generated/google/apis/cloudkms_v1/service.rb', line 649

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_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)

    Selector specifying which fields to include in a partial response.

  • quota_user (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.

  • options (Google::Apis::RequestOptions)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

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

Parameters:

  • name (String)

    The resource name of the CryptoKey to update.

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

    Selector specifying which fields to include in a partial response.

  • quota_user (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.

  • options (Google::Apis::RequestOptions)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



682
683
684
685
686
687
688
689
690
691
692
# File 'generated/google/apis/cloudkms_v1/service.rb', line 682

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