class DatadogAPIClient::V2::SecurityMonitoringAPI

Attributes

api_client[RW]

Public Class Methods

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

Public Instance Methods

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

Create a security filter Create a security filter. See the [security filter guide](docs.datadoghq.com/security_platform/guide/how-to-setup-security-filters-using-security-monitoring-api/) for more examples. @param body [SecurityFilterCreateRequest] The definition of the new security filter. @param [Hash] opts the optional parameters @return [SecurityFilterResponse]

# File lib/datadog_api_client/v2/api/security_monitoring_api.rb, line 30
def create_security_filter(body, opts = {})
  data, _status_code, _headers = create_security_filter_with_http_info(body, opts)
  data
end
create_security_filter_with_http_info(body, opts = {}) click to toggle source

Create a security filter Create a security filter. See the [security filter guide](docs.datadoghq.com/security_platform/guide/how-to-setup-security-filters-using-security-monitoring-api/) for more examples. @param body [SecurityFilterCreateRequest] The definition of the new security filter. @param [Hash] opts the optional parameters @return [Array<(SecurityFilterResponse, Integer, Hash)>] SecurityFilterResponse data, response status code and response headers

# File lib/datadog_api_client/v2/api/security_monitoring_api.rb, line 40
def create_security_filter_with_http_info(body, opts = {})

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

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SecurityMonitoringAPI.create_security_filter ...'
  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 SecurityMonitoringAPI.create_security_filter"
  end
  # resource path
  local_var_path = '/api/v2/security_monitoring/configuration/security_filters'

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

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

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

Create a detection rule Create a detection rule. @param body [SecurityMonitoringRuleCreatePayload] @param [Hash] opts the optional parameters @return [SecurityMonitoringRuleResponse]

# File lib/datadog_api_client/v2/api/security_monitoring_api.rb, line 105
def create_security_monitoring_rule(body, opts = {})
  data, _status_code, _headers = create_security_monitoring_rule_with_http_info(body, opts)
  data
end
create_security_monitoring_rule_with_http_info(body, opts = {}) click to toggle source

Create a detection rule Create a detection rule. @param body [SecurityMonitoringRuleCreatePayload] @param [Hash] opts the optional parameters @return [Array<(SecurityMonitoringRuleResponse, Integer, Hash)>] SecurityMonitoringRuleResponse data, response status code and response headers

# File lib/datadog_api_client/v2/api/security_monitoring_api.rb, line 115
def create_security_monitoring_rule_with_http_info(body, opts = {})

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

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SecurityMonitoringAPI.create_security_monitoring_rule ...'
  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 SecurityMonitoringAPI.create_security_monitoring_rule"
  end
  # resource path
  local_var_path = '/api/v2/security_monitoring/rules'

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

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

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

Delete a security filter Delete a specific security filter. @param security_filter_id [String] The ID of the security filter. @param [Hash] opts the optional parameters @return [nil]

# File lib/datadog_api_client/v2/api/security_monitoring_api.rb, line 180
def delete_security_filter(security_filter_id, opts = {})
  delete_security_filter_with_http_info(security_filter_id, opts)
  nil
end
delete_security_filter_with_http_info(security_filter_id, opts = {}) click to toggle source

Delete a security filter Delete a specific security filter. @param security_filter_id [String] The ID of the security filter. @param [Hash] opts the optional parameters @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers

