Class: Google::Apis::KmsinventoryV1::KmsinventoryService

Inherits:
Core::BaseService
  • Object
show all
Defined in:
lib/google/apis/kmsinventory_v1/service.rb

Overview

KMS Inventory API

Examples:

require 'google/apis/kmsinventory_v1'

Kmsinventory = Google::Apis::KmsinventoryV1 # Alias the module
service = Kmsinventory::KmsinventoryService.new

See Also:

Constant Summary collapse

DEFAULT_ENDPOINT_TEMPLATE =
"https://kmsinventory.$UNIVERSE_DOMAIN$/"

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeKmsinventoryService

Returns a new instance of KmsinventoryService.



47
48
49
50
51
52
# File 'lib/google/apis/kmsinventory_v1/service.rb', line 47

def initialize
  super(DEFAULT_ENDPOINT_TEMPLATE, '',
        client_name: 'google-apis-kmsinventory_v1',
        client_version: Google::Apis::KmsinventoryV1::GEM_VERSION)
  @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.



40
41
42
# File 'lib/google/apis/kmsinventory_v1/service.rb', line 40

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.



45
46
47
# File 'lib/google/apis/kmsinventory_v1/service.rb', line 45

def quota_user
  @quota_user
end

Instance Method Details

#get_project_location_key_ring_crypto_key_protected_resources_summary(name, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::KmsinventoryV1::GoogleCloudKmsInventoryV1ProtectedResourcesSummary

Returns aggregate information about the resources protected by the given Cloud KMS CryptoKey. Only resources within the same Cloud organization as the key will be returned. The project that holds the key must be part of an organization in order for this call to succeed.

Parameters:

  • name (String)

    Required. The resource name of the 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:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



175
176
177
178
179
180
181
182
183
# File 'lib/google/apis/kmsinventory_v1/service.rb', line 175

def get_project_location_key_ring_crypto_key_protected_resources_summary(name, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v1/{+name}/protectedResourcesSummary', options)
  command.response_representation = Google::Apis::KmsinventoryV1::GoogleCloudKmsInventoryV1ProtectedResourcesSummary::Representation
  command.response_class = Google::Apis::KmsinventoryV1::GoogleCloudKmsInventoryV1ProtectedResourcesSummary
  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

#list_project_crypto_keys(parent, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::KmsinventoryV1::GoogleCloudKmsInventoryV1ListCryptoKeysResponse

Returns cryptographic keys managed by Cloud KMS in a given Cloud project. Note that this data is sourced from snapshots, meaning it may not completely reflect the actual state of key metadata at call time.

Parameters:

  • parent (String)

    Required. The Google Cloud project for which to retrieve key metadata, in the format projects/*

  • page_size (Fixnum) (defaults to: nil)

    Optional. The maximum number of keys to return. The service may return fewer than this value. If unspecified, at most 1000 keys will be returned. The maximum value is 1000; values above 1000 will be coerced to 1000.

  • page_token (String) (defaults to: nil)

    Optional. Pass this into a subsequent request in order to receive the next page of results.

  • 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:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



140
141
142
143
144
145
146
147
148
149
150
# File 'lib/google/apis/kmsinventory_v1/service.rb', line 140

def list_project_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::KmsinventoryV1::GoogleCloudKmsInventoryV1ListCryptoKeysResponse::Representation
  command.response_class = Google::Apis::KmsinventoryV1::GoogleCloudKmsInventoryV1ListCryptoKeysResponse
  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

#search_organization_protected_resources(scope, crypto_key: nil, page_size: nil, page_token: nil, resource_types: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::KmsinventoryV1::GoogleCloudKmsInventoryV1SearchProtectedResourcesResponse

Returns metadata about the resources protected by the given Cloud KMS CryptoKey in the given Cloud organization.

Parameters:

  • scope (String)

    Required. Resource name of the organization. Example: organizations/123

  • crypto_key (String) (defaults to: nil)

    Required. The resource name of the CryptoKey.

  • page_size (Fixnum) (defaults to: nil)

    The maximum number of resources to return. The service may return fewer than this value. If unspecified, at most 500 resources will be returned. The maximum value is 500; values above 500 will be coerced to 500.

  • page_token (String) (defaults to: nil)

    A page token, received from a previous KeyTrackingService. SearchProtectedResources call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to KeyTrackingService. SearchProtectedResources must match the call that provided the page token.

  • resource_types (Array<String>, String) (defaults to: nil)

    Optional. A list of resource types that this request searches for. If empty, it will search all the trackable resource types. Regular expressions are also supported. For example: * compute.googleapis.com.* snapshots resources whose type starts with compute.googleapis.com. * .*Image snapshots resources whose type ends with Image. * .*Image.* snapshots resources whose type contains Image. See RE2 for all supported regular expression syntax. If the regular expression does not match any supported resource type, an INVALID_ARGUMENT error will be returned.

  • 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:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



96
97
98
99
100
101
102
103
104
105
106
107
108
# File 'lib/google/apis/kmsinventory_v1/service.rb', line 96

def search_organization_protected_resources(scope, crypto_key: nil, page_size: nil, page_token: nil, resource_types: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v1/{+scope}/protectedResources:search', options)
  command.response_representation = Google::Apis::KmsinventoryV1::GoogleCloudKmsInventoryV1SearchProtectedResourcesResponse::Representation
  command.response_class = Google::Apis::KmsinventoryV1::GoogleCloudKmsInventoryV1SearchProtectedResourcesResponse
  command.params['scope'] = scope unless scope.nil?
  command.query['cryptoKey'] = crypto_key unless crypto_key.nil?
  command.query['pageSize'] = page_size unless page_size.nil?
  command.query['pageToken'] = page_token unless page_token.nil?
  command.query['resourceTypes'] = resource_types unless resource_types.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end