datadog_api_client 2.6.0 → 2.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (134) hide show
  1. checksums.yaml +4 -4
  2. data/.apigentools-info +4 -4
  3. data/.generator/schemas/v1/openapi.yaml +233 -14
  4. data/.generator/schemas/v2/openapi.yaml +1403 -151
  5. data/CHANGELOG.md +27 -0
  6. data/examples/v1/dashboards/CreateDashboard_1039800684.rb +37 -0
  7. data/examples/v1/dashboards/CreateDashboard_2432046716.rb +33 -0
  8. data/examples/v1/dashboards/CreateDashboard_2610827685.rb +38 -0
  9. data/examples/v1/dashboards/CreateDashboard_2843286292.rb +43 -0
  10. data/examples/v1/gcp-integration/CreateGCPIntegration.rb +1 -0
  11. data/examples/v1/gcp-integration/DeleteGCPIntegration.rb +1 -0
  12. data/examples/v1/gcp-integration/UpdateGCPIntegration.rb +1 -0
  13. data/examples/v1/monitors/ValidateExistingMonitor.rb +1 -0
  14. data/examples/v1/monitors/ValidateMonitor.rb +1 -0
  15. data/examples/v1/service-level-objectives/CreateSLO.rb +2 -2
  16. data/examples/v1/synthetics/CreateSyntheticsAPITest.rb +16 -0
  17. data/examples/v1/synthetics/CreateSyntheticsAPITest_1487281163.rb +1 -0
  18. data/examples/v1/synthetics/CreateSyntheticsBrowserTest_397420811.rb +74 -0
  19. data/examples/v1/synthetics/UpdateBrowserTest.rb +16 -0
  20. data/examples/v2/cloudflare-integration/CreateCloudflareAccount.rb +16 -0
  21. data/examples/v2/cloudflare-integration/DeleteCloudflareAccount.rb +5 -0
  22. data/examples/v2/cloudflare-integration/GetCloudflareAccount.rb +8 -0
  23. data/examples/v2/cloudflare-integration/ListCloudflareAccounts.rb +5 -0
  24. data/examples/v2/cloudflare-integration/UpdateCloudflareAccount.rb +18 -0
  25. data/examples/v2/fastly-integration/CreateFastlyAccount.rb +16 -0
  26. data/examples/v2/fastly-integration/CreateFastlyService.rb +18 -0
  27. data/examples/v2/fastly-integration/DeleteFastlyAccount.rb +5 -0
  28. data/examples/v2/fastly-integration/DeleteFastlyService.rb +5 -0
  29. data/examples/v2/fastly-integration/GetFastlyAccount.rb +8 -0
  30. data/examples/v2/fastly-integration/GetFastlyService.rb +5 -0
  31. data/examples/v2/fastly-integration/ListFastlyAccounts.rb +5 -0
  32. data/examples/v2/fastly-integration/ListFastlyServices.rb +5 -0
  33. data/examples/v2/fastly-integration/UpdateFastlyAccount.rb +17 -0
  34. data/examples/v2/fastly-integration/UpdateFastlyService.rb +18 -0
  35. data/examples/v2/metrics/QueryScalarData.rb +5 -6
  36. data/examples/v2/metrics/QueryScalarData_3112571352.rb +35 -0
  37. data/examples/v2/metrics/QueryTimeseriesData.rb +5 -6
  38. data/examples/v2/metrics/QueryTimeseriesData_301142940.rb +35 -0
  39. data/examples/v2/monitors/CreateMonitorConfigPolicy.rb +22 -0
  40. data/examples/v2/monitors/DeleteMonitorConfigPolicy.rb +8 -0
  41. data/examples/v2/monitors/GetMonitorConfigPolicy.rb +8 -0
  42. data/examples/v2/monitors/ListMonitorConfigPolicies.rb +5 -0
  43. data/examples/v2/monitors/UpdateMonitorConfigPolicy.rb +26 -0
  44. data/examples/v2/sensitive-data-scanner/CreateScanningRule.rb +6 -0
  45. data/examples/v2/{users → service-accounts}/CreateServiceAccount.rb +1 -1
  46. data/lib/datadog_api_client/inflector.rb +61 -0
  47. data/lib/datadog_api_client/v1/api/usage_metering_api.rb +3 -3
  48. data/lib/datadog_api_client/v1/models/gcp_account.rb +11 -1
  49. data/lib/datadog_api_client/v1/models/host_meta.rb +1 -1
  50. data/lib/datadog_api_client/v1/models/hourly_usage_attribution_usage_type.rb +1 -1
  51. data/lib/datadog_api_client/v1/models/list_stream_compute_aggregation.rb +40 -0
  52. data/lib/datadog_api_client/v1/models/list_stream_compute_items.rb +112 -0
  53. data/lib/datadog_api_client/v1/models/list_stream_group_by_items.rb +102 -0
  54. data/lib/datadog_api_client/v1/models/list_stream_query.rb +61 -1
  55. data/lib/datadog_api_client/v1/models/list_stream_source.rb +2 -0
  56. data/lib/datadog_api_client/v1/models/metrics_query_metadata.rb +3 -2
  57. data/lib/datadog_api_client/v1/models/monitor_options.rb +11 -1
  58. data/lib/datadog_api_client/v1/models/monitor_options_notification_presets.rb +29 -0
  59. data/lib/datadog_api_client/v1/models/monthly_usage_attribution_supported_metrics.rb +2 -2
  60. data/lib/datadog_api_client/v1/models/monthly_usage_attribution_values.rb +13 -13
  61. data/lib/datadog_api_client/v1/models/run_workflow_widget_definition.rb +187 -0
  62. data/lib/datadog_api_client/v1/models/run_workflow_widget_definition_type.rb +26 -0
  63. data/lib/datadog_api_client/v1/models/run_workflow_widget_input.rb +123 -0
  64. data/lib/datadog_api_client/v1/models/synthetics_config_variable.rb +1 -1
  65. data/lib/datadog_api_client/v1/models/synthetics_test_options.rb +21 -1
  66. data/lib/datadog_api_client/v1/models/synthetics_test_options_http_version.rb +28 -0
  67. data/lib/datadog_api_client/v1/models/synthetics_test_options_scheduling.rb +103 -0
  68. data/lib/datadog_api_client/v1/models/synthetics_test_options_scheduling_timeframe.rb +126 -0
  69. data/lib/datadog_api_client/v1/models/widget_definition.rb +1 -0
  70. data/lib/datadog_api_client/v2/api/cloudflare_integration_api.rb +355 -0
  71. data/lib/datadog_api_client/v2/api/fastly_integration_api.rb +709 -0
  72. data/lib/datadog_api_client/v2/api/metrics_api.rb +7 -6
  73. data/lib/datadog_api_client/v2/api/monitors_api.rb +355 -0
  74. data/lib/datadog_api_client/v2/api/service_accounts_api.rb +67 -0
  75. data/lib/datadog_api_client/v2/api/users_api.rb +0 -67
  76. data/lib/datadog_api_client/v2/models/cloudflare_account_create_request.rb +102 -0
  77. data/lib/datadog_api_client/v2/models/cloudflare_account_create_request_attributes.rb +133 -0
  78. data/lib/datadog_api_client/v2/models/cloudflare_account_create_request_data.rb +123 -0
  79. data/lib/datadog_api_client/v2/models/cloudflare_account_response.rb +91 -0
  80. data/lib/datadog_api_client/v2/models/cloudflare_account_response_attributes.rb +112 -0
  81. data/lib/datadog_api_client/v2/models/cloudflare_account_response_data.rb +144 -0
  82. data/lib/datadog_api_client/v2/models/cloudflare_account_type.rb +26 -0
  83. data/lib/datadog_api_client/v2/models/cloudflare_account_update_request.rb +102 -0
  84. data/lib/datadog_api_client/v2/models/cloudflare_account_update_request_attributes.rb +112 -0
  85. data/lib/datadog_api_client/v2/models/cloudflare_account_update_request_data.rb +101 -0
  86. data/lib/datadog_api_client/v2/models/cloudflare_accounts_response.rb +93 -0
  87. data/lib/datadog_api_client/v2/models/cost_by_org_attributes.rb +11 -1
  88. data/lib/datadog_api_client/v2/models/data_scalar_column.rb +123 -0
  89. data/lib/datadog_api_client/v2/models/fastly_accoun_response_attributes.rb +114 -0
  90. data/lib/datadog_api_client/v2/models/fastly_account_create_request.rb +102 -0
  91. data/lib/datadog_api_client/v2/models/fastly_account_create_request_attributes.rb +135 -0
  92. data/lib/datadog_api_client/v2/models/fastly_account_create_request_data.rb +123 -0
  93. data/lib/datadog_api_client/v2/models/fastly_account_response.rb +91 -0
  94. data/lib/datadog_api_client/v2/models/fastly_account_response_data.rb +144 -0
  95. data/lib/datadog_api_client/v2/models/fastly_account_type.rb +26 -0
  96. data/lib/datadog_api_client/v2/models/fastly_account_update_request.rb +102 -0
  97. data/lib/datadog_api_client/v2/models/fastly_account_update_request_attributes.rb +91 -0
  98. data/lib/datadog_api_client/v2/models/fastly_account_update_request_data.rb +101 -0
  99. data/lib/datadog_api_client/v2/models/fastly_accounts_response.rb +93 -0
  100. data/lib/datadog_api_client/v2/models/fastly_service.rb +114 -0
  101. data/lib/datadog_api_client/v2/models/fastly_service_attributes.rb +93 -0
  102. data/lib/datadog_api_client/v2/models/fastly_service_data.rb +133 -0
  103. data/lib/datadog_api_client/v2/models/fastly_service_request.rb +102 -0
  104. data/lib/datadog_api_client/v2/models/fastly_service_response.rb +91 -0
  105. data/lib/datadog_api_client/v2/models/fastly_service_type.rb +26 -0
  106. data/lib/datadog_api_client/v2/models/fastly_services_response.rb +93 -0
  107. data/lib/datadog_api_client/v2/models/group_scalar_column.rb +113 -0
  108. data/lib/datadog_api_client/v2/models/monitor_config_policy_attribute_create_request.rb +123 -0
  109. data/lib/datadog_api_client/v2/models/monitor_config_policy_attribute_edit_request.rb +123 -0
  110. data/lib/datadog_api_client/v2/models/monitor_config_policy_attribute_response.rb +101 -0
  111. data/lib/datadog_api_client/v2/models/monitor_config_policy_create_data.rb +123 -0
  112. data/lib/datadog_api_client/v2/models/monitor_config_policy_create_request.rb +102 -0
  113. data/lib/datadog_api_client/v2/models/monitor_config_policy_edit_data.rb +144 -0
  114. data/lib/datadog_api_client/v2/models/monitor_config_policy_edit_request.rb +102 -0
  115. data/lib/datadog_api_client/v2/models/monitor_config_policy_list_response.rb +93 -0
  116. data/lib/datadog_api_client/v2/models/monitor_config_policy_policy.rb +62 -0
  117. data/lib/datadog_api_client/v2/models/monitor_config_policy_policy_create_request.rb +62 -0
  118. data/lib/datadog_api_client/v2/models/monitor_config_policy_resource_type.rb +26 -0
  119. data/lib/datadog_api_client/v2/models/monitor_config_policy_response.rb +91 -0
  120. data/lib/datadog_api_client/v2/models/monitor_config_policy_response_data.rb +111 -0
  121. data/lib/datadog_api_client/v2/models/monitor_config_policy_tag_policy.rb +124 -0
  122. data/lib/datadog_api_client/v2/models/monitor_config_policy_tag_policy_create_request.rb +150 -0
  123. data/lib/datadog_api_client/v2/models/monitor_config_policy_type.rb +26 -0
  124. data/lib/datadog_api_client/v2/models/scalar_column.rb +35 -77
  125. data/lib/datadog_api_client/v2/models/scalar_formula_response_atrributes.rb +4 -16
  126. data/lib/datadog_api_client/v2/models/scalar_meta.rb +96 -0
  127. data/lib/datadog_api_client/v2/models/security_monitoring_rule_detection_method.rb +1 -0
  128. data/lib/datadog_api_client/v2/models/security_monitoring_rule_query_aggregation.rb +1 -0
  129. data/lib/datadog_api_client/v2/models/security_monitoring_signal_rule_response.rb +11 -1
  130. data/lib/datadog_api_client/v2/models/security_monitoring_standard_rule_response.rb +11 -1
  131. data/lib/datadog_api_client/v2/models/sensitive_data_scanner_rule_attributes.rb +22 -9
  132. data/lib/datadog_api_client/v2/models/timeseries_response_series.rb +4 -1
  133. data/lib/datadog_api_client/version.rb +1 -1
  134. metadata +91 -3
