datadog_api_client 1.0.0 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (190) hide show
  1. checksums.yaml +4 -4
  2. data/.apigentools-info +6 -6
  3. data/.github/workflows/scripts/test_integration.js +24 -0
  4. data/.github/workflows/test.yml +4 -0
  5. data/.github/workflows/test_integration.yml +87 -0
  6. data/.openapi-generator/FILES +48 -0
  7. data/CHANGELOG.md +18 -0
  8. data/README.md +1 -1
  9. data/data/v1/openapi.yaml +1133 -99
  10. data/data/v2/openapi.yaml +420 -13
  11. data/docs/v1/Downtime.md +2 -0
  12. data/docs/v1/DowntimeChild.md +48 -0
  13. data/docs/v1/MetricsAPI.md +1 -1
  14. data/docs/v1/Monitor.md +3 -3
  15. data/docs/v1/MonitorGroupSearchResponse.md +22 -0
  16. data/docs/v1/MonitorGroupSearchResponseCounts.md +20 -0
  17. data/docs/v1/MonitorGroupSearchResult.md +30 -0
  18. data/docs/v1/MonitorOptions.md +1 -1
  19. data/docs/v1/MonitorSearchResponse.md +22 -0
  20. data/docs/v1/MonitorSearchResponseCounts.md +24 -0
  21. data/docs/v1/MonitorSearchResponseMetadata.md +24 -0
  22. data/docs/v1/MonitorSearchResult.md +40 -0
  23. data/docs/v1/MonitorSearchResultNotification.md +20 -0
  24. data/docs/v1/MonitorsAPI.md +155 -13
  25. data/docs/v1/NotebookCreateDataAttributes.md +1 -1
  26. data/docs/v1/NotebookResponseDataAttributes.md +3 -3
  27. data/docs/v1/NotebookUpdateDataAttributes.md +1 -1
  28. data/docs/v1/NotebooksResponse.md +1 -1
  29. data/docs/v1/NotebooksResponseData.md +22 -0
  30. data/docs/v1/NotebooksResponseDataAttributes.md +30 -0
  31. data/docs/v1/README.md +25 -4
  32. data/docs/v1/SyntheticsAPI.md +62 -2
  33. data/docs/v1/SyntheticsAPITest.md +2 -2
  34. data/docs/v1/SyntheticsAPITestConfig.md +1 -1
  35. data/docs/v1/SyntheticsBrowserTest.md +2 -2
  36. data/docs/v1/SyntheticsConfigVariable.md +3 -1
  37. data/docs/v1/SyntheticsGlobalVariableValue.md +1 -1
  38. data/docs/v1/SyntheticsListGlobalVariablesResponse.md +18 -0
  39. data/docs/v1/SyntheticsTestConfig.md +1 -1
  40. data/docs/v1/SyntheticsTestDetails.md +2 -2
  41. data/docs/v1/UsageAttributionBody.md +2 -0
  42. data/docs/v1/UsageAttributionPagination.md +3 -7
  43. data/docs/v1/UsageAttributionValues.md +8 -0
  44. data/docs/v1/UsageAuditLogsHour.md +20 -0
  45. data/docs/v1/UsageAuditLogsResponse.md +18 -0
  46. data/docs/v1/UsageCWSHour.md +22 -0
  47. data/docs/v1/UsageCWSResponse.md +18 -0
  48. data/docs/v1/UsageCloudSecurityPostureManagementHour.md +22 -0
  49. data/docs/v1/UsageCloudSecurityPostureManagementResponse.md +18 -0
  50. data/docs/v1/UsageMeteringAPI.md +157 -21
  51. data/docs/v1/UsageSummaryDate.md +12 -4
  52. data/docs/v1/UsageSummaryDateOrg.md +12 -4
  53. data/docs/v1/UsageSummaryResponse.md +12 -4
  54. data/docs/v1/UsageTopAvgMetricsMetadata.md +2 -2
  55. data/docs/v1/WidgetCustomLink.md +7 -3
  56. data/docs/v2/IncidentServicesAPI.md +2 -2
  57. data/docs/v2/IncidentTeamsAPI.md +2 -2
  58. data/docs/v2/IncidentsAPI.md +2 -2
  59. data/docs/v2/IncidentsResponse.md +1 -1
  60. data/docs/v2/KeyManagementAPI.md +6 -6
  61. data/docs/v2/README.md +21 -0
  62. data/docs/v2/RelationshipToIncidentIntegrationMetadataData.md +1 -1
  63. data/docs/v2/RelationshipToIncidentIntegrationMetadatas.md +1 -1
  64. data/docs/v2/RolesAPI.md +4 -4
  65. data/docs/v2/SecurityFilter.md +22 -0
  66. data/docs/v2/SecurityFilterAttributes.md +30 -0
  67. data/docs/v2/SecurityFilterCreateAttributes.md +26 -0
  68. data/docs/v2/SecurityFilterCreateData.md +20 -0
  69. data/docs/v2/SecurityFilterCreateRequest.md +18 -0
  70. data/docs/v2/SecurityFilterDeleteResponse.md +18 -0
  71. data/docs/v2/SecurityFilterExclusionFilter.md +20 -0
  72. data/docs/v2/SecurityFilterExclusionFilterResponse.md +20 -0
  73. data/docs/v2/SecurityFilterFilteredDataType.md +15 -0
  74. data/docs/v2/SecurityFilterMeta.md +18 -0
  75. data/docs/v2/SecurityFilterResponse.md +20 -0
  76. data/docs/v2/SecurityFilterType.md +15 -0
  77. data/docs/v2/SecurityFilterUpdateAttributes.md +28 -0
  78. data/docs/v2/SecurityFilterUpdateData.md +20 -0
  79. data/docs/v2/SecurityFilterUpdateRequest.md +18 -0
  80. data/docs/v2/SecurityFiltersResponse.md +20 -0
  81. data/docs/v2/SecurityMonitoringAPI.md +316 -2
  82. data/docs/v2/UsersAPI.md +10 -10
  83. data/lib/datadog_api_client/v1.rb +18 -2
  84. data/lib/datadog_api_client/v1/api/metrics_api.rb +2 -2
  85. data/lib/datadog_api_client/v1/api/monitors_api.rb +163 -5
  86. data/lib/datadog_api_client/v1/api/synthetics_api.rb +67 -0
  87. data/lib/datadog_api_client/v1/api/usage_metering_api.rb +180 -23
  88. data/lib/datadog_api_client/v1/models/downtime.rb +11 -1
  89. data/lib/datadog_api_client/v1/models/downtime_child.rb +427 -0
  90. data/lib/datadog_api_client/v1/models/monitor.rb +10 -0
  91. data/lib/datadog_api_client/v1/models/monitor_group_search_response.rb +243 -0
  92. data/lib/datadog_api_client/v1/models/monitor_group_search_response_counts.rb +237 -0
  93. data/lib/datadog_api_client/v1/models/monitor_group_search_result.rb +285 -0
  94. data/lib/datadog_api_client/v1/models/monitor_options.rb +1 -1
  95. data/lib/datadog_api_client/v1/models/monitor_search_response.rb +243 -0
  96. data/lib/datadog_api_client/v1/models/monitor_search_response_counts.rb +261 -0
  97. data/lib/datadog_api_client/v1/models/monitor_search_response_metadata.rb +253 -0
  98. data/lib/datadog_api_client/v1/models/monitor_search_result.rb +339 -0
  99. data/lib/datadog_api_client/v1/models/monitor_search_result_notification.rb +233 -0
  100. data/lib/datadog_api_client/v1/models/notebook_create_data_attributes.rb +1 -1
  101. data/lib/datadog_api_client/v1/models/notebook_distribution_cell_attributes.rb +1 -1
  102. data/lib/datadog_api_client/v1/models/notebook_heat_map_cell_attributes.rb +1 -1
  103. data/lib/datadog_api_client/v1/models/notebook_log_stream_cell_attributes.rb +1 -1
  104. data/lib/datadog_api_client/v1/models/notebook_markdown_cell_attributes.rb +1 -1
  105. data/lib/datadog_api_client/v1/models/notebook_response_data_attributes.rb +3 -3
  106. data/lib/datadog_api_client/v1/models/notebook_timeseries_cell_attributes.rb +1 -1
  107. data/lib/datadog_api_client/v1/models/notebook_toplist_cell_attributes.rb +1 -1
  108. data/lib/datadog_api_client/v1/models/notebook_update_data_attributes.rb +1 -1
  109. data/lib/datadog_api_client/v1/models/notebooks_response.rb +1 -1
  110. data/lib/datadog_api_client/v1/models/notebooks_response_data.rb +258 -0
  111. data/lib/datadog_api_client/v1/models/notebooks_response_data_attributes.rb +317 -0
  112. data/lib/datadog_api_client/v1/models/synthetics_api_test_config.rb +0 -5
  113. data/lib/datadog_api_client/v1/models/synthetics_config_variable.rb +11 -6
  114. data/lib/datadog_api_client/v1/models/synthetics_config_variable_type.rb +1 -0
  115. data/lib/datadog_api_client/v1/models/synthetics_global_variable_value.rb +0 -5
  116. data/lib/datadog_api_client/v1/models/synthetics_list_global_variables_response.rb +225 -0
  117. data/lib/datadog_api_client/v1/models/synthetics_test_config.rb +0 -5
  118. data/lib/datadog_api_client/v1/models/usage_attribution_body.rb +11 -1
  119. data/lib/datadog_api_client/v1/models/usage_attribution_pagination.rb +10 -30
  120. data/lib/datadog_api_client/v1/models/usage_attribution_values.rb +41 -1
  121. data/lib/datadog_api_client/v1/models/usage_audit_logs_hour.rb +233 -0
  122. data/lib/datadog_api_client/v1/models/{usage_compliance_response.rb → usage_audit_logs_response.rb} +6 -6
  123. data/lib/datadog_api_client/v1/models/{usage_compliance_hour.rb → usage_cloud_security_posture_management_hour.rb} +19 -19
  124. data/lib/datadog_api_client/v1/models/usage_cloud_security_posture_management_response.rb +225 -0
  125. data/lib/datadog_api_client/v1/models/usage_cws_hour.rb +243 -0
  126. data/lib/datadog_api_client/v1/models/usage_cws_response.rb +225 -0
  127. data/lib/datadog_api_client/v1/models/usage_summary_date.rb +61 -22
  128. data/lib/datadog_api_client/v1/models/usage_summary_date_org.rb +61 -22
  129. data/lib/datadog_api_client/v1/models/usage_summary_response.rb +61 -22
  130. data/lib/datadog_api_client/v1/models/usage_top_avg_metrics_metadata.rb +2 -4
  131. data/lib/datadog_api_client/v1/models/widget_custom_link.rb +24 -14
  132. data/lib/datadog_api_client/v2.rb +16 -0
  133. data/lib/datadog_api_client/v2/api/security_monitoring_api.rb +369 -0
  134. data/lib/datadog_api_client/v2/models/incident_integration_metadata_type.rb +1 -1
  135. data/lib/datadog_api_client/v2/models/relationship_to_incident_integration_metadata_data.rb +1 -1
  136. data/lib/datadog_api_client/v2/models/security_filter.rb +243 -0
  137. data/lib/datadog_api_client/v2/models/security_filter_attributes.rb +299 -0
  138. data/lib/datadog_api_client/v2/models/security_filter_create_attributes.rb +289 -0
  139. data/lib/datadog_api_client/v2/models/security_filter_create_data.rb +243 -0
  140. data/lib/datadog_api_client/v2/models/security_filter_create_request.rb +227 -0
  141. data/lib/datadog_api_client/v2/models/security_filter_delete_response.rb +222 -0
  142. data/lib/datadog_api_client/v2/models/security_filter_exclusion_filter.rb +243 -0
  143. data/lib/datadog_api_client/v2/models/security_filter_exclusion_filter_response.rb +233 -0
  144. data/lib/datadog_api_client/v2/models/security_filter_filtered_data_type.rb +39 -0
  145. data/lib/datadog_api_client/v2/models/security_filter_meta.rb +223 -0
  146. data/lib/datadog_api_client/v2/models/security_filter_response.rb +231 -0
  147. data/lib/datadog_api_client/v2/models/security_filter_type.rb +39 -0
  148. data/lib/datadog_api_client/v2/models/security_filter_update_attributes.rb +289 -0
  149. data/lib/datadog_api_client/v2/models/security_filter_update_data.rb +243 -0
  150. data/lib/datadog_api_client/v2/models/security_filter_update_request.rb +227 -0
  151. data/lib/datadog_api_client/v2/models/security_filters_response.rb +234 -0
  152. data/lib/datadog_api_client/version.rb +1 -1
  153. data/spec/v1/models/downtime_child_spec.rb +127 -0
  154. data/spec/v1/models/monitor_group_search_response_counts_spec.rb +43 -0
  155. data/spec/v1/models/monitor_group_search_response_spec.rb +49 -0
  156. data/spec/v1/models/monitor_group_search_result_spec.rb +73 -0
  157. data/spec/v1/models/monitor_search_response_counts_spec.rb +55 -0
  158. data/spec/v1/models/monitor_search_response_metadata_spec.rb +55 -0
  159. data/spec/v1/models/monitor_search_response_spec.rb +49 -0
  160. data/spec/v1/models/monitor_search_result_notification_spec.rb +43 -0
  161. data/spec/v1/models/monitor_search_result_spec.rb +103 -0
  162. data/spec/v1/models/notebooks_response_data_attributes_spec.rb +73 -0
  163. data/spec/v1/models/notebooks_response_data_spec.rb +49 -0
  164. data/spec/v1/models/synthetics_list_global_variables_response_spec.rb +37 -0
  165. data/spec/v1/models/usage_audit_logs_hour_spec.rb +43 -0
  166. data/spec/v1/models/{usage_compliance_response_spec.rb → usage_audit_logs_response_spec.rb} +6 -6
  167. data/spec/v1/models/usage_cloud_security_posture_management_hour_spec.rb +49 -0
  168. data/spec/v1/models/usage_cloud_security_posture_management_response_spec.rb +37 -0
  169. data/spec/v1/models/{usage_compliance_hour_spec.rb → usage_cws_hour_spec.rb} +8 -8
  170. data/spec/v1/models/usage_cws_response_spec.rb +37 -0
  171. data/spec/v2/models/security_filter_attributes_spec.rb +73 -0
  172. data/spec/v2/models/security_filter_create_attributes_spec.rb +61 -0
  173. data/spec/v2/models/security_filter_create_data_spec.rb +43 -0
  174. data/spec/v2/models/security_filter_create_request_spec.rb +37 -0
  175. data/spec/v2/models/security_filter_delete_response_spec.rb +37 -0
  176. data/spec/v2/models/security_filter_exclusion_filter_response_spec.rb +43 -0
  177. data/spec/v2/models/security_filter_exclusion_filter_spec.rb +43 -0
  178. data/spec/v2/models/security_filter_filtered_data_type_spec.rb +31 -0
  179. data/spec/v2/models/security_filter_meta_spec.rb +37 -0
  180. data/spec/v2/models/security_filter_response_spec.rb +43 -0
  181. data/spec/v2/models/security_filter_spec.rb +49 -0
  182. data/spec/v2/models/security_filter_type_spec.rb +31 -0
  183. data/spec/v2/models/security_filter_update_attributes_spec.rb +67 -0
  184. data/spec/v2/models/security_filter_update_data_spec.rb +43 -0
  185. data/spec/v2/models/security_filter_update_request_spec.rb +37 -0
  186. data/spec/v2/models/security_filters_response_spec.rb +43 -0
  187. metadata +140 -11
  188. data/.azure-pipelines/all.yml +0 -50
  189. data/docs/v1/UsageComplianceHour.md +0 -22
  190. data/docs/v1/UsageComplianceResponse.md +0 -18
