class DatadogAPIClient::V1::ServiceLevelObjectiveCorrectionsAPI

Attributes

api_client[RW]

Public Class Methods

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

Public Instance Methods

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

Create an SLO correction Create an SLO Correction @param body [SLOCorrectionCreateRequest] Create an SLO Correction @param [Hash] opts the optional parameters @return [SLOCorrectionResponse]

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

Create an SLO correction Create an SLO Correction @param body [SLOCorrectionCreateRequest] Create an SLO Correction @param [Hash] opts the optional parameters @return [Array<(SLOCorrectionResponse, Integer, Hash)>] SLOCorrectionResponse data, response status code and response headers

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

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

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ServiceLevelObjectiveCorrectionsAPI.create_slo_correction ...'
  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 ServiceLevelObjectiveCorrectionsAPI.create_slo_correction"
  end
  # resource path
  local_var_path = '/api/v1/slo/correction'

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

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

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

Delete an SLO correction Permanently delete the specified SLO correction object @param slo_correction_id [String] The ID of the SLO correction object @param [Hash] opts the optional parameters @return [nil]

# File lib/datadog_api_client/v1/api/service_level_objective_corrections_api.rb, line 105
def delete_slo_correction(slo_correction_id, opts = {})
  delete_slo_correction_with_http_info(slo_correction_id, opts)
  nil
end
delete_slo_correction_with_http_info(slo_correction_id, opts = {}) click to toggle source

Delete an SLO correction Permanently delete the specified SLO correction object @param slo_correction_id [String] The ID of the SLO correction object @param [Hash] opts the optional parameters @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers

# File lib/datadog_api_client/v1/api/service_level_objective_corrections_api.rb, line 115
def delete_slo_correction_with_http_info(slo_correction_id, opts = {})

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

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ServiceLevelObjectiveCorrectionsAPI.delete_slo_correction ...'
  end
  # verify the required parameter 'slo_correction_id' is set
  if @api_client.config.client_side_validation && slo_correction_id.nil?
    fail ArgumentError, "Missing the required parameter 'slo_correction_id' when calling ServiceLevelObjectiveCorrectionsAPI.delete_slo_correction"
  end
  # resource path
  local_var_path = '/api/v1/slo/correction/{slo_correction_id}'.sub('{' + 'slo_correction_id' + '}', CGI.escape(slo_correction_id.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]

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

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

Get an SLO correction for an SLO Get an SLO correction @param slo_correction_id [String] The ID of the SLO correction object @param [Hash] opts the optional parameters @return [SLOCorrectionResponse]

# File lib/datadog_api_client/v1/api/service_level_objective_corrections_api.rb, line 178
def get_slo_correction(slo_correction_id, opts = {})
  data, _status_code, _headers = get_slo_correction_with_http_info(slo_correction_id, opts)
  data
end
get_slo_correction_with_http_info(slo_correction_id, opts = {}) click to toggle source

Get an SLO correction for an SLO Get an SLO correction @param slo_correction_id [String] The ID of the SLO correction object @param [Hash] opts the optional parameters @return [Array<(SLOCorrectionResponse, Integer, Hash)>] SLOCorrectionResponse data, response status code and response headers

# File lib/datadog_api_client/v1/api/service_level_objective_corrections_api.rb, line 188
def get_slo_correction_with_http_info(slo_correction_id, opts = {})

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

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ServiceLevelObjectiveCorrectionsAPI.get_slo_correction ...'
  end
  # verify the required parameter 'slo_correction_id' is set
  if @api_client.config.client_side_validation && slo_correction_id.nil?
    fail ArgumentError, "Missing the required parameter 'slo_correction_id' when calling ServiceLevelObjectiveCorrectionsAPI.get_slo_correction"
  end
  # resource path
  local_var_path = '/api/v1/slo/correction/{slo_correction_id}'.sub('{' + 'slo_correction_id' + '}', CGI.escape(slo_correction_id.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] || 'SLOCorrectionResponse'

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

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

Get all SLO corrections Get all Service Level Objective corrections @param [Hash] opts the optional parameters @return [SLOCorrectionListResponse]

# File lib/datadog_api_client/v1/api/service_level_objective_corrections_api.rb, line 250
def list_slo_correction(opts = {})
  data, _status_code, _headers = list_slo_correction_with_http_info(opts)
  data
end
list_slo_correction_with_http_info(opts = {}) click to toggle source

Get all SLO corrections Get all Service Level Objective corrections @param [Hash] opts the optional parameters @return [Array<(SLOCorrectionListResponse, Integer, Hash)>] SLOCorrectionListResponse data, response status code and response headers

# File lib/datadog_api_client/v1/api/service_level_objective_corrections_api.rb, line 259
def list_slo_correction_with_http_info(opts = {})

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

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ServiceLevelObjectiveCorrectionsAPI.list_slo_correction ...'
  end
  # resource path
  local_var_path = '/api/v1/slo/correction'

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

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

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

Update an SLO correction Update the specified SLO correction object object @param slo_correction_id [String] The ID of the SLO correction object @param body [SLOCorrectionUpdateRequest] The edited SLO correction object. @param [Hash] opts the optional parameters @return [SLOCorrectionResponse]

# File lib/datadog_api_client/v1/api/service_level_objective_corrections_api.rb, line 319
def update_slo_correction(slo_correction_id, body, opts = {})
  data, _status_code, _headers = update_slo_correction_with_http_info(slo_correction_id, body, opts)
  data
end
update_slo_correction_with_http_info(slo_correction_id, body, opts = {}) click to toggle source

Update an SLO correction Update the specified SLO correction object object @param slo_correction_id [String] The ID of the SLO correction object @param body [SLOCorrectionUpdateRequest] The edited SLO correction object. @param [Hash] opts the optional parameters @return [Array<(SLOCorrectionResponse, Integer, Hash)>] SLOCorrectionResponse data, response status code and response headers

# File lib/datadog_api_client/v1/api/service_level_objective_corrections_api.rb, line 330
def update_slo_correction_with_http_info(slo_correction_id, body, opts = {})

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

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ServiceLevelObjectiveCorrectionsAPI.update_slo_correction ...'
  end
  # verify the required parameter 'slo_correction_id' is set
  if @api_client.config.client_side_validation && slo_correction_id.nil?
    fail ArgumentError, "Missing the required parameter 'slo_correction_id' when calling ServiceLevelObjectiveCorrectionsAPI.update_slo_correction"
  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 ServiceLevelObjectiveCorrectionsAPI.update_slo_correction"
  end
  # resource path
  local_var_path = '/api/v1/slo/correction/{slo_correction_id}'.sub('{' + 'slo_correction_id' + '}', CGI.escape(slo_correction_id.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] || 'SLOCorrectionResponse'

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

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