datadog_api_client 2.34.0 → 2.36.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 +59 -6
- data/.generator/schemas/v2/openapi.yaml +1093 -69
- data/.generator/src/generator/formatter.py +2 -2
- data/.generator/src/generator/openapi.py +1 -1
- data/.github/workflows/release.yml +1 -1
- data/CHANGELOG.md +36 -0
- data/Gemfile +1 -0
- data/examples/v1/monitors/CreateMonitor_1539578087.rb +1 -0
- data/examples/v1/monitors/CreateMonitor_440013737.rb +1 -0
- data/examples/v1/synthetics/CreateSyntheticsAPITest_1279271422.rb +142 -0
- data/examples/v2/csm-threats/CreateCSMThreatsAgentRule_1295653933.rb +35 -0
- data/examples/v2/dora-metrics/CreateDORADeployment.rb +0 -3
- data/examples/v2/dora-metrics/CreateDORAFailure.rb +30 -0
- data/examples/v2/dora-metrics/CreateDORAIncident.rb +11 -9
- data/examples/v2/dora-metrics/CreateDORAIncident_1768887482.rb +25 -0
- data/examples/v2/logs-custom-destinations/CreateLogsCustomDestination_1735989579.rb +30 -0
- data/examples/v2/microsoft-teams-integration/CreateWorkflowsWebhookHandle_1716851881.rb +1 -1
- data/examples/v2/on-call/GetTeamOnCallUsers.rb +11 -0
- data/examples/v2/security-monitoring/ListFindings_2932019633.rb +11 -0
- data/examples/v2/software-catalog/DeleteCatalogKind.rb +5 -0
- data/examples/v2/software-catalog/ListCatalogKind.rb +5 -0
- data/examples/v2/software-catalog/ListCatalogKind_3806205775.rb +5 -0
- data/examples/v2/software-catalog/UpsertCatalogKind.rb +9 -0
- data/examples/v2/teams/AddMemberTeam.rb +15 -0
- data/examples/v2/teams/ListMemberTeams.rb +8 -0
- data/examples/v2/teams/ListMemberTeams_1662850354.rb +8 -0
- data/examples/v2/teams/RemoveMemberTeam.rb +8 -0
- data/lib/datadog_api_client/configuration.rb +3 -2
- data/lib/datadog_api_client/inflector.rb +42 -6
- data/lib/datadog_api_client/v1/api/snapshots_api.rb +2 -1
- data/lib/datadog_api_client/v1/models/monitor.rb +17 -1
- data/lib/datadog_api_client/v1/models/monitor_draft_status.rb +32 -0
- data/lib/datadog_api_client/v1/models/monitor_options.rb +1 -1
- data/lib/datadog_api_client/v1/models/monitor_update_request.rb +17 -1
- data/lib/datadog_api_client/v1/models/synthetics_api_test_step_subtype.rb +6 -0
- data/lib/datadog_api_client/v1/models/synthetics_basic_auth_web.rb +2 -31
- data/lib/datadog_api_client/v1/models/synthetics_test_request.rb +32 -2
- data/lib/datadog_api_client/v2/api/dora_metrics_api.rb +79 -15
- data/lib/datadog_api_client/v2/api/on_call_api.rb +67 -0
- data/lib/datadog_api_client/v2/api/restriction_policies_api.rb +5 -3
- data/lib/datadog_api_client/v2/api/security_monitoring_api.rb +13 -0
- data/lib/datadog_api_client/v2/api/software_catalog_api.rb +221 -0
- data/lib/datadog_api_client/v2/api/teams_api.rb +254 -0
- data/lib/datadog_api_client/v2/models/action_query_spec_inputs.rb +1 -1
- data/lib/datadog_api_client/v2/models/{dora_incident_response.rb → add_member_team_request.rb} +5 -5
- data/lib/datadog_api_client/v2/models/change_event_custom_attributes_author_type.rb +2 -0
- data/lib/datadog_api_client/v2/models/cloud_configuration_rule_payload.rb +21 -1
- data/lib/datadog_api_client/v2/models/cloud_workload_security_agent_rule_action.rb +33 -3
- data/lib/datadog_api_client/v2/models/cloud_workload_security_agent_rule_action_metadata.rb +125 -0
- data/lib/datadog_api_client/v2/models/cloud_workload_security_agent_rule_action_set.rb +165 -0
- data/lib/datadog_api_client/v2/models/cloud_workload_security_agent_rule_attributes.rb +37 -1
- data/lib/datadog_api_client/v2/models/cloud_workload_security_agent_rule_create_attributes.rb +57 -1
- data/lib/datadog_api_client/v2/models/cloud_workload_security_agent_rule_update_attributes.rb +57 -1
- data/lib/datadog_api_client/v2/models/custom_destination_forward_destination.rb +2 -1
- data/lib/datadog_api_client/v2/models/custom_destination_forward_destination_microsoft_sentinel.rb +228 -0
- data/lib/datadog_api_client/v2/models/custom_destination_forward_destination_microsoft_sentinel_type.rb +26 -0
- data/lib/datadog_api_client/v2/models/custom_destination_response_forward_destination.rb +2 -1
- data/lib/datadog_api_client/v2/models/custom_destination_response_forward_destination_microsoft_sentinel.rb +228 -0
- data/lib/datadog_api_client/v2/models/custom_destination_response_forward_destination_microsoft_sentinel_type.rb +26 -0
- data/lib/datadog_api_client/v2/models/dora_deployment_request_attributes.rb +21 -1
- data/lib/datadog_api_client/v2/models/{dora_incident_request.rb → dora_failure_request.rb} +4 -4
- data/lib/datadog_api_client/v2/models/{dora_incident_request_attributes.rb → dora_failure_request_attributes.rb} +31 -11
- data/lib/datadog_api_client/v2/models/{dora_incident_request_data.rb → dora_failure_request_data.rb} +4 -4
- data/lib/datadog_api_client/v2/models/dora_failure_response.rb +123 -0
- data/lib/datadog_api_client/v2/models/{dora_incident_response_data.rb → dora_failure_response_data.rb} +6 -6
- data/lib/datadog_api_client/v2/models/{dora_incident_type.rb → dora_failure_type.rb} +3 -3
- data/lib/datadog_api_client/v2/models/escalation.rb +143 -0
- data/lib/datadog_api_client/v2/models/escalation_relationships.rb +105 -0
- data/lib/datadog_api_client/v2/models/escalation_relationships_responders.rb +107 -0
- data/lib/datadog_api_client/v2/models/escalation_relationships_responders_data_items.rb +144 -0
- data/lib/datadog_api_client/v2/models/escalation_relationships_responders_data_items_type.rb +26 -0
- data/lib/datadog_api_client/v2/models/escalation_type.rb +26 -0
- data/lib/datadog_api_client/v2/models/finding_attributes.rb +31 -1
- data/lib/datadog_api_client/v2/models/kind_attributes.rb +143 -0
- data/lib/datadog_api_client/v2/models/kind_data.rb +153 -0
- data/lib/datadog_api_client/v2/models/kind_metadata.rb +115 -0
- data/lib/datadog_api_client/v2/models/kind_obj.rb +143 -0
- data/lib/datadog_api_client/v2/models/kind_response_meta.rb +105 -0
- data/lib/datadog_api_client/v2/models/list_kind_catalog_response.rb +117 -0
- data/lib/datadog_api_client/v2/models/member_team.rb +144 -0
- data/lib/datadog_api_client/v2/models/member_team_type.rb +26 -0
- data/lib/datadog_api_client/v2/models/security_monitoring_rule_case.rb +11 -1
- data/lib/datadog_api_client/v2/models/security_monitoring_rule_type_create.rb +1 -0
- data/lib/datadog_api_client/v2/models/security_monitoring_rule_type_read.rb +1 -0
- data/lib/datadog_api_client/v2/models/security_monitoring_rule_update_payload.rb +21 -1
- data/lib/datadog_api_client/v2/models/security_monitoring_signal_rule_payload.rb +21 -1
- data/lib/datadog_api_client/v2/models/security_monitoring_signal_rule_response.rb +21 -1
- data/lib/datadog_api_client/v2/models/security_monitoring_standard_rule_payload.rb +21 -1
- data/lib/datadog_api_client/v2/models/security_monitoring_standard_rule_query.rb +11 -1
- data/lib/datadog_api_client/v2/models/security_monitoring_standard_rule_response.rb +21 -1
- data/lib/datadog_api_client/v2/models/security_monitoring_third_party_rule_case.rb +11 -1
- data/lib/datadog_api_client/v2/models/sensitive_data_scanner_group_attributes.rb +15 -3
- data/lib/datadog_api_client/v2/models/sensitive_data_scanner_samplings.rb +137 -0
- data/lib/datadog_api_client/v2/models/team_on_call_responders.rb +117 -0
- data/lib/datadog_api_client/v2/models/team_on_call_responders_data.rb +143 -0
- data/lib/datadog_api_client/v2/models/team_on_call_responders_data_relationships.rb +115 -0
- data/lib/datadog_api_client/v2/models/team_on_call_responders_data_relationships_escalations.rb +107 -0
- data/lib/datadog_api_client/v2/models/team_on_call_responders_data_relationships_escalations_data_items.rb +144 -0
- data/lib/datadog_api_client/v2/models/team_on_call_responders_data_relationships_escalations_data_items_type.rb +26 -0
- data/lib/datadog_api_client/v2/models/team_on_call_responders_data_relationships_responders.rb +107 -0
- data/lib/datadog_api_client/v2/models/team_on_call_responders_data_relationships_responders_data_items.rb +144 -0
- data/lib/datadog_api_client/v2/models/team_on_call_responders_data_relationships_responders_data_items_type.rb +26 -0
- data/lib/datadog_api_client/v2/models/team_on_call_responders_data_type.rb +26 -0
- data/lib/datadog_api_client/v2/models/team_on_call_responders_included.rb +63 -0
- data/lib/datadog_api_client/v2/models/upsert_catalog_kind_request.rb +63 -0
- data/lib/datadog_api_client/v2/models/upsert_catalog_kind_response.rb +117 -0
- data/lib/datadog_api_client/version.rb +1 -1
- data/repository.datadog.yaml +8 -0
- metadata +57 -7
@@ -308,13 +308,13 @@ def format_data_with_schema_dict(
|
|
308
308
|
)
|
309
309
|
parameters += f"{escape_reserved_keyword(snake_case(k))}: {value},\n"
|
310
310
|
|
311
|
-
if schema.get("additionalProperties"):
|
311
|
+
if (additionalProperties := schema.get("additionalProperties", {})) and additionalProperties != False:
|
312
312
|
for k, v in data.items():
|
313
313
|
if has_properties and k in schema["properties"]:
|
314
314
|
continue
|
315
315
|
value = format_data_with_schema(
|
316
316
|
v,
|
317
|
-
|
317
|
+
additionalProperties,
|
318
318
|
name_prefix=name_prefix,
|
319
319
|
replace_values=replace_values,
|
320
320
|
)
|
@@ -33,7 +33,7 @@ def type_to_ruby(schema, alternative_name=None):
|
|
33
33
|
if "enum" in schema:
|
34
34
|
return name
|
35
35
|
if (
|
36
|
-
not (schema.get("additionalProperties") and not schema.get("properties"))
|
36
|
+
not (schema.get("additionalProperties") not in (None, False) and not schema.get("properties"))
|
37
37
|
and schema.get("type", "object") == "object"
|
38
38
|
):
|
39
39
|
return name
|
@@ -74,7 +74,7 @@ jobs:
|
|
74
74
|
# TODO: Implement this
|
75
75
|
# changelog_content=$(git diff $BASE_REF...$HEAD_REF -- $package/CHANGELOG.md | grep -A 1000 "^+##" | grep -v "^+++" | sed 's/^+//')
|
76
76
|
|
77
|
-
is_prerelease=$(echo $package | grep -
|
77
|
+
is_prerelease=$(echo "${versions[$package]}" | grep -qvE '^[0-9]+\.[0-9]+\.[0-9]+$' && echo true || echo false)
|
78
78
|
# Create the tag
|
79
79
|
gh api repos/{owner}/{repo}/git/refs \
|
80
80
|
-f ref="refs/tags/$tag_name" \
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,41 @@
|
|
1
1
|
# CHANGELOG
|
2
2
|
|
3
|
+
## 2.36.0/2025-06-23
|
4
|
+
|
5
|
+
### Fixed
|
6
|
+
* Fix basic auth requirements [#2481](https://github.com/DataDog/datadog-api-client-ruby/pull/2481)
|
7
|
+
* Add support for the api_security detection rule type [#2476](https://github.com/DataDog/datadog-api-client-ruby/pull/2476)
|
8
|
+
|
9
|
+
### Added
|
10
|
+
* Microsoft Sentinel Public API support [#2479](https://github.com/DataDog/datadog-api-client-ruby/pull/2479)
|
11
|
+
* Add hash field to actions in CWS agent rules [#2470](https://github.com/DataDog/datadog-api-client-ruby/pull/2470)
|
12
|
+
* Add custom fields to Rule update/validate API public documentation. [#2466](https://github.com/DataDog/datadog-api-client-ruby/pull/2466)
|
13
|
+
* SDCD-1142: adding `custom_tags` optional attribute to DORA API spec [#2451](https://github.com/DataDog/datadog-api-client-ruby/pull/2451)
|
14
|
+
* Add sampling fields to SDS spec [#2447](https://github.com/DataDog/datadog-api-client-ruby/pull/2447)
|
15
|
+
* Add API spec for team hierarchy APIs [#2420](https://github.com/DataDog/datadog-api-client-ruby/pull/2420)
|
16
|
+
|
17
|
+
### Changed
|
18
|
+
* Update events intake specs for v2 Events post endpoint [#2460](https://github.com/DataDog/datadog-api-client-ruby/pull/2460)
|
19
|
+
|
20
|
+
## 2.35.0/2025-06-16
|
21
|
+
|
22
|
+
### Fixed
|
23
|
+
* Fix generation for additionalProperties containers [#2469](https://github.com/DataDog/datadog-api-client-ruby/pull/2469)
|
24
|
+
|
25
|
+
### Changed
|
26
|
+
* Add billing read permission [#2456](https://github.com/DataDog/datadog-api-client-ruby/pull/2456)
|
27
|
+
* Update DORA endpoints [#2434](https://github.com/DataDog/datadog-api-client-ruby/pull/2434)
|
28
|
+
|
29
|
+
### Added
|
30
|
+
* Add `form` field for `multipart/form-data` HTTP API tests [#2452](https://github.com/DataDog/datadog-api-client-ruby/pull/2452)
|
31
|
+
* Add new endpoint to upsert/list/delete custom kinds [#2445](https://github.com/DataDog/datadog-api-client-ruby/pull/2445)
|
32
|
+
* Add spec for team on-call endpoint [#2443](https://github.com/DataDog/datadog-api-client-ruby/pull/2443)
|
33
|
+
* Add support for all subtypes in multistep steps [#2415](https://github.com/DataDog/datadog-api-client-ruby/pull/2415)
|
34
|
+
* Added new optional field definition to include more detail in findings for '/api/v2/posture_management/findings' [#2413](https://github.com/DataDog/datadog-api-client-ruby/pull/2413)
|
35
|
+
* Exposing set action on Terraform V2 [#2412](https://github.com/DataDog/datadog-api-client-ruby/pull/2412)
|
36
|
+
* Add monitor draft status field [#2410](https://github.com/DataDog/datadog-api-client-ruby/pull/2410)
|
37
|
+
* Add rum application to restriction policy [#2292](https://github.com/DataDog/datadog-api-client-ruby/pull/2292)
|
38
|
+
|
3
39
|
## 2.34.0/2025-05-28
|
4
40
|
|
5
41
|
### Fixed
|
data/Gemfile
CHANGED
@@ -83,6 +83,148 @@ body = DatadogAPIClient::V1::SyntheticsAPITest.new({
|
|
83
83
|
call_type: DatadogAPIClient::V1::SyntheticsTestCallType::UNARY,
|
84
84
|
}),
|
85
85
|
}),
|
86
|
+
DatadogAPIClient::V1::SyntheticsAPITestStep.new({
|
87
|
+
name: "SSL step",
|
88
|
+
subtype: DatadogAPIClient::V1::SyntheticsAPITestStepSubtype::SSL,
|
89
|
+
allow_failure: false,
|
90
|
+
is_critical: true,
|
91
|
+
_retry: DatadogAPIClient::V1::SyntheticsTestOptionsRetry.new({
|
92
|
+
count: 0,
|
93
|
+
interval: 300,
|
94
|
+
}),
|
95
|
+
assertions: [
|
96
|
+
DatadogAPIClient::V1::SyntheticsAssertionTarget.new({
|
97
|
+
operator: DatadogAPIClient::V1::SyntheticsAssertionOperator::IS_IN_MORE_DAYS_THAN,
|
98
|
+
type: DatadogAPIClient::V1::SyntheticsAssertionType::CERTIFICATE,
|
99
|
+
target: 10,
|
100
|
+
}),
|
101
|
+
],
|
102
|
+
request: DatadogAPIClient::V1::SyntheticsTestRequest.new({
|
103
|
+
check_certificate_revocation: true,
|
104
|
+
host: "example.org",
|
105
|
+
port: 443,
|
106
|
+
}),
|
107
|
+
}),
|
108
|
+
DatadogAPIClient::V1::SyntheticsAPITestStep.new({
|
109
|
+
name: "DNS step",
|
110
|
+
subtype: DatadogAPIClient::V1::SyntheticsAPITestStepSubtype::DNS,
|
111
|
+
allow_failure: false,
|
112
|
+
is_critical: true,
|
113
|
+
_retry: DatadogAPIClient::V1::SyntheticsTestOptionsRetry.new({
|
114
|
+
count: 0,
|
115
|
+
interval: 300,
|
116
|
+
}),
|
117
|
+
assertions: [
|
118
|
+
DatadogAPIClient::V1::SyntheticsAssertionTarget.new({
|
119
|
+
operator: DatadogAPIClient::V1::SyntheticsAssertionOperator::LESS_THAN,
|
120
|
+
type: DatadogAPIClient::V1::SyntheticsAssertionType::RESPONSE_TIME,
|
121
|
+
target: 1000,
|
122
|
+
}),
|
123
|
+
],
|
124
|
+
request: DatadogAPIClient::V1::SyntheticsTestRequest.new({
|
125
|
+
host: "troisdizaines.com",
|
126
|
+
dns_server: "8.8.8.8",
|
127
|
+
dns_server_port: "53",
|
128
|
+
}),
|
129
|
+
}),
|
130
|
+
DatadogAPIClient::V1::SyntheticsAPITestStep.new({
|
131
|
+
name: "TCP step",
|
132
|
+
subtype: DatadogAPIClient::V1::SyntheticsAPITestStepSubtype::TCP,
|
133
|
+
allow_failure: false,
|
134
|
+
is_critical: true,
|
135
|
+
_retry: DatadogAPIClient::V1::SyntheticsTestOptionsRetry.new({
|
136
|
+
count: 0,
|
137
|
+
interval: 300,
|
138
|
+
}),
|
139
|
+
assertions: [
|
140
|
+
DatadogAPIClient::V1::SyntheticsAssertionTarget.new({
|
141
|
+
operator: DatadogAPIClient::V1::SyntheticsAssertionOperator::LESS_THAN,
|
142
|
+
type: DatadogAPIClient::V1::SyntheticsAssertionType::RESPONSE_TIME,
|
143
|
+
target: 1000,
|
144
|
+
}),
|
145
|
+
],
|
146
|
+
request: DatadogAPIClient::V1::SyntheticsTestRequest.new({
|
147
|
+
host: "34.95.79.70",
|
148
|
+
port: 80,
|
149
|
+
should_track_hops: true,
|
150
|
+
timeout: 32,
|
151
|
+
}),
|
152
|
+
}),
|
153
|
+
DatadogAPIClient::V1::SyntheticsAPITestStep.new({
|
154
|
+
name: "ICMP step",
|
155
|
+
subtype: DatadogAPIClient::V1::SyntheticsAPITestStepSubtype::ICMP,
|
156
|
+
allow_failure: false,
|
157
|
+
is_critical: true,
|
158
|
+
_retry: DatadogAPIClient::V1::SyntheticsTestOptionsRetry.new({
|
159
|
+
count: 0,
|
160
|
+
interval: 300,
|
161
|
+
}),
|
162
|
+
assertions: [
|
163
|
+
DatadogAPIClient::V1::SyntheticsAssertionTarget.new({
|
164
|
+
operator: DatadogAPIClient::V1::SyntheticsAssertionOperator::IS,
|
165
|
+
target: 0,
|
166
|
+
type: DatadogAPIClient::V1::SyntheticsAssertionType::PACKET_LOSS_PERCENTAGE,
|
167
|
+
}),
|
168
|
+
],
|
169
|
+
request: DatadogAPIClient::V1::SyntheticsTestRequest.new({
|
170
|
+
host: "34.95.79.70",
|
171
|
+
number_of_packets: 4,
|
172
|
+
should_track_hops: true,
|
173
|
+
timeout: 38,
|
174
|
+
}),
|
175
|
+
}),
|
176
|
+
DatadogAPIClient::V1::SyntheticsAPITestStep.new({
|
177
|
+
name: "Websocket step",
|
178
|
+
subtype: DatadogAPIClient::V1::SyntheticsAPITestStepSubtype::WEBSOCKET,
|
179
|
+
allow_failure: false,
|
180
|
+
is_critical: true,
|
181
|
+
_retry: DatadogAPIClient::V1::SyntheticsTestOptionsRetry.new({
|
182
|
+
count: 0,
|
183
|
+
interval: 300,
|
184
|
+
}),
|
185
|
+
assertions: [
|
186
|
+
DatadogAPIClient::V1::SyntheticsAssertionTarget.new({
|
187
|
+
operator: DatadogAPIClient::V1::SyntheticsAssertionOperator::LESS_THAN,
|
188
|
+
type: DatadogAPIClient::V1::SyntheticsAssertionType::RESPONSE_TIME,
|
189
|
+
target: 1000,
|
190
|
+
}),
|
191
|
+
],
|
192
|
+
request: DatadogAPIClient::V1::SyntheticsTestRequest.new({
|
193
|
+
url: "ws://34.95.79.70/web-socket",
|
194
|
+
message: "My message",
|
195
|
+
is_message_base64_encoded: true,
|
196
|
+
headers: {
|
197
|
+
f: "g",
|
198
|
+
},
|
199
|
+
basic_auth: DatadogAPIClient::V1::SyntheticsBasicAuthWeb.new({
|
200
|
+
type: DatadogAPIClient::V1::SyntheticsBasicAuthWebType::WEB,
|
201
|
+
username: "user",
|
202
|
+
password: "password",
|
203
|
+
}),
|
204
|
+
}),
|
205
|
+
}),
|
206
|
+
DatadogAPIClient::V1::SyntheticsAPITestStep.new({
|
207
|
+
name: "UDP step",
|
208
|
+
subtype: DatadogAPIClient::V1::SyntheticsAPITestStepSubtype::UDP,
|
209
|
+
allow_failure: false,
|
210
|
+
is_critical: true,
|
211
|
+
_retry: DatadogAPIClient::V1::SyntheticsTestOptionsRetry.new({
|
212
|
+
count: 0,
|
213
|
+
interval: 300,
|
214
|
+
}),
|
215
|
+
assertions: [
|
216
|
+
DatadogAPIClient::V1::SyntheticsAssertionTarget.new({
|
217
|
+
operator: DatadogAPIClient::V1::SyntheticsAssertionOperator::LESS_THAN,
|
218
|
+
type: DatadogAPIClient::V1::SyntheticsAssertionType::RESPONSE_TIME,
|
219
|
+
target: 1000,
|
220
|
+
}),
|
221
|
+
],
|
222
|
+
request: DatadogAPIClient::V1::SyntheticsTestRequest.new({
|
223
|
+
host: "8.8.8.8",
|
224
|
+
port: 53,
|
225
|
+
message: "A image.google.com",
|
226
|
+
}),
|
227
|
+
}),
|
86
228
|
],
|
87
229
|
}),
|
88
230
|
locations: [
|
@@ -0,0 +1,35 @@
|
|
1
|
+
# Create a Workload Protection agent rule with set action returns "OK" response
|
2
|
+
|
3
|
+
require "datadog_api_client"
|
4
|
+
api_instance = DatadogAPIClient::V2::CSMThreatsAPI.new
|
5
|
+
|
6
|
+
# there is a valid "policy_rc" in the system
|
7
|
+
POLICY_DATA_ID = ENV["POLICY_DATA_ID"]
|
8
|
+
|
9
|
+
body = DatadogAPIClient::V2::CloudWorkloadSecurityAgentRuleCreateRequest.new({
|
10
|
+
data: DatadogAPIClient::V2::CloudWorkloadSecurityAgentRuleCreateData.new({
|
11
|
+
attributes: DatadogAPIClient::V2::CloudWorkloadSecurityAgentRuleCreateAttributes.new({
|
12
|
+
description: "My Agent rule with set action",
|
13
|
+
enabled: true,
|
14
|
+
expression: 'exec.file.name == "sh"',
|
15
|
+
filters: [],
|
16
|
+
name: "examplecsmthreat",
|
17
|
+
policy_id: POLICY_DATA_ID,
|
18
|
+
product_tags: [],
|
19
|
+
actions: [
|
20
|
+
DatadogAPIClient::V2::CloudWorkloadSecurityAgentRuleAction.new({
|
21
|
+
set: DatadogAPIClient::V2::CloudWorkloadSecurityAgentRuleActionSet.new({
|
22
|
+
name: "test_set",
|
23
|
+
value: "test_value",
|
24
|
+
scope: "process",
|
25
|
+
}),
|
26
|
+
}),
|
27
|
+
DatadogAPIClient::V2::CloudWorkloadSecurityAgentRuleAction.new({
|
28
|
+
_hash: DatadogAPIClient::V2::CloudWorkloadSecurityAgentRuleActionHash.new({}),
|
29
|
+
}),
|
30
|
+
],
|
31
|
+
}),
|
32
|
+
type: DatadogAPIClient::V2::CloudWorkloadSecurityAgentRuleType::AGENT_RULE,
|
33
|
+
}),
|
34
|
+
})
|
35
|
+
p api_instance.create_csm_threats_agent_rule(body)
|
@@ -1,9 +1,6 @@
|
|
1
1
|
# Send a deployment event for DORA Metrics returns "OK" response
|
2
2
|
|
3
3
|
require "datadog_api_client"
|
4
|
-
DatadogAPIClient.configure do |config|
|
5
|
-
config.unstable_operations["v2.create_dora_deployment".to_sym] = true
|
6
|
-
end
|
7
4
|
api_instance = DatadogAPIClient::V2::DORAMetricsAPI.new
|
8
5
|
|
9
6
|
body = DatadogAPIClient::V2::DORADeploymentRequest.new({
|
@@ -0,0 +1,30 @@
|
|
1
|
+
# Send a failure event for DORA Metrics returns "OK - but delayed due to incident" response
|
2
|
+
|
3
|
+
require "datadog_api_client"
|
4
|
+
api_instance = DatadogAPIClient::V2::DORAMetricsAPI.new
|
5
|
+
|
6
|
+
body = DatadogAPIClient::V2::DORAFailureRequest.new({
|
7
|
+
data: DatadogAPIClient::V2::DORAFailureRequestData.new({
|
8
|
+
attributes: DatadogAPIClient::V2::DORAFailureRequestAttributes.new({
|
9
|
+
custom_tags: [
|
10
|
+
"language:java",
|
11
|
+
"department:engineering",
|
12
|
+
],
|
13
|
+
env: "staging",
|
14
|
+
finished_at: 1693491984000000000,
|
15
|
+
git: DatadogAPIClient::V2::DORAGitInfo.new({
|
16
|
+
commit_sha: "66adc9350f2cc9b250b69abddab733dd55e1a588",
|
17
|
+
repository_url: "https://github.com/organization/example-repository",
|
18
|
+
}),
|
19
|
+
name: "Webserver is down failing all requests.",
|
20
|
+
services: [
|
21
|
+
"shopist",
|
22
|
+
],
|
23
|
+
severity: "High",
|
24
|
+
started_at: 1693491974000000000,
|
25
|
+
team: "backend",
|
26
|
+
version: "v1.12.07",
|
27
|
+
}),
|
28
|
+
}),
|
29
|
+
})
|
30
|
+
p api_instance.create_dora_failure(body)
|
@@ -1,25 +1,27 @@
|
|
1
1
|
# Send an incident event for DORA Metrics returns "OK" response
|
2
2
|
|
3
3
|
require "datadog_api_client"
|
4
|
-
DatadogAPIClient.configure do |config|
|
5
|
-
config.unstable_operations["v2.create_dora_incident".to_sym] = true
|
6
|
-
end
|
7
4
|
api_instance = DatadogAPIClient::V2::DORAMetricsAPI.new
|
8
5
|
|
9
|
-
body = DatadogAPIClient::V2::
|
10
|
-
data: DatadogAPIClient::V2::
|
11
|
-
attributes: DatadogAPIClient::V2::
|
12
|
-
|
6
|
+
body = DatadogAPIClient::V2::DORAFailureRequest.new({
|
7
|
+
data: DatadogAPIClient::V2::DORAFailureRequestData.new({
|
8
|
+
attributes: DatadogAPIClient::V2::DORAFailureRequestAttributes.new({
|
9
|
+
custom_tags: [
|
10
|
+
"language:java",
|
11
|
+
"department:engineering",
|
12
|
+
],
|
13
|
+
env: "staging",
|
14
|
+
finished_at: 1693491984000000000,
|
13
15
|
git: DatadogAPIClient::V2::DORAGitInfo.new({
|
14
16
|
commit_sha: "66adc9350f2cc9b250b69abddab733dd55e1a588",
|
15
17
|
repository_url: "https://github.com/organization/example-repository",
|
16
18
|
}),
|
17
|
-
name: "Webserver is down failing all requests",
|
19
|
+
name: "Webserver is down failing all requests.",
|
18
20
|
services: [
|
19
21
|
"shopist",
|
20
22
|
],
|
21
23
|
severity: "High",
|
22
|
-
started_at:
|
24
|
+
started_at: 1693491974000000000,
|
23
25
|
team: "backend",
|
24
26
|
version: "v1.12.07",
|
25
27
|
}),
|
@@ -0,0 +1,25 @@
|
|
1
|
+
# Send a failure event for DORA Metrics returns "OK" response
|
2
|
+
|
3
|
+
require "datadog_api_client"
|
4
|
+
api_instance = DatadogAPIClient::V2::DORAMetricsAPI.new
|
5
|
+
|
6
|
+
body = DatadogAPIClient::V2::DORAFailureRequest.new({
|
7
|
+
data: DatadogAPIClient::V2::DORAFailureRequestData.new({
|
8
|
+
attributes: DatadogAPIClient::V2::DORAFailureRequestAttributes.new({
|
9
|
+
finished_at: 1707842944600000000,
|
10
|
+
git: DatadogAPIClient::V2::DORAGitInfo.new({
|
11
|
+
commit_sha: "66adc9350f2cc9b250b69abddab733dd55e1a588",
|
12
|
+
repository_url: "https://github.com/organization/example-repository",
|
13
|
+
}),
|
14
|
+
name: "Webserver is down failing all requests",
|
15
|
+
services: [
|
16
|
+
"shopist",
|
17
|
+
],
|
18
|
+
severity: "High",
|
19
|
+
started_at: 1707842944500000000,
|
20
|
+
team: "backend",
|
21
|
+
version: "v1.12.07",
|
22
|
+
}),
|
23
|
+
}),
|
24
|
+
})
|
25
|
+
p api_instance.create_dora_incident(body)
|
@@ -0,0 +1,30 @@
|
|
1
|
+
# Create a Microsoft Sentinel custom destination returns "OK" response
|
2
|
+
|
3
|
+
require "datadog_api_client"
|
4
|
+
api_instance = DatadogAPIClient::V2::LogsCustomDestinationsAPI.new
|
5
|
+
|
6
|
+
body = DatadogAPIClient::V2::CustomDestinationCreateRequest.new({
|
7
|
+
data: DatadogAPIClient::V2::CustomDestinationCreateRequestDefinition.new({
|
8
|
+
attributes: DatadogAPIClient::V2::CustomDestinationCreateRequestAttributes.new({
|
9
|
+
enabled: false,
|
10
|
+
forward_tags: false,
|
11
|
+
forward_tags_restriction_list: [
|
12
|
+
"datacenter",
|
13
|
+
"host",
|
14
|
+
],
|
15
|
+
forward_tags_restriction_list_type: DatadogAPIClient::V2::CustomDestinationAttributeTagsRestrictionListType::ALLOW_LIST,
|
16
|
+
forwarder_destination: DatadogAPIClient::V2::CustomDestinationForwardDestinationMicrosoftSentinel.new({
|
17
|
+
type: DatadogAPIClient::V2::CustomDestinationForwardDestinationMicrosoftSentinelType::MICROSOFT_SENTINEL,
|
18
|
+
tenant_id: "f3c9a8a1-4c2e-4d2e-b911-9f3c28c3c8b2",
|
19
|
+
client_id: "9a2f4d83-2b5e-429e-a35a-2b3c4182db71",
|
20
|
+
data_collection_endpoint: "https://my-dce-5kyl.eastus-1.ingest.monitor.azure.com",
|
21
|
+
data_collection_rule_id: "dcr-000a00a000a00000a000000aa000a0aa",
|
22
|
+
stream_name: "Custom-MyTable",
|
23
|
+
}),
|
24
|
+
name: "Nginx logs",
|
25
|
+
query: "source:nginx",
|
26
|
+
}),
|
27
|
+
type: DatadogAPIClient::V2::CustomDestinationType::CUSTOM_DESTINATION,
|
28
|
+
}),
|
29
|
+
})
|
30
|
+
p api_instance.create_logs_custom_destination(body)
|
@@ -7,7 +7,7 @@ body = DatadogAPIClient::V2::MicrosoftTeamsCreateWorkflowsWebhookHandleRequest.n
|
|
7
7
|
data: DatadogAPIClient::V2::MicrosoftTeamsWorkflowsWebhookHandleRequestData.new({
|
8
8
|
attributes: DatadogAPIClient::V2::MicrosoftTeamsWorkflowsWebhookHandleRequestAttributes.new({
|
9
9
|
name: "Example-Microsoft-Teams-Integration",
|
10
|
-
url: "https://
|
10
|
+
url: "https://example.logic.azure.com/workflows/123",
|
11
11
|
}),
|
12
12
|
type: DatadogAPIClient::V2::MicrosoftTeamsWorkflowsWebhookHandleType::WORKFLOWS_WEBHOOK_HANDLE,
|
13
13
|
}),
|
@@ -0,0 +1,11 @@
|
|
1
|
+
# Get team on-call users returns "OK" response
|
2
|
+
|
3
|
+
require "datadog_api_client"
|
4
|
+
api_instance = DatadogAPIClient::V2::OnCallAPI.new
|
5
|
+
|
6
|
+
# there are valid "routing_rules" in the system
|
7
|
+
ROUTING_RULES_DATA_ID = ENV["ROUTING_RULES_DATA_ID"]
|
8
|
+
opts = {
|
9
|
+
include: "responders,escalations.responders",
|
10
|
+
}
|
11
|
+
p api_instance.get_team_on_call_users(ROUTING_RULES_DATA_ID, opts)
|
@@ -0,0 +1,11 @@
|
|
1
|
+
# List findings returns "OK" response with details
|
2
|
+
|
3
|
+
require "datadog_api_client"
|
4
|
+
DatadogAPIClient.configure do |config|
|
5
|
+
config.unstable_operations["v2.list_findings".to_sym] = true
|
6
|
+
end
|
7
|
+
api_instance = DatadogAPIClient::V2::SecurityMonitoringAPI.new
|
8
|
+
opts = {
|
9
|
+
detailed_findings: true,
|
10
|
+
}
|
11
|
+
p api_instance.list_findings(opts)
|
@@ -0,0 +1,15 @@
|
|
1
|
+
# Add a member team returns "Added" response
|
2
|
+
|
3
|
+
require "datadog_api_client"
|
4
|
+
DatadogAPIClient.configure do |config|
|
5
|
+
config.unstable_operations["v2.add_member_team".to_sym] = true
|
6
|
+
end
|
7
|
+
api_instance = DatadogAPIClient::V2::TeamsAPI.new
|
8
|
+
|
9
|
+
body = DatadogAPIClient::V2::AddMemberTeamRequest.new({
|
10
|
+
data: DatadogAPIClient::V2::MemberTeam.new({
|
11
|
+
id: "aeadc05e-98a8-11ec-ac2c-da7ad0900001",
|
12
|
+
type: DatadogAPIClient::V2::MemberTeamType::MEMBER_TEAMS,
|
13
|
+
}),
|
14
|
+
})
|
15
|
+
api_instance.add_member_team("super_team_id", body)
|
@@ -0,0 +1,8 @@
|
|
1
|
+
# Get all member teams returns "OK" response
|
2
|
+
|
3
|
+
require "datadog_api_client"
|
4
|
+
DatadogAPIClient.configure do |config|
|
5
|
+
config.unstable_operations["v2.list_member_teams".to_sym] = true
|
6
|
+
end
|
7
|
+
api_instance = DatadogAPIClient::V2::TeamsAPI.new
|
8
|
+
p api_instance.list_member_teams("super_team_id")
|
@@ -0,0 +1,8 @@
|
|
1
|
+
# Get all member teams returns "OK" response with pagination
|
2
|
+
|
3
|
+
require "datadog_api_client"
|
4
|
+
DatadogAPIClient.configure do |config|
|
5
|
+
config.unstable_operations["v2.list_member_teams".to_sym] = true
|
6
|
+
end
|
7
|
+
api_instance = DatadogAPIClient::V2::TeamsAPI.new
|
8
|
+
api_instance.list_member_teams_with_pagination("super_team_id") { |item| puts item }
|
@@ -0,0 +1,8 @@
|
|
1
|
+
# Remove a member team returns "No Content" response
|
2
|
+
|
3
|
+
require "datadog_api_client"
|
4
|
+
DatadogAPIClient.configure do |config|
|
5
|
+
config.unstable_operations["v2.remove_member_team".to_sym] = true
|
6
|
+
end
|
7
|
+
api_instance = DatadogAPIClient::V2::TeamsAPI.new
|
8
|
+
api_instance.remove_member_team("super_team_id", "member_team_id")
|
@@ -210,8 +210,6 @@ module DatadogAPIClient
|
|
210
210
|
"v2.cancel_data_deletion_request": false,
|
211
211
|
"v2.create_data_deletion_request": false,
|
212
212
|
"v2.get_data_deletion_requests": false,
|
213
|
-
"v2.create_dora_deployment": false,
|
214
|
-
"v2.create_dora_incident": false,
|
215
213
|
"v2.create_incident": false,
|
216
214
|
"v2.create_incident_integration": false,
|
217
215
|
"v2.create_incident_todo": false,
|
@@ -269,6 +267,9 @@ module DatadogAPIClient
|
|
269
267
|
"v2.create_slo_report_job": false,
|
270
268
|
"v2.get_slo_report": false,
|
271
269
|
"v2.get_slo_report_job_status": false,
|
270
|
+
"v2.add_member_team": false,
|
271
|
+
"v2.list_member_teams": false,
|
272
|
+
"v2.remove_member_team": false,
|
272
273
|
"v2.create_incident_team": false,
|
273
274
|
"v2.delete_incident_team": false,
|
274
275
|
"v2.get_incident_team": false,
|