lib/oci/key_management/kms_management_client.rb
# Lists the master encryption keys in the specified vault and compartment.
#
# As a management operation, this call is subject to a Key Management limit that applies to the total number
# of requests across all management read operations. Key Management might throttle this call to reject an
# otherwise valid request when the total rate of management read operations exceeds 10 requests per second
# for a given tenancy.
#
# @param [String] compartment_id The OCID of the compartment.
# @param [Hash] opts the optional parameters
# @option opts [OCI::Retry::RetryConfig] :retry_config The retry configuration to apply to this operation. If no key is provided then the service-level
#   retry configuration defined by {#retry_config} will be used. If an explicit `nil` value is provided then the operation will not retry
# @option opts [Integer] :limit The maximum number of items to return in a paginated \"List\" call.
#
# @option opts [String] :page The value of the `opc-next-page` response header
#   from the previous \"List\" call.
#
# @option opts [String] :opc_request_id Unique identifier for the request. If provided, the returned request ID
#   will include this value. Otherwise, a random request ID will be
#   generated by the service.
#
# @option opts [String] :sort_by The field to sort by. You can specify only one sort order. The default
#   order for `TIMECREATED` is descending. The default order for `DISPLAYNAME`
#   is ascending.
#
#   Allowed values are: TIMECREATED, DISPLAYNAME
# @option opts [String] :sort_order The sort order to use, either ascending (`ASC`) or descending (`DESC`).
#
#   Allowed values are: ASC, DESC
# @option opts [String] :protection_mode A key's protection mode indicates how the key persists and where cryptographic operations that use the key are performed. A
#   protection mode of `HSM` means that the key persists on a hardware security module (HSM) and all cryptographic operations are
#   performed inside the HSM. A protection mode of `SOFTWARE` means that the key persists on the server, protected by the vault's
#   RSA wrapping key which persists on the HSM. All cryptographic operations that use a key with a protection mode of
#   `SOFTWARE` are performed on the server.
#    (default to HSM)
#   Allowed values are: HSM, SOFTWARE
# @option opts [String] :algorithm The algorithm used by a key's key versions to encrypt or decrypt data. Currently, support includes AES, RSA, and ECDSA algorithms.
#
#   Allowed values are: AES, RSA, ECDSA
# @option opts [Integer] :length The length of the key in bytes, expressed as an integer. Supported values include 16, 24, or 32.
#
# @option opts [String] :curve_id The curve ID of the keys. (This pertains only to ECDSA keys.)
#
#   Allowed values are: NIST_P256, NIST_P384, NIST_P521
# @return [Response] A Response object with data of type Array<{OCI::KeyManagement::Models::KeySummary KeySummary}>
# @note Click [here](https://docs.cloud.oracle.com/en-us/iaas/tools/ruby-sdk-examples/latest/keymanagement/list_keys.rb.html) to see an example of how to use list_keys API.
Lists the master encryption keys in the specified vault and compartment.
As a management operation, this call is subject to a Key Management limit that applies to the total number
of requests across all management read operations. Key Management might throttle this call to reject an
otherwise valid request when the total rate of management read operations exceeds 10 requests per second
for a given tenancy.
Lists the master encryption keys in the specified vault and compartment . As a management operation this call is subject to a Key Management limit that applies to the total number of requests across all management read operations . Key Management might throttle this call to reject an otherwise valid request when the total rate of management read operations exceeds 10 requests per second for a given tenancy .
def list_keys(compartment_id, opts = {})
      logger.debug 'Calling operation KmsManagementClient#list_keys.' if logger
      raise "Missing the required parameter 'compartment_id' when calling list_keys." if compartment_id.nil?
      if opts[:sort_by] && !%w[TIMECREATED DISPLAYNAME].include?(opts[:sort_by])
        raise 'Invalid value for "sort_by", must be one of TIMECREATED, DISPLAYNAME.'
      end
      if opts[:sort_order] && !%w[ASC DESC].include?(opts[:sort_order])
        raise 'Invalid value for "sort_order", must be one of ASC, DESC.'
      end
      if opts[:protection_mode] && !%w[HSM SOFTWARE].include?(opts[:protection_mode])
        raise 'Invalid value for "protection_mode", must be one of HSM, SOFTWARE.'
      end
      if opts[:algorithm] && !%w[AES RSA ECDSA].include?(opts[:algorithm])
        raise 'Invalid value for "algorithm", must be one of AES, RSA, ECDSA.'
      end
      if opts[:curve_id] && !%w[NIST_P256 NIST_P384 NIST_P521].include?(opts[:curve_id])
        raise 'Invalid value for "curve_id", must be one of NIST_P256, NIST_P384, NIST_P521.'
      end
      path = '/20180608/keys'
      operation_signing_strategy = :standard
      query_params = {}
      query_params[:compartmentId] = compartment_id
      query_params[:limit] = opts[:limit] if opts[:limit]
      query_params[:page] = opts[:page] if opts[:page]
      query_params[:sortBy] = opts[:sort_by] if opts[:sort_by]
      query_params[:sortOrder] = opts[:sort_order] if opts[:sort_order]
      query_params[:protectionMode] = opts[:protection_mode] if opts[:protection_mode]
      query_params[:algorithm] = opts[:algorithm] if opts[:algorithm]
      query_params[:length] = opts[:length] if opts[:length]
      query_params[:curveId] = opts[:curve_id] if opts[:curve_id]
      header_params = {}
      header_params[:accept] = 'application/json'
      header_params[:'content-type'] = 'application/json'
      header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
      post_body = nil
      OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'KmsManagementClient#list_keys') do
        @api_client.call_api(
          :GET,
          path,
          endpoint,
          header_params: header_params,
          query_params: query_params,
          operation_signing_strategy: operation_signing_strategy,
          body: post_body,
          return_type: 'Array<OCI::KeyManagement::Models::KeySummary>'
        )
      end
    end
