datadog_api_client 2.24.0 → 2.25.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (146) hide show
  1. checksums.yaml +4 -4
  2. data/.apigentools-info +4 -4
  3. data/.generator/conftest.py +2 -0
  4. data/.generator/schemas/v1/openapi.yaml +265 -8
  5. data/.generator/schemas/v2/openapi.yaml +1471 -32
  6. data/.generator/src/generator/openapi.py +4 -0
  7. data/CHANGELOG.md +41 -0
  8. data/examples/v1/azure-integration/CreateAzureIntegration.rb +1 -1
  9. data/examples/v1/azure-integration/UpdateAzureHostFilters.rb +7 -1
  10. data/examples/v1/azure-integration/UpdateAzureIntegration.rb +7 -1
  11. data/examples/v1/dashboards/CreateDashboard_985012506.rb +61 -0
  12. data/examples/v1/synthetics/CreateSyntheticsAPITest_1717840259.rb +163 -0
  13. data/examples/v1/synthetics/CreateSyntheticsBrowserTest.rb +2 -0
  14. data/examples/v2/cloud-cost-management/DeleteCustomCostsFile.rb +5 -0
  15. data/examples/v2/cloud-cost-management/DeleteCustomCostsFile_372970393.rb +5 -0
  16. data/examples/v2/cloud-cost-management/GetCustomCostsFile.rb +5 -0
  17. data/examples/v2/cloud-cost-management/GetCustomCostsFile_1307381576.rb +5 -0
  18. data/examples/v2/cloud-cost-management/ListCustomCostsFiles.rb +5 -0
  19. data/examples/v2/cloud-cost-management/ListCustomCostsFiles_1968771127.rb +5 -0
  20. data/examples/v2/cloud-cost-management/UploadCustomCostsFile.rb +15 -0
  21. data/examples/v2/cloud-cost-management/UploadCustomCostsFile_4125168396.rb +19 -0
  22. data/examples/v2/network-device-monitoring/GetDevice.rb +5 -0
  23. data/examples/v2/network-device-monitoring/GetInterfaces.rb +5 -0
  24. data/examples/v2/network-device-monitoring/ListDeviceUserTags.rb +5 -0
  25. data/examples/v2/network-device-monitoring/ListDevices.rb +10 -0
  26. data/examples/v2/network-device-monitoring/UpdateDeviceUserTags.rb +18 -0
  27. data/examples/v2/roles/CreateRole.rb +0 -3
  28. data/examples/v2/security-monitoring/ConvertExistingSecurityMonitoringRule.rb +8 -0
  29. data/examples/v2/security-monitoring/ConvertSecurityMonitoringRuleFromJSONToTerraform.rb +36 -0
  30. data/examples/v2/service-scorecards/UpdateScorecardRule.rb +24 -0
  31. data/examples/v2/workflow-automation/CancelWorkflowInstance.rb +5 -0
  32. data/examples/v2/workflow-automation/CreateWorkflowInstance.rb +13 -0
  33. data/examples/v2/workflow-automation/GetWorkflowInstance.rb +5 -0
  34. data/examples/v2/workflow-automation/ListWorkflowInstances.rb +5 -0
  35. data/lib/datadog_api_client/configuration.rb +1 -0
  36. data/lib/datadog_api_client/inflector.rb +53 -1
  37. data/lib/datadog_api_client/v1/api/aws_logs_integration_api.rb +1 -1
  38. data/lib/datadog_api_client/v1/api/hosts_api.rb +1 -1
  39. data/lib/datadog_api_client/v1/api/monitors_api.rb +12 -1
  40. data/lib/datadog_api_client/v1/api/usage_metering_api.rb +7 -3
  41. data/lib/datadog_api_client/v1/models/azure_account.rb +14 -1
  42. data/lib/datadog_api_client/v1/models/azure_account_metrics_config.rb +85 -0
  43. data/lib/datadog_api_client/v1/models/formula_and_function_apm_dependency_stats_query_definition.rb +24 -1
  44. data/lib/datadog_api_client/v1/models/formula_and_function_apm_resource_stats_query_definition.rb +24 -1
  45. data/lib/datadog_api_client/v1/models/formula_and_function_cloud_cost_query_definition.rb +24 -1
  46. data/lib/datadog_api_client/v1/models/formula_and_function_event_query_definition.rb +24 -1
  47. data/lib/datadog_api_client/v1/models/formula_and_function_events_data_source.rb +1 -0
  48. data/lib/datadog_api_client/v1/models/formula_and_function_metric_query_definition.rb +24 -1
  49. data/lib/datadog_api_client/v1/models/formula_and_function_process_query_definition.rb +24 -1
  50. data/lib/datadog_api_client/v1/models/formula_and_function_slo_query_definition.rb +24 -1
  51. data/lib/datadog_api_client/v1/models/formula_and_function_slo_query_type.rb +1 -0
  52. data/lib/datadog_api_client/v1/models/hourly_usage_attribution_usage_type.rb +2 -0
  53. data/lib/datadog_api_client/v1/models/list_stream_source.rb +1 -0
  54. data/lib/datadog_api_client/v1/models/monitor_formula_and_function_events_data_source.rb +1 -0
  55. data/lib/datadog_api_client/v1/models/monitor_type.rb +1 -0
  56. data/lib/datadog_api_client/v1/models/monthly_usage_attribution_supported_metrics.rb +4 -0
  57. data/lib/datadog_api_client/v1/models/monthly_usage_attribution_values.rb +41 -1
  58. data/lib/datadog_api_client/v1/models/synthetics_basic_auth_digest.rb +12 -1
  59. data/lib/datadog_api_client/v1/models/synthetics_basic_auth_oauth_client.rb +12 -1
  60. data/lib/datadog_api_client/v1/models/synthetics_basic_auth_oauth_rop.rb +12 -1
  61. data/lib/datadog_api_client/v1/models/synthetics_delete_tests_payload.rb +12 -1
  62. data/lib/datadog_api_client/v1/models/synthetics_test_options.rb +21 -1
  63. data/lib/datadog_api_client/v1/models/usage_billable_summary_hour.rb +21 -1
  64. data/lib/datadog_api_client/v1/models/usage_summary_date.rb +61 -1
  65. data/lib/datadog_api_client/v1/models/usage_summary_date_org.rb +81 -1
  66. data/lib/datadog_api_client/v1/models/usage_summary_response.rb +61 -1
  67. data/lib/datadog_api_client/v2/api/api_management_api.rb +5 -5
  68. data/lib/datadog_api_client/v2/api/authn_mappings_api.rb +6 -0
  69. data/lib/datadog_api_client/v2/api/case_management_api.rb +13 -13
  70. data/lib/datadog_api_client/v2/api/cloud_cost_management_api.rb +260 -0
  71. data/lib/datadog_api_client/v2/api/network_device_monitoring_api.rb +362 -0
  72. data/lib/datadog_api_client/v2/api/organizations_api.rb +1 -1
  73. data/lib/datadog_api_client/v2/api/restriction_policies_api.rb +15 -7
  74. data/lib/datadog_api_client/v2/api/security_monitoring_api.rb +134 -0
  75. data/lib/datadog_api_client/v2/api/service_scorecards_api.rb +79 -1
  76. data/lib/datadog_api_client/v2/api/usage_metering_api.rb +8 -0
  77. data/lib/datadog_api_client/v2/api/workflow_automation_api.rb +307 -0
  78. data/lib/datadog_api_client/v2/models/api_key_relationships.rb +9 -1
  79. data/lib/datadog_api_client/v2/models/authn_mapping_resource_type.rb +27 -0
  80. data/lib/datadog_api_client/v2/models/cost_by_org_attributes.rb +21 -1
  81. data/lib/datadog_api_client/v2/models/custom_cost_get_response_meta.rb +80 -0
  82. data/lib/datadog_api_client/v2/models/custom_cost_list_response_meta.rb +90 -0
  83. data/lib/datadog_api_client/v2/models/custom_cost_upload_response_meta.rb +80 -0
  84. data/lib/datadog_api_client/v2/models/custom_costs_file_get_response.rb +90 -0
  85. data/lib/datadog_api_client/v2/models/custom_costs_file_line_item.rb +173 -0
  86. data/lib/datadog_api_client/v2/models/custom_costs_file_list_response.rb +92 -0
  87. data/lib/datadog_api_client/v2/models/custom_costs_file_metadata.rb +152 -0
  88. data/lib/datadog_api_client/v2/models/custom_costs_file_metadata_high_level.rb +100 -0
  89. data/lib/datadog_api_client/v2/models/custom_costs_file_metadata_with_content.rb +164 -0
  90. data/lib/datadog_api_client/v2/models/custom_costs_file_metadata_with_content_high_level.rb +100 -0
  91. data/lib/datadog_api_client/v2/models/custom_costs_file_upload_response.rb +90 -0
  92. data/lib/datadog_api_client/v2/models/custom_costs_file_usage_charge_period.rb +90 -0
  93. data/lib/datadog_api_client/v2/models/custom_costs_user.rb +100 -0
  94. data/lib/datadog_api_client/v2/models/device_attributes.rb +272 -0
  95. data/lib/datadog_api_client/v2/models/device_attributes_interface_statuses.rb +110 -0
  96. data/lib/datadog_api_client/v2/models/devices_list_data.rb +100 -0
  97. data/lib/datadog_api_client/v2/models/dora_deployment_request_attributes.rb +2 -2
  98. data/lib/datadog_api_client/v2/models/dora_incident_request_attributes.rb +2 -2
  99. data/lib/datadog_api_client/v2/models/full_application_key_attributes.rb +1 -1
  100. data/lib/datadog_api_client/v2/models/get_device_attributes.rb +262 -0
  101. data/lib/datadog_api_client/v2/models/get_device_data.rb +100 -0
  102. data/lib/datadog_api_client/v2/models/get_device_response.rb +80 -0
  103. data/lib/datadog_api_client/v2/models/get_interfaces_data.rb +100 -0
  104. data/lib/datadog_api_client/v2/models/get_interfaces_response.rb +82 -0
  105. data/lib/datadog_api_client/v2/models/hourly_usage_attributes.rb +21 -1
  106. data/lib/datadog_api_client/v2/models/interface_attributes.rb +130 -0
  107. data/lib/datadog_api_client/v2/models/interface_attributes_status.rb +29 -0
  108. data/lib/datadog_api_client/v2/models/list_devices_response.rb +92 -0
  109. data/lib/datadog_api_client/v2/models/list_devices_response_metadata.rb +80 -0
  110. data/lib/datadog_api_client/v2/models/list_devices_response_metadata_page.rb +80 -0
  111. data/lib/datadog_api_client/v2/models/list_tags_response.rb +80 -0
  112. data/lib/datadog_api_client/v2/models/list_tags_response_data.rb +100 -0
  113. data/lib/datadog_api_client/v2/models/list_tags_response_data_attributes.rb +82 -0
  114. data/lib/datadog_api_client/v2/models/projected_cost_attributes.rb +21 -1
  115. data/lib/datadog_api_client/v2/models/role_relationships.rb +4 -14
  116. data/lib/datadog_api_client/v2/models/role_update_attributes.rb +32 -4
  117. data/lib/datadog_api_client/v2/models/rum_application_attributes.rb +1 -1
  118. data/lib/datadog_api_client/v2/models/rum_application_create_attributes.rb +1 -1
  119. data/lib/datadog_api_client/v2/models/rum_application_list_attributes.rb +1 -1
  120. data/lib/datadog_api_client/v2/models/rum_application_update_attributes.rb +1 -1
  121. data/lib/datadog_api_client/v2/models/security_monitoring_rule_convert_payload.rb +63 -0
  122. data/lib/datadog_api_client/v2/models/security_monitoring_rule_convert_response.rb +80 -0
  123. data/lib/datadog_api_client/v2/models/security_monitoring_rule_detection_method.rb +1 -0
  124. data/lib/datadog_api_client/v2/models/security_monitoring_rule_evaluation_window.rb +1 -1
  125. data/lib/datadog_api_client/v2/models/security_monitoring_rule_keep_alive.rb +1 -1
  126. data/lib/datadog_api_client/v2/models/security_monitoring_rule_options.rb +2 -2
  127. data/lib/datadog_api_client/v2/models/update_rule_request.rb +80 -0
  128. data/lib/datadog_api_client/v2/models/update_rule_request_data.rb +90 -0
  129. data/lib/datadog_api_client/v2/models/update_rule_response.rb +80 -0
  130. data/lib/datadog_api_client/v2/models/update_rule_response_data.rb +110 -0
  131. data/lib/datadog_api_client/v2/models/user_attributes.rb +11 -1
  132. data/lib/datadog_api_client/v2/models/workflow_instance_create_meta.rb +80 -0
  133. data/lib/datadog_api_client/v2/models/workflow_instance_create_request.rb +80 -0
  134. data/lib/datadog_api_client/v2/models/workflow_instance_create_response.rb +80 -0
  135. data/lib/datadog_api_client/v2/models/workflow_instance_create_response_data.rb +80 -0
  136. data/lib/datadog_api_client/v2/models/workflow_instance_list_item.rb +80 -0
  137. data/lib/datadog_api_client/v2/models/workflow_list_instances_response.rb +92 -0
  138. data/lib/datadog_api_client/v2/models/workflow_list_instances_response_meta.rb +80 -0
  139. data/lib/datadog_api_client/v2/models/workflow_list_instances_response_meta_page.rb +80 -0
  140. data/lib/datadog_api_client/v2/models/worklflow_cancel_instance_response.rb +80 -0
  141. data/lib/datadog_api_client/v2/models/worklflow_cancel_instance_response_data.rb +80 -0
  142. data/lib/datadog_api_client/v2/models/worklflow_get_instance_response.rb +80 -0
  143. data/lib/datadog_api_client/v2/models/worklflow_get_instance_response_data.rb +80 -0
  144. data/lib/datadog_api_client/v2/models/worklflow_get_instance_response_data_attributes.rb +80 -0
  145. data/lib/datadog_api_client/version.rb +1 -1
  146. metadata +76 -2
