lib/oci/key_management/kms_management_client.rb
# Lists all key versions for the specified key.
#
# @param [String] key_id The OCID of the key.
# @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
# @return [Response] A Response object with data of type Array<{OCI::KeyManagement::Models::KeyVersionSummary KeyVersionSummary}>
Lists all key versions for the specified key.
Lists all key versions for the specified key .
def list_key_versions(key_id, opts = {})
      logger.debug 'Calling operation KmsManagementClient#list_key_versions.' if logger
      raise "Missing the required parameter 'key_id' when calling list_key_versions." if key_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
      raise "Parameter value for 'key_id' must not be blank" if OCI::Internal::Util.blank_string?(key_id)
      path = '/20180608/keys/{keyId}/keyVersions'.sub('{keyId}', key_id.to_s)
      operation_signing_strategy = :standard
      query_params = {}
      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]
      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_key_versions') 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::KeyVersionSummary>'
        )
      end
    end
def list_key_versions ( key_id , opts = { } ) logger . debug 'Calling operation KmsManagementClient#list_key_versions.' if logger raise "Missing the required parameter 'key_id' when calling list_key_versions." if key_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 raise "Parameter value for 'key_id' must not be blank" if OCI :: Internal :: Util . blank_string? ( key_id ) path = '/20180608/keys/{keyId}/keyVersions' . sub ( '{keyId}' , key_id . to_s ) operation_signing_strategy = :standard query_params = { } 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 ] 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_key_versions' ) 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::KeyVersionSummary>' ) end end
Lists all key versions for the specified key.
Lists all key versions for the specified key .
# 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::KeyVersionSummary KeyVersionSummary}>
A Response object with data of type Array< { OCI :: KeyManagement :: Models :: KeyVersionSummary KeyVersionSummary } >
Response
key_id
opts
:sort_order The sort order to use, either ascending (`ASC`) or descending (`DESC`). Allowed values are: ASC, DESC
: sort_order The sort order to use either ascending ( ` ASC ` ) or descending ( ` DESC ` ) . Allowed values are : ASC DESC
opts the optional parameters
opts the optional parameters