@@ -44,8 +44,8 @@ module DatadogAPIClient::V1
44
44
  # Attribute type mapping.
45
45
  def self.openapi_types
46
46
  {
47
- :'day' => :'Object',
48
- :'month' => :'Object',
47
+ :'day' => :'Time',
48
+ :'month' => :'Time',
49
49
  :'pagination' => :'UsageAttributionPagination'
50
50
  }
51
51
  end
@@ -53,8 +53,6 @@ module DatadogAPIClient::V1
53
53
  # List of attributes with nullable: true
54
54
  def self.openapi_nullable
55
55
  Set.new([
56
- :'day',
57
- :'month',
58
56
  ])
59
57
  end
60
58
 
@@ -19,17 +19,25 @@ require 'time'
19
19
  module DatadogAPIClient::V1
20
20
  # Custom links help you connect a data value to a URL, like a Datadog page or your AWS console.
21
21
  class WidgetCustomLink
22
+ # The flag for toggling context menu link visibility.
23
+ attr_accessor :is_hidden
24
+
22
25
  # The label for the custom link URL. Keep the label short and descriptive. Use metrics and tags as variables.
23
26
  attr_accessor :label
24
27
 
25
28
  # The URL of the custom link. URL must include `http` or `https`. A relative URL must start with `/`.