@@ -732,7 +732,7 @@ module DatadogAPIClient::V2
732
732
  return data, status_code, headers
733
733
  end
734
734
 
735
- # Scalar cross product query.
735
+ # Query scalar data across multiple products.
736
736
  #
737
737
  # @see #query_scalar_data_with_http_info
738
738
  def query_scalar_data(body, opts = {})
@@ -740,9 +740,10 @@ module DatadogAPIClient::V2
740
740
  data
741
741
  end
742
742
 
743
- # Scalar cross product query.
743
+ # Query scalar data across multiple products.
744
744
  #
745
- # The internal endpoint to query scalar/table data for multiple data sources and
745
+ # Query scalar values (as seen on Query Value, Table and Toplist widgets).
746
+ # Multiple data sources are supported with the ability to
746
747
  # process the data using formulas and functions.
747
748
  #
748
749
  # @param body [ScalarFormulaQueryRequest]
@@ -806,7 +807,7 @@ module DatadogAPIClient::V2
806
807
  return data, status_code, headers
807
808
  end
808
809
 
809
- # Timeseries cross product query.
810
+ # Query timeseries data across multiple products.
810
811
  #
811
812
  # @see #query_timeseries_data_with_http_info
812
813
  def query_timeseries_data(body, opts = {})
@@ -814,9 +815,9 @@ module DatadogAPIClient::V2
814
815
  data