# File lib/datadog_api_client/v2/api/security_monitoring_api.rb, line 190
def delete_security_filter_with_http_info(security_filter_id, opts = {})

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

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SecurityMonitoringAPI.delete_security_filter ...'
  end
  # verify the required parameter 'security_filter_id' is set
  if @api_client.config.client_side_validation && security_filter_id.nil?
    fail ArgumentError, "Missing the required parameter 'security_filter_id' when calling SecurityMonitoringAPI.delete_security_filter"
  end
  # resource path
  local_var_path = '/api/v2/security_monitoring/configuration/security_filters/{security_filter_id}'.sub('{' + 'security_filter_id' + '}', CGI.escape(security_filter_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_security_filter,
    :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: SecurityMonitoringAPI#delete_security_filter\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
delete_security_monitoring_rule(rule_id, opts = {}) click to toggle source

Delete an existing rule Delete an existing rule. Default rules cannot be deleted. @param rule_id [String] The ID of the rule. @param [Hash] opts the optional parameters @return [nil]

# File lib/datadog_api_client/v2/api/security_monitoring_api.rb, line 253
def delete_security_monitoring_rule(rule_id, opts = {})
  delete_security_monitoring_rule_with_http_info(rule_id, opts)
  nil
end
delete_security_monitoring_rule_with_http_info(rule_id, opts = {}) click to toggle source

Delete an existing rule Delete an existing rule. Default rules cannot be deleted. @param rule_id [String] The ID of the rule. @param [Hash] opts the optional parameters @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers

# File lib/datadog_api_client/v2/api/security_monitoring_api.rb, line 263
def delete_security_monitoring_rule_with_http_info(rule_id, opts = {})

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

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SecurityMonitoringAPI.delete_security_monitoring_rule ...'
  end
  # verify the required parameter 'rule_id' is set
  if @api_client.config.client_side_validation && rule_id.nil?
    fail ArgumentError, "Missing the required parameter 'rule_id' when calling SecurityMonitoringAPI.delete_security_monitoring_rule"
  end
  # resource path
  local_var_path = '/api/v2/security_monitoring/rules/{rule_id}'.sub('{' + 'rule_id' + '}', CGI.escape(rule_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_security_monitoring_rule,
    :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: SecurityMonitoringAPI#delete_security_monitoring_rule\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
get_security_filter(security_filter_id, opts = {}) click to toggle source

Get a security filter Get the details of a specific security filter. See the [security filter guide](docs.datadoghq.com/security_platform/guide/how-to-setup-security-filters-using-security-monitoring-api/) for more examples. @param security_filter_id [String] The ID of the security filter. @param [Hash] opts the optional parameters @return [SecurityFilterResponse]

# File lib/datadog_api_client/v2/api/security_monitoring_api.rb, line 326
def get_security_filter(security_filter_id, opts = {})
  data, _status_code, _headers = get_security_filter_with_http_info(security_filter_id, opts)
  data
end
get_security_filter_with_http_info(security_filter_id, opts = {}) click to toggle source

Get a security filter Get the details of a specific security filter. See the [security filter guide](docs.datadoghq.com/security_platform/guide/how-to-setup-security-filters-using-security-monitoring-api/) for more examples. @param security_filter_id [String] The ID of the security filter. @param [Hash] opts the optional parameters @return [Array<(SecurityFilterResponse, Integer, Hash)>] SecurityFilterResponse data, response status code and response headers

# File lib/datadog_api_client/v2/api/security_monitoring_api.rb, line 336
def get_security_filter_with_http_info(security_filter_id, opts = {})

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

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SecurityMonitoringAPI.get_security_filter ...'
  end
  # verify the required parameter 'security_filter_id' is set
  if @api_client.config.client_side_validation && security_filter_id.nil?
    fail ArgumentError, "Missing the required parameter 'security_filter_id' when calling SecurityMonitoringAPI.get_security_filter"
  end
  # resource path
  local_var_path = '/api/v2/security_monitoring/configuration/security_filters/{security_filter_id}'.sub('{' + 'security_filter_id' + '}', CGI.escape(security_filter_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] || 'SecurityFilterResponse'

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

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

Get a rule's details Get a rule's details. @param rule_id [String] The ID of the rule. @param [Hash] opts the optional parameters @return [SecurityMonitoringRuleResponse]

# File lib/datadog_api_client/v2/api/security_monitoring_api.rb, line 399
def get_security_monitoring_rule(rule_id, opts = {})
  data, _status_code, _headers = get_security_monitoring_rule_with_http_info(rule_id, opts)
  data
end
get_security_monitoring_rule_with_http_info(rule_id, opts = {}) click to toggle source

Get a rule&#39;s details Get a rule&#39;s details. @param rule_id [String] The ID of the rule. @param [Hash] opts the optional parameters @return [Array<(SecurityMonitoringRuleResponse, Integer, Hash)>] SecurityMonitoringRuleResponse data, response status code and response headers

# File lib/datadog_api_client/v2/api/security_monitoring_api.rb, line 409
def get_security_monitoring_rule_with_http_info(rule_id, opts = {})

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

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SecurityMonitoringAPI.get_security_monitoring_rule ...'
  end
  # verify the required parameter 'rule_id' is set
  if @api_client.config.client_side_validation && rule_id.nil?
    fail ArgumentError, "Missing the required parameter 'rule_id' when calling SecurityMonitoringAPI.get_security_monitoring_rule"
  end
  # resource path
  local_var_path = '/api/v2/security_monitoring/rules/{rule_id}'.sub('{' + 'rule_id' + '}', CGI.escape(rule_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] || 'SecurityMonitoringRuleResponse'

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

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

Get all security filters Get the list of configured security filters with their definitions. @param [Hash] opts the optional parameters @return [SecurityFiltersResponse]

# File lib/datadog_api_client/v2/api/security_monitoring_api.rb, line 471
def list_security_filters(opts = {})
  data, _status_code, _headers = list_security_filters_with_http_info(opts)
  data
end
list_security_filters_with_http_info(opts = {}) click to toggle source

Get all security filters Get the list of configured security filters with their definitions. @param [Hash] opts the optional parameters @return [Array<(SecurityFiltersResponse, Integer, Hash)>] SecurityFiltersResponse data, response status code and response headers

# File lib/datadog_api_client/v2/api/security_monitoring_api.rb, line 480
def list_security_filters_with_http_info(opts = {})

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

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SecurityMonitoringAPI.list_security_filters ...'
  end
  # resource path
  local_var_path = '/api/v2/security_monitoring/configuration/security_filters'

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

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

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

List rules List rules. @param [Hash] opts the optional parameters @option opts [Integer] :page_size Size for a given page. (default to 10) @option opts [Integer] :page_number Specific page number to return. (default to 0) @return [SecurityMonitoringListRulesResponse]

# File lib/datadog_api_client/v2/api/security_monitoring_api.rb, line 540
def list_security_monitoring_rules(opts = {})
  data, _status_code, _headers = list_security_monitoring_rules_with_http_info(opts)
  data
end
list_security_monitoring_rules_with_http_info(opts = {}) click to toggle source

List rules List rules. @param [Hash] opts the optional parameters @option opts [Integer] :page_size Size for a given page. @option opts [Integer] :page_number Specific page number to return. @return [Array<(SecurityMonitoringListRulesResponse, Integer, Hash)>] SecurityMonitoringListRulesResponse data, response status code and response headers

# File lib/datadog_api_client/v2/api/security_monitoring_api.rb, line 551
def list_security_monitoring_rules_with_http_info(opts = {})

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

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SecurityMonitoringAPI.list_security_monitoring_rules ...'
  end
  # resource path
  local_var_path = '/api/v2/security_monitoring/rules'

  # query parameters
  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?

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

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

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

Get a quick list of security signals The list endpoint returns security signals that match a search query. Both this endpoint and the POST endpoint can be used interchangeably when listing security signals. @param [Hash] opts the optional parameters @option opts [String] :filter_query The search query for security signals. @option opts [Time] :filter_from The minimum timestamp for requested security signals. @option opts [Time] :filter_to The maximum timestamp for requested security signals. @option opts [SecurityMonitoringSignalsSort] :sort The order of the security signals in results. @option opts [String] :page_cursor A list of results using the cursor provided in the previous query. @option opts [Integer] :page_limit The maximum number of security signals in the response. (default to 10) @return [SecurityMonitoringSignalsListResponse]

# File lib/datadog_api_client/v2/api/security_monitoring_api.rb, line 617
def list_security_monitoring_signals(opts = {})
  data, _status_code, _headers = list_security_monitoring_signals_with_http_info(opts)
  data
end
list_security_monitoring_signals_with_http_info(opts = {}) click to toggle source

Get a quick list of security signals The list endpoint returns security signals that match a search query. Both this endpoint and the POST endpoint can be used interchangeably when listing security signals. @param [Hash] opts the optional parameters @option opts [String] :filter_query The search query for security signals. @option opts [Time] :filter_from The minimum timestamp for requested security signals. @option opts [Time] :filter_to The maximum timestamp for requested security signals. @option opts [SecurityMonitoringSignalsSort] :sort The order of the security signals in results. @option opts [String] :page_cursor A list of results using the cursor provided in the previous query. @option opts [Integer] :page_limit The maximum number of security signals in the response. @return [Array<(SecurityMonitoringSignalsListResponse, Integer, Hash)>] SecurityMonitoringSignalsListResponse data, response status code and response headers

# File lib/datadog_api_client/v2/api/security_monitoring_api.rb, line 632
def list_security_monitoring_signals_with_http_info(opts = {})

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

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SecurityMonitoringAPI.list_security_monitoring_signals ...'
  end
  if @api_client.config.client_side_validation && !opts[:'page_limit'].nil? && opts[:'page_limit'] > 1000
    fail ArgumentError, 'invalid value for "opts[:"page_limit"]" when calling SecurityMonitoringAPI.list_security_monitoring_signals, must be smaller than or equal to 1000.'
  end

  # resource path
  local_var_path = '/api/v2/security_monitoring/signals'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'filter[query]'] = opts[:'filter_query'] if !opts[:'filter_query'].nil?
  query_params[:'filter[from]'] = opts[:'filter_from'] if !opts[:'filter_from'].nil?
  query_params[:'filter[to]'] = opts[:'filter_to'] if !opts[:'filter_to'].nil?
  query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?
  query_params[:'page[cursor]'] = opts[:'page_cursor'] if !opts[:'page_cursor'].nil?
  query_params[:'page[limit]'] = opts[:'page_limit'] if !opts[:'page_limit'].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] || 'SecurityMonitoringSignalsListResponse'

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

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

Get a list of security signals Returns security signals that match a search query. Both this endpoint and the GET endpoint can be used interchangeably for listing security signals. @param [Hash] opts the optional parameters @option opts [SecurityMonitoringSignalListRequest] :body @return [SecurityMonitoringSignalsListResponse]

# File lib/datadog_api_client/v2/api/security_monitoring_api.rb, line 701
def search_security_monitoring_signals(opts = {})
  data, _status_code, _headers = search_security_monitoring_signals_with_http_info(opts)
  data
end
search_security_monitoring_signals_with_http_info(opts = {}) click to toggle source

Get a list of security signals Returns security signals that match a search query. Both this endpoint and the GET endpoint can be used interchangeably for listing security signals. @param [Hash] opts the optional parameters @option opts [SecurityMonitoringSignalListRequest] :body @return [Array<(SecurityMonitoringSignalsListResponse, Integer, Hash)>] SecurityMonitoringSignalsListResponse data, response status code and response headers

# File lib/datadog_api_client/v2/api/security_monitoring_api.rb, line 711
def search_security_monitoring_signals_with_http_info(opts = {})

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

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SecurityMonitoringAPI.search_security_monitoring_signals ...'
  end
  # resource path
  local_var_path = '/api/v2/security_monitoring/signals/search'

  # 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(opts[:'body'])

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

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

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

Update a security filter Update a specific security filter. Returns the security filter object when the request is successful. @param security_filter_id [String] The ID of the security filter. @param body [SecurityFilterUpdateRequest] New definition of the security filter. @param [Hash] opts the optional parameters @return [SecurityFilterResponse]

# File lib/datadog_api_client/v2/api/security_monitoring_api.rb, line 773
def update_security_filter(security_filter_id, body, opts = {})
  data, _status_code, _headers = update_security_filter_with_http_info(security_filter_id, body, opts)
  data
end
update_security_filter_with_http_info(security_filter_id, body, opts = {}) click to toggle source

Update a security filter Update a specific security filter. Returns the security filter object when the request is successful. @param security_filter_id [String] The ID of the security filter. @param body [SecurityFilterUpdateRequest] New definition of the security filter. @param [Hash] opts the optional parameters @return [Array<(SecurityFilterResponse, Integer, Hash)>] SecurityFilterResponse data, response status code and response headers

# File lib/datadog_api_client/v2/api/security_monitoring_api.rb, line 784
def update_security_filter_with_http_info(security_filter_id, body, opts = {})

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

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SecurityMonitoringAPI.update_security_filter ...'
  end
  # verify the required parameter 'security_filter_id' is set
  if @api_client.config.client_side_validation && security_filter_id.nil?
    fail ArgumentError, "Missing the required parameter 'security_filter_id' when calling SecurityMonitoringAPI.update_security_filter"
  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 SecurityMonitoringAPI.update_security_filter"
  end
  # resource path
  local_var_path = '/api/v2/security_monitoring/configuration/security_filters/{security_filter_id}'.sub('{' + 'security_filter_id' + '}', CGI.escape(security_filter_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] || 'SecurityFilterResponse'

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

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

Update an existing rule Update an existing rule. When updating `cases`, `queries` or `options`, the whole field must be included. For example, when modifying a query all queries must be included. Default rules can only be updated to be enabled and to change notifications. @param rule_id [String] The ID of the rule. @param body [SecurityMonitoringRuleUpdatePayload] @param [Hash] opts the optional parameters @return [SecurityMonitoringRuleResponse]

# File lib/datadog_api_client/v2/api/security_monitoring_api.rb, line 854
def update_security_monitoring_rule(rule_id, body, opts = {})
  data, _status_code, _headers = update_security_monitoring_rule_with_http_info(rule_id, body, opts)
  data
end
update_security_monitoring_rule_with_http_info(rule_id, body, opts = {}) click to toggle source

Update an existing rule Update an existing rule. When updating &#x60;cases&#x60;, &#x60;queries&#x60; or &#x60;options&#x60;, the whole field must be included. For example, when modifying a query all queries must be included. Default rules can only be updated to be enabled and to change notifications. @param rule_id [String] The ID of the rule. @param body [SecurityMonitoringRuleUpdatePayload] @param [Hash] opts the optional parameters @return [Array<(SecurityMonitoringRuleResponse, Integer, Hash)>] SecurityMonitoringRuleResponse data, response status code and response headers

# File lib/datadog_api_client/v2/api/security_monitoring_api.rb, line 865
def update_security_monitoring_rule_with_http_info(rule_id, body, opts = {})

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

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SecurityMonitoringAPI.update_security_monitoring_rule ...'
  end
  # verify the required parameter 'rule_id' is set
  if @api_client.config.client_side_validation && rule_id.nil?
    fail ArgumentError, "Missing the required parameter 'rule_id' when calling SecurityMonitoringAPI.update_security_monitoring_rule"
  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 SecurityMonitoringAPI.update_security_monitoring_rule"
  end
  # resource path
  local_var_path = '/api/v2/security_monitoring/rules/{rule_id}'.sub('{' + 'rule_id' + '}', CGI.escape(rule_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] || 'SecurityMonitoringRuleResponse'

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

  new_options = opts.merge(
    :operation => :update_security_monitoring_rule,
    :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: SecurityMonitoringAPI#update_security_monitoring_rule\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end