26
29
  attr_accessor :link
27
30
 
31
+ # The label ID that refers to a context menu link. Can be `logs`, `hosts`, `traces`, `profiles`, `processes`, `containers`, or `rum`.
32
+ attr_accessor :override_label
33
+
28
34
  # Attribute mapping from ruby-style variable name to JSON key.
29
35
  def self.attribute_map
30
36
  {
37
+ :'is_hidden' => :'is_hidden',
31
38
  :'label' => :'label',
32
- :'link' => :'link'
39
+ :'link' => :'link',
40
+ :'override_label' => :'override_label'
33
41
  }
34
42
  end
35
43
 
@@ -41,8 +49,10 @@ module DatadogAPIClient::V1
41
49
  # Attribute type mapping.
42
50
  def self.openapi_types
43
51
  {
52
+ :'is_hidden' => :'Boolean',
44
53
  :'label' => :'String',
45
- :'link' => :'String'
54
+ :'link' => :'String',
55
+ :'override_label' => :'String'
46
56
  }
47
57
  end
48
58
 
@@ -67,6 +77,10 @@ module DatadogAPIClient::V1
67
77
  h[k.to_sym] = v
68
78
  }
69
79
 
80
+ if attributes.key?(:'is_hidden')
81
+ self.is_hidden = attributes[:'is_hidden']
82
+ end
83
+
70
84
  if attributes.key?(:'label')