@@ -0,0 +1,362 @@
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 'cgi'
17
+
18
+ module DatadogAPIClient::V2
19
+ class NetworkDeviceMonitoringAPI
20
+ attr_accessor :api_client
21
+
22
+ def initialize(api_client = DatadogAPIClient::APIClient.default)
23
+ @api_client = api_client
24
+ end
25
+
26
+ # Get the device details.
27
+ #
28
+ # @see #get_device_with_http_info
29
+ def get_device(device_id, opts = {})
30
+ data, _status_code, _headers = get_device_with_http_info(device_id, opts)
31
+ data
32
+ end
33
+
34
+ # Get the device details.
35
+ #
36
+ # Get the device details.
37
+ #
38
+ # @param device_id [String] The id of the device to fetch.
39
+ # @param opts [Hash] the optional parameters
40
+ # @return [Array<(GetDeviceResponse, Integer, Hash)>] GetDeviceResponse data, response status code and response headers
41
+ def get_device_with_http_info(device_id, opts = {})
42
+
43
+ if @api_client.config.debugging
44
+ @api_client.config.logger.debug 'Calling API: NetworkDeviceMonitoringAPI.get_device ...'
45
+ end
46
+ # verify the required parameter 'device_id' is set
47
+ if @api_client.config.client_side_validation && device_id.nil?
48
+ fail ArgumentError, "Missing the required parameter 'device_id' when calling NetworkDeviceMonitoringAPI.get_device"
49
+ end
50
+ # resource path
51
+ local_var_path = '/api/v2/ndm/devices/{device_id}'.sub('{device_id}', CGI.escape(device_id.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] || 'GetDeviceResponse'
69
+
70
+ # auth_names
71
+ auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth]
72
+
73
+ new_options = opts.merge(
74
+ :operation => :get_device,
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: NetworkDeviceMonitoringAPI#get_device\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
87
+ end
88
+ return data, status_code, headers
89
+ end
90
+
91
+ # Get the list of interfaces of the device.
92
+ #
93
+ # @see #get_interfaces_with_http_info
94
+ def get_interfaces(device_id, opts = {})
95
+ data, _status_code, _headers = get_interfaces_with_http_info(device_id, opts)
96
+ data
97
+ end
98
+
99
+ # Get the list of interfaces of the device.
100
+ #
101
+ # Get the list of interfaces of the device.
102
+ #
103
+ # @param device_id [String] The ID of the device to get interfaces from.
104
+ # @param opts [Hash] the optional parameters
105
+ # @return [Array<(GetInterfacesResponse, Integer, Hash)>] GetInterfacesResponse data, response status code and response headers
106
+ def get_interfaces_with_http_info(device_id, opts = {})
107
+
108
+ if @api_client.config.debugging
109
+ @api_client.config.logger.debug 'Calling API: NetworkDeviceMonitoringAPI.get_interfaces ...'
110
+ end
111
+ # verify the required parameter 'device_id' is set
112
+ if @api_client.config.client_side_validation && device_id.nil?
113
+ fail ArgumentError, "Missing the required parameter 'device_id' when calling NetworkDeviceMonitoringAPI.get_interfaces"
114
+ end
115
+ # resource path
116
+ local_var_path = '/api/v2/ndm/interfaces'
117
+
118
+ # query parameters
119
+ query_params = opts[:query_params] || {}
120
+ query_params[:'device_id'] = device_id
121
+
122
+ # header parameters
123
+ header_params = opts[:header_params] || {}
124
+ # HTTP header 'Accept' (if needed)
125
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
126
+
127
+ # form parameters
128
+ form_params = opts[:form_params] || {}
129
+
130
+ # http body (model)
131
+ post_body = opts[:debug_body]
132
+
133
+ # return_type
134
+ return_type = opts[:debug_return_type] || 'GetInterfacesResponse'
135
+
136
+ # auth_names
137
+ auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth]
138
+
139
+ new_options = opts.merge(
140
+ :operation => :get_interfaces,
141
+ :header_params => header_params,
142
+ :query_params => query_params,
143
+ :form_params => form_params,
144
+ :body => post_body,
145
+ :auth_names => auth_names,
146
+ :return_type => return_type,
147
+ :api_version => "V2"
148
+ )
149
+
150
+ data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options)
151
+ if @api_client.config.debugging
152
+ @api_client.config.logger.debug "API called: NetworkDeviceMonitoringAPI#get_interfaces\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
153
+ end
154
+ return data, status_code, headers
155
+ end
156
+
157
+ # Get the list of devices.
158
+ #
159
+ # @see #list_devices_with_http_info
160
+ def list_devices(opts = {})
161
+ data, _status_code, _headers = list_devices_with_http_info(opts)
162
+ data
163
+ end
164
+
165
+ # Get the list of devices.
166
+ #
167
+ # Get the list of devices.
168
+ #
169
+ # @param opts [Hash] the optional parameters
170
+ # @option opts [Integer] :page_number The page number to fetch.
171
+ # @option opts [Integer] :page_size The number of devices to return per page.
172
+ # @option opts [String] :sort The field to sort the devices by.
173
+ # @option opts [String] :filter_tag Filter devices by tag.
174
+ # @return [Array<(ListDevicesResponse, Integer, Hash)>] ListDevicesResponse data, response status code and response headers
175
+ def list_devices_with_http_info(opts = {})
176
+
177
+ if @api_client.config.debugging
178
+ @api_client.config.logger.debug 'Calling API: NetworkDeviceMonitoringAPI.list_devices ...'
179
+ end
180
+ # resource path
181
+ local_var_path = '/api/v2/ndm/devices'
182
+
183
+ # query parameters
184
+ query_params = opts[:query_params] || {}
185
+ query_params[:'page[number]'] = opts[:'page_number'] if !opts[:'page_number'].nil?
186
+ query_params[:'page[size]'] = opts[:'page_size'] if !opts[:'page_size'].nil?
187
+ query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?
188
+ query_params[:'filter[tag]'] = opts[:'filter_tag'] if !opts[:'filter_tag'].nil?
189
+
190
+ # header parameters
191
+ header_params = opts[:header_params] || {}
192
+ # HTTP header 'Accept' (if needed)
193
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
194
+
195
+ # form parameters
196
+ form_params = opts[:form_params] || {}
197
+
198
+ # http body (model)
199
+ post_body = opts[:debug_body]
200
+
201
+ # return_type
202
+ return_type = opts[:debug_return_type] || 'ListDevicesResponse'
203
+
204
+ # auth_names
205
+ auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth]
206
+
207
+ new_options = opts.merge(
208
+ :operation => :list_devices,
209
+ :header_params => header_params,
210
+ :query_params => query_params,
211
+ :form_params => form_params,
212
+ :body => post_body,
213
+ :auth_names => auth_names,
214
+ :return_type => return_type,
215
+ :api_version => "V2"
216
+ )
217
+
218
+ data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options)
219
+ if @api_client.config.debugging
220
+ @api_client.config.logger.debug "API called: NetworkDeviceMonitoringAPI#list_devices\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
221
+ end
222
+ return data, status_code, headers
223
+ end
224
+
225
+ # Get the list of tags for a device.
226
+ #
227
+ # @see #list_device_user_tags_with_http_info
228
+ def list_device_user_tags(device_id, opts = {})
229
+ data, _status_code, _headers = list_device_user_tags_with_http_info(device_id, opts)
230
+ data
231
+ end
232
+
233
+ # Get the list of tags for a device.
234
+ #
235
+ # Get the list of tags for a device.
236
+ #
237
+ # @param device_id [String] The id of the device to fetch tags for.
238
+ # @param opts [Hash] the optional parameters
239
+ # @return [Array<(ListTagsResponse, Integer, Hash)>] ListTagsResponse data, response status code and response headers
240
+ def list_device_user_tags_with_http_info(device_id, opts = {})
241
+
242
+ if @api_client.config.debugging
243
+ @api_client.config.logger.debug 'Calling API: NetworkDeviceMonitoringAPI.list_device_user_tags ...'
244
+ end
245
+ # verify the required parameter 'device_id' is set
246
+ if @api_client.config.client_side_validation && device_id.nil?
247
+ fail ArgumentError, "Missing the required parameter 'device_id' when calling NetworkDeviceMonitoringAPI.list_device_user_tags"
248
+ end
249
+ # resource path
250
+ local_var_path = '/api/v2/ndm/tags/devices/{device_id}'.sub('{device_id}', CGI.escape(device_id.to_s).gsub('%2F', '/'))
251
+
252
+ # query parameters
253
+ query_params = opts[:query_params] || {}
254
+
255
+ # header parameters
256
+ header_params = opts[:header_params] || {}
257
+ # HTTP header 'Accept' (if needed)
258
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
259
+
260
+ # form parameters
261
+ form_params = opts[:form_params] || {}
262
+
263
+ # http body (model)
264
+ post_body = opts[:debug_body]
265
+
266
+ # return_type
267
+ return_type = opts[:debug_return_type] || 'ListTagsResponse'
268
+
269
+ # auth_names
270
+ auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth]
271
+
272
+ new_options = opts.merge(
273
+ :operation => :list_device_user_tags,
274
+ :header_params => header_params,
275
+ :query_params => query_params,
276
+ :form_params => form_params,
277
+ :body => post_body,
278
+ :auth_names => auth_names,
279
+ :return_type => return_type,
280
+ :api_version => "V2"
281
+ )
282
+
283
+ data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options)
284
+ if @api_client.config.debugging
285
+ @api_client.config.logger.debug "API called: NetworkDeviceMonitoringAPI#list_device_user_tags\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
286
+ end
287
+ return data, status_code, headers
288
+ end
289
+
290
+ # Update the tags for a device.
291
+ #
292
+ # @see #update_device_user_tags_with_http_info
293
+ def update_device_user_tags(device_id, body, opts = {})
294
+ data, _status_code, _headers = update_device_user_tags_with_http_info(device_id, body, opts)
295
+ data
296
+ end
297
+
298
+ # Update the tags for a device.
299
+ #
300
+ # Update the tags for a device.
301
+ #
302
+ # @param device_id [String] The id of the device to update tags for.
303
+ # @param body [ListTagsResponse]
304
+ # @param opts [Hash] the optional parameters
305
+ # @return [Array<(ListTagsResponse, Integer, Hash)>] ListTagsResponse data, response status code and response headers
306
+ def update_device_user_tags_with_http_info(device_id, body, opts = {})
307
+
308
+ if @api_client.config.debugging
309
+ @api_client.config.logger.debug 'Calling API: NetworkDeviceMonitoringAPI.update_device_user_tags ...'
310
+ end
311
+ # verify the required parameter 'device_id' is set
312
+ if @api_client.config.client_side_validation && device_id.nil?
313
+ fail ArgumentError, "Missing the required parameter 'device_id' when calling NetworkDeviceMonitoringAPI.update_device_user_tags"
314
+ end
315
+ # verify the required parameter 'body' is set
316
+ if @api_client.config.client_side_validation && body.nil?
317
+ fail ArgumentError, "Missing the required parameter 'body' when calling NetworkDeviceMonitoringAPI.update_device_user_tags"
318
+ end
319
+ # resource path
320
+ local_var_path = '/api/v2/ndm/tags/devices/{device_id}'.sub('{device_id}', CGI.escape(device_id.to_s).gsub('%2F', '/'))
321
+
322
+ # query parameters
323
+ query_params = opts[:query_params] || {}
324
+
325
+ # header parameters
326
+ header_params = opts[:header_params] || {}
327
+ # HTTP header 'Accept' (if needed)
328
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
329
+ # HTTP header 'Content-Type'
330
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
331
+
332
+ # form parameters
333
+ form_params = opts[:form_params] || {}
334
+
335
+ # http body (model)
336
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(body)
337
+
338
+ # return_type
339
+ return_type = opts[:debug_return_type] || 'ListTagsResponse'
340
+
341
+ # auth_names
342
+ auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth]
343
+
344
+ new_options = opts.merge(
345
+ :operation => :update_device_user_tags,
346
+ :header_params => header_params,
347
+ :query_params => query_params,
348
+ :form_params => form_params,
349
+ :body => post_body,
350
+ :auth_names => auth_names,
351
+ :return_type => return_type,
352
+ :api_version => "V2"
353
+ )
354
+
355
+ data, status_code, headers = @api_client.call_api(Net::HTTP::Patch, local_var_path, new_options)
356
+ if @api_client.config.debugging
357
+ @api_client.config.logger.debug "API called: NetworkDeviceMonitoringAPI#update_device_user_tags\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
358
+ end
359
+ return data, status_code, headers
360
+ end
361
+ end
362
+ end
@@ -200,7 +200,7 @@ module DatadogAPIClient::V2
200
200
  return_type = opts[:debug_return_type] || 'OrgConfigGetResponse'
