class DatadogAPIClient::V1::LogsIndexesAPI

Attributes

api_client[RW]

Public Class Methods

new(api_client = APIClient.default) click to toggle source
# File lib/datadog_api_client/v1/api/logs_indexes_api.rb, line 22
def initialize(api_client = APIClient.default)
  @api_client = api_client
end

Public Instance Methods

create_logs_index(body, opts = {}) click to toggle source

Create an index Creates a new index. Returns the Index object passed in the request body when the request is successful. @param body [LogsIndex] Object containing the new index. @param [Hash] opts the optional parameters @return [LogsIndex]

# File lib/datadog_api_client/v1/api/logs_indexes_api.rb, line 30
def create_logs_index(body, opts = {})
  data, _status_code, _headers = create_logs_index_with_http_info(body, opts)
  data
end
create_logs_index_with_http_info(body, opts = {}) click to toggle source

Create an index Creates a new index. Returns the Index object passed in the request body when the request is successful. @param body [LogsIndex] Object containing the new index. @param [Hash] opts the optional parameters @return [Array<(LogsIndex, Integer, Hash)>] LogsIndex data, response status code and response headers

# File lib/datadog_api_client/v1/api/logs_indexes_api.rb, line 40
def create_logs_index_with_http_info(body, opts = {})

  if @api_client.config.unstable_operations.has_key?(:create_logs_index)
    unstable_enabled = @api_client.config.unstable_operations[:create_logs_index]
    if unstable_enabled
      @api_client.config.logger.warn format("Using unstable operation '%s'", "create_logs_index")
    else
      raise APIError.new(message: format("Unstable operation '%s' is disabled", "create_logs_index"))
    end
  end

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LogsIndexesAPI.create_logs_index ...'
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling LogsIndexesAPI.create_logs_index"
  end
  # resource path
  local_var_path = '/api/v1/logs/config/indexes'

  # query parameters
  query_params = opts[:query_params] || {}

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

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

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(body)

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

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

  new_options = opts.merge(
    :operation => :create_logs_index,
    :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(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LogsIndexesAPI#create_logs_index\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
get_logs_index(name, opts = {}) click to toggle source

Get an index Get one log index from your organization. This endpoint takes no JSON arguments. @param name [String] Name of the log index. @param [Hash] opts the optional parameters @return [LogsIndex]

# File lib/datadog_api_client/v1/api/logs_indexes_api.rb, line 105
def get_logs_index(name, opts = {})
  data, _status_code, _headers = get_logs_index_with_http_info(name, opts)
  data
end
get_logs_index_order(opts = {}) click to toggle source

Get indexes order Get the current order of your log indexes. This endpoint takes no JSON arguments. @param [Hash] opts the optional parameters @return [LogsIndexesOrder]

# File lib/datadog_api_client/v1/api/logs_indexes_api.rb, line 177
def get_logs_index_order(opts = {})
  data, _status_code, _headers = get_logs_index_order_with_http_info(opts)
  data
end
get_logs_index_order_with_http_info(opts = {}) click to toggle source

Get indexes order Get the current order of your log indexes. This endpoint takes no JSON arguments. @param [Hash] opts the optional parameters @return [Array<(LogsIndexesOrder, Integer, Hash)>] LogsIndexesOrder data, response status code and response headers

# File lib/datadog_api_client/v1/api/logs_indexes_api.rb, line 186
def get_logs_index_order_with_http_info(opts = {})

  if @api_client.config.unstable_operations.has_key?(:get_logs_index_order)
    unstable_enabled = @api_client.config.unstable_operations[:get_logs_index_order]
    if unstable_enabled
      @api_client.config.logger.warn format("Using unstable operation '%s'", "get_logs_index_order")
    else
      raise APIError.new(message: format("Unstable operation '%s' is disabled", "get_logs_index_order"))
    end
  end

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LogsIndexesAPI.get_logs_index_order ...'
  end
  # resource path
  local_var_path = '/api/v1/logs/config/index-order'

  # query parameters
  query_params = opts[:query_params] || {}

  # 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] || 'LogsIndexesOrder'

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

  new_options = opts.merge(
    :operation => :get_logs_index_order,
    :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: LogsIndexesAPI#get_logs_index_order\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
get_logs_index_with_http_info(name, opts = {}) click to toggle source

Get an index Get one log index from your organization. This endpoint takes no JSON arguments. @param name [String] Name of the log index. @param [Hash] opts the optional parameters @return [Array<(LogsIndex, Integer, Hash)>] LogsIndex data, response status code and response headers

# File lib/datadog_api_client/v1/api/logs_indexes_api.rb, line 115
def get_logs_index_with_http_info(name, opts = {})

  if @api_client.config.unstable_operations.has_key?(:get_logs_index)
    unstable_enabled = @api_client.config.unstable_operations[:get_logs_index]
    if unstable_enabled
      @api_client.config.logger.warn format("Using unstable operation '%s'", "get_logs_index")
    else
      raise APIError.new(message: format("Unstable operation '%s' is disabled", "get_logs_index"))
    end
  end

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LogsIndexesAPI.get_logs_index ...'
  end
  # verify the required parameter 'name' is set
  if @api_client.config.client_side_validation && name.nil?
    fail ArgumentError, "Missing the required parameter 'name' when calling LogsIndexesAPI.get_logs_index"
  end
  # resource path
  local_var_path = '/api/v1/logs/config/indexes/{name}'.sub('{' + 'name' + '}', CGI.escape(name.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # 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] || 'LogsIndex'

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

  new_options = opts.merge(
    :operation => :get_logs_index,
    :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: LogsIndexesAPI#get_logs_index\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
list_log_indexes(opts = {}) click to toggle source

Get all indexes The Index object describes the configuration of a log index. This endpoint returns an array of the `LogIndex` objects of your organization. @param [Hash] opts the optional parameters @return [LogsIndexListResponse]

# File lib/datadog_api_client/v1/api/logs_indexes_api.rb, line 244
def list_log_indexes(opts = {})
  data, _status_code, _headers = list_log_indexes_with_http_info(opts)
  data
end
list_log_indexes_with_http_info(opts = {}) click to toggle source

Get all indexes The Index object describes the configuration of a log index. This endpoint returns an array of the &#x60;LogIndex&#x60; objects of your organization. @param [Hash] opts the optional parameters @return [Array<(LogsIndexListResponse, Integer, Hash)>] LogsIndexListResponse data, response status code and response headers

# File lib/datadog_api_client/v1/api/logs_indexes_api.rb, line 253
def list_log_indexes_with_http_info(opts = {})

  if @api_client.config.unstable_operations.has_key?(:list_log_indexes)
    unstable_enabled = @api_client.config.unstable_operations[:list_log_indexes]
    if unstable_enabled
      @api_client.config.logger.warn format("Using unstable operation '%s'", "list_log_indexes")
    else
      raise APIError.new(message: format("Unstable operation '%s' is disabled", "list_log_indexes"))
    end
  end

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LogsIndexesAPI.list_log_indexes ...'
  end
  # resource path
  local_var_path = '/api/v1/logs/config/indexes'

  # query parameters
  query_params = opts[:query_params] || {}

  # 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] || 'LogsIndexListResponse'

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

  new_options = opts.merge(
    :operation => :list_log_indexes,
    :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: LogsIndexesAPI#list_log_indexes\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
update_logs_index(name, body, opts = {}) click to toggle source

Update an index Update an index as identified by its name. Returns the Index object passed in the request body when the request is successful. Using the `PUT` method updates your index’s configuration by replacing your current configuration with the new one sent to your Datadog organization. @param name [String] Name of the log index. @param body [LogsIndexUpdateRequest] Object containing the new &#x60;LogsIndexUpdateRequest&#x60;. @param [Hash] opts the optional parameters @return [LogsIndex]

# File lib/datadog_api_client/v1/api/logs_indexes_api.rb, line 313
def update_logs_index(name, body, opts = {})
  data, _status_code, _headers = update_logs_index_with_http_info(name, body, opts)
  data
end
update_logs_index_order(body, opts = {}) click to toggle source

Update indexes order This endpoint updates the index order of your organization. It returns the index order object passed in the request body when the request is successful. @param body [LogsIndexesOrder] Object containing the new ordered list of index names @param [Hash] opts the optional parameters @return [LogsIndexesOrder]

# File lib/datadog_api_client/v1/api/logs_indexes_api.rb, line 393
def update_logs_index_order(body, opts = {})
  data, _status_code, _headers = update_logs_index_order_with_http_info(body, opts)
  data
end
update_logs_index_order_with_http_info(body, opts = {}) click to toggle source

Update indexes order This endpoint updates the index order of your organization. It returns the index order object passed in the request body when the request is successful. @param body [LogsIndexesOrder] Object containing the new ordered list of index names @param [Hash] opts the optional parameters @return [Array<(LogsIndexesOrder, Integer, Hash)>] LogsIndexesOrder data, response status code and response headers

# File lib/datadog_api_client/v1/api/logs_indexes_api.rb, line 403
def update_logs_index_order_with_http_info(body, opts = {})

  if @api_client.config.unstable_operations.has_key?(:update_logs_index_order)
    unstable_enabled = @api_client.config.unstable_operations[:update_logs_index_order]
    if unstable_enabled
      @api_client.config.logger.warn format("Using unstable operation '%s'", "update_logs_index_order")
    else
      raise APIError.new(message: format("Unstable operation '%s' is disabled", "update_logs_index_order"))
    end
  end

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LogsIndexesAPI.update_logs_index_order ...'
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling LogsIndexesAPI.update_logs_index_order"
  end
  # resource path
  local_var_path = '/api/v1/logs/config/index-order'

  # query parameters
  query_params = opts[:query_params] || {}

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

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

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(body)

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

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

  new_options = opts.merge(
    :operation => :update_logs_index_order,
    :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(:PUT, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LogsIndexesAPI#update_logs_index_order\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
update_logs_index_with_http_info(name, body, opts = {}) click to toggle source

Update an index Update an index as identified by its name. Returns the Index object passed in the request body when the request is successful. Using the &#x60;PUT&#x60; method updates your index’s configuration by replacing your current configuration with the new one sent to your Datadog organization. @param name [String] Name of the log index. @param body [LogsIndexUpdateRequest] Object containing the new &#x60;LogsIndexUpdateRequest&#x60;. @param [Hash] opts the optional parameters @return [Array<(LogsIndex, Integer, Hash)>] LogsIndex data, response status code and response headers

# File lib/datadog_api_client/v1/api/logs_indexes_api.rb, line 324
def update_logs_index_with_http_info(name, body, opts = {})

  if @api_client.config.unstable_operations.has_key?(:update_logs_index)
    unstable_enabled = @api_client.config.unstable_operations[:update_logs_index]
    if unstable_enabled
      @api_client.config.logger.warn format("Using unstable operation '%s'", "update_logs_index")
    else
      raise APIError.new(message: format("Unstable operation '%s' is disabled", "update_logs_index"))
    end
  end

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LogsIndexesAPI.update_logs_index ...'
  end
  # verify the required parameter 'name' is set
  if @api_client.config.client_side_validation && name.nil?
    fail ArgumentError, "Missing the required parameter 'name' when calling LogsIndexesAPI.update_logs_index"
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling LogsIndexesAPI.update_logs_index"
  end
  # resource path
  local_var_path = '/api/v1/logs/config/indexes/{name}'.sub('{' + 'name' + '}', CGI.escape(name.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

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

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

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(body)

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

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

  new_options = opts.merge(
    :operation => :update_logs_index,
    :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(:PUT, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LogsIndexesAPI#update_logs_index\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end