71
85
  self.label = attributes[:'label']
72
86
  end
@@ -74,28 +88,22 @@ module DatadogAPIClient::V1
74
88
  if attributes.key?(:'link')
75
89
  self.link = attributes[:'link']
76
90
  end
91
+
92
+ if attributes.key?(:'override_label')
93
+ self.override_label = attributes[:'override_label']
94
+ end
77
95
  end
78
96
 
79
97
  # Show invalid properties with the reasons. Usually used together with valid?
80
98
  # @return Array for valid properties with the reasons
81
99
  def list_invalid_properties
82
100
  invalid_properties = Array.new
83
- if @label.nil?
84
- invalid_properties.push('invalid value for "label", label cannot be nil.')
85
- end
86
-
87
- if @link.nil?
88
- invalid_properties.push('invalid value for "link", link cannot be nil.')
89
- end
90
-
91
101
  invalid_properties
92
102
  end
93
103
 
94
104
  # Check to see if the all the properties in the model are valid
95
105
  # @return true if the model is valid
96
106
  def valid?
97
- return false if @label.nil?
98
- return false if @link.nil?
99
107
  true
100
108
  end
101
109
 
@@ -104,8 +112,10 @@ module DatadogAPIClient::V1
104
112
  def ==(o)
105
113
  return true if self.equal?(o)