815
816
  end
816
817
 
817
- # Timeseries cross product query.
818
+ # Query timeseries data across multiple products.
818
819
  #
819
- # The internal endpoint to query timeseries data for multiple data sources and
820
+ # Query timeseries data across various data sources and
820
821
  # process the data by applying formulas and functions.
821
822
  #
822
823
  # @param body [TimeseriesFormulaQueryRequest]
@@ -0,0 +1,355 @@
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 MonitorsAPI
20
+ attr_accessor :api_client
21
+
22
+ def initialize(api_client = DatadogAPIClient::APIClient.default)
23
+ @api_client = api_client
24
+ end
25
+
26
+ # Create a monitor configuration policy.
27
+ #
28
+ # @see #create_monitor_config_policy_with_http_info
29
+ def create_monitor_config_policy(body, opts = {})
30
+ data, _status_code, _headers = create_monitor_config_policy_with_http_info(body, opts)
31
+ data
32
+ end
33
+
34
+ # Create a monitor configuration policy.
35
+ #
36
+ # Create a monitor configuration policy.
37
+ #
38
+ # @param body [MonitorConfigPolicyCreateRequest] Create a monitor configuration policy request body.
39
+ # @param opts [Hash] the optional parameters
40
+ # @return [Array<(MonitorConfigPolicyResponse, Integer, Hash)>] MonitorConfigPolicyResponse data, response status code and response headers
41
+ def create_monitor_config_policy_with_http_info(body, opts = {})
42
+
43
+ if @api_client.config.debugging
44
+ @api_client.config.logger.debug 'Calling API: MonitorsAPI.create_monitor_config_policy ...'
45
+ end
46
+ # verify the required parameter 'body' is set
47
+ if @api_client.config.client_side_validation && body.nil?
48
+ fail ArgumentError, "Missing the required parameter 'body' when calling MonitorsAPI.create_monitor_config_policy"
49
+ end
50
+ # resource path
51
+ local_var_path = '/api/v2/monitor/policy'
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
+ # HTTP header 'Content-Type'
61
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
62
+
63
+ # form parameters
64
+ form_params = opts[:form_params] || {}
65
+
66
+ # http body (model)
67
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(body)
68
+
69
+ # return_type
70
+ return_type = opts[:debug_return_type] || 'MonitorConfigPolicyResponse'
71
+
72
+ # auth_names
73
+ auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]
74
+
75
+ new_options = opts.merge(
76
+ :operation => :create_monitor_config_policy,
77
+ :header_params => header_params,
78
+ :query_params => query_params,
79
+ :form_params => form_params,
80
+ :body => post_body,
81
+ :auth_names => auth_names,
82
+ :return_type => return_type,
83
+ :api_version => "V2"
84
+ )
85
+
86
+ data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options)
87
+ if @api_client.config.debugging
88
+ @api_client.config.logger.debug "API called: MonitorsAPI#create_monitor_config_policy\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
89
+ end
90
+ return data, status_code, headers
91
+ end
92
+
93
+ # Delete a monitor configuration policy.
94
+ #
95
+ # @see #delete_monitor_config_policy_with_http_info
96
+ def delete_monitor_config_policy(policy_id, opts = {})
97
+ delete_monitor_config_policy_with_http_info(policy_id, opts)
98
+ nil
99
+ end
100
+
101
+ # Delete a monitor configuration policy.
102
+ #
103
+ # Delete a monitor configuration policy.
104
+ #
105
+ # @param policy_id [String] ID of the monitor configuration policy.
106
+ # @param opts [Hash] the optional parameters
107
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
108
+ def delete_monitor_config_policy_with_http_info(policy_id, opts = {})
109
+
110
+ if @api_client.config.debugging
111
+ @api_client.config.logger.debug 'Calling API: MonitorsAPI.delete_monitor_config_policy ...'
112
+ end
113
+ # verify the required parameter 'policy_id' is set
114
+ if @api_client.config.client_side_validation && policy_id.nil?
115
+ fail ArgumentError, "Missing the required parameter 'policy_id' when calling MonitorsAPI.delete_monitor_config_policy"
116
+ end
117
+ # resource path
118
+ local_var_path = '/api/v2/monitor/policy/{policy_id}'.sub('{policy_id}', CGI.escape(policy_id.to_s).gsub('%2F', '/'))
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(['*/*'])
127
+
128
+ # form parameters
129
+ form_params = opts[:form_params] || {}
130
+
131
+ # http body (model)
132
+ post_body = opts[:debug_body]
133
+
134
+ # return_type
135
+ return_type = opts[:debug_return_type]
136
+
137
+ # auth_names
138
+ auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]
139
+
140
+ new_options = opts.merge(
141
+ :operation => :delete_monitor_config_policy,
142
+ :header_params => header_params,
143
+ :query_params => query_params,
144
+ :form_params => form_params,
145
+ :body => post_body,
146
+ :auth_names => auth_names,
147
+ :return_type => return_type,
148
+ :api_version => "V2"
149
+ )
150
+
151
+ data, status_code, headers = @api_client.call_api(Net::HTTP::Delete, local_var_path, new_options)
152
+ if @api_client.config.debugging
153
+ @api_client.config.logger.debug "API called: MonitorsAPI#delete_monitor_config_policy\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
154
+ end
155
+ return data, status_code, headers
156
+ end
157
+
158
+ # Get a monitor configuration policy.
159
+ #
160
+ # @see #get_monitor_config_policy_with_http_info
161
+ def get_monitor_config_policy(policy_id, opts = {})
162
+ data, _status_code, _headers = get_monitor_config_policy_with_http_info(policy_id, opts)
163
+ data
164
+ end
165
+
166
+ # Get a monitor configuration policy.
167
+ #
168
+ # Get a monitor configuration policy by `policy_id`.
169
+ #
170
+ # @param policy_id [String] ID of the monitor configuration policy.
171
+ # @param opts [Hash] the optional parameters
172
+ # @return [Array<(MonitorConfigPolicyResponse, Integer, Hash)>] MonitorConfigPolicyResponse data, response status code and response headers
173
+ def get_monitor_config_policy_with_http_info(policy_id, opts = {})
174
+
175
+ if @api_client.config.debugging
176
+ @api_client.config.logger.debug 'Calling API: MonitorsAPI.get_monitor_config_policy ...'
177
+ end
178
+ # verify the required parameter 'policy_id' is set
179
+ if @api_client.config.client_side_validation && policy_id.nil?
180
+ fail ArgumentError, "Missing the required parameter 'policy_id' when calling MonitorsAPI.get_monitor_config_policy"
181
+ end
182
+ # resource path
183
+ local_var_path = '/api/v2/monitor/policy/{policy_id}'.sub('{policy_id}', CGI.escape(policy_id.to_s).gsub('%2F', '/'))
184
+
185
+ # query parameters
186
+ query_params = opts[:query_params] || {}
187
+
188
+ # header parameters
189
+ header_params = opts[:header_params] || {}
190
+ # HTTP header 'Accept' (if needed)
191
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
192
+
193
+ # form parameters
194
+ form_params = opts[:form_params] || {}
195
+
196
+ # http body (model)
197
+ post_body = opts[:debug_body]
198
+
199
+ # return_type
200
+ return_type = opts[:debug_return_type] || 'MonitorConfigPolicyResponse'
201
+
202
+ # auth_names
203
+ auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]
204
+
205
+ new_options = opts.merge(
206
+ :operation => :get_monitor_config_policy,
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::Get, local_var_path, new_options)
217
+ if @api_client.config.debugging
218
+ @api_client.config.logger.debug "API called: MonitorsAPI#get_monitor_config_policy\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
219
+ end
220
+ return data, status_code, headers
221
+ end
222
+
223
+ # Get all monitor configuration policies.
224
+ #
225
+ # @see #list_monitor_config_policies_with_http_info
226
+ def list_monitor_config_policies(opts = {})
227
+ data, _status_code, _headers = list_monitor_config_policies_with_http_info(opts)
228
+ data
229
+ end
230
+
231
+ # Get all monitor configuration policies.
232
+ #
233
+ # Get all monitor configuration policies.
234
+ #
235
+ # @param opts [Hash] the optional parameters
236
+ # @return [Array<(MonitorConfigPolicyListResponse, Integer, Hash)>] MonitorConfigPolicyListResponse data, response status code and response headers
237
+ def list_monitor_config_policies_with_http_info(opts = {})
238
+
239
+ if @api_client.config.debugging
240
+ @api_client.config.logger.debug 'Calling API: MonitorsAPI.list_monitor_config_policies ...'
241
+ end
242
+ # resource path
243
+ local_var_path = '/api/v2/monitor/policy'
244
+
245
+ # query parameters
246
+ query_params = opts[:query_params] || {}
247
+
248
+ # header parameters
249
+ header_params = opts[:header_params] || {}
250
+ # HTTP header 'Accept' (if needed)
251
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
252
+
253
+ # form parameters
254
+ form_params = opts[:form_params] || {}
255
+
256
+ # http body (model)
257
+ post_body = opts[:debug_body]
258
+
259
+ # return_type
260
+ return_type = opts[:debug_return_type] || 'MonitorConfigPolicyListResponse'
261
+
262
+ # auth_names
263
+ auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]
264
+
265
+ new_options = opts.merge(
266
+ :operation => :list_monitor_config_policies,
267
+ :header_params => header_params,
268
+ :query_params => query_params,
269
+ :form_params => form_params,
270
+ :body => post_body,
271
+ :auth_names => auth_names,
272
+ :return_type => return_type,
273
+ :api_version => "V2"
274
+ )
275
+
276
+ data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options)
277
+ if @api_client.config.debugging
278
+ @api_client.config.logger.debug "API called: MonitorsAPI#list_monitor_config_policies\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
279
+ end
280
+ return data, status_code, headers
281
+ end
282
+
283
+ # Edit a monitor configuration policy.
284
+ #
285
+ # @see #update_monitor_config_policy_with_http_info
286
+ def update_monitor_config_policy(policy_id, body, opts = {})
287
+ data, _status_code, _headers = update_monitor_config_policy_with_http_info(policy_id, body, opts)
288
+ data
289
+ end
290
+
291
+ # Edit a monitor configuration policy.
292
+ #
293
+ # Edit a monitor configuration policy.
294
+ #
295
+ # @param policy_id [String] ID of the monitor configuration policy.
296
+ # @param body [MonitorConfigPolicyEditRequest] Description of the update.
297
+ # @param opts [Hash] the optional parameters
298
+ # @return [Array<(MonitorConfigPolicyResponse, Integer, Hash)>] MonitorConfigPolicyResponse data, response status code and response headers
299
+ def update_monitor_config_policy_with_http_info(policy_id, body, opts = {})
300
+
301
+ if @api_client.config.debugging
302
+ @api_client.config.logger.debug 'Calling API: MonitorsAPI.update_monitor_config_policy ...'
303
+ end
304
+ # verify the required parameter 'policy_id' is set
305
+ if @api_client.config.client_side_validation && policy_id.nil?
306
+ fail ArgumentError, "Missing the required parameter 'policy_id' when calling MonitorsAPI.update_monitor_config_policy"
307
+ end
308
+ # verify the required parameter 'body' is set
309
+ if @api_client.config.client_side_validation && body.nil?
310
+ fail ArgumentError, "Missing the required parameter 'body' when calling MonitorsAPI.update_monitor_config_policy"
311
+ end
312
+ # resource path
313
+ local_var_path = '/api/v2/monitor/policy/{policy_id}'.sub('{policy_id}', CGI.escape(policy_id.to_s).gsub('%2F', '/'))
314
+
315
+ # query parameters
316
+ query_params = opts[:query_params] || {}
317
+
318
+ # header parameters
319
+ header_params = opts[:header_params] || {}
320
+ # HTTP header 'Accept' (if needed)
321
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
322
+ # HTTP header 'Content-Type'
323
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
324
+
325
+ # form parameters
326
+ form_params = opts[:form_params] || {}
327
+
328
+ # http body (model)
329
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(body)
330
+
331
+ # return_type
332
+ return_type = opts[:debug_return_type] || 'MonitorConfigPolicyResponse'
333
+
334
+ # auth_names
335
+ auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]
336
+
337
+ new_options = opts.merge(
338
+ :operation => :update_monitor_config_policy,
339
+ :header_params => header_params,
340
+ :query_params => query_params,
341
+ :form_params => form_params,
342
+ :body => post_body,
343
+ :auth_names => auth_names,
344
+ :return_type => return_type,
345
+ :api_version => "V2"
346
+ )
347
+
348
+ data, status_code, headers = @api_client.call_api(Net::HTTP::Patch, local_var_path, new_options)
349
+ if @api_client.config.debugging
350
+ @api_client.config.logger.debug "API called: MonitorsAPI#update_monitor_config_policy\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
351
+ end
352
+ return data, status_code, headers
353
+ end
354
+ end
355
+ end
@@ -23,6 +23,73 @@ module DatadogAPIClient::V2
23
23
  @api_client = api_client
