lib/datadog_api_client/v2/api/key_management_api.rb
# Get all API keys
# List all API keys available for your account.
# @param opts [Hash] the optional parameters
# @option opts [Integer] :page_size Size for a given page.
# @option opts [Integer] :page_number Specific page number to return.
# @option opts [APIKeysSort] :sort API key attribute used to sort results. Sort order is ascending by default. In order to specify a descending sort, prefix the attribute with a minus sign.
# @option opts [String] :filter Filter API keys by the specified string.
# @option opts [String] :filter_created_at_start Only include API keys created on or after the specified date.
# @option opts [String] :filter_created_at_end Only include API keys created on or before the specified date.
# @option opts [String] :filter_modified_at_start Only include API keys modified on or after the specified date.
# @option opts [String] :filter_modified_at_end Only include API keys modified on or before the specified date.
# @option opts [String] :include Comma separated list of resource paths for related resources to include in the response. Supported resource paths are `created_by` and `modified_by`.
# @return [Array<(APIKeysResponse, Integer, Hash)>] APIKeysResponse data, response status code and response headers
Get all API keys
List all API keys available for your account.
Get all API keys List all API keys available for your account .
def list_api_keys_with_http_info(opts = {})
      if @api_client.config.unstable_operations.has_key?(:list_api_keys)
        unstable_enabled = @api_client.config.unstable_operations[:list_api_keys]
        if unstable_enabled
          @api_client.config.logger.warn format("Using unstable operation '%s'", "list_api_keys")
        else
          raise APIError.new(message: format("Unstable operation '%s' is disabled", "list_api_keys"))
        end
      end
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: KeyManagementAPI.list_api_keys ...'
      end
      allowable_values = ['created_at', '-created_at', 'last4', '-last4', 'modified_at', '-modified_at', 'name', '-name']
      if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort'])
        fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}"
      end
      local_var_path = '/api/v2/api_keys'
      query_params = opts[:query_params] || {}
      query_params[:'page[size]'] = opts[:'page_size'] if !opts[:'page_size'].nil?
      query_params[:'page[number]'] = opts[:'page_number'] if !opts[:'page_number'].nil?
      query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?
      query_params[:'filter'] = opts[:'filter'] if !opts[:'filter'].nil?
      query_params[:'filter[created_at][start]'] = opts[:'filter_created_at_start'] if !opts[:'filter_created_at_start'].nil?
      query_params[:'filter[created_at][end]'] = opts[:'filter_created_at_end'] if !opts[:'filter_created_at_end'].nil?
      query_params[:'filter[modified_at][start]'] = opts[:'filter_modified_at_start'] if !opts[:'filter_modified_at_start'].nil?
      query_params[:'filter[modified_at][end]'] = opts[:'filter_modified_at_end'] if !opts[:'filter_modified_at_end'].nil?
      query_params[:'include'] = opts[:'include'] if !opts[:'include'].nil?
      header_params = opts[:header_params] || {}
      header_params['Accept'] = @api_client.select_header_accept(['application/json'])
      form_params = opts[:form_params] || {}
      post_body = opts[:debug_body]
      return_type = opts[:debug_return_type] || 'APIKeysResponse'
      auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth]
      new_options = opts.merge(
        :operation => :list_api_keys,
        :header_params => header_params,
        :query_params => query_params,
        :form_params => form_params,
        :body => post_body,
        :auth_names => auth_names,
        :return_type => return_type
      )
      data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: KeyManagementAPI#list_api_keys\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end
def list_api_keys_with_http_info ( opts = { } ) if @api_client . config . unstable_operations . has_key? ( :list_api_keys ) unstable_enabled = @api_client . config . unstable_operations [ :list_api_keys ] if unstable_enabled @api_client . config . logger . warn format ( "Using unstable operation '%s'" , "list_api_keys" ) else raise APIError . new ( message : format ( "Unstable operation '%s' is disabled" , "list_api_keys" ) ) end end if @api_client . config . debugging @api_client . config . logger . debug 'Calling API: KeyManagementAPI.list_api_keys ...' end allowable_values = [ 'created_at' , '-created_at' , 'last4' , '-last4' , 'modified_at' , '-modified_at' , 'name' , '-name' ] if @api_client . config . client_side_validation && opts [ :' sort ' ] && ! allowable_values . include? ( opts [ :' sort ' ] ) fail ArgumentError , "invalid value for \"sort\", must be one of #{allowable_values}" end local_var_path = '/api/v2/api_keys' query_params = opts [ :query_params ] || { } query_params [ :' page[size] ' ] = opts [ :' page_size ' ] if ! opts [ :' page_size ' ] . nil? query_params [ :' page[number] ' ] = opts [ :' page_number ' ] if ! opts [ :' page_number ' ] . nil? query_params [ :' sort ' ] = opts [ :' sort ' ] if ! opts [ :' sort ' ] . nil? query_params [ :' filter ' ] = opts [ :' filter ' ] if ! opts [ :' filter ' ] . nil? query_params [ :' filter[created_at][start] ' ] = opts [ :' filter_created_at_start ' ] if ! opts [ :' filter_created_at_start ' ] . nil? query_params [ :' filter[created_at][end] ' ] = opts [ :' filter_created_at_end ' ] if ! opts [ :' filter_created_at_end ' ] . nil? query_params [ :' filter[modified_at][start] ' ] = opts [ :' filter_modified_at_start ' ] if ! opts [ :' filter_modified_at_start ' ] . nil? query_params [ :' filter[modified_at][end] ' ] = opts [ :' filter_modified_at_end ' ] if ! opts [ :' filter_modified_at_end ' ] . nil? query_params [ :' include ' ] = opts [ :' include ' ] if ! opts [ :' include ' ] . nil? header_params = opts [ :header_params ] || { } header_params [ 'Accept' ] = @api_client . select_header_accept ( [ 'application/json' ] ) form_params = opts [ :form_params ] || { } post_body = opts [ :debug_body ] return_type = opts [ :debug_return_type ] || 'APIKeysResponse' auth_names = opts [ :debug_auth_names ] || [ :apiKeyAuth , :appKeyAuth ] new_options = opts . merge ( :operation => :list_api_keys , :header_params => header_params , :query_params => query_params , :form_params => form_params , :body => post_body , :auth_names => auth_names , :return_type => return_type ) data , status_code , headers = @api_client . call_api ( :GET , local_var_path , new_options ) if @api_client . config . debugging @api_client . config . logger . debug "API called: KeyManagementAPI#list_api_keys\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data , status_code , headers end
Get all API keys
List all API keys available for your account.
Get all API keys List all API keys available for your account .
# resource path # query parameters # header parameters # HTTP header 'Accept' (if needed) # form parameters # http body (model) # return_type # auth_names
APIKeysResponse data, response status code and response headers
APIKeysResponse data response status code and response headers
Array<(APIKeysResponse, Integer, Hash)>
opts
:include Comma separated list of resource paths for related resources to include in the response. Supported resource paths are `created_by` and `modified_by`.
: include Comma separated list of resource paths for related resources to include in the response . Supported resource paths are ` created_by ` and ` modified_by ` .