def list_keys ( compartment_id , opts = { } ) logger . debug 'Calling operation KmsManagementClient#list_keys.' if logger raise "Missing the required parameter 'compartment_id' when calling list_keys." if compartment_id . nil? if opts [ :sort_by ] && ! %w[ TIMECREATED DISPLAYNAME ] . include? ( opts [ :sort_by ] ) raise 'Invalid value for "sort_by", must be one of TIMECREATED, DISPLAYNAME.' end if opts [ :sort_order ] && ! %w[ ASC DESC ] . include? ( opts [ :sort_order ] ) raise 'Invalid value for "sort_order", must be one of ASC, DESC.' end if opts [ :protection_mode ] && ! %w[ HSM SOFTWARE ] . include? ( opts [ :protection_mode ] ) raise 'Invalid value for "protection_mode", must be one of HSM, SOFTWARE.' end if opts [ :algorithm ] && ! %w[ AES RSA ECDSA ] . include? ( opts [ :algorithm ] ) raise 'Invalid value for "algorithm", must be one of AES, RSA, ECDSA.' end if opts [ :curve_id ] && ! %w[ NIST_P256 NIST_P384 NIST_P521 ] . include? ( opts [ :curve_id ] ) raise 'Invalid value for "curve_id", must be one of NIST_P256, NIST_P384, NIST_P521.' end path = '/20180608/keys' operation_signing_strategy = :standard query_params = { } query_params [ :compartmentId ] = compartment_id query_params [ :limit ] = opts [ :limit ] if opts [ :limit ] query_params [ :page ] = opts [ :page ] if opts [ :page ] query_params [ :sortBy ] = opts [ :sort_by ] if opts [ :sort_by ] query_params [ :sortOrder ] = opts [ :sort_order ] if opts [ :sort_order ] query_params [ :protectionMode ] = opts [ :protection_mode ] if opts [ :protection_mode ] query_params [ :algorithm ] = opts [ :algorithm ] if opts [ :algorithm ] query_params [ :length ] = opts [ :length ] if opts [ :length ] query_params [ :curveId ] = opts [ :curve_id ] if opts [ :curve_id ] header_params = { } header_params [ :accept ] = 'application/json' header_params [ :' content-type ' ] = 'application/json' header_params [ :' opc-request-id ' ] = opts [ :opc_request_id ] if opts [ :opc_request_id ] post_body = nil OCI :: Retry . make_retrying_call ( applicable_retry_config ( opts ) , call_name : 'KmsManagementClient#list_keys' ) do @api_client . call_api ( :GET , path , endpoint , header_params : header_params , query_params : query_params , operation_signing_strategy : operation_signing_strategy , body : post_body , return_type : 'Array<OCI::KeyManagement::Models::KeySummary>' ) end end
Lists the master encryption keys in the specified vault and compartment.
Lists the master encryption keys in the specified vault and compartment .
# rubocop:disable Style/NegatedIf # Query Params # Header Params # rubocop:enable Style/NegatedIf # rubocop:disable Metrics/BlockLength # rubocop:enable Metrics/BlockLength
A Response object with data of type Array<{OCI::KeyManagement::Models::KeySummary KeySummary}>
A Response object with data of type Array< { OCI :: KeyManagement :: Models :: KeySummary KeySummary } >
Response
compartment_id
opts
:curve_id The curve ID of the keys. (This pertains only to ECDSA keys.) Allowed values are: NIST_P256, NIST_P384, NIST_P521
: curve_id The curve ID of the keys . ( This pertains only to ECDSA keys . ) Allowed values are : NIST_P256 NIST_P384 NIST_P521
opts the optional parameters
opts the optional parameters
note
Click [here] to see an example of how to use list_keys API.
Click [ here ] to see an example of how to use list_keys API .