24
24
  end
25
25
 
26
+ # Create a service account.
27
+ #
28
+ # @see #create_service_account_with_http_info
29
+ def create_service_account(body, opts = {})
30
+ data, _status_code, _headers = create_service_account_with_http_info(body, opts)
31
+ data
32
+ end
33
+
34
+ # Create a service account.
35
+ #
36
+ # Create a service account for your organization.
37
+ #
38
+ # @param body [ServiceAccountCreateRequest]
39
+ # @param opts [Hash] the optional parameters
40
+ # @return [Array<(UserResponse, Integer, Hash)>] UserResponse data, response status code and response headers
41
+ def create_service_account_with_http_info(body, opts = {})
42
+
43
+ if @api_client.config.debugging
44
+ @api_client.config.logger.debug 'Calling API: ServiceAccountsAPI.create_service_account ...'
45
+ end
46
+ # verify the required parameter 'body' is set
47
+ if @api_client.config.client_side_validation && body.nil?
48
+ fail ArgumentError, "Missing the required parameter 'body' when calling ServiceAccountsAPI.create_service_account"
49
+ end
50
+ # resource path
51
+ local_var_path = '/api/v2/service_accounts'
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
+ # HTTP header 'Content-Type'
61
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
62
+
63
+ # form parameters
64
+ form_params = opts[:form_params] || {}
65
+
66
+ # http body (model)
67
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(body)
68
+
69
+ # return_type
70
+ return_type = opts[:debug_return_type] || 'UserResponse'
71
+
72
+ # auth_names
73
+ auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth]
74
+
75
+ new_options = opts.merge(
76
+ :operation => :create_service_account,
77
+ :header_params => header_params,
78
+ :query_params => query_params,
79
+ :form_params => form_params,
80
+ :body => post_body,
81
+ :auth_names => auth_names,
82
+ :return_type => return_type,
83
+ :api_version => "V2"
84
+ )
85
+
86
+ data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options)
87
+ if @api_client.config.debugging
88
+ @api_client.config.logger.debug "API called: ServiceAccountsAPI#create_service_account\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
89
+ end
90
+ return data, status_code, headers
91
+ end
92
+
26
93
  # Create an application key for this service account.