201
201
 
202
202
  # auth_names
203
- auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]
203
+ auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth]
204
204
 
205
205
  new_options = opts.merge(
206
206
  :operation => :update_org_config,
@@ -172,15 +172,23 @@ module DatadogAPIClient::V2
172
172
  # - Powerpacks: `powerpack`
173
173
  # - Security Rules: `security-rule`
174
174
  # - Service Level Objectives: `slo`
175
+ # - Synthetic Global Variables: `synthetic-global-variable`
176
+ # - Synthetic Tests: `synthetic-test`
177
+ # - Synthetic Private Locations: `synthetic-private-location`
178
+ # - Monitors: `monitor`
175
179
  #
176
180
  # #### Supported relations for resources
177
- # Resource Type | Supported Relations
178
- # -------------------------|--------------------------
179
- # Dashboards | `viewer`, `editor`
180
- # Notebooks | `viewer`, `editor`
181
- # Powerpacks | `viewer`, `editor`
182
- # Security Rules | `viewer`, `editor`
183
- # Service Level Objectives | `viewer`, `editor`
181
+ # Resource Type | Supported Relations
182
+ # ----------------------------|--------------------------
183
+ # Dashboards | `viewer`, `editor`
184
+ # Notebooks | `viewer`, `editor`
185
+ # Powerpacks | `viewer`, `editor`
186
+ # Security Rules | `viewer`, `editor`
187
+ # Service Level Objectives | `viewer`, `editor`
188
+ # Synthetic Global Variables | `viewer`, `editor`
189
+ # Synthetic Tests | `viewer`, `editor`
190
+ # Synthetic Private Locations | `viewer`, `editor`
191
+ # Monitors | `viewer`, `editor`
184
192
  #
185
193
  # @param resource_id [String] Identifier, formatted as `type:id`. Supported types: `connection`, `dashboard`, `notebook`, `security-rule`, `slo`.
186
194
  # @param body [RestrictionPolicyUpdateRequest] Restriction policy payload
@@ -23,6 +23,140 @@ module DatadogAPIClient::V2
23
23
  @api_client = api_client
24
24
  end
25
25
 
26
+ # Convert an existing rule from JSON to Terraform.
27
+ #
28
+ # @see #convert_existing_security_monitoring_rule_with_http_info
29
+ def convert_existing_security_monitoring_rule(rule_id, opts = {})
30
+ data, _status_code, _headers = convert_existing_security_monitoring_rule_with_http_info(rule_id, opts)
31
+ data
32
+ end
33
+
34
+ # Convert an existing rule from JSON to Terraform.
35
+ #
36
+ # Convert an existing rule from JSON to Terraform for datadog provider
37
+ # resource datadog_security_monitoring_rule.
38
+ #
39
+ # @param rule_id [String] The ID of the rule.
40
+ # @param opts [Hash] the optional parameters
41
+ # @return [Array<(SecurityMonitoringRuleConvertResponse, Integer, Hash)>] SecurityMonitoringRuleConvertResponse data, response status code and response headers
42
+ def convert_existing_security_monitoring_rule_with_http_info(rule_id, opts = {})
43
+
44
+ if @api_client.config.debugging
45
+ @api_client.config.logger.debug 'Calling API: SecurityMonitoringAPI.convert_existing_security_monitoring_rule ...'
46
+ end
47
+ # verify the required parameter 'rule_id' is set
48
+ if @api_client.config.client_side_validation && rule_id.nil?
49
+ fail ArgumentError, "Missing the required parameter 'rule_id' when calling SecurityMonitoringAPI.convert_existing_security_monitoring_rule"
50
+ end
51
+ # resource path
52
+ local_var_path = '/api/v2/security_monitoring/rules/{rule_id}/convert'.sub('{rule_id}', CGI.escape(rule_id.to_s).gsub('%2F', '/'))
53
+
54
+ # query parameters
55
+ query_params = opts[:query_params] || {}
56
+
57
+ # header parameters
58
+ header_params = opts[:header_params] || {}
59
+ # HTTP header 'Accept' (if needed)
60
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
61
+
62
+ # form parameters
63
+ form_params = opts[:form_params] || {}
64
+
65
+ # http body (model)
66
+ post_body = opts[:debug_body]
67
+
68
+ # return_type
69
+ return_type = opts[:debug_return_type] || 'SecurityMonitoringRuleConvertResponse'
70
+
71
+ # auth_names
72
+ auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]
73
+
74
+ new_options = opts.merge(
75
+ :operation => :convert_existing_security_monitoring_rule,
76
+ :header_params => header_params,
77
+ :query_params => query_params,
78
+ :form_params => form_params,
79
+ :body => post_body,
80
+ :auth_names => auth_names,
81
+ :return_type => return_type,
82
+ :api_version => "V2"
83
+ )
84
+
85
+ data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options)
86
+ if @api_client.config.debugging
87
+ @api_client.config.logger.debug "API called: SecurityMonitoringAPI#convert_existing_security_monitoring_rule\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
88
+ end
89
+ return data, status_code, headers
90
+ end
91
+
92
+ # Convert a rule from JSON to Terraform.
93
+ #
94
+ # @see #convert_security_monitoring_rule_from_json_to_terraform_with_http_info
95
+ def convert_security_monitoring_rule_from_json_to_terraform(body, opts = {})
96
+ data, _status_code, _headers = convert_security_monitoring_rule_from_json_to_terraform_with_http_info(body, opts)
97
+ data
98
+ end
99
+
100
+ # Convert a rule from JSON to Terraform.
101
+ #
102
+ # Convert a rule that doesn't (yet) exist from JSON to Terraform for datadog provider
103
+ # resource datadog_security_monitoring_rule.
104
+ #
105
+ # @param body [SecurityMonitoringRuleConvertPayload]
106
+ # @param opts [Hash] the optional parameters
107
+ # @return [Array<(SecurityMonitoringRuleConvertResponse, Integer, Hash)>] SecurityMonitoringRuleConvertResponse data, response status code and response headers
108
+ def convert_security_monitoring_rule_from_json_to_terraform_with_http_info(body, opts = {})
109
+
110
+ if @api_client.config.debugging
111
+ @api_client.config.logger.debug 'Calling API: SecurityMonitoringAPI.convert_security_monitoring_rule_from_json_to_terraform ...'
112
+ end
113
+ # verify the required parameter 'body' is set
114
+ if @api_client.config.client_side_validation && body.nil?
115
+ fail ArgumentError, "Missing the required parameter 'body' when calling SecurityMonitoringAPI.convert_security_monitoring_rule_from_json_to_terraform"
116
+ end
117
+ # resource path
118
+ local_var_path = '/api/v2/security_monitoring/rules/convert'
119
+
120
+ # query parameters
121
+ query_params = opts[:query_params] || {}
122
+
123
+ # header parameters
124
+ header_params = opts[:header_params] || {}
125
+ # HTTP header 'Accept' (if needed)
126
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
127
+ # HTTP header 'Content-Type'
128
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
129
+
130
+ # form parameters
131
+ form_params = opts[:form_params] || {}
132
+
133
+ # http body (model)
134
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(body)
135
+
136
+ # return_type
137
+ return_type = opts[:debug_return_type] || 'SecurityMonitoringRuleConvertResponse'
138
+
139
+ # auth_names
140
+ auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]
141
+
142
+ new_options = opts.merge(
143
+ :operation => :convert_security_monitoring_rule_from_json_to_terraform,
144
+ :header_params => header_params,
145
+ :query_params => query_params,
146
+ :form_params => form_params,
147
+ :body => post_body,
148
+ :auth_names => auth_names,
149
+ :return_type => return_type,
150
+ :api_version => "V2"
151
+ )
152
+
153
+ data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options)
154
+ if @api_client.config.debugging
155
+ @api_client.config.logger.debug "API called: SecurityMonitoringAPI#convert_security_monitoring_rule_from_json_to_terraform\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
156
+ end
157
+ return data, status_code, headers
158
+ end
159
+
26
160
  # Create a security filter.