106
114
  self.class == o.class &&
115
+ is_hidden == o.is_hidden &&
107
116
  label == o.label &&
108
- link == o.link
117
+ link == o.link &&
118
+ override_label == o.override_label
109
119
  end
110
120
 
111
121
  # @see the `==` method
@@ -117,7 +127,7 @@ module DatadogAPIClient::V1
117
127
  # Calculates hash code according to all attributes.
118
128
  # @return [Integer] Hash code
119
129
  def hash
120
- [label, link].hash
130
+ [is_hidden, label, link, override_label].hash
121
131
  end
122
132
 
123
133
  # Builds the object from hash
@@ -269,6 +269,22 @@ require 'datadog_api_client/v2/models/role_update_response_data'
269
269
  require 'datadog_api_client/v2/models/roles_response'
270
270
  require 'datadog_api_client/v2/models/roles_sort'
271
271
  require 'datadog_api_client/v2/models/roles_type'
272
+ require 'datadog_api_client/v2/models/security_filter'
273
+ require 'datadog_api_client/v2/models/security_filter_attributes'
274
+ require 'datadog_api_client/v2/models/security_filter_create_attributes'
275
+ require 'datadog_api_client/v2/models/security_filter_create_data'
276
+ require 'datadog_api_client/v2/models/security_filter_create_request'
277
+ require 'datadog_api_client/v2/models/security_filter_delete_response'
278
+ require 'datadog_api_client/v2/models/security_filter_exclusion_filter'
279
+ require 'datadog_api_client/v2/models/security_filter_exclusion_filter_response'
280
+ require 'datadog_api_client/v2/models/security_filter_filtered_data_type'
281
+ require 'datadog_api_client/v2/models/security_filter_meta'
282
+ require 'datadog_api_client/v2/models/security_filter_response'
283
+ require 'datadog_api_client/v2/models/security_filter_type'
284
+ require 'datadog_api_client/v2/models/security_filter_update_attributes'
285
+ require 'datadog_api_client/v2/models/security_filter_update_data'
286
+ require 'datadog_api_client/v2/models/security_filter_update_request'
287
+ require 'datadog_api_client/v2/models/security_filters_response'
272
288
  require 'datadog_api_client/v2/models/security_monitoring_filter'
273
289
  require 'datadog_api_client/v2/models/security_monitoring_filter_action'
274
290
  require 'datadog_api_client/v2/models/security_monitoring_list_rules_response'
@@ -22,6 +22,81 @@ module DatadogAPIClient::V2
22
22
  def initialize(api_client = APIClient.default)
23
23
  @api_client = api_client
24
24
  end
25
+ # Create a security filter
26
+ # Create a security filter. See the [security filter guide](https://docs.datadoghq.com/security_platform/guide/how-to-setup-security-filters-using-security-monitoring-api/) for more examples.
27
+ # @param body [SecurityFilterCreateRequest] The definition of the new security filter.
28
+ # @param [Hash] opts the optional parameters
29
+ # @return [SecurityFilterResponse]
30
+ def create_security_filter(body, opts = {})
31
+ data, _status_code, _headers = create_security_filter_with_http_info(body, opts)
32
+ data
33
+ end
34
+
35
+ # Create a security filter
36
+ # Create a security filter. See the [security filter guide](https://docs.datadoghq.com/security_platform/guide/how-to-setup-security-filters-using-security-monitoring-api/) for more examples.
37
+ # @param body [SecurityFilterCreateRequest] The definition of the new security filter.
38
+ # @param [Hash] opts the optional parameters
39
+ # @return [Array<(SecurityFilterResponse, Integer, Hash)>] SecurityFilterResponse data, response status code and response headers
40
+ def create_security_filter_with_http_info(body, opts = {})
41
+
42
+ if @api_client.config.unstable_operations.has_key?(:create_security_filter)
43
+ unstable_enabled = @api_client.config.unstable_operations[:create_security_filter]
44
+ if unstable_enabled
45
+ @api_client.config.logger.warn format("Using unstable operation '%s'", "create_security_filter")
46
+ else
47
+ raise APIError.new(message: format("Unstable operation '%s' is disabled", "create_security_filter"))
48
+ end
49
+ end
50
+
51
+ if @api_client.config.debugging
52
+ @api_client.config.logger.debug 'Calling API: SecurityMonitoringAPI.create_security_filter ...'
53
+ end
54
+ # verify the required parameter 'body' is set
55
+ if @api_client.config.client_side_validation && body.nil?
56
+ fail ArgumentError, "Missing the required parameter 'body' when calling SecurityMonitoringAPI.create_security_filter"
57
+ end
58
+ # resource path
59
+ local_var_path = '/api/v2/security_monitoring/configuration/security_filters'
60
+
61
+ # query parameters
62
+ query_params = opts[:query_params] || {}
63
+
64
+ # header parameters
65
+ header_params = opts[:header_params] || {}
66
+ # HTTP header 'Accept' (if needed)
67
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
68
+ # HTTP header 'Content-Type'
69
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
70
+
71
+ # form parameters
72
+ form_params = opts[:form_params] || {}
73
+
74
+ # http body (model)
75
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(body)
76
+
77
+ # return_type
78
+ return_type = opts[:debug_return_type] || 'SecurityFilterResponse'
79
+
80
+ # auth_names
81
+ auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth]
82
+
83
+ new_options = opts.merge(
84
+ :operation => :create_security_filter,
85
+ :header_params => header_params,
86
+ :query_params => query_params,
87
+ :form_params => form_params,
88
+ :body => post_body,
89
+ :auth_names => auth_names,
90
+ :return_type => return_type
91
+ )
92
+
93
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
94
+ if @api_client.config.debugging
95
+ @api_client.config.logger.debug "API called: SecurityMonitoringAPI#create_security_filter\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
96
+ end
97
+ return data, status_code, headers
98
+ end
99
+
25
100
  # Create a detection rule