27
94
  #
28
95
  # @see #create_service_account_application_key_with_http_info
@@ -23,73 +23,6 @@ module DatadogAPIClient::V2
23
23
  @api_client = api_client
24
24
  end
25
25
 
26
- # Create a service account.
27
- #
28
- # @see #create_service_account_with_http_info
29
- def create_service_account(body, opts = {})
30
- data, _status_code, _headers = create_service_account_with_http_info(body, opts)
31
- data
32
- end
33
-
34
- # Create a service account.
35
- #
36
- # Create a service account for your organization.
37
- #
38
- # @param body [ServiceAccountCreateRequest]
39
- # @param opts [Hash] the optional parameters
40
- # @return [Array<(UserResponse, Integer, Hash)>] UserResponse data, response status code and response headers
41
- def create_service_account_with_http_info(body, opts = {})
42
-
43
- if @api_client.config.debugging
44
- @api_client.config.logger.debug 'Calling API: UsersAPI.create_service_account ...'
45
- end
46
- # verify the required parameter 'body' is set
47
- if @api_client.config.client_side_validation && body.nil?
48
- fail ArgumentError, "Missing the required parameter 'body' when calling UsersAPI.create_service_account"
49
- end
50
- # resource path
51
- local_var_path = '/api/v2/service_accounts'
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
- # HTTP header 'Content-Type'
61
- header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
62
-
63
- # form parameters
64
- form_params = opts[:form_params] || {}
65
-
66
- # http body (model)
67
- post_body = opts[:debug_body] || @api_client.object_to_http_body(body)
68
-
69
- # return_type
70
- return_type = opts[:debug_return_type] || 'UserResponse'
71
-
72
- # auth_names
73
- auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth]
74
-
75
- new_options = opts.merge(
76
- :operation => :create_service_account,
77
- :header_params => header_params,
78
- :query_params => query_params,
79
- :form_params => form_params,
80
- :body => post_body,
81
- :auth_names => auth_names,
82
- :return_type => return_type,
83
- :api_version => "V2"
84
- )
85
-
86
- data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options)
87
- if @api_client.config.debugging
88
- @api_client.config.logger.debug "API called: UsersAPI#create_service_account\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
89
- end
90
- return data, status_code, headers
91
- end
92
-
93
26
  # Create a user.
