datadog_api_client 2.23.0 → 2.24.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.apigentools-info +4 -4
- data/.generator/schemas/v1/openapi.yaml +666 -156
- data/.generator/schemas/v2/openapi.yaml +774 -89
- data/.generator/src/generator/replacement.json +1 -1
- data/.github/CODEOWNERS +5 -5
- data/CHANGELOG.md +26 -0
- data/examples/v1/dashboards/CreateDashboard_1213075383.rb +10 -4
- data/examples/v1/dashboards/CreateDashboard_2336428357.rb +10 -4
- data/examples/v1/dashboards/CreateDashboard_2563642929.rb +66 -0
- data/examples/v1/dashboards/CreateDashboard_3669695268.rb +10 -4
- data/examples/v1/dashboards/CreateDashboard_915214113.rb +10 -4
- data/examples/v1/monitors/UpdateMonitor.rb +1 -0
- data/examples/v1/synthetics/CreateSyntheticsAPITest_1241981394.rb +1 -0
- data/examples/v1/synthetics/CreateSyntheticsAPITest_1279271422.rb +9 -4
- data/examples/v1/synthetics/CreateSyntheticsAPITest_1487281163.rb +15 -0
- data/examples/v1/synthetics/CreateSyntheticsAPITest_1987645492.rb +134 -0
- data/examples/v2/api-management/ListAPIs.rb +8 -0
- data/examples/v2/csm-threats/CreateCSMThreatsAgentRule.rb +3 -0
- data/examples/v2/csm-threats/UpdateCloudWorkloadSecurityAgentRule.rb +1 -0
- data/examples/v2/organizations/GetOrgConfig.rb +5 -0
- data/examples/v2/organizations/ListOrgConfigs.rb +5 -0
- data/examples/v2/organizations/UpdateOrgConfig.rb +14 -0
- data/examples/v2/security-monitoring/TestExistingSecurityMonitoringRule.rb +21 -0
- data/examples/v2/security-monitoring/TestSecurityMonitoringRule.rb +58 -0
- data/examples/v2/security-monitoring/ValidateSecurityMonitoringRule.rb +1 -1
- data/lib/datadog_api_client/configuration.rb +1 -0
- data/lib/datadog_api_client/inflector.rb +37 -1
- data/lib/datadog_api_client/v1/api/monitors_api.rb +1 -1
- data/lib/datadog_api_client/v1/models/event.rb +1 -1
- data/lib/datadog_api_client/v1/models/formula_type.rb +26 -0
- data/lib/datadog_api_client/v1/models/geomap_widget_request.rb +14 -4
- data/lib/datadog_api_client/v1/models/group_type.rb +26 -0
- data/lib/datadog_api_client/v1/models/monitor.rb +1 -16
- data/lib/datadog_api_client/v1/models/monitor_update_request.rb +2 -23
- data/lib/datadog_api_client/v1/models/monthly_usage_attribution_values.rb +2 -2
- data/lib/datadog_api_client/v1/models/synthetics_api_step.rb +37 -180
- data/lib/datadog_api_client/v1/models/synthetics_api_test_step.rb +206 -0
- data/lib/datadog_api_client/v1/models/{synthetics_api_step_subtype.rb → synthetics_api_test_step_subtype.rb} +2 -2
- data/lib/datadog_api_client/v1/models/synthetics_api_wait_step.rb +148 -0
- data/lib/datadog_api_client/v1/models/synthetics_api_wait_step_subtype.rb +26 -0
- data/lib/datadog_api_client/v1/models/synthetics_assertion.rb +1 -0
- data/lib/datadog_api_client/v1/models/synthetics_assertion_body_hash_operator.rb +28 -0
- data/lib/datadog_api_client/v1/models/synthetics_assertion_body_hash_target.rb +140 -0
- data/lib/datadog_api_client/v1/models/synthetics_assertion_body_hash_type.rb +26 -0
- data/lib/datadog_api_client/v1/models/synthetics_assertion_json_path_target_target.rb +11 -1
- data/lib/datadog_api_client/v1/models/synthetics_test_options_monitor_options.rb +0 -4
- data/lib/datadog_api_client/v1/models/synthetics_test_request_body_file.rb +22 -1
- data/lib/datadog_api_client/v1/models/table_widget_request.rb +14 -4
- data/lib/datadog_api_client/v1/models/toplist_widget_request.rb +11 -1
- data/lib/datadog_api_client/v1/models/usage_rum_sessions_hour.rb +7 -7
- data/lib/datadog_api_client/v1/models/usage_rum_sessions_response.rb +2 -2
- data/lib/datadog_api_client/v1/models/usage_summary_date.rb +168 -18
- data/lib/datadog_api_client/v1/models/usage_summary_date_org.rb +169 -19
- data/lib/datadog_api_client/v1/models/usage_summary_response.rb +171 -21
- data/lib/datadog_api_client/v1/models/widget_formula_sort.rb +144 -0
- data/lib/datadog_api_client/v1/models/widget_group_sort.rb +140 -0
- data/lib/datadog_api_client/v1/models/widget_sort_by.rb +110 -0
- data/lib/datadog_api_client/v1/models/widget_sort_order_by.rb +63 -0
- data/lib/datadog_api_client/v2/api/api_management_api.rb +80 -2
- data/lib/datadog_api_client/v2/api/organizations_api.rb +197 -0
- data/lib/datadog_api_client/v2/api/security_monitoring_api.rb +140 -1
- data/lib/datadog_api_client/v2/models/cloud_configuration_rule_payload.rb +240 -0
- data/lib/datadog_api_client/v2/models/cloud_workload_security_agent_rule_create_attributes.rb +13 -1
- data/lib/datadog_api_client/v2/models/dora_incident_request_attributes.rb +1 -1
- data/lib/datadog_api_client/v2/models/events_group_by.rb +5 -4
- data/lib/datadog_api_client/v2/models/list_apis_response.rb +92 -0
- data/lib/datadog_api_client/v2/models/list_apis_response_data.rb +90 -0
- data/lib/datadog_api_client/v2/models/list_apis_response_data_attributes.rb +80 -0
- data/lib/datadog_api_client/v2/models/list_apis_response_meta.rb +80 -0
- data/lib/datadog_api_client/v2/models/list_apis_response_meta_pagination.rb +100 -0
- data/lib/datadog_api_client/v2/models/org_config_get_response.rb +98 -0
- data/lib/datadog_api_client/v2/models/org_config_list_response.rb +100 -0
- data/lib/datadog_api_client/v2/models/org_config_read.rb +140 -0
- data/lib/datadog_api_client/v2/models/org_config_read_attributes.rb +179 -0
- data/lib/datadog_api_client/v2/models/org_config_type.rb +26 -0
- data/lib/datadog_api_client/v2/models/org_config_write.rb +119 -0
- data/lib/datadog_api_client/v2/models/org_config_write_attributes.rb +98 -0
- data/lib/datadog_api_client/v2/models/org_config_write_request.rb +98 -0
- data/lib/datadog_api_client/v2/models/security_monitoring_rule_query_payload.rb +118 -0
- data/lib/datadog_api_client/v2/models/security_monitoring_rule_query_payload_data.rb +120 -0
- data/lib/datadog_api_client/v2/models/security_monitoring_rule_test_payload.rb +62 -0
- data/lib/datadog_api_client/v2/models/security_monitoring_rule_test_request.rb +92 -0
- data/lib/datadog_api_client/v2/models/security_monitoring_rule_test_response.rb +84 -0
- data/lib/datadog_api_client/v2/models/security_monitoring_rule_type_test.rb +26 -0
- data/lib/datadog_api_client/v2/models/security_monitoring_rule_update_payload.rb +1 -1
- data/lib/datadog_api_client/v2/models/security_monitoring_rule_validate_payload.rb +64 -0
- data/lib/datadog_api_client/v2/models/security_monitoring_signal_rule_payload.rb +251 -0
- data/lib/datadog_api_client/v2/models/security_monitoring_standard_rule_create_payload.rb +1 -1
- data/lib/datadog_api_client/v2/models/security_monitoring_standard_rule_payload.rb +263 -0
- data/lib/datadog_api_client/v2/models/security_monitoring_standard_rule_response.rb +1 -1
- data/lib/datadog_api_client/v2/models/security_monitoring_standard_rule_test_payload.rb +263 -0
- data/lib/datadog_api_client/version.rb +1 -1
- metadata +47 -3
@@ -23,6 +23,203 @@ module DatadogAPIClient::V2
|
|
23
23
|
@api_client = api_client
|
24
24
|
end
|
25
25
|
|
26
|
+
# Get a specific Org Config value.
|
27
|
+
#
|
28
|
+
# @see #get_org_config_with_http_info
|
29
|
+
def get_org_config(org_config_name, opts = {})
|
30
|
+
data, _status_code, _headers = get_org_config_with_http_info(org_config_name, opts)
|
31
|
+
data
|
32
|
+
end
|
33
|
+
|
34
|
+
# Get a specific Org Config value.
|
35
|
+
#
|
36
|
+
# Return the name, description, and value of a specific Org Config.
|
37
|
+
#
|
38
|
+
# @param org_config_name [String] The name of an Org Config.
|
39
|
+
# @param opts [Hash] the optional parameters
|
40
|
+
# @return [Array<(OrgConfigGetResponse, Integer, Hash)>] OrgConfigGetResponse data, response status code and response headers
|
41
|
+
def get_org_config_with_http_info(org_config_name, opts = {})
|
42
|
+
|
43
|
+
if @api_client.config.debugging
|
44
|
+
@api_client.config.logger.debug 'Calling API: OrganizationsAPI.get_org_config ...'
|
45
|
+
end
|
46
|
+
# verify the required parameter 'org_config_name' is set
|
47
|
+
if @api_client.config.client_side_validation && org_config_name.nil?
|
48
|
+
fail ArgumentError, "Missing the required parameter 'org_config_name' when calling OrganizationsAPI.get_org_config"
|
49
|
+
end
|
50
|
+
# resource path
|
51
|
+
local_var_path = '/api/v2/org_configs/{org_config_name}'.sub('{org_config_name}', CGI.escape(org_config_name.to_s).gsub('%2F', '/'))
|
52
|
+
|
53
|
+
# query parameters
|
54
|
+
query_params = opts[:query_params] || {}
|
55
|
+
|
56
|
+
# header parameters
|
57
|
+
header_params = opts[:header_params] || {}
|
58
|
+
# HTTP header 'Accept' (if needed)
|
59
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
60
|
+
|
61
|
+
# form parameters
|
62
|
+
form_params = opts[:form_params] || {}
|
63
|
+
|
64
|
+
# http body (model)
|
65
|
+
post_body = opts[:debug_body]
|
66
|
+
|
67
|
+
# return_type
|
68
|
+
return_type = opts[:debug_return_type] || 'OrgConfigGetResponse'
|
69
|
+
|
70
|
+
# auth_names
|
71
|
+
auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth]
|
72
|
+
|
73
|
+
new_options = opts.merge(
|
74
|
+
:operation => :get_org_config,
|
75
|
+
:header_params => header_params,
|
76
|
+
:query_params => query_params,
|
77
|
+
:form_params => form_params,
|
78
|
+
:body => post_body,
|
79
|
+
:auth_names => auth_names,
|
80
|
+
:return_type => return_type,
|
81
|
+
:api_version => "V2"
|
82
|
+
)
|
83
|
+
|
84
|
+
data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options)
|
85
|
+
if @api_client.config.debugging
|
86
|
+
@api_client.config.logger.debug "API called: OrganizationsAPI#get_org_config\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
87
|
+
end
|
88
|
+
return data, status_code, headers
|
89
|
+
end
|
90
|
+
|
91
|
+
# List Org Configs.
|
92
|
+
#
|
93
|
+
# @see #list_org_configs_with_http_info
|
94
|
+
def list_org_configs(opts = {})
|
95
|
+
data, _status_code, _headers = list_org_configs_with_http_info(opts)
|
96
|
+
data
|
97
|
+
end
|
98
|
+
|
99
|
+
# List Org Configs.
|
100
|
+
#
|
101
|
+
# Returns all Org Configs (name, description, and value).
|
102
|
+
#
|
103
|
+
# @param opts [Hash] the optional parameters
|
104
|
+
# @return [Array<(OrgConfigListResponse, Integer, Hash)>] OrgConfigListResponse data, response status code and response headers
|
105
|
+
def list_org_configs_with_http_info(opts = {})
|
106
|
+
|
107
|
+
if @api_client.config.debugging
|
108
|
+
@api_client.config.logger.debug 'Calling API: OrganizationsAPI.list_org_configs ...'
|
109
|
+
end
|
110
|
+
# resource path
|
111
|
+
local_var_path = '/api/v2/org_configs'
|
112
|
+
|
113
|
+
# query parameters
|
114
|
+
query_params = opts[:query_params] || {}
|
115
|
+
|
116
|
+
# header parameters
|
117
|
+
header_params = opts[:header_params] || {}
|
118
|
+
# HTTP header 'Accept' (if needed)
|
119
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
120
|
+
|
121
|
+
# form parameters
|
122
|
+
form_params = opts[:form_params] || {}
|
123
|
+
|
124
|
+
# http body (model)
|
125
|
+
post_body = opts[:debug_body]
|
126
|
+
|
127
|
+
# return_type
|
128
|
+
return_type = opts[:debug_return_type] || 'OrgConfigListResponse'
|
129
|
+
|
130
|
+
# auth_names
|
131
|
+
auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth]
|
132
|
+
|
133
|
+
new_options = opts.merge(
|
134
|
+
:operation => :list_org_configs,
|
135
|
+
:header_params => header_params,
|
136
|
+
:query_params => query_params,
|
137
|
+
:form_params => form_params,
|
138
|
+
:body => post_body,
|
139
|
+
:auth_names => auth_names,
|
140
|
+
:return_type => return_type,
|
141
|
+
:api_version => "V2"
|
142
|
+
)
|
143
|
+
|
144
|
+
data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options)
|
145
|
+
if @api_client.config.debugging
|
146
|
+
@api_client.config.logger.debug "API called: OrganizationsAPI#list_org_configs\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
147
|
+
end
|
148
|
+
return data, status_code, headers
|
149
|
+
end
|
150
|
+
|
151
|
+
# Update a specific Org Config.
|
152
|
+
#
|
153
|
+
# @see #update_org_config_with_http_info
|
154
|
+
def update_org_config(org_config_name, body, opts = {})
|
155
|
+
data, _status_code, _headers = update_org_config_with_http_info(org_config_name, body, opts)
|
156
|
+
data
|
157
|
+
end
|
158
|
+
|
159
|
+
# Update a specific Org Config.
|
160
|
+
#
|
161
|
+
# Update the value of a specific Org Config.
|
162
|
+
#
|
163
|
+
# @param org_config_name [String] The name of an Org Config.
|
164
|
+
# @param body [OrgConfigWriteRequest]
|
165
|
+
# @param opts [Hash] the optional parameters
|
166
|
+
# @return [Array<(OrgConfigGetResponse, Integer, Hash)>] OrgConfigGetResponse data, response status code and response headers
|
167
|
+
def update_org_config_with_http_info(org_config_name, body, opts = {})
|
168
|
+
|
169
|
+
if @api_client.config.debugging
|
170
|
+
@api_client.config.logger.debug 'Calling API: OrganizationsAPI.update_org_config ...'
|
171
|
+
end
|
172
|
+
# verify the required parameter 'org_config_name' is set
|
173
|
+
if @api_client.config.client_side_validation && org_config_name.nil?
|
174
|
+
fail ArgumentError, "Missing the required parameter 'org_config_name' when calling OrganizationsAPI.update_org_config"
|
175
|
+
end
|
176
|
+
# verify the required parameter 'body' is set
|
177
|
+
if @api_client.config.client_side_validation && body.nil?
|
178
|
+
fail ArgumentError, "Missing the required parameter 'body' when calling OrganizationsAPI.update_org_config"
|
179
|
+
end
|
180
|
+
# resource path
|
181
|
+
local_var_path = '/api/v2/org_configs/{org_config_name}'.sub('{org_config_name}', CGI.escape(org_config_name.to_s).gsub('%2F', '/'))
|
182
|
+
|
183
|
+
# query parameters
|
184
|
+
query_params = opts[:query_params] || {}
|
185
|
+
|
186
|
+
# header parameters
|
187
|
+
header_params = opts[:header_params] || {}
|
188
|
+
# HTTP header 'Accept' (if needed)
|
189
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
190
|
+
# HTTP header 'Content-Type'
|
191
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
192
|
+
|
193
|
+
# form parameters
|
194
|
+
form_params = opts[:form_params] || {}
|
195
|
+
|
196
|
+
# http body (model)
|
197
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(body)
|
198
|
+
|
199
|
+
# return_type
|
200
|
+
return_type = opts[:debug_return_type] || 'OrgConfigGetResponse'
|
201
|
+
|
202
|
+
# auth_names
|
203
|
+
auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]
|
204
|
+
|
205
|
+
new_options = opts.merge(
|
206
|
+
:operation => :update_org_config,
|
207
|
+
:header_params => header_params,
|
208
|
+
:query_params => query_params,
|
209
|
+
:form_params => form_params,
|
210
|
+
:body => post_body,
|
211
|
+
:auth_names => auth_names,
|
212
|
+
:return_type => return_type,
|
213
|
+
:api_version => "V2"
|
214
|
+
)
|
215
|
+
|
216
|
+
data, status_code, headers = @api_client.call_api(Net::HTTP::Patch, local_var_path, new_options)
|
217
|
+
if @api_client.config.debugging
|
218
|
+
@api_client.config.logger.debug "API called: OrganizationsAPI#update_org_config\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
219
|
+
end
|
220
|
+
return data, status_code, headers
|
221
|
+
end
|
222
|
+
|
26
223
|
# Upload IdP metadata.
|
27
224
|
#
|
28
225
|
# @see #upload_idp_metadata_with_http_info
|
@@ -1580,6 +1580,145 @@ module DatadogAPIClient::V2
|
|
1580
1580
|
end
|
1581
1581
|
end
|
1582
1582
|
|
1583
|
+
# Test an existing rule.
|
1584
|
+
#
|
1585
|
+
# @see #test_existing_security_monitoring_rule_with_http_info
|
1586
|
+
def test_existing_security_monitoring_rule(rule_id, body, opts = {})
|
1587
|
+
data, _status_code, _headers = test_existing_security_monitoring_rule_with_http_info(rule_id, body, opts)
|
1588
|
+
data
|
1589
|
+
end
|
1590
|
+
|
1591
|
+
# Test an existing rule.
|
1592
|
+
#
|
1593
|
+
# Test an existing rule.
|
1594
|
+
#
|
1595
|
+
# @param rule_id [String] The ID of the rule.
|
1596
|
+
# @param body [SecurityMonitoringRuleTestRequest]
|
1597
|
+
# @param opts [Hash] the optional parameters
|
1598
|
+
# @return [Array<(SecurityMonitoringRuleTestResponse, Integer, Hash)>] SecurityMonitoringRuleTestResponse data, response status code and response headers
|
1599
|
+
def test_existing_security_monitoring_rule_with_http_info(rule_id, body, opts = {})
|
1600
|
+
|
1601
|
+
if @api_client.config.debugging
|
1602
|
+
@api_client.config.logger.debug 'Calling API: SecurityMonitoringAPI.test_existing_security_monitoring_rule ...'
|
1603
|
+
end
|
1604
|
+
# verify the required parameter 'rule_id' is set
|
1605
|
+
if @api_client.config.client_side_validation && rule_id.nil?
|
1606
|
+
fail ArgumentError, "Missing the required parameter 'rule_id' when calling SecurityMonitoringAPI.test_existing_security_monitoring_rule"
|
1607
|
+
end
|
1608
|
+
# verify the required parameter 'body' is set
|
1609
|
+
if @api_client.config.client_side_validation && body.nil?
|
1610
|
+
fail ArgumentError, "Missing the required parameter 'body' when calling SecurityMonitoringAPI.test_existing_security_monitoring_rule"
|
1611
|
+
end
|
1612
|
+
# resource path
|
1613
|
+
local_var_path = '/api/v2/security_monitoring/rules/{rule_id}/test'.sub('{rule_id}', CGI.escape(rule_id.to_s).gsub('%2F', '/'))
|
1614
|
+
|
1615
|
+
# query parameters
|
1616
|
+
query_params = opts[:query_params] || {}
|
1617
|
+
|
1618
|
+
# header parameters
|
1619
|
+
header_params = opts[:header_params] || {}
|
1620
|
+
# HTTP header 'Accept' (if needed)
|
1621
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
1622
|
+
# HTTP header 'Content-Type'
|
1623
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
1624
|
+
|
1625
|
+
# form parameters
|
1626
|
+
form_params = opts[:form_params] || {}
|
1627
|
+
|
1628
|
+
# http body (model)
|
1629
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(body)
|
1630
|
+
|
1631
|
+
# return_type
|
1632
|
+
return_type = opts[:debug_return_type] || 'SecurityMonitoringRuleTestResponse'
|
1633
|
+
|
1634
|
+
# auth_names
|
1635
|
+
auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]
|
1636
|
+
|
1637
|
+
new_options = opts.merge(
|
1638
|
+
:operation => :test_existing_security_monitoring_rule,
|
1639
|
+
:header_params => header_params,
|
1640
|
+
:query_params => query_params,
|
1641
|
+
:form_params => form_params,
|
1642
|
+
:body => post_body,
|
1643
|
+
:auth_names => auth_names,
|
1644
|
+
:return_type => return_type,
|
1645
|
+
:api_version => "V2"
|
1646
|
+
)
|
1647
|
+
|
1648
|
+
data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options)
|
1649
|
+
if @api_client.config.debugging
|
1650
|
+
@api_client.config.logger.debug "API called: SecurityMonitoringAPI#test_existing_security_monitoring_rule\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
1651
|
+
end
|
1652
|
+
return data, status_code, headers
|
1653
|
+
end
|
1654
|
+
|
1655
|
+
# Test a rule.
|
1656
|
+
#
|
1657
|
+
# @see #test_security_monitoring_rule_with_http_info
|
1658
|
+
def test_security_monitoring_rule(body, opts = {})
|
1659
|
+
data, _status_code, _headers = test_security_monitoring_rule_with_http_info(body, opts)
|
1660
|
+
data
|
1661
|
+
end
|
1662
|
+
|
1663
|
+
# Test a rule.
|
1664
|
+
#
|
1665
|
+
# Test a rule.
|
1666
|
+
#
|
1667
|
+
# @param body [SecurityMonitoringRuleTestRequest]
|
1668
|
+
# @param opts [Hash] the optional parameters
|
1669
|
+
# @return [Array<(SecurityMonitoringRuleTestResponse, Integer, Hash)>] SecurityMonitoringRuleTestResponse data, response status code and response headers
|
1670
|
+
def test_security_monitoring_rule_with_http_info(body, opts = {})
|
1671
|
+
|
1672
|
+
if @api_client.config.debugging
|
1673
|
+
@api_client.config.logger.debug 'Calling API: SecurityMonitoringAPI.test_security_monitoring_rule ...'
|
1674
|
+
end
|
1675
|
+
# verify the required parameter 'body' is set
|
1676
|
+
if @api_client.config.client_side_validation && body.nil?
|
1677
|
+
fail ArgumentError, "Missing the required parameter 'body' when calling SecurityMonitoringAPI.test_security_monitoring_rule"
|
1678
|
+
end
|
1679
|
+
# resource path
|
1680
|
+
local_var_path = '/api/v2/security_monitoring/rules/test'
|
1681
|
+
|
1682
|
+
# query parameters
|
1683
|
+
query_params = opts[:query_params] || {}
|
1684
|
+
|
1685
|
+
# header parameters
|
1686
|
+
header_params = opts[:header_params] || {}
|
1687
|
+
# HTTP header 'Accept' (if needed)
|
1688
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
1689
|
+
# HTTP header 'Content-Type'
|
1690
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
1691
|
+
|
1692
|
+
# form parameters
|
1693
|
+
form_params = opts[:form_params] || {}
|
1694
|
+
|
1695
|
+
# http body (model)
|
1696
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(body)
|
1697
|
+
|
1698
|
+
# return_type
|
1699
|
+
return_type = opts[:debug_return_type] || 'SecurityMonitoringRuleTestResponse'
|
1700
|
+
|
1701
|
+
# auth_names
|
1702
|
+
auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]
|
1703
|
+
|
1704
|
+
new_options = opts.merge(
|
1705
|
+
:operation => :test_security_monitoring_rule,
|
1706
|
+
:header_params => header_params,
|
1707
|
+
:query_params => query_params,
|
1708
|
+
:form_params => form_params,
|
1709
|
+
:body => post_body,
|
1710
|
+
:auth_names => auth_names,
|
1711
|
+
:return_type => return_type,
|
1712
|
+
:api_version => "V2"
|
1713
|
+
)
|
1714
|
+
|
1715
|
+
data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options)
|
1716
|
+
if @api_client.config.debugging
|
1717
|
+
@api_client.config.logger.debug "API called: SecurityMonitoringAPI#test_security_monitoring_rule\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
1718
|
+
end
|
1719
|
+
return data, status_code, headers
|
1720
|
+
end
|
1721
|
+
|
1583
1722
|
# Update a security filter.
|
1584
1723
|
#
|
1585
1724
|
# @see #update_security_filter_with_http_info
|
@@ -1812,7 +1951,7 @@ module DatadogAPIClient::V2
|
|
1812
1951
|
#
|
1813
1952
|
# Validate a detection rule.
|
1814
1953
|
#
|
1815
|
-
# @param body [
|
1954
|
+
# @param body [SecurityMonitoringRuleValidatePayload]
|
1816
1955
|
# @param opts [Hash] the optional parameters
|
1817
1956
|
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
|
1818
1957
|
def validate_security_monitoring_rule_with_http_info(body, opts = {})
|
@@ -0,0 +1,240 @@
|
|
1
|
+
=begin
|
2
|
+
#Datadog API V2 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 'date'
|
17
|
+
require 'time'
|
18
|
+
|
19
|
+
module DatadogAPIClient::V2
|
20
|
+
# The payload of a cloud configuration rule.
|
21
|
+
class CloudConfigurationRulePayload
|
22
|
+
include BaseGenericModel
|
23
|
+
|
24
|
+
# Description of generated findings and signals (severity and channels to be notified in case of a signal). Must contain exactly one item.
|
25
|
+
#
|
26
|
+
attr_reader :cases
|
27
|
+
|
28
|
+
# How to generate compliance signals. Useful for cloud_configuration rules only.
|
29
|
+
attr_reader :compliance_signal_options
|
30
|
+
|
31
|
+
# Additional queries to filter matched events before they are processed.
|
32
|
+
attr_accessor :filters
|
33
|
+
|
34
|
+
# Whether the rule is enabled.
|
35
|
+
attr_reader :is_enabled
|
36
|
+
|
37
|
+
# Message in markdown format for generated findings and signals.
|
38
|
+
attr_reader :message
|
39
|
+
|
40
|
+
# The name of the rule.
|
41
|
+
attr_reader :name
|
42
|
+
|
43
|
+
# Options on cloud configuration rules.
|
44
|
+
attr_reader :options
|
45
|
+
|
46
|
+
# Tags for generated findings and signals.
|
47
|
+
attr_accessor :tags
|
48
|
+
|
49
|
+
# The rule type.
|
50
|
+
attr_accessor :type
|
51
|
+
|
52
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
53
|
+
# @!visibility private
|
54
|
+
def self.attribute_map
|
55
|
+
{
|
56
|
+
:'cases' => :'cases',
|
57
|
+
:'compliance_signal_options' => :'complianceSignalOptions',
|
58
|
+
:'filters' => :'filters',
|
59
|
+
:'is_enabled' => :'isEnabled',
|
60
|
+
:'message' => :'message',
|
61
|
+
:'name' => :'name',
|
62
|
+
:'options' => :'options',
|
63
|
+
:'tags' => :'tags',
|
64
|
+
:'type' => :'type'
|
65
|
+
}
|
66
|
+
end
|
67
|
+
|
68
|
+
# Attribute type mapping.
|
69
|
+
# @!visibility private
|
70
|
+
def self.openapi_types
|
71
|
+
{
|
72
|
+
:'cases' => :'Array<CloudConfigurationRuleCaseCreate>',
|
73
|
+
:'compliance_signal_options' => :'CloudConfigurationRuleComplianceSignalOptions',
|
74
|
+
:'filters' => :'Array<SecurityMonitoringFilter>',
|
75
|
+
:'is_enabled' => :'Boolean',
|
76
|
+
:'message' => :'String',
|
77
|
+
:'name' => :'String',
|
78
|
+
:'options' => :'CloudConfigurationRuleOptions',
|
79
|
+
:'tags' => :'Array<String>',
|
80
|
+
:'type' => :'CloudConfigurationRuleType'
|
81
|
+
}
|
82
|
+
end
|
83
|
+
|
84
|
+
# Initializes the object
|
85
|
+
# @param attributes [Hash] Model attributes in the form of hash
|
86
|
+
# @!visibility private
|
87
|
+
def initialize(attributes = {})
|
88
|
+
if (!attributes.is_a?(Hash))
|
89
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::CloudConfigurationRulePayload` initialize method"
|
90
|
+
end
|
91
|
+
|
92
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
93
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
94
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
95
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `DatadogAPIClient::V2::CloudConfigurationRulePayload`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
96
|
+
end
|
97
|
+
h[k.to_sym] = v
|
98
|
+
}
|
99
|
+
|
100
|
+
if attributes.key?(:'cases')
|
101
|
+
if (value = attributes[:'cases']).is_a?(Array)
|
102
|
+
self.cases = value
|
103
|
+
end
|
104
|
+
end
|
105
|
+
|
106
|
+
if attributes.key?(:'compliance_signal_options')
|
107
|
+
self.compliance_signal_options = attributes[:'compliance_signal_options']
|
108
|
+
end
|
109
|
+
|
110
|
+
if attributes.key?(:'filters')
|
111
|
+
if (value = attributes[:'filters']).is_a?(Array)
|
112
|
+
self.filters = value
|
113
|
+
end
|
114
|
+
end
|
115
|
+
|
116
|
+
if attributes.key?(:'is_enabled')
|
117
|
+
self.is_enabled = attributes[:'is_enabled']
|
118
|
+
end
|
119
|
+
|
120
|
+
if attributes.key?(:'message')
|
121
|
+
self.message = attributes[:'message']
|
122
|
+
end
|
123
|
+
|
124
|
+
if attributes.key?(:'name')
|
125
|
+
self.name = attributes[:'name']
|
126
|
+
end
|
127
|
+
|
128
|
+
if attributes.key?(:'options')
|
129
|
+
self.options = attributes[:'options']
|
130
|
+
end
|
131
|
+
|
132
|
+
if attributes.key?(:'tags')
|
133
|
+
if (value = attributes[:'tags']).is_a?(Array)
|
134
|
+
self.tags = value
|
135
|
+
end
|
136
|
+
end
|
137
|
+
|
138
|
+
if attributes.key?(:'type')
|
139
|
+
self.type = attributes[:'type']
|
140
|
+
end
|
141
|
+
end
|
142
|
+
|
143
|
+
# Check to see if the all the properties in the model are valid
|
144
|
+
# @return true if the model is valid
|
145
|
+
# @!visibility private
|
146
|
+
def valid?
|
147
|
+
return false if @cases.nil?
|
148
|
+
return false if @compliance_signal_options.nil?
|
149
|
+
return false if @is_enabled.nil?
|
150
|
+
return false if @message.nil?
|
151
|
+
return false if @name.nil?
|
152
|
+
return false if @options.nil?
|
153
|
+
true
|
154
|
+
end
|
155
|
+
|
156
|
+
# Custom attribute writer method with validation
|
157
|
+
# @param cases [Object] Object to be assigned
|
158
|
+
# @!visibility private
|
159
|
+
def cases=(cases)
|
160
|
+
if cases.nil?
|
161
|
+
fail ArgumentError, 'invalid value for "cases", cases cannot be nil.'
|
162
|
+
end
|
163
|
+
@cases = cases
|
164
|
+
end
|
165
|
+
|
166
|
+
# Custom attribute writer method with validation
|
167
|
+
# @param compliance_signal_options [Object] Object to be assigned
|
168
|
+
# @!visibility private
|
169
|
+
def compliance_signal_options=(compliance_signal_options)
|
170
|
+
if compliance_signal_options.nil?
|
171
|
+
fail ArgumentError, 'invalid value for "compliance_signal_options", compliance_signal_options cannot be nil.'
|
172
|
+
end
|
173
|
+
@compliance_signal_options = compliance_signal_options
|
174
|
+
end
|
175
|
+
|
176
|
+
# Custom attribute writer method with validation
|
177
|
+
# @param is_enabled [Object] Object to be assigned
|
178
|
+
# @!visibility private
|
179
|
+
def is_enabled=(is_enabled)
|
180
|
+
if is_enabled.nil?
|
181
|
+
fail ArgumentError, 'invalid value for "is_enabled", is_enabled cannot be nil.'
|
182
|
+
end
|
183
|
+
@is_enabled = is_enabled
|
184
|
+
end
|
185
|
+
|
186
|
+
# Custom attribute writer method with validation
|
187
|
+
# @param message [Object] Object to be assigned
|
188
|
+
# @!visibility private
|
189
|
+
def message=(message)
|
190
|
+
if message.nil?
|
191
|
+
fail ArgumentError, 'invalid value for "message", message cannot be nil.'
|
192
|
+
end
|
193
|
+
@message = message
|
194
|
+
end
|
195
|
+
|
196
|
+
# Custom attribute writer method with validation
|
197
|
+
# @param name [Object] Object to be assigned
|
198
|
+
# @!visibility private
|
199
|
+
def name=(name)
|
200
|
+
if name.nil?
|
201
|
+
fail ArgumentError, 'invalid value for "name", name cannot be nil.'
|
202
|
+
end
|
203
|
+
@name = name
|
204
|
+
end
|
205
|
+
|
206
|
+
# Custom attribute writer method with validation
|
207
|
+
# @param options [Object] Object to be assigned
|
208
|
+
# @!visibility private
|
209
|
+
def options=(options)
|
210
|
+
if options.nil?
|
211
|
+
fail ArgumentError, 'invalid value for "options", options cannot be nil.'
|
212
|
+
end
|
213
|
+
@options = options
|
214
|
+
end
|
215
|
+
|
216
|
+
# Checks equality by comparing each attribute.
|
217
|
+
# @param o [Object] Object to be compared
|
218
|
+
# @!visibility private
|
219
|
+
def ==(o)
|
220
|
+
return true if self.equal?(o)
|
221
|
+
self.class == o.class &&
|
222
|
+
cases == o.cases &&
|
223
|
+
compliance_signal_options == o.compliance_signal_options &&
|
224
|
+
filters == o.filters &&
|
225
|
+
is_enabled == o.is_enabled &&
|
226
|
+
message == o.message &&
|
227
|
+
name == o.name &&
|
228
|
+
options == o.options &&
|
229
|
+
tags == o.tags &&
|
230
|
+
type == o.type
|
231
|
+
end
|
232
|
+
|
233
|
+
# Calculates hash code according to all attributes.
|
234
|
+
# @return [Integer] Hash code
|
235
|
+
# @!visibility private
|
236
|
+
def hash
|
237
|
+
[cases, compliance_signal_options, filters, is_enabled, message, name, options, tags, type].hash
|
238
|
+
end
|
239
|
+
end
|
240
|
+
end
|
data/lib/datadog_api_client/v2/models/cloud_workload_security_agent_rule_create_attributes.rb
CHANGED
@@ -30,6 +30,9 @@ module DatadogAPIClient::V2
|
|
30
30
|
# The SECL expression of the Agent rule.
|
31
31
|
attr_reader :expression
|
32
32
|
|
33
|
+
# The platforms the Agent rule is supported on.
|
34
|
+
attr_accessor :filters
|
35
|
+
|
33
36
|
# The name of the Agent rule.
|
34
37
|
attr_reader :name
|
35
38
|
|
@@ -40,6 +43,7 @@ module DatadogAPIClient::V2
|
|
40
43
|
:'description' => :'description',
|
41
44
|
:'enabled' => :'enabled',
|
42
45
|
:'expression' => :'expression',
|
46
|
+
:'filters' => :'filters',
|
43
47
|
:'name' => :'name'
|
44
48
|
}
|
45
49
|
end
|
@@ -51,6 +55,7 @@ module DatadogAPIClient::V2
|
|
51
55
|
:'description' => :'String',
|
52
56
|
:'enabled' => :'Boolean',
|
53
57
|
:'expression' => :'String',
|
58
|
+
:'filters' => :'Array<String>',
|
54
59
|
:'name' => :'String'
|
55
60
|
}
|
56
61
|
end
|
@@ -83,6 +88,12 @@ module DatadogAPIClient::V2
|
|
83
88
|
self.expression = attributes[:'expression']
|
84
89
|
end
|
85
90
|
|
91
|
+
if attributes.key?(:'filters')
|
92
|
+
if (value = attributes[:'filters']).is_a?(Array)
|
93
|
+
self.filters = value
|
94
|
+
end
|
95
|
+
end
|
96
|
+
|
86
97
|
if attributes.key?(:'name')
|
87
98
|
self.name = attributes[:'name']
|
88
99
|
end
|
@@ -126,6 +137,7 @@ module DatadogAPIClient::V2
|
|
126
137
|
description == o.description &&
|
127
138
|
enabled == o.enabled &&
|
128
139
|
expression == o.expression &&
|
140
|
+
filters == o.filters &&
|
129
141
|
name == o.name
|
130
142
|
end
|
131
143
|
|
@@ -133,7 +145,7 @@ module DatadogAPIClient::V2
|
|
133
145
|
# @return [Integer] Hash code
|
134
146
|
# @!visibility private
|
135
147
|
def hash
|
136
|
-
[description, enabled, expression, name].hash
|
148
|
+
[description, enabled, expression, filters, name].hash
|
137
149
|
end
|
138
150
|
end
|
139
151
|
end
|
@@ -24,7 +24,7 @@ module DatadogAPIClient::V2
|
|
24
24
|
# Environment name that was impacted by the incident.
|
25
25
|
attr_accessor :env
|
26
26
|
|
27
|
-
# Unix timestamp in nanoseconds when the incident finished. It should not be older than
|
27
|
+
# Unix timestamp in nanoseconds when the incident finished. It should not be older than 1 hour.
|
28
28
|
attr_accessor :finished_at
|
29
29
|
|
30
30
|
# Git info for DORA Metrics events.
|
@@ -24,7 +24,8 @@ module DatadogAPIClient::V2
|
|
24
24
|
# The facet by which to split groups.
|
25
25
|
attr_reader :facet
|
26
26
|
|
27
|
-
# The maximum
|
27
|
+
# The maximum buckets to return for this group by. Note: at most 10000 buckets are allowed.
|
28
|
+
# If grouping by multiple facets, the product of limits must not exceed 10000.
|
28
29
|
attr_reader :limit
|
29
30
|
|
30
31
|
# The dimension by which to sort a query's results.
|
@@ -84,7 +85,7 @@ module DatadogAPIClient::V2
|
|
84
85
|
# @!visibility private
|
85
86
|
def valid?
|
86
87
|
return false if @facet.nil?
|
87
|
-
return false if !@limit.nil? && @limit >
|
88
|
+
return false if !@limit.nil? && @limit > 10000
|
88
89
|
true
|
89
90
|
end
|
90
91
|
|
@@ -102,8 +103,8 @@ module DatadogAPIClient::V2
|
|
102
103
|
# @param limit [Object] Object to be assigned
|
103
104
|
# @!visibility private
|
104
105
|
def limit=(limit)
|
105
|
-
if !limit.nil? && limit >
|
106
|
-
fail ArgumentError, 'invalid value for "limit", must be smaller than or equal to
|
106
|
+
if !limit.nil? && limit > 10000
|
107
|
+
fail ArgumentError, 'invalid value for "limit", must be smaller than or equal to 10000.'
|
107
108
|
end
|
108
109
|
@limit = limit
|
109
110
|
end
|