26
101
  # Create a detection rule.
27
102
  # @param body [SecurityMonitoringRuleCreatePayload]
@@ -97,6 +172,79 @@ module DatadogAPIClient::V2
97
172
  return data, status_code, headers
98
173
  end
99
174
 
175
+ # Delete a security filter
176
+ # Delete a specific security filter.
177
+ # @param security_filter_id [String] The ID of the security filter.
178
+ # @param [Hash] opts the optional parameters
179
+ # @return [SecurityFilterDeleteResponse]
180
+ def delete_security_filter(security_filter_id, opts = {})
181
+ data, _status_code, _headers = delete_security_filter_with_http_info(security_filter_id, opts)
182
+ data
183
+ end
184
+
185
+ # Delete a security filter
186
+ # Delete a specific security filter.
187
+ # @param security_filter_id [String] The ID of the security filter.
188
+ # @param [Hash] opts the optional parameters
189
+ # @return [Array<(SecurityFilterDeleteResponse, Integer, Hash)>] SecurityFilterDeleteResponse data, response status code and response headers
190
+ def delete_security_filter_with_http_info(security_filter_id, opts = {})
191
+
192
+ if @api_client.config.unstable_operations.has_key?(:delete_security_filter)
193
+ unstable_enabled = @api_client.config.unstable_operations[:delete_security_filter]
194
+ if unstable_enabled
195
+ @api_client.config.logger.warn format("Using unstable operation '%s'", "delete_security_filter")
196
+ else
197
+ raise APIError.new(message: format("Unstable operation '%s' is disabled", "delete_security_filter"))
198
+ end
199
+ end
200
+
201
+ if @api_client.config.debugging
202
+ @api_client.config.logger.debug 'Calling API: SecurityMonitoringAPI.delete_security_filter ...'
203
+ end
204
+ # verify the required parameter 'security_filter_id' is set
205
+ if @api_client.config.client_side_validation && security_filter_id.nil?
206
+ fail ArgumentError, "Missing the required parameter 'security_filter_id' when calling SecurityMonitoringAPI.delete_security_filter"
207
+ end
208
+ # resource path
209
+ local_var_path = '/api/v2/security_monitoring/configuration/security_filters/{security_filter_id}'.sub('{' + 'security_filter_id' + '}', CGI.escape(security_filter_id.to_s))
210
+
211
+ # query parameters
212
+ query_params = opts[:query_params] || {}
213
+
214
+ # header parameters
215
+ header_params = opts[:header_params] || {}
216
+ # HTTP header 'Accept' (if needed)
217
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
218
+
219
+ # form parameters
220
+ form_params = opts[:form_params] || {}
221
+
222
+ # http body (model)
223
+ post_body = opts[:debug_body]
224
+
225
+ # return_type
226
+ return_type = opts[:debug_return_type] || 'SecurityFilterDeleteResponse'
227
+
228
+ # auth_names
229
+ auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth]
230
+
231
+ new_options = opts.merge(
232
+ :operation => :delete_security_filter,
233
+ :header_params => header_params,
234
+ :query_params => query_params,
235
+ :form_params => form_params,
236
+ :body => post_body,
237
+ :auth_names => auth_names,
238
+ :return_type => return_type
239
+ )
240
+
241
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
242
+ if @api_client.config.debugging
243
+ @api_client.config.logger.debug "API called: SecurityMonitoringAPI#delete_security_filter\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
244
+ end
245
+ return data, status_code, headers
246
+ end
247
+
100
248
  # Delete an existing rule
101
249
  # Delete an existing rule. Default rules cannot be deleted.
102
250
  # @param rule_id [String] The ID of the rule.
@@ -170,6 +318,79 @@ module DatadogAPIClient::V2
170
318
  return data, status_code, headers
171
319
  end
172
320
 