94
27
  #
95
28
  # @see #create_user_with_http_info
@@ -0,0 +1,102 @@
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
+ # Payload schema when adding a Cloudflare account.
21
+ class CloudflareAccountCreateRequest
22
+ include BaseGenericModel
23
+
24
+ # Whether the object has unparsed attributes
25
+ # @!visibility private
26
+ attr_accessor :_unparsed
27
+
28
+ # Data object for creating a Cloudflare account.
29
+ attr_reader :data
30
+
31
+ # Attribute mapping from ruby-style variable name to JSON key.
32
+ # @!visibility private
33
+ def self.attribute_map
34
+ {
35
+ :'data' => :'data'
36
+ }
37
+ end
38
+
39
+ # Attribute type mapping.
40
+ # @!visibility private
41
+ def self.openapi_types
42
+ {
43
+ :'data' => :'CloudflareAccountCreateRequestData'
44
+ }
45
+ end
46
+
47
+ # Initializes the object
48
+ # @param attributes [Hash] Model attributes in the form of hash
49
+ # @!visibility private
50
+ def initialize(attributes = {})
51
+ if (!attributes.is_a?(Hash))
52
+ fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::CloudflareAccountCreateRequest` initialize method"
53
+ end
54
+
55
+ # check to see if the attribute exists and convert string to symbol for hash key
56
+ attributes = attributes.each_with_object({}) { |(k, v), h|
57
+ if (!self.class.attribute_map.key?(k.to_sym))
58
+ fail ArgumentError, "`#{k}` is not a valid attribute in `DatadogAPIClient::V2::CloudflareAccountCreateRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
59
+ end
60
+ h[k.to_sym] = v
61
+ }
62
+
63
+ if attributes.key?(:'data')
64
+ self.data = attributes[:'data']
65
+ end
66
+ end
67
+
68
+ # Check to see if the all the properties in the model are valid
69
+ # @return true if the model is valid
70
+ # @!visibility private
71
+ def valid?
72
+ return false if @data.nil?
73
+ true
74
+ end
75
+
76
+ # Custom attribute writer method with validation
77
+ # @param data [Object] Object to be assigned
78
+ # @!visibility private
79
+ def data=(data)
80
+ if data.nil?
81
+ fail ArgumentError, 'invalid value for "data", data cannot be nil.'
82
+ end
83
+ @data = data
84
+ end
85
+
86
+ # Checks equality by comparing each attribute.
87
+ # @param o [Object] Object to be compared
88
+ # @!visibility private
89
+ def ==(o)
90
+ return true if self.equal?(o)
91
+ self.class == o.class &&
92
+ data == o.data
93
+ end
94
+
95
+ # Calculates hash code according to all attributes.
96
+ # @return [Integer] Hash code
97
+ # @!visibility private
98
+ def hash
99
+ [data].hash
100
+ end
101
+ end
102
+ end