Method: DatadogAPIClient::V2::KeyManagementAPI#get_application_key_with_http_info

Defined in:
lib/datadog_api_client/v2/api/key_management_api.rb

#get_application_key_with_http_info(app_key_id, opts = {}) ⇒ Array<(ApplicationKeyResponse, Integer, Hash)>

Get an application key.

Get an application key for your org.

Parameters:

  • app_key_id (String)

    The ID of the application key.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :include (String)

    Resource path for related resources to include in the response. Only ‘owned_by` is supported.

Returns:

  • (Array<(ApplicationKeyResponse, Integer, Hash)>)

    ApplicationKeyResponse data, response status code and response headers



438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
# File 'lib/datadog_api_client/v2/api/key_management_api.rb', line 438

def get_application_key_with_http_info(app_key_id, opts = {})

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: KeyManagementAPI.get_application_key ...'
  end
  # verify the required parameter 'app_key_id' is set
  if @api_client.config.client_side_validation && app_key_id.nil?
    fail ArgumentError, "Missing the required parameter 'app_key_id' when calling KeyManagementAPI.get_application_key"
  end
  # resource path
  local_var_path = '/api/v2/application_keys/{app_key_id}'.sub('{app_key_id}', CGI.escape(app_key_id.to_s).gsub('%2F', '/'))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'include'] = opts[:'include'] if !opts[:'include'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'ApplicationKeyResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth]

  new_options = opts.merge(
    :operation => :get_application_key,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V2"
  )

  data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: KeyManagementAPI#get_application_key\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end