321
+ # Get a security filter
322
+ # Get the details of a specific security filter. See the [security filter guide](https://docs.datadoghq.com/security_platform/guide/how-to-setup-security-filters-using-security-monitoring-api/) for more examples.
323
+ # @param security_filter_id [String] The ID of the security filter.
324
+ # @param [Hash] opts the optional parameters
325
+ # @return [SecurityFilterResponse]
326
+ def get_security_filter(security_filter_id, opts = {})
327
+ data, _status_code, _headers = get_security_filter_with_http_info(security_filter_id, opts)
328
+ data
329
+ end
330
+
331
+ # Get a security filter
332
+ # Get the details of a specific security filter. See the [security filter guide](https://docs.datadoghq.com/security_platform/guide/how-to-setup-security-filters-using-security-monitoring-api/) for more examples.
333
+ # @param security_filter_id [String] The ID of the security filter.
334
+ # @param [Hash] opts the optional parameters
335
+ # @return [Array<(SecurityFilterResponse, Integer, Hash)>] SecurityFilterResponse data, response status code and response headers
336
+ def get_security_filter_with_http_info(security_filter_id, opts = {})
337
+
338
+ if @api_client.config.unstable_operations.has_key?(:get_security_filter)
339
+ unstable_enabled = @api_client.config.unstable_operations[:get_security_filter]
340
+ if unstable_enabled
341
+ @api_client.config.logger.warn format("Using unstable operation '%s'", "get_security_filter")
342
+ else
343
+ raise APIError.new(message: format("Unstable operation '%s' is disabled", "get_security_filter"))
344
+ end
345
+ end
346
+
347
+ if @api_client.config.debugging
348
+ @api_client.config.logger.debug 'Calling API: SecurityMonitoringAPI.get_security_filter ...'
349
+ end
350
+ # verify the required parameter 'security_filter_id' is set
351
+ if @api_client.config.client_side_validation && security_filter_id.nil?
352
+ fail ArgumentError, "Missing the required parameter 'security_filter_id' when calling SecurityMonitoringAPI.get_security_filter"
353
+ end
354
+ # resource path
355
+ local_var_path = '/api/v2/security_monitoring/configuration/security_filters/{security_filter_id}'.sub('{' + 'security_filter_id' + '}', CGI.escape(security_filter_id.to_s))
356
+
357
+ # query parameters
358
+ query_params = opts[:query_params] || {}
359
+
360
+ # header parameters
361
+ header_params = opts[:header_params] || {}
362
+ # HTTP header 'Accept' (if needed)
363
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
364
+
365
+ # form parameters
366
+ form_params = opts[:form_params] || {}
367
+
368
+ # http body (model)
369
+ post_body = opts[:debug_body]
370
+
371
+ # return_type
372
+ return_type = opts[:debug_return_type] || 'SecurityFilterResponse'
373
+
374
+ # auth_names
375
+ auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth]
376
+
377
+ new_options = opts.merge(
378
+ :operation => :get_security_filter,
379
+ :header_params => header_params,
380
+ :query_params => query_params,
381
+ :form_params => form_params,
382
+ :body => post_body,
383
+ :auth_names => auth_names,
384
+ :return_type => return_type
385
+ )
386
+
387
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
388
+ if @api_client.config.debugging
389
+ @api_client.config.logger.debug "API called: SecurityMonitoringAPI#get_security_filter\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
390
+ end
391
+ return data, status_code, headers
392
+ end
393
+
173
394
  # Get a rule's details
174
395
  # Get a rule's details.
175
396
  # @param rule_id [String] The ID of the rule.
@@ -243,6 +464,73 @@ module DatadogAPIClient::V2
243
464
  return data, status_code, headers
244
465
  end
245
466
 
467
+ # Get all security filters
468
+ # Get the list of configured security filters with their definitions.
469
+ # @param [Hash] opts the optional parameters
470
+ # @return [SecurityFiltersResponse]
471
+ def list_security_filters(opts = {})
472
+ data, _status_code, _headers = list_security_filters_with_http_info(opts)
473
+ data
474
+ end
475
+
476
+ # Get all security filters
477
+ # Get the list of configured security filters with their definitions.
478
+ # @param [Hash] opts the optional parameters
479
+ # @return [Array<(SecurityFiltersResponse, Integer, Hash)>] SecurityFiltersResponse data, response status code and response headers
480
+ def list_security_filters_with_http_info(opts = {})
481
+
482
+ if @api_client.config.unstable_operations.has_key?(:list_security_filters)
483
+ unstable_enabled = @api_client.config.unstable_operations[:list_security_filters]
484
+ if unstable_enabled
485
+ @api_client.config.logger.warn format("Using unstable operation '%s'", "list_security_filters")
486
+ else
487
+ raise APIError.new(message: format("Unstable operation '%s' is disabled", "list_security_filters"))
488
+ end
489
+ end
490
+
491
+ if @api_client.config.debugging
492
+ @api_client.config.logger.debug 'Calling API: SecurityMonitoringAPI.list_security_filters ...'
493
+ end
494
+ # resource path
495
+ local_var_path = '/api/v2/security_monitoring/configuration/security_filters'
496
+
497
+ # query parameters
498
+ query_params = opts[:query_params] || {}
499
+
500
+ # header parameters
501
+ header_params = opts[:header_params] || {}
502
+ # HTTP header 'Accept' (if needed)
503
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
504
+
505
+ # form parameters
506
+ form_params = opts[:form_params] || {}
507
+
508
+ # http body (model)
509
+ post_body = opts[:debug_body]
510
+
511
+ # return_type
512
+ return_type = opts[:debug_return_type] || 'SecurityFiltersResponse'
513
+
514
+ # auth_names
515
+ auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth]
516
+
517
+ new_options = opts.merge(
518
+ :operation => :list_security_filters,
519
+ :header_params => header_params,
520
+ :query_params => query_params,
521
+ :form_params => form_params,
522
+ :body => post_body,
523
+ :auth_names => auth_names,
524
+ :return_type => return_type
525
+ )
526
+
527
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
528
+ if @api_client.config.debugging
529
+ @api_client.config.logger.debug "API called: SecurityMonitoringAPI#list_security_filters\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
530
+ end
531
+ return data, status_code, headers
532
+ end
533
+
246
534
  # List rules