27
161
  #
28
162
  # @see #create_security_filter_with_http_info
@@ -181,7 +181,7 @@ module DatadogAPIClient::V2
181
181
  #
182
182
  # Deletes a single rule.
183
183
  #
184
- # @param rule_id [String] The ID of the rule/scorecard.
184
+ # @param rule_id [String] The ID of the rule.
185
185
  # @param opts [Hash] the optional parameters
186
186
  # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
187
187
  def delete_scorecard_rule_with_http_info(rule_id, opts = {})
@@ -453,5 +453,83 @@ module DatadogAPIClient::V2
453
453
  @api_client.set_attribute_from_path(api_version, opts, "page_offset", Integer, @api_client.get_attribute_from_path(opts, "page_offset", 0) + page_size)
454
454
  end
455
455
  end
456
+
457
+ # Update an existing rule.
458
+ #
459
+ # @see #update_scorecard_rule_with_http_info
460
+ def update_scorecard_rule(rule_id, body, opts = {})
461
+ data, _status_code, _headers = update_scorecard_rule_with_http_info(rule_id, body, opts)
462
+ data
463
+ end
464
+
465
+ # Update an existing rule.
466
+ #
467
+ # Updates an existing rule.
468
+ #
469
+ # @param rule_id [String] The ID of the rule.
470
+ # @param body [UpdateRuleRequest] Rule attributes.
471
+ # @param opts [Hash] the optional parameters
472
+ # @return [Array<(UpdateRuleResponse, Integer, Hash)>] UpdateRuleResponse data, response status code and response headers
473
+ def update_scorecard_rule_with_http_info(rule_id, body, opts = {})
474
+ unstable_enabled = @api_client.config.unstable_operations["v2.update_scorecard_rule".to_sym]
475
+ if unstable_enabled
476
+ @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.update_scorecard_rule")
477
+ else
478
+ raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.update_scorecard_rule"))
479
+ end
480
+
481
+ if @api_client.config.debugging
482
+ @api_client.config.logger.debug 'Calling API: ServiceScorecardsAPI.update_scorecard_rule ...'
483
+ end
484
+ # verify the required parameter 'rule_id' is set
485
+ if @api_client.config.client_side_validation && rule_id.nil?
486
+ fail ArgumentError, "Missing the required parameter 'rule_id' when calling ServiceScorecardsAPI.update_scorecard_rule"
487
+ end
488
+ # verify the required parameter 'body' is set
489
+ if @api_client.config.client_side_validation && body.nil?
490
+ fail ArgumentError, "Missing the required parameter 'body' when calling ServiceScorecardsAPI.update_scorecard_rule"
491
+ end
492
+ # resource path
493
+ local_var_path = '/api/v2/scorecard/rules/{rule_id}'.sub('{rule_id}', CGI.escape(rule_id.to_s).gsub('%2F', '/'))
494
+
495
+ # query parameters
496
+ query_params = opts[:query_params] || {}
497
+
498
+ # header parameters
499
+ header_params = opts[:header_params] || {}
500
+ # HTTP header 'Accept' (if needed)
501
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
502
+ # HTTP header 'Content-Type'
503
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
504
+
505
+ # form parameters
506
+ form_params = opts[:form_params] || {}
507
+
508
+ # http body (model)
509
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(body)
510
+
511
+ # return_type
512
+ return_type = opts[:debug_return_type] || 'UpdateRuleResponse'
513
+
514
+ # auth_names
515
+ auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]
516
+
517
+ new_options = opts.merge(
518
+ :operation => :update_scorecard_rule,
519
+ :header_params => header_params,
520
+ :query_params => query_params,
521
+ :form_params => form_params,
522
+ :body => post_body,
523
+ :auth_names => auth_names,
524
+ :return_type => return_type,
525
+ :api_version => "V2"
526
+ )
527
+
528
+ data, status_code, headers = @api_client.call_api(Net::HTTP::Put, local_var_path, new_options)
529
+ if @api_client.config.debugging
530
+ @api_client.config.logger.debug "API called: ServiceScorecardsAPI#update_scorecard_rule\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
531
+ end
532
+ return data, status_code, headers
533
+ end
456
534
  end
457
535
  end