datadog_api_client 1.9.0 → 1.10.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.
- checksums.yaml +4 -4
- data/.apigentools-info +4 -4
- data/.generator/schemas/v1/openapi.yaml +489 -124
- data/.generator/schemas/v2/openapi.yaml +701 -28
- data/.generator/src/generator/formatter.py +6 -1
- data/.generator/src/generator/openapi.py +5 -5
- data/.generator/src/generator/templates/api_client.j2 +1 -4
- data/.generator/src/generator/templates/model_generic.j2 +42 -3
- data/.github/workflows/prepare_release.yml +15 -3
- data/CHANGELOG.md +32 -0
- data/Makefile +1 -1
- data/README.md +16 -0
- data/check-examples.sh +0 -2
- data/examples/v1/aws-integration/UpdateAWSAccount.rb +8 -4
- data/examples/v1/downtimes/CreateDowntime_2908359488.rb +1 -0
- data/examples/v1/downtimes/CreateDowntime_3059354445.rb +1 -0
- data/examples/v1/downtimes/UpdateDowntime.rb +1 -0
- data/examples/v1/monitors/CreateMonitor_1969035628.rb +52 -0
- data/examples/v1/monitors/CreateMonitor_2520912138.rb +22 -0
- data/examples/v1/security-monitoring/AddSecurityMonitoringSignalToIncident.rb +9 -0
- data/examples/v1/security-monitoring/EditSecurityMonitoringSignalAssignee.rb +9 -0
- data/examples/v1/security-monitoring/EditSecurityMonitoringSignalState.rb +10 -0
- data/examples/v1/service-level-objective-corrections/CreateSLOCorrection.rb +0 -3
- data/examples/v1/service-level-objective-corrections/CreateSLOCorrection_1326388368.rb +0 -3
- data/examples/v1/service-level-objective-corrections/DeleteSLOCorrection.rb +0 -3
- data/examples/v1/service-level-objective-corrections/GetSLOCorrection.rb +0 -3
- data/examples/v1/service-level-objective-corrections/ListSLOCorrection.rb +0 -3
- data/examples/v1/service-level-objective-corrections/UpdateSLOCorrection.rb +0 -3
- data/examples/v1/service-level-objectives/GetSLOCorrections.rb +0 -3
- data/examples/v1/synthetics/CreateSyntheticsAPITest.rb +5 -0
- data/examples/v1/synthetics/CreateSyntheticsAPITest_1402674167.rb +44 -0
- data/examples/v1/synthetics/CreateSyntheticsBrowserTest_2932742688.rb +64 -0
- data/examples/v1/synthetics/UpdateBrowserTest.rb +5 -0
- data/examples/v1/usage-metering/GetHourlyUsageAttribution.rb +1 -1
- data/examples/v1/usage-metering/GetMonthlyUsageAttribution.rb +1 -1
- data/examples/v1/usage-metering/{GetMonthlyUsageAttribution_3738504447.rb → GetMonthlyUsageAttribution_3849653599.rb} +1 -1
- data/examples/v1/usage-metering/GetUsageAttribution.rb +1 -1
- data/examples/v1/usage-metering/GetUsageRumSessions_3271366243.rb +9 -0
- data/examples/v2/logs/SubmitLog.rb +1 -0
- data/examples/v2/logs-archives/CreateLogsArchive.rb +1 -0
- data/examples/v2/logs-archives/UpdateLogsArchive.rb +1 -0
- data/examples/v2/metrics/EstimateMetricsOutputSeries.rb +9 -0
- data/examples/v2/metrics/SubmitMetrics.rb +20 -0
- data/examples/v2/security-monitoring/UpdateSecurityMonitoringRule.rb +1 -0
- data/examples/v2/usage-metering/GetCostByOrg.rb +5 -0
- data/examples/v2/usage-metering/GetUsageApplicationSecurityMonitoring.rb +8 -0
- data/examples/v2/usage-metering/GetUsageLambdaTracedInvocations.rb +8 -0
- data/lib/datadog_api_client/v1/api/metrics_api.rb +1 -1
- data/lib/datadog_api_client/v1/api/monitors_api.rb +69 -56
- data/lib/datadog_api_client/v1/api/security_monitoring_api.rb +266 -0
- data/lib/datadog_api_client/v1/api/service_level_objective_corrections_api.rb +1 -1
- data/lib/datadog_api_client/v1/api/usage_metering_api.rb +10 -10
- data/lib/datadog_api_client/v1/api_client.rb +1 -4
- data/lib/datadog_api_client/v1/configuration.rb +0 -6
- data/lib/datadog_api_client/v1/models/add_signal_to_incident_request.rb +142 -0
- data/lib/datadog_api_client/v1/models/downtime.rb +11 -1
- data/lib/datadog_api_client/v1/models/downtime_child.rb +11 -1
- data/lib/datadog_api_client/v1/models/event.rb +1 -1
- data/lib/datadog_api_client/v1/models/http_log_item.rb +29 -4
- data/lib/datadog_api_client/v1/models/logs_category_processor.rb +1 -1
- data/lib/datadog_api_client/v1/models/logs_list_request.rb +1 -1
- data/lib/datadog_api_client/v1/models/logs_sort.rb +1 -1
- data/lib/datadog_api_client/v1/models/monitor_formula_and_function_events_data_source.rb +1 -0
- data/lib/datadog_api_client/v1/models/monitor_group_search_response_counts.rb +2 -2
- data/lib/datadog_api_client/v1/models/{monitor_search_response_counts_tag_item.rb → monitor_search_count_item.rb} +3 -3
- data/lib/datadog_api_client/v1/models/monitor_search_response_counts.rb +4 -4
- data/lib/datadog_api_client/v1/models/monitor_type.rb +1 -0
- data/lib/datadog_api_client/v1/models/monthly_usage_attribution_response.rb +1 -1
- data/lib/datadog_api_client/v1/models/notebook_cell_create_request.rb +146 -0
- data/lib/datadog_api_client/v1/models/notebook_cell_create_request_attributes.rb +68 -0
- data/lib/datadog_api_client/v1/models/series.rb +2 -2
- data/lib/datadog_api_client/v1/models/signal_archive_reason.rb +29 -0
- data/lib/datadog_api_client/v1/models/signal_assignee_update_request.rb +132 -0
- data/lib/datadog_api_client/v1/models/signal_state_update_request.rb +152 -0
- data/lib/datadog_api_client/v1/models/signal_triage_state.rb +28 -0
- data/lib/datadog_api_client/v1/models/slo_correction_create_request_attributes.rb +1 -1
- data/lib/datadog_api_client/v1/models/slo_correction_response_attributes.rb +4 -4
- data/lib/datadog_api_client/v1/models/slo_correction_update_request_attributes.rb +1 -1
- data/lib/datadog_api_client/v1/models/{monitor_search_response_counts_status_item.rb → successful_signal_update_response.rb} +12 -22
- data/lib/datadog_api_client/v1/models/synthetics_api_test.rb +1 -1
- data/lib/datadog_api_client/v1/models/synthetics_assertion_type.rb +2 -0
- data/lib/datadog_api_client/v1/models/synthetics_browser_test_rum_settings.rb +152 -0
- data/lib/datadog_api_client/v1/models/synthetics_test_details.rb +1 -1
- data/lib/datadog_api_client/v1/models/synthetics_test_details_sub_type.rb +2 -1
- data/lib/datadog_api_client/v1/models/synthetics_test_options.rb +21 -1
- data/lib/datadog_api_client/v1/models/synthetics_test_request.rb +21 -1
- data/lib/datadog_api_client/v1/models/usage_attribution_response.rb +1 -1
- data/lib/datadog_api_client/v1/models/usage_rum_sessions_hour.rb +18 -4
- data/lib/datadog_api_client/v1/models/usage_summary_date.rb +11 -1
- data/lib/datadog_api_client/v1/models/usage_summary_date_org.rb +11 -1
- data/lib/datadog_api_client/v1/models/usage_summary_response.rb +11 -1
- data/lib/datadog_api_client/v1.rb +11 -6
- data/lib/datadog_api_client/v2/api/authn_mappings_api.rb +0 -2
- data/lib/datadog_api_client/v2/api/metrics_api.rb +173 -0
- data/lib/datadog_api_client/v2/api/usage_metering_api.rb +228 -0
- data/lib/datadog_api_client/v2/api_client.rb +1 -4
- data/lib/datadog_api_client/v2/models/authn_mapping.rb +1 -13
- data/lib/datadog_api_client/v2/models/authn_mapping_attributes.rb +1 -12
- data/lib/datadog_api_client/v2/models/authn_mapping_response.rb +16 -4
- data/lib/datadog_api_client/v2/models/authn_mappings_response.rb +13 -1
- data/lib/datadog_api_client/v2/models/chargeback_breakdown.rb +131 -0
- data/lib/datadog_api_client/v2/models/cost_by_org.rb +133 -0
- data/lib/datadog_api_client/v2/models/cost_by_org_attributes.rb +153 -0
- data/lib/datadog_api_client/v2/models/cost_by_org_response.rb +113 -0
- data/lib/datadog_api_client/v2/models/cost_by_org_type.rb +26 -0
- data/lib/datadog_api_client/v2/models/hourly_usage_type.rb +2 -0
- data/lib/datadog_api_client/v2/models/http_log_item.rb +40 -4
- data/lib/datadog_api_client/v2/models/intake_payload_accepted.rb +111 -0
- data/lib/datadog_api_client/v2/models/logs_archive_attributes.rb +12 -1
- data/lib/datadog_api_client/v2/models/logs_archive_create_request_attributes.rb +12 -1
- data/lib/datadog_api_client/v2/models/metric_content_encoding.rb +26 -0
- data/lib/datadog_api_client/v2/models/metric_estimate.rb +133 -0
- data/lib/datadog_api_client/v2/models/metric_estimate_attributes.rb +133 -0
- data/lib/datadog_api_client/v2/models/metric_estimate_resource_type.rb +26 -0
- data/lib/datadog_api_client/v2/models/metric_estimate_response.rb +111 -0
- data/lib/datadog_api_client/v2/models/metric_estimate_type.rb +28 -0
- data/lib/datadog_api_client/v2/models/metric_intake_type.rb +30 -0
- data/lib/datadog_api_client/v2/models/metric_metadata.rb +111 -0
- data/lib/datadog_api_client/v2/models/metric_origin.rb +170 -0
- data/lib/datadog_api_client/{v1/models/monitor_group_search_response_counts_type_item.rb → v2/models/metric_payload.rb} +27 -24
- data/lib/datadog_api_client/v2/models/metric_point.rb +122 -0
- data/lib/datadog_api_client/{v1/models/monitor_search_response_counts_type_item.rb → v2/models/metric_resource.rb} +21 -21
- data/lib/datadog_api_client/v2/models/metric_series.rb +220 -0
- data/lib/datadog_api_client/v2/models/relationship_to_saml_assertion_attribute_data.rb +1 -5
- data/lib/datadog_api_client/v2/models/saml_assertion_attribute.rb +1 -5
- data/lib/datadog_api_client/v2/models/security_monitoring_rule_detection_method.rb +1 -0
- data/lib/datadog_api_client/v2/models/security_monitoring_rule_hardcoded_evaluator_type.rb +26 -0
- data/lib/datadog_api_client/v2/models/security_monitoring_rule_options.rb +11 -1
- data/lib/datadog_api_client/{v1/models/monitor_group_search_response_counts_status_item.rb → v2/models/usage_application_security_monitoring_response.rb} +16 -24
- data/lib/datadog_api_client/{v1/models/monitor_search_response_counts_muted_item.rb → v2/models/usage_lambda_traced_invocations_response.rb} +16 -24
- data/lib/datadog_api_client/v2.rb +22 -0
- data/lib/datadog_api_client/version.rb +1 -1
- data/spec/v1/api_client_spec.rb +3 -3
- data/spec/v2/api_client_spec.rb +3 -3
- metadata +49 -11
- data/extract-code-blocks.awk +0 -81
- data/extract-code-blocks.sh +0 -3
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
# Get mobile hourly usage for RUM Sessions returns "OK" response
|
|
2
|
+
|
|
3
|
+
require "datadog_api_client"
|
|
4
|
+
api_instance = DatadogAPIClient::V1::UsageMeteringAPI.new
|
|
5
|
+
opts = {
|
|
6
|
+
end_hr: (Time.now + -3 * 86400),
|
|
7
|
+
type: "mobile",
|
|
8
|
+
}
|
|
9
|
+
p api_instance.get_usage_rum_sessions((Time.now + -5 * 86400), opts)
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
# Tag Configuration Cardinality Estimator returns "Success" response
|
|
2
|
+
|
|
3
|
+
require "datadog_api_client"
|
|
4
|
+
api_instance = DatadogAPIClient::V2::MetricsAPI.new
|
|
5
|
+
opts = {
|
|
6
|
+
filter_groups: "app,host",
|
|
7
|
+
filter_num_aggregations: 4,
|
|
8
|
+
}
|
|
9
|
+
p api_instance.estimate_metrics_output_series("system.cpu.idle", opts)
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# Submit metrics returns "Payload accepted" response
|
|
2
|
+
|
|
3
|
+
require "datadog_api_client"
|
|
4
|
+
api_instance = DatadogAPIClient::V2::MetricsAPI.new
|
|
5
|
+
|
|
6
|
+
body = DatadogAPIClient::V2::MetricPayload.new({
|
|
7
|
+
series: [
|
|
8
|
+
DatadogAPIClient::V2::MetricSeries.new({
|
|
9
|
+
metric: "system.load.1",
|
|
10
|
+
type: DatadogAPIClient::V2::MetricIntakeType::UNSPECIFIED,
|
|
11
|
+
points: [
|
|
12
|
+
DatadogAPIClient::V2::MetricPoint.new({
|
|
13
|
+
timestamp: Time.now.to_i,
|
|
14
|
+
value: 0.7,
|
|
15
|
+
}),
|
|
16
|
+
],
|
|
17
|
+
}),
|
|
18
|
+
],
|
|
19
|
+
})
|
|
20
|
+
p api_instance.submit_metrics(body)
|
|
@@ -19,6 +19,7 @@ body = DatadogAPIClient::V2::SecurityMonitoringRuleUpdatePayload.new({
|
|
|
19
19
|
options: DatadogAPIClient::V2::SecurityMonitoringRuleOptions.new({
|
|
20
20
|
detection_method: DatadogAPIClient::V2::SecurityMonitoringRuleDetectionMethod::THRESHOLD,
|
|
21
21
|
evaluation_window: DatadogAPIClient::V2::SecurityMonitoringRuleEvaluationWindow::ZERO_MINUTES,
|
|
22
|
+
hardcoded_evaluator_type: DatadogAPIClient::V2::SecurityMonitoringRuleHardcodedEvaluatorType::LOG4SHELL,
|
|
22
23
|
impossible_travel_options: DatadogAPIClient::V2::SecurityMonitoringRuleImpossibleTravelOptions.new({
|
|
23
24
|
baseline_user_locations: true,
|
|
24
25
|
}),
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
# Get hourly usage for Application Security returns "OK" response
|
|
2
|
+
|
|
3
|
+
require "datadog_api_client"
|
|
4
|
+
api_instance = DatadogAPIClient::V2::UsageMeteringAPI.new
|
|
5
|
+
opts = {
|
|
6
|
+
end_hr: (Time.now + -3 * 86400),
|
|
7
|
+
}
|
|
8
|
+
p api_instance.get_usage_application_security_monitoring((Time.now + -5 * 86400), opts)
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
# Get hourly usage for Lambda Traced Invocations returns "OK" response
|
|
2
|
+
|
|
3
|
+
require "datadog_api_client"
|
|
4
|
+
api_instance = DatadogAPIClient::V2::UsageMeteringAPI.new
|
|
5
|
+
opts = {
|
|
6
|
+
end_hr: (Time.now + -3 * 86400),
|
|
7
|
+
}
|
|
8
|
+
p api_instance.get_usage_lambda_traced_invocations((Time.now + -5 * 86400), opts)
|
|
@@ -350,7 +350,7 @@ module DatadogAPIClient::V1
|
|
|
350
350
|
# If you’re submitting metrics directly to the Datadog API without using DogStatsD, expect:
|
|
351
351
|
#
|
|
352
352
|
# - 64 bits for the timestamp
|
|
353
|
-
# -
|
|
353
|
+
# - 64 bits for the value
|
|
354
354
|
# - 40 bytes for the metric names
|
|
355
355
|
# - 50 bytes for the timeseries
|
|
356
356
|
# - The full payload is approximately 100 bytes. However, with the DogStatsD API,
|
|
@@ -163,27 +163,27 @@ module DatadogAPIClient::V1
|
|
|
163
163
|
#
|
|
164
164
|
# Example: `"check".over(tags).last(count).by(group).count_by_status()`
|
|
165
165
|
#
|
|
166
|
-
# -
|
|
167
|
-
# -
|
|
168
|
-
# -
|
|
166
|
+
# - `check` name of the check, for example `datadog.agent.up`
|
|
167
|
+
# - `tags` one or more quoted tags (comma-separated), or "*". for example: `.over("env:prod", "role:db")`; `over` cannot be blank.
|
|
168
|
+
# - `count` must be at greater than or equal to your max threshold (defined in the `options`). It is limited to 100.
|
|
169
169
|
# For example, if you've specified to notify on 1 critical, 3 ok, and 2 warn statuses, `count` should be at least 3.
|
|
170
|
-
# -
|
|
170
|
+
# - `group` must be specified for check monitors. Per-check grouping is already explicitly known for some service checks.
|
|
171
171
|
# For example, Postgres integration monitors are tagged by `db`, `host`, and `port`, and Network monitors by `host`, `instance`, and `url`. See [Service Checks](https://docs.datadoghq.com/api/latest/service-checks/) documentation for more information.
|
|
172
172
|
#
|
|
173
173
|
# **Event Alert Query**
|
|
174
174
|
#
|
|
175
175
|
# Example: `events('sources:nagios status:error,warning priority:normal tags: "string query"').rollup("count").last("1h")"`
|
|
176
176
|
#
|
|
177
|
-
# -
|
|
178
|
-
# -
|
|
179
|
-
# -
|
|
180
|
-
# -
|
|
181
|
-
# -
|
|
182
|
-
# -
|
|
183
|
-
# -
|
|
184
|
-
# -
|
|
185
|
-
# -
|
|
186
|
-
# -
|
|
177
|
+
# - `event`, the event query string:
|
|
178
|
+
# - `string_query` free text query to match against event title and text.
|
|
179
|
+
# - `sources` event sources (comma-separated).
|
|
180
|
+
# - `status` event statuses (comma-separated). Valid options: error, warn, and info.
|
|
181
|
+
# - `priority` event priorities (comma-separated). Valid options: low, normal, all.
|
|
182
|
+
# - `host` event reporting host (comma-separated).
|
|
183
|
+
# - `tags` event tags (comma-separated).
|
|
184
|
+
# - `excluded_tags` excluded event tags (comma-separated).
|
|
185
|
+
# - `rollup` the stats roll-up method. `count` is the only supported method now.
|
|
186
|
+
# - `last` the timeframe to roll up the counts. Examples: 45m, 4h. Supported timeframes: m, h and d. This value should not exceed 48 hours.
|
|
187
187
|
#
|
|
188
188
|
# **NOTE** The Event Alert Query is being deprecated and replaced by the Event V2 Alert Query. For more information, see the [Event Migration guide](https://docs.datadoghq.com/events/guides/migrating_to_new_events_features/).
|
|
189
189
|
#
|
|
@@ -191,44 +191,44 @@ module DatadogAPIClient::V1
|
|
|
191
191
|
#
|
|
192
192
|
# Example: `events(query).rollup(rollup_method[, measure]).last(time_window) operator #`
|
|
193
193
|
#
|
|
194
|
-
# -
|
|
195
|
-
# -
|
|
196
|
-
# -
|
|
197
|
-
# -
|
|
198
|
-
# -
|
|
199
|
-
# -
|
|
194
|
+
# - `query` The search query - following the [Log search syntax](https://docs.datadoghq.com/logs/search_syntax/).
|
|
195
|
+
# - `rollup_method` The stats roll-up method - supports `count`, `avg` and `cardinality`.
|
|
196
|
+
# - `measure` For `avg` and cardinality `rollup_method` - specify the measure or the facet name you want to use.
|
|
197
|
+
# - `time_window` #m (between 1 and 2880), #h (between 1 and 48).
|
|
198
|
+
# - `operator` `<`, `<=`, `>`, `>=`, `==`, or `!=`.
|
|
199
|
+
# - `#` an integer or decimal number used to set the threshold.
|
|
200
200
|
#
|
|
201
201
|
# **Process Alert Query**
|
|
202
202
|
#
|
|
203
203
|
# Example: `processes(search).over(tags).rollup('count').last(timeframe) operator #`
|
|
204
204
|
#
|
|
205
|
-
# -
|
|
205
|
+
# - `search` free text search string for querying processes.
|
|
206
206
|
# Matching processes match results on the [Live Processes](https://docs.datadoghq.com/infrastructure/process/?tab=linuxwindows) page.
|
|
207
|
-
# -
|
|
208
|
-
# -
|
|
209
|
-
# -
|
|
210
|
-
# -
|
|
207
|
+
# - `tags` one or more tags (comma-separated)
|
|
208
|
+
# - `timeframe` the timeframe to roll up the counts. Examples: 10m, 4h. Supported timeframes: s, m, h and d
|
|
209
|
+
# - `operator` <, <=, >, >=, ==, or !=
|
|
210
|
+
# - `#` an integer or decimal number used to set the threshold
|
|
211
211
|
#
|
|
212
212
|
# **Logs Alert Query**
|
|
213
213
|
#
|
|
214
214
|
# Example: `logs(query).index(index_name).rollup(rollup_method[, measure]).last(time_window) operator #`
|
|
215
215
|
#
|
|
216
|
-
# -
|
|
217
|
-
# -
|
|
218
|
-
# -
|
|
219
|
-
# -
|
|
220
|
-
# -
|
|
221
|
-
# -
|
|
222
|
-
# -
|
|
216
|
+
# - `query` The search query - following the [Log search syntax](https://docs.datadoghq.com/logs/search_syntax/).
|
|
217
|
+
# - `index_name` For multi-index organizations, the log index in which the request is performed.
|
|
218
|
+
# - `rollup_method` The stats roll-up method - supports `count`, `avg` and `cardinality`.
|
|
219
|
+
# - `measure` For `avg` and cardinality `rollup_method` - specify the measure or the facet name you want to use.
|
|
220
|
+
# - `time_window` #m (between 1 and 2880), #h (between 1 and 48).
|
|
221
|
+
# - `operator` `<`, `<=`, `>`, `>=`, `==`, or `!=`.
|
|
222
|
+
# - `#` an integer or decimal number used to set the threshold.
|
|
223
223
|
#
|
|
224
224
|
# **Composite Query**
|
|
225
225
|
#
|
|
226
226
|
# Example: `12345 && 67890`, where `12345` and `67890` are the IDs of non-composite monitors
|
|
227
227
|
#
|
|
228
|
-
# *
|
|
229
|
-
# *
|
|
228
|
+
# * `name` [*required*, *default* = **dynamic, based on query**]: The name of the alert.
|
|
229
|
+
# * `message` [*required*, *default* = **dynamic, based on query**]: A message to include with notifications for this monitor.
|
|
230
230
|
# Email notifications can be sent to specific users by using the same '@username' notation as events.
|
|
231
|
-
# *
|
|
231
|
+
# * `tags` [*optional*, *default* = **empty list**]: A list of tags to associate with your monitor.
|
|
232
232
|
# When getting all monitor details via the API, use the `monitor_tags` argument to filter results by these tags.
|
|
233
233
|
# It is only available via the API and isn't visible or editable in the Datadog UI.
|
|
234
234
|
#
|
|
@@ -236,20 +236,20 @@ module DatadogAPIClient::V1
|
|
|
236
236
|
#
|
|
237
237
|
# Example: `error_budget("slo_id").over("time_window") operator #`
|
|
238
238
|
#
|
|
239
|
-
# -
|
|
240
|
-
# -
|
|
241
|
-
# -
|
|
239
|
+
# - `slo_id`: The alphanumeric SLO ID of the SLO you are configuring the alert for.
|
|
240
|
+
# - `time_window`: The time window of the SLO target you wish to alert on. Valid options: `7d`, `30d`, `90d`.
|
|
241
|
+
# - `operator`: `>=` or `>`
|
|
242
242
|
#
|
|
243
243
|
# **Audit Alert Query**
|
|
244
244
|
#
|
|
245
245
|
# Example: `audits(query).rollup(rollup_method[, measure]).last(time_window) operator #`
|
|
246
246
|
#
|
|
247
|
-
# -
|
|
248
|
-
# -
|
|
249
|
-
# -
|
|
250
|
-
# -
|
|
251
|
-
# -
|
|
252
|
-
# -
|
|
247
|
+
# - `query` The search query - following the [Log search syntax](https://docs.datadoghq.com/logs/search_syntax/).
|
|
248
|
+
# - `rollup_method` The stats roll-up method - supports `count`, `avg` and `cardinality`.
|
|
249
|
+
# - `measure` For `avg` and cardinality `rollup_method` - specify the measure or the facet name you want to use.
|
|
250
|
+
# - `time_window` #m (between 1 and 2880), #h (between 1 and 48).
|
|
251
|
+
# - `operator` `<`, `<=`, `>`, `>=`, `==`, or `!=`.
|
|
252
|
+
# - `#` an integer or decimal number used to set the threshold.
|
|
253
253
|
#
|
|
254
254
|
# **NOTE** Only available on US1-FED and in closed beta on US1, EU, US3, and US5.
|
|
255
255
|
#
|
|
@@ -257,26 +257,39 @@ module DatadogAPIClient::V1
|
|
|
257
257
|
#
|
|
258
258
|
# Example: `ci-pipelines(query).rollup(rollup_method[, measure]).last(time_window) operator #`
|
|
259
259
|
#
|
|
260
|
-
# -
|
|
261
|
-
# -
|
|
262
|
-
# -
|
|
263
|
-
# -
|
|
264
|
-
# -
|
|
265
|
-
# -
|
|
260
|
+
# - `query` The search query - following the [Log search syntax](https://docs.datadoghq.com/logs/search_syntax/).
|
|
261
|
+
# - `rollup_method` The stats roll-up method - supports `count`, `avg`, and `cardinality`.
|
|
262
|
+
# - `measure` For `avg` and cardinality `rollup_method` - specify the measure or the facet name you want to use.
|
|
263
|
+
# - `time_window` #m (between 1 and 2880), #h (between 1 and 48).
|
|
264
|
+
# - `operator` `<`, `<=`, `>`, `>=`, `==`, or `!=`.
|
|
265
|
+
# - `#` an integer or decimal number used to set the threshold.
|
|
266
266
|
#
|
|
267
267
|
# **NOTE** CI Pipeline monitors are in alpha on US1, EU, US3 and US5.
|
|
268
268
|
#
|
|
269
|
+
# **CI Tests Alert Query**
|
|
270
|
+
#
|
|
271
|
+
# Example: `ci-tests(query).rollup(rollup_method[, measure]).last(time_window) operator #`
|
|
272
|
+
#
|
|
273
|
+
# - `query` The search query - following the [Log search syntax](https://docs.datadoghq.com/logs/search_syntax/).
|
|
274
|
+
# - `rollup_method` The stats roll-up method - supports `count`, `avg`, and `cardinality`.
|
|
275
|
+
# - `measure` For `avg` and cardinality `rollup_method` - specify the measure or the facet name you want to use.
|
|
276
|
+
# - `time_window` #m (between 1 and 2880), #h (between 1 and 48).
|
|
277
|
+
# - `operator` `<`, `<=`, `>`, `>=`, `==`, or `!=`.
|
|
278
|
+
# - `#` an integer or decimal number used to set the threshold.
|
|
279
|
+
#
|
|
280
|
+
# **NOTE** CI Test monitors are available only in closed beta on US1, EU, US3 and US5.
|
|
281
|
+
#
|
|
269
282
|
# **Error Tracking Alert Query**
|
|
270
283
|
#
|
|
271
284
|
# Example(RUM): `error-tracking-rum(query).rollup(rollup_method[, measure]).last(time_window) operator #`
|
|
272
285
|
# Example(APM Traces): `error-tracking-traces(query).rollup(rollup_method[, measure]).last(time_window) operator #`
|
|
273
286
|
#
|
|
274
|
-
# -
|
|
275
|
-
# -
|
|
276
|
-
# -
|
|
277
|
-
# -
|
|
278
|
-
# -
|
|
279
|
-
# -
|
|
287
|
+
# - `query` The search query - following the [Log search syntax](https://docs.datadoghq.com/logs/search_syntax/).
|
|
288
|
+
# - `rollup_method` The stats roll-up method - supports `count`, `avg`, and `cardinality`.
|
|
289
|
+
# - `measure` For `avg` and cardinality `rollup_method` - specify the measure or the facet name you want to use.
|
|
290
|
+
# - `time_window` #m (between 1 and 2880), #h (between 1 and 48).
|
|
291
|
+
# - `operator` `<`, `<=`, `>`, `>=`, `==`, or `!=`.
|
|
292
|
+
# - `#` an integer or decimal number used to set the threshold.
|
|
280
293
|
#
|
|
281
294
|
# @param body [Monitor] Create a monitor request body.
|
|
282
295
|
# @param opts [Hash] the optional parameters
|
|
@@ -0,0 +1,266 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Datadog API V1 Collection
|
|
3
|
+
|
|
4
|
+
#Collection of all Datadog Public endpoints.
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 1.0
|
|
7
|
+
Contact: support@datadoghq.com
|
|
8
|
+
Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator
|
|
9
|
+
|
|
10
|
+
Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
|
|
11
|
+
This product includes software developed at Datadog (https://www.datadoghq.com/).
|
|
12
|
+
Copyright 2020-Present Datadog, Inc.
|
|
13
|
+
|
|
14
|
+
=end
|
|
15
|
+
|
|
16
|
+
require 'cgi'
|
|
17
|
+
|
|
18
|
+
module DatadogAPIClient::V1
|
|
19
|
+
class SecurityMonitoringAPI
|
|
20
|
+
attr_accessor :api_client
|
|
21
|
+
|
|
22
|
+
def initialize(api_client = APIClient.default)
|
|
23
|
+
@api_client = api_client
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
# Add a security signal to an incident.
|
|
27
|
+
#
|
|
28
|
+
# @see #add_security_monitoring_signal_to_incident_with_http_info
|
|
29
|
+
def add_security_monitoring_signal_to_incident(signal_id, body, opts = {})
|
|
30
|
+
data, _status_code, _headers = add_security_monitoring_signal_to_incident_with_http_info(signal_id, body, opts)
|
|
31
|
+
data
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
# Add a security signal to an incident.
|
|
35
|
+
#
|
|
36
|
+
# Add a security signal to an incident. This makes it possible to search for signals by incident within the signal explorer and to view the signals on the incident timeline.
|
|
37
|
+
#
|
|
38
|
+
# @param signal_id [String] The ID of the signal.
|
|
39
|
+
# @param body [AddSignalToIncidentRequest] Attributes describing the signal update.
|
|
40
|
+
# @param opts [Hash] the optional parameters
|
|
41
|
+
# @return [Array<(SuccessfulSignalUpdateResponse, Integer, Hash)>] SuccessfulSignalUpdateResponse data, response status code and response headers
|
|
42
|
+
def add_security_monitoring_signal_to_incident_with_http_info(signal_id, body, opts = {})
|
|
43
|
+
|
|
44
|
+
if @api_client.config.unstable_operations.has_key?(:add_security_monitoring_signal_to_incident)
|
|
45
|
+
unstable_enabled = @api_client.config.unstable_operations[:add_security_monitoring_signal_to_incident]
|
|
46
|
+
if unstable_enabled
|
|
47
|
+
@api_client.config.logger.warn format("Using unstable operation '%s'", "add_security_monitoring_signal_to_incident")
|
|
48
|
+
else
|
|
49
|
+
raise APIError.new(message: format("Unstable operation '%s' is disabled", "add_security_monitoring_signal_to_incident"))
|
|
50
|
+
end
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
if @api_client.config.debugging
|
|
54
|
+
@api_client.config.logger.debug 'Calling API: SecurityMonitoringAPI.add_security_monitoring_signal_to_incident ...'
|
|
55
|
+
end
|
|
56
|
+
# verify the required parameter 'signal_id' is set
|
|
57
|
+
if @api_client.config.client_side_validation && signal_id.nil?
|
|
58
|
+
fail ArgumentError, "Missing the required parameter 'signal_id' when calling SecurityMonitoringAPI.add_security_monitoring_signal_to_incident"
|
|
59
|
+
end
|
|
60
|
+
# verify the required parameter 'body' is set
|
|
61
|
+
if @api_client.config.client_side_validation && body.nil?
|
|
62
|
+
fail ArgumentError, "Missing the required parameter 'body' when calling SecurityMonitoringAPI.add_security_monitoring_signal_to_incident"
|
|
63
|
+
end
|
|
64
|
+
# resource path
|
|
65
|
+
local_var_path = '/api/v1/security_analytics/signals/{signal_id}/add_to_incident'.sub('{signal_id}', CGI.escape(signal_id.to_s).gsub('%2F', '/'))
|
|
66
|
+
|
|
67
|
+
# query parameters
|
|
68
|
+
query_params = opts[:query_params] || {}
|
|
69
|
+
|
|
70
|
+
# header parameters
|
|
71
|
+
header_params = opts[:header_params] || {}
|
|
72
|
+
# HTTP header 'Accept' (if needed)
|
|
73
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
74
|
+
# HTTP header 'Content-Type'
|
|
75
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
|
76
|
+
|
|
77
|
+
# form parameters
|
|
78
|
+
form_params = opts[:form_params] || {}
|
|
79
|
+
|
|
80
|
+
# http body (model)
|
|
81
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(body)
|
|
82
|
+
|
|
83
|
+
# return_type
|
|
84
|
+
return_type = opts[:debug_return_type] || 'SuccessfulSignalUpdateResponse'
|
|
85
|
+
|
|
86
|
+
# auth_names
|
|
87
|
+
auth_names = opts[:debug_auth_names] || [:AuthZ, :apiKeyAuth, :appKeyAuth]
|
|
88
|
+
|
|
89
|
+
new_options = opts.merge(
|
|
90
|
+
:operation => :add_security_monitoring_signal_to_incident,
|
|
91
|
+
:header_params => header_params,
|
|
92
|
+
:query_params => query_params,
|
|
93
|
+
:form_params => form_params,
|
|
94
|
+
:body => post_body,
|
|
95
|
+
:auth_names => auth_names,
|
|
96
|
+
:return_type => return_type
|
|
97
|
+
)
|
|
98
|
+
|
|
99
|
+
data, status_code, headers = @api_client.call_api(Net::HTTP::Patch, local_var_path, new_options)
|
|
100
|
+
if @api_client.config.debugging
|
|
101
|
+
@api_client.config.logger.debug "API called: SecurityMonitoringAPI#add_security_monitoring_signal_to_incident\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
102
|
+
end
|
|
103
|
+
return data, status_code, headers
|
|
104
|
+
end
|
|
105
|
+
|
|
106
|
+
# Modify the triage assignee of a security signal.
|
|
107
|
+
#
|
|
108
|
+
# @see #edit_security_monitoring_signal_assignee_with_http_info
|
|
109
|
+
def edit_security_monitoring_signal_assignee(signal_id, body, opts = {})
|
|
110
|
+
data, _status_code, _headers = edit_security_monitoring_signal_assignee_with_http_info(signal_id, body, opts)
|
|
111
|
+
data
|
|
112
|
+
end
|
|
113
|
+
|
|
114
|
+
# Modify the triage assignee of a security signal.
|
|
115
|
+
#
|
|
116
|
+
# Modify the triage assignee of a security signal.
|
|
117
|
+
#
|
|
118
|
+
# @param signal_id [String] The ID of the signal.
|
|
119
|
+
# @param body [SignalAssigneeUpdateRequest] Attributes describing the signal update.
|
|
120
|
+
# @param opts [Hash] the optional parameters
|
|
121
|
+
# @return [Array<(SuccessfulSignalUpdateResponse, Integer, Hash)>] SuccessfulSignalUpdateResponse data, response status code and response headers
|
|
122
|
+
def edit_security_monitoring_signal_assignee_with_http_info(signal_id, body, opts = {})
|
|
123
|
+
|
|
124
|
+
if @api_client.config.unstable_operations.has_key?(:edit_security_monitoring_signal_assignee)
|
|
125
|
+
unstable_enabled = @api_client.config.unstable_operations[:edit_security_monitoring_signal_assignee]
|
|
126
|
+
if unstable_enabled
|
|
127
|
+
@api_client.config.logger.warn format("Using unstable operation '%s'", "edit_security_monitoring_signal_assignee")
|
|
128
|
+
else
|
|
129
|
+
raise APIError.new(message: format("Unstable operation '%s' is disabled", "edit_security_monitoring_signal_assignee"))
|
|
130
|
+
end
|
|
131
|
+
end
|
|
132
|
+
|
|
133
|
+
if @api_client.config.debugging
|
|
134
|
+
@api_client.config.logger.debug 'Calling API: SecurityMonitoringAPI.edit_security_monitoring_signal_assignee ...'
|
|
135
|
+
end
|
|
136
|
+
# verify the required parameter 'signal_id' is set
|
|
137
|
+
if @api_client.config.client_side_validation && signal_id.nil?
|
|
138
|
+
fail ArgumentError, "Missing the required parameter 'signal_id' when calling SecurityMonitoringAPI.edit_security_monitoring_signal_assignee"
|
|
139
|
+
end
|
|
140
|
+
# verify the required parameter 'body' is set
|
|
141
|
+
if @api_client.config.client_side_validation && body.nil?
|
|
142
|
+
fail ArgumentError, "Missing the required parameter 'body' when calling SecurityMonitoringAPI.edit_security_monitoring_signal_assignee"
|
|
143
|
+
end
|
|
144
|
+
# resource path
|
|
145
|
+
local_var_path = '/api/v1/security_analytics/signals/{signal_id}/assignee'.sub('{signal_id}', CGI.escape(signal_id.to_s).gsub('%2F', '/'))
|
|
146
|
+
|
|
147
|
+
# query parameters
|
|
148
|
+
query_params = opts[:query_params] || {}
|
|
149
|
+
|
|
150
|
+
# header parameters
|
|
151
|
+
header_params = opts[:header_params] || {}
|
|
152
|
+
# HTTP header 'Accept' (if needed)
|
|
153
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
154
|
+
# HTTP header 'Content-Type'
|
|
155
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
|
156
|
+
|
|
157
|
+
# form parameters
|
|
158
|
+
form_params = opts[:form_params] || {}
|
|
159
|
+
|
|
160
|
+
# http body (model)
|
|
161
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(body)
|
|
162
|
+
|
|
163
|
+
# return_type
|
|
164
|
+
return_type = opts[:debug_return_type] || 'SuccessfulSignalUpdateResponse'
|
|
165
|
+
|
|
166
|
+
# auth_names
|
|
167
|
+
auth_names = opts[:debug_auth_names] || [:AuthZ, :apiKeyAuth, :appKeyAuth]
|
|
168
|
+
|
|
169
|
+
new_options = opts.merge(
|
|
170
|
+
:operation => :edit_security_monitoring_signal_assignee,
|
|
171
|
+
:header_params => header_params,
|
|
172
|
+
:query_params => query_params,
|
|
173
|
+
:form_params => form_params,
|
|
174
|
+
:body => post_body,
|
|
175
|
+
:auth_names => auth_names,
|
|
176
|
+
:return_type => return_type
|
|
177
|
+
)
|
|
178
|
+
|
|
179
|
+
data, status_code, headers = @api_client.call_api(Net::HTTP::Patch, local_var_path, new_options)
|
|
180
|
+
if @api_client.config.debugging
|
|
181
|
+
@api_client.config.logger.debug "API called: SecurityMonitoringAPI#edit_security_monitoring_signal_assignee\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
182
|
+
end
|
|
183
|
+
return data, status_code, headers
|
|
184
|
+
end
|
|
185
|
+
|
|
186
|
+
# Change the triage state of a security signal.
|
|
187
|
+
#
|
|
188
|
+
# @see #edit_security_monitoring_signal_state_with_http_info
|
|
189
|
+
def edit_security_monitoring_signal_state(signal_id, body, opts = {})
|
|
190
|
+
data, _status_code, _headers = edit_security_monitoring_signal_state_with_http_info(signal_id, body, opts)
|
|
191
|
+
data
|
|
192
|
+
end
|
|
193
|
+
|
|
194
|
+
# Change the triage state of a security signal.
|
|
195
|
+
#
|
|
196
|
+
# Change the triage state of a security signal.
|
|
197
|
+
#
|
|
198
|
+
# @param signal_id [String] The ID of the signal.
|
|
199
|
+
# @param body [SignalStateUpdateRequest] Attributes describing the signal update.
|
|
200
|
+
# @param opts [Hash] the optional parameters
|
|
201
|
+
# @return [Array<(SuccessfulSignalUpdateResponse, Integer, Hash)>] SuccessfulSignalUpdateResponse data, response status code and response headers
|
|
202
|
+
def edit_security_monitoring_signal_state_with_http_info(signal_id, body, opts = {})
|
|
203
|
+
|
|
204
|
+
if @api_client.config.unstable_operations.has_key?(:edit_security_monitoring_signal_state)
|
|
205
|
+
unstable_enabled = @api_client.config.unstable_operations[:edit_security_monitoring_signal_state]
|
|
206
|
+
if unstable_enabled
|
|
207
|
+
@api_client.config.logger.warn format("Using unstable operation '%s'", "edit_security_monitoring_signal_state")
|
|
208
|
+
else
|
|
209
|
+
raise APIError.new(message: format("Unstable operation '%s' is disabled", "edit_security_monitoring_signal_state"))
|
|
210
|
+
end
|
|
211
|
+
end
|
|
212
|
+
|
|
213
|
+
if @api_client.config.debugging
|
|
214
|
+
@api_client.config.logger.debug 'Calling API: SecurityMonitoringAPI.edit_security_monitoring_signal_state ...'
|
|
215
|
+
end
|
|
216
|
+
# verify the required parameter 'signal_id' is set
|
|
217
|
+
if @api_client.config.client_side_validation && signal_id.nil?
|
|
218
|
+
fail ArgumentError, "Missing the required parameter 'signal_id' when calling SecurityMonitoringAPI.edit_security_monitoring_signal_state"
|
|
219
|
+
end
|
|
220
|
+
# verify the required parameter 'body' is set
|
|
221
|
+
if @api_client.config.client_side_validation && body.nil?
|
|
222
|
+
fail ArgumentError, "Missing the required parameter 'body' when calling SecurityMonitoringAPI.edit_security_monitoring_signal_state"
|
|
223
|
+
end
|
|
224
|
+
# resource path
|
|
225
|
+
local_var_path = '/api/v1/security_analytics/signals/{signal_id}/state'.sub('{signal_id}', CGI.escape(signal_id.to_s).gsub('%2F', '/'))
|
|
226
|
+
|
|
227
|
+
# query parameters
|
|
228
|
+
query_params = opts[:query_params] || {}
|
|
229
|
+
|
|
230
|
+
# header parameters
|
|
231
|
+
header_params = opts[:header_params] || {}
|
|
232
|
+
# HTTP header 'Accept' (if needed)
|
|
233
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
234
|
+
# HTTP header 'Content-Type'
|
|
235
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
|
236
|
+
|
|
237
|
+
# form parameters
|
|
238
|
+
form_params = opts[:form_params] || {}
|
|
239
|
+
|
|
240
|
+
# http body (model)
|
|
241
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(body)
|
|
242
|
+
|
|
243
|
+
# return_type
|
|
244
|
+
return_type = opts[:debug_return_type] || 'SuccessfulSignalUpdateResponse'
|
|
245
|
+
|
|
246
|
+
# auth_names
|
|
247
|
+
auth_names = opts[:debug_auth_names] || [:AuthZ, :apiKeyAuth, :appKeyAuth]
|
|
248
|
+
|
|
249
|
+
new_options = opts.merge(
|
|
250
|
+
:operation => :edit_security_monitoring_signal_state,
|
|
251
|
+
:header_params => header_params,
|
|
252
|
+
:query_params => query_params,
|
|
253
|
+
:form_params => form_params,
|
|
254
|
+
:body => post_body,
|
|
255
|
+
:auth_names => auth_names,
|
|
256
|
+
:return_type => return_type
|
|
257
|
+
)
|
|
258
|
+
|
|
259
|
+
data, status_code, headers = @api_client.call_api(Net::HTTP::Patch, local_var_path, new_options)
|
|
260
|
+
if @api_client.config.debugging
|
|
261
|
+
@api_client.config.logger.debug "API called: SecurityMonitoringAPI#edit_security_monitoring_signal_state\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
262
|
+
end
|
|
263
|
+
return data, status_code, headers
|
|
264
|
+
end
|
|
265
|
+
end
|
|
266
|
+
end
|
|
@@ -322,7 +322,7 @@ module DatadogAPIClient::V1
|
|
|
322
322
|
|
|
323
323
|
# Update an SLO correction.
|
|
324
324
|
#
|
|
325
|
-
# Update the specified SLO correction object
|
|
325
|
+
# Update the specified SLO correction object.
|
|
326
326
|
#
|
|
327
327
|
# @param slo_correction_id [String] The ID of the SLO correction object.
|
|
328
328
|
# @param body [SLOCorrectionUpdateRequest] The edited SLO correction object.
|