247
535
  # List rules.
248
536
  # @param [Hash] opts the optional parameters
@@ -476,6 +764,87 @@ module DatadogAPIClient::V2
476
764
  return data, status_code, headers
477
765
  end
478
766
 
767
+ # Update a security filter
768
+ # Update a specific security filter. Returns the security filter object when the request is successful.
769
+ # @param security_filter_id [String] The ID of the security filter.
770
+ # @param body [SecurityFilterUpdateRequest] New definition of the security filter.
771
+ # @param [Hash] opts the optional parameters
772
+ # @return [SecurityFilterResponse]
773
+ def update_security_filter(security_filter_id, body, opts = {})
774
+ data, _status_code, _headers = update_security_filter_with_http_info(security_filter_id, body, opts)
775
+ data
776
+ end
777
+
778
+ # Update a security filter
779
+ # Update a specific security filter. Returns the security filter object when the request is successful.
780
+ # @param security_filter_id [String] The ID of the security filter.
781
+ # @param body [SecurityFilterUpdateRequest] New definition of the security filter.
782
+ # @param [Hash] opts the optional parameters
783
+ # @return [Array<(SecurityFilterResponse, Integer, Hash)>] SecurityFilterResponse data, response status code and response headers
784
+ def update_security_filter_with_http_info(security_filter_id, body, opts = {})
785
+
786
+ if @api_client.config.unstable_operations.has_key?(:update_security_filter)
787
+ unstable_enabled = @api_client.config.unstable_operations[:update_security_filter]
788
+ if unstable_enabled
789
+ @api_client.config.logger.warn format("Using unstable operation '%s'", "update_security_filter")
790
+ else
791
+ raise APIError.new(message: format("Unstable operation '%s' is disabled", "update_security_filter"))
792
+ end
793
+ end
794
+
795
+ if @api_client.config.debugging
796
+ @api_client.config.logger.debug 'Calling API: SecurityMonitoringAPI.update_security_filter ...'
797
+ end
798
+ # verify the required parameter 'security_filter_id' is set
799
+ if @api_client.config.client_side_validation && security_filter_id.nil?
800
+ fail ArgumentError, "Missing the required parameter 'security_filter_id' when calling SecurityMonitoringAPI.update_security_filter"
801
+ end
802
+ # verify the required parameter 'body' is set
803
+ if @api_client.config.client_side_validation && body.nil?
804
+ fail ArgumentError, "Missing the required parameter 'body' when calling SecurityMonitoringAPI.update_security_filter"
805
+ end
806
+ # resource path
807
+ local_var_path = '/api/v2/security_monitoring/configuration/security_filters/{security_filter_id}'.sub('{' + 'security_filter_id' + '}', CGI.escape(security_filter_id.to_s))
808
+
809
+ # query parameters
810
+ query_params = opts[:query_params] || {}
811
+
812
+ # header parameters
813
+ header_params = opts[:header_params] || {}
814
+ # HTTP header 'Accept' (if needed)
815
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
816
+ # HTTP header 'Content-Type'
817
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
818
+
819
+ # form parameters
820
+ form_params = opts[:form_params] || {}
821
+
822
+ # http body (model)
823
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(body)
824
+
825
+ # return_type
826
+ return_type = opts[:debug_return_type] || 'SecurityFilterResponse'
827
+
828
+ # auth_names
829
+ auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth]
830
+
831
+ new_options = opts.merge(
832
+ :operation => :update_security_filter,
833
+ :header_params => header_params,
834
+ :query_params => query_params,
835
+ :form_params => form_params,
836
+ :body => post_body,
837
+ :auth_names => auth_names,
838
+ :return_type => return_type
839
+ )
840
+
841
+ data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
842
+ if @api_client.config.debugging
843
+ @api_client.config.logger.debug "API called: SecurityMonitoringAPI#update_security_filter\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
844
+ end
845
+ return data, status_code, headers
846
+ end
847
+
479
848
  # Update an existing rule
480
849
  # 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.
481
850
  # @param rule_id [String] The ID of the rule.