datadog_api_client 2.12.0 → 2.13.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (165) hide show
  1. checksums.yaml +4 -4
  2. data/.apigentools-info +6 -6
  3. data/.generator/conftest.py +7 -0
  4. data/.generator/poetry.lock +45 -75
  5. data/.generator/pyproject.toml +7 -7
  6. data/.generator/schemas/v1/openapi.yaml +76 -3
  7. data/.generator/schemas/v2/openapi.yaml +2328 -459
  8. data/.generator/src/generator/formatter.py +9 -3
  9. data/.generator/src/generator/openapi.py +4 -2
  10. data/.github/workflows/test_integration.yml +7 -1
  11. data/.pre-commit-config.yaml +2 -2
  12. data/CHANGELOG.md +31 -0
  13. data/examples/v1/dashboards/CreateDashboard_1284514532.rb +43 -0
  14. data/examples/v1/dashboards/CreateDashboard_2261785072.rb +47 -0
  15. data/examples/v1/dashboards/CreateDashboard_3513586382.rb +74 -0
  16. data/examples/v1/dashboards/CreateDashboard_3562282606.rb +1 -0
  17. data/examples/v1/organizations/UpdateOrg.rb +1 -1
  18. data/examples/v1/users/CreateUser.rb +1 -1
  19. data/examples/v1/users/CreateUser_266604071.rb +13 -0
  20. data/examples/v1/users/UpdateUser.rb +1 -1
  21. data/examples/v2/confluent-cloud/CreateConfluentAccount.rb +1 -0
  22. data/examples/v2/confluent-cloud/CreateConfluentResource.rb +1 -0
  23. data/examples/v2/confluent-cloud/UpdateConfluentResource.rb +1 -0
  24. data/examples/v2/downtimes/CancelDowntime.rb +11 -0
  25. data/examples/v2/downtimes/CreateDowntime.rb +26 -0
  26. data/examples/v2/downtimes/GetDowntime.rb +11 -0
  27. data/examples/v2/downtimes/ListDowntimes.rb +8 -0
  28. data/examples/v2/downtimes/ListMonitorDowntimes.rb +8 -0
  29. data/examples/v2/downtimes/ListMonitorDowntimes_128979780.rb +8 -0
  30. data/examples/v2/downtimes/UpdateDowntime.rb +21 -0
  31. data/examples/v2/logs/ListLogsGet_2034110533.rb +3 -1
  32. data/examples/v2/security-monitoring/CreateSecurityMonitoringRule_1092490364.rb +10 -0
  33. data/examples/v2/spans/AggregateSpans.rb +25 -0
  34. data/examples/v2/spans/ListSpans.rb +25 -0
  35. data/examples/v2/spans/ListSpansGet.rb +5 -0
  36. data/examples/v2/spans/ListSpansGet_1130763422.rb +8 -0
  37. data/examples/v2/spans/ListSpans_3495563906.rb +25 -0
  38. data/lib/datadog_api_client/configuration.rb +6 -0
  39. data/lib/datadog_api_client/inflector.rb +87 -0
  40. data/lib/datadog_api_client/v1/models/change_widget_request.rb +1 -1
  41. data/lib/datadog_api_client/v1/models/formula_and_function_cloud_cost_data_source.rb +26 -0
  42. data/lib/datadog_api_client/v1/models/formula_and_function_cloud_cost_query_definition.rb +150 -0
  43. data/lib/datadog_api_client/v1/models/formula_and_function_query_definition.rb +2 -1
  44. data/lib/datadog_api_client/v1/models/formula_and_function_response_format.rb +2 -1
  45. data/lib/datadog_api_client/v1/models/formula_and_function_slo_query_definition.rb +11 -1
  46. data/lib/datadog_api_client/v1/models/geomap_widget_request.rb +24 -2
  47. data/lib/datadog_api_client/v1/models/ip_prefixes_remote_configuration.rb +94 -0
  48. data/lib/datadog_api_client/v1/models/ip_ranges.rb +11 -1
  49. data/lib/datadog_api_client/v1/models/organization_settings.rb +8 -0
  50. data/lib/datadog_api_client/v1/models/query_value_widget_request.rb +1 -1
  51. data/lib/datadog_api_client/v1/models/scatterplot_table_request.rb +1 -1
  52. data/lib/datadog_api_client/v1/models/sunburst_widget_request.rb +1 -1
  53. data/lib/datadog_api_client/v1/models/table_widget_request.rb +1 -1
  54. data/lib/datadog_api_client/v1/models/timeseries_widget_request.rb +1 -1
  55. data/lib/datadog_api_client/v1/models/toplist_widget_request.rb +1 -1
  56. data/lib/datadog_api_client/v1/models/tree_map_widget_request.rb +1 -1
  57. data/lib/datadog_api_client/v1/models/user.rb +8 -0
  58. data/lib/datadog_api_client/v1/models/widget_display_type.rb +1 -0
  59. data/lib/datadog_api_client/v2/api/ci_visibility_pipelines_api.rb +2 -0
  60. data/lib/datadog_api_client/v2/api/downtimes_api.rb +462 -0
  61. data/lib/datadog_api_client/v2/api/logs_api.rb +2 -2
  62. data/lib/datadog_api_client/v2/api/metrics_api.rb +1 -1
  63. data/lib/datadog_api_client/v2/api/rum_api.rb +2 -2
  64. data/lib/datadog_api_client/v2/api/spans_api.rb +294 -0
  65. data/lib/datadog_api_client/v2/models/ci_app_pipeline_event_pipeline.rb +1 -1
  66. data/lib/datadog_api_client/v2/models/cloud_configuration_rule_create_payload.rb +13 -1
  67. data/lib/datadog_api_client/v2/models/cloud_workload_security_agent_rule_attributes.rb +41 -1
  68. data/lib/datadog_api_client/v2/models/confluent_account_resource_attributes.rb +11 -1
  69. data/lib/datadog_api_client/v2/models/confluent_resource_request_attributes.rb +11 -1
  70. data/lib/datadog_api_client/v2/models/confluent_resource_response_attributes.rb +21 -1
  71. data/lib/datadog_api_client/v2/models/dashboard_list_item.rb +12 -1
  72. data/lib/datadog_api_client/v2/models/downtime_create_request.rb +98 -0
  73. data/lib/datadog_api_client/v2/models/downtime_create_request_attributes.rb +194 -0
  74. data/lib/datadog_api_client/v2/models/downtime_create_request_data.rb +119 -0
  75. data/lib/datadog_api_client/v2/models/downtime_included_monitor_type.rb +26 -0
  76. data/lib/datadog_api_client/v2/models/downtime_meta.rb +80 -0
  77. data/lib/datadog_api_client/v2/models/downtime_meta_page.rb +80 -0
  78. data/lib/datadog_api_client/v2/models/downtime_monitor_identifier.rb +63 -0
  79. data/lib/datadog_api_client/v2/models/downtime_monitor_identifier_id.rb +98 -0
  80. data/lib/datadog_api_client/v2/models/downtime_monitor_identifier_tags.rb +107 -0
  81. data/lib/datadog_api_client/v2/models/downtime_monitor_included_attributes.rb +80 -0
  82. data/lib/datadog_api_client/v2/models/downtime_monitor_included_item.rb +100 -0
  83. data/lib/datadog_api_client/v2/models/downtime_notify_end_state_actions.rb +27 -0
  84. data/lib/datadog_api_client/v2/models/downtime_notify_end_state_types.rb +28 -0
  85. data/lib/datadog_api_client/v2/models/downtime_relationships.rb +90 -0
  86. data/lib/datadog_api_client/v2/models/downtime_relationships_created_by.rb +88 -0
  87. data/lib/datadog_api_client/v2/models/downtime_relationships_created_by_data.rb +90 -0
  88. data/lib/datadog_api_client/v2/models/downtime_relationships_monitor.rb +88 -0
  89. data/lib/datadog_api_client/v2/models/downtime_relationships_monitor_data.rb +90 -0
  90. data/lib/datadog_api_client/v2/models/downtime_resource_type.rb +26 -0
  91. data/lib/datadog_api_client/v2/models/downtime_response.rb +95 -0
  92. data/lib/datadog_api_client/v2/models/downtime_response_attributes.rb +208 -0
  93. data/lib/datadog_api_client/v2/models/downtime_response_data.rb +110 -0
  94. data/lib/datadog_api_client/v2/models/downtime_response_included_item.rb +63 -0
  95. data/lib/datadog_api_client/v2/models/downtime_schedule_create_request.rb +63 -0
  96. data/lib/datadog_api_client/v2/models/downtime_schedule_current_downtime_response.rb +100 -0
  97. data/lib/datadog_api_client/v2/models/downtime_schedule_one_time_create_update_request.rb +101 -0
  98. data/lib/datadog_api_client/v2/models/downtime_schedule_one_time_response.rb +98 -0
  99. data/lib/datadog_api_client/v2/models/downtime_schedule_recurrence_create_update_request.rb +143 -0
  100. data/lib/datadog_api_client/v2/models/downtime_schedule_recurrence_response.rb +106 -0
  101. data/lib/datadog_api_client/v2/models/downtime_schedule_recurrences_create_request.rb +110 -0
  102. data/lib/datadog_api_client/v2/models/downtime_schedule_recurrences_response.rb +131 -0
  103. data/lib/datadog_api_client/v2/models/downtime_schedule_recurrences_update_request.rb +92 -0
  104. data/lib/datadog_api_client/v2/models/downtime_schedule_response.rb +65 -0
  105. data/lib/datadog_api_client/v2/models/downtime_schedule_update_request.rb +63 -0
  106. data/lib/datadog_api_client/v2/models/downtime_status.rb +29 -0
  107. data/lib/datadog_api_client/v2/models/downtime_update_request.rb +98 -0
  108. data/lib/datadog_api_client/v2/models/downtime_update_request_attributes.rb +165 -0
  109. data/lib/datadog_api_client/v2/models/downtime_update_request_data.rb +140 -0
  110. data/lib/datadog_api_client/v2/models/event_response_attributes.rb +11 -1
  111. data/lib/datadog_api_client/v2/models/events_group_by_sort.rb +1 -1
  112. data/lib/datadog_api_client/v2/models/events_response_metadata.rb +11 -1
  113. data/lib/datadog_api_client/v2/models/list_downtimes_response.rb +104 -0
  114. data/lib/datadog_api_client/v2/models/metrics_aggregator.rb +1 -1
  115. data/lib/datadog_api_client/v2/models/metrics_scalar_query.rb +1 -1
  116. data/lib/datadog_api_client/v2/models/monitor_downtime_match_resource_type.rb +26 -0
  117. data/lib/datadog_api_client/v2/models/monitor_downtime_match_response.rb +92 -0
  118. data/lib/datadog_api_client/v2/models/monitor_downtime_match_response_attributes.rb +120 -0
  119. data/lib/datadog_api_client/v2/models/monitor_downtime_match_response_data.rb +108 -0
  120. data/lib/datadog_api_client/v2/models/restriction_policy_binding.rb +2 -1
  121. data/lib/datadog_api_client/v2/models/rum_application_list.rb +11 -1
  122. data/lib/datadog_api_client/v2/models/service_definition_data.rb +11 -1
  123. data/lib/datadog_api_client/v2/models/service_definition_meta.rb +36 -4
  124. data/lib/datadog_api_client/v2/models/service_definition_meta_warnings.rb +100 -0
  125. data/lib/datadog_api_client/v2/models/span.rb +100 -0
  126. data/lib/datadog_api_client/v2/models/spans_aggregate_bucket.rb +100 -0
  127. data/lib/datadog_api_client/v2/models/spans_aggregate_bucket_attributes.rb +100 -0
  128. data/lib/datadog_api_client/v2/models/spans_aggregate_bucket_type.rb +26 -0
  129. data/lib/datadog_api_client/v2/models/spans_aggregate_bucket_value.rb +64 -0
  130. data/lib/datadog_api_client/v2/models/spans_aggregate_bucket_value_timeseries_point.rb +90 -0
  131. data/lib/datadog_api_client/v2/models/spans_aggregate_data.rb +90 -0
  132. data/lib/datadog_api_client/v2/models/spans_aggregate_request.rb +80 -0
  133. data/lib/datadog_api_client/v2/models/spans_aggregate_request_attributes.rb +115 -0
  134. data/lib/datadog_api_client/v2/models/spans_aggregate_request_type.rb +26 -0
  135. data/lib/datadog_api_client/v2/models/spans_aggregate_response.rb +92 -0
  136. data/lib/datadog_api_client/v2/models/spans_aggregate_response_metadata.rb +113 -0
  137. data/lib/datadog_api_client/v2/models/spans_aggregate_response_status.rb +27 -0
  138. data/lib/datadog_api_client/v2/models/spans_aggregate_sort.rb +110 -0
  139. data/lib/datadog_api_client/v2/models/spans_aggregate_sort_type.rb +27 -0
  140. data/lib/datadog_api_client/v2/models/spans_aggregation_function.rb +37 -0
  141. data/lib/datadog_api_client/v2/models/spans_attributes.rb +244 -0
  142. data/lib/datadog_api_client/v2/models/spans_compute.rb +129 -0
  143. data/lib/datadog_api_client/v2/models/spans_compute_type.rb +27 -0
  144. data/lib/datadog_api_client/v2/models/spans_group_by.rb +149 -0
  145. data/lib/datadog_api_client/v2/models/spans_group_by_histogram.rb +143 -0
  146. data/lib/datadog_api_client/v2/models/spans_group_by_missing.rb +63 -0
  147. data/lib/datadog_api_client/v2/models/spans_group_by_total.rb +64 -0
  148. data/lib/datadog_api_client/v2/models/spans_list_request.rb +80 -0
  149. data/lib/datadog_api_client/v2/models/spans_list_request_attributes.rb +111 -0
  150. data/lib/datadog_api_client/v2/models/spans_list_request_data.rb +90 -0
  151. data/lib/datadog_api_client/v2/models/spans_list_request_page.rb +108 -0
  152. data/lib/datadog_api_client/v2/models/spans_list_request_type.rb +26 -0
  153. data/lib/datadog_api_client/v2/models/spans_list_response.rb +102 -0
  154. data/lib/datadog_api_client/v2/models/spans_list_response_links.rb +81 -0
  155. data/lib/datadog_api_client/v2/models/spans_list_response_metadata.rb +123 -0
  156. data/lib/datadog_api_client/v2/models/spans_query_filter.rb +100 -0
  157. data/lib/datadog_api_client/v2/models/spans_query_options.rb +91 -0
  158. data/lib/datadog_api_client/v2/models/spans_response_metadata_page.rb +81 -0
  159. data/lib/datadog_api_client/v2/models/spans_sort.rb +27 -0
  160. data/lib/datadog_api_client/v2/models/spans_sort_order.rb +27 -0
  161. data/lib/datadog_api_client/v2/models/spans_type.rb +26 -0
  162. data/lib/datadog_api_client/v2/models/spans_warning.rb +100 -0
  163. data/lib/datadog_api_client/v2/models/user_invitation_response_data.rb +11 -1
  164. data/lib/datadog_api_client/version.rb +1 -1
  165. metadata +105 -2
@@ -0,0 +1,294 @@
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 SpansAPI
20
+ attr_accessor :api_client
21
+
22
+ def initialize(api_client = DatadogAPIClient::APIClient.default)
23
+ @api_client = api_client
24
+ end
25
+
26
+ # Aggregate spans.
27
+ #
28
+ # @see #aggregate_spans_with_http_info
29
+ def aggregate_spans(body, opts = {})
30
+ data, _status_code, _headers = aggregate_spans_with_http_info(body, opts)
31
+ data
32
+ end
33
+
34
+ # Aggregate spans.
35
+ #
36
+ # The API endpoint to aggregate spans into buckets and compute metrics and timeseries.
37
+ # This endpoint is rate limited to `300` requests per hour.
38
+ #
39
+ # @param body [SpansAggregateRequest]
40
+ # @param opts [Hash] the optional parameters
41
+ # @return [Array<(SpansAggregateResponse, Integer, Hash)>] SpansAggregateResponse data, response status code and response headers
42
+ def aggregate_spans_with_http_info(body, opts = {})
43
+
44
+ if @api_client.config.debugging
45
+ @api_client.config.logger.debug 'Calling API: SpansAPI.aggregate_spans ...'
46
+ end
47
+ # verify the required parameter 'body' is set
48
+ if @api_client.config.client_side_validation && body.nil?
49
+ fail ArgumentError, "Missing the required parameter 'body' when calling SpansAPI.aggregate_spans"
50
+ end
51
+ # resource path
52
+ local_var_path = '/api/v2/spans/analytics/aggregate'
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
+ # HTTP header 'Content-Type'
62
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
63
+
64
+ # form parameters
65
+ form_params = opts[:form_params] || {}
66
+
67
+ # http body (model)
68
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(body)
69
+
70
+ # return_type
71
+ return_type = opts[:debug_return_type] || 'SpansAggregateResponse'
72
+
73
+ # auth_names
74
+ auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth]
75
+
76
+ new_options = opts.merge(
77
+ :operation => :aggregate_spans,
78
+ :header_params => header_params,
79
+ :query_params => query_params,
80
+ :form_params => form_params,
81
+ :body => post_body,
82
+ :auth_names => auth_names,
83
+ :return_type => return_type,
84
+ :api_version => "V2"
85
+ )
86
+
87
+ data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options)
88
+ if @api_client.config.debugging
89
+ @api_client.config.logger.debug "API called: SpansAPI#aggregate_spans\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
90
+ end
91
+ return data, status_code, headers
92
+ end
93
+
94
+ # Search spans.
95
+ #
96
+ # @see #list_spans_with_http_info
97
+ def list_spans(body, opts = {})
98
+ data, _status_code, _headers = list_spans_with_http_info(body, opts)
99
+ data
100
+ end
101
+
102
+ # Search spans.
103
+ #
104
+ # List endpoint returns spans that match a span search query.
105
+ # [Results are paginated][1].
106
+ #
107
+ # Use this endpoint to build complex spans filtering and search.
108
+ # This endpoint is rate limited to `300` requests per hour.
109
+ #
110
+ # [1]: /logs/guide/collect-multiple-logs-with-pagination?tab=v2api
111
+ #
112
+ # @param body [SpansListRequest]
113
+ # @param opts [Hash] the optional parameters
114
+ # @return [Array<(SpansListResponse, Integer, Hash)>] SpansListResponse data, response status code and response headers
115
+ def list_spans_with_http_info(body, opts = {})
116
+
117
+ if @api_client.config.debugging
118
+ @api_client.config.logger.debug 'Calling API: SpansAPI.list_spans ...'
119
+ end
120
+ # verify the required parameter 'body' is set
121
+ if @api_client.config.client_side_validation && body.nil?
122
+ fail ArgumentError, "Missing the required parameter 'body' when calling SpansAPI.list_spans"
123
+ end
124
+ # resource path
125
+ local_var_path = '/api/v2/spans/events/search'
126
+
127
+ # query parameters
128
+ query_params = opts[:query_params] || {}
129
+
130
+ # header parameters
131
+ header_params = opts[:header_params] || {}
132
+ # HTTP header 'Accept' (if needed)
133
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
134
+ # HTTP header 'Content-Type'
135
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
136
+
137
+ # form parameters
138
+ form_params = opts[:form_params] || {}
139
+
140
+ # http body (model)
141
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(body)
142
+
143
+ # return_type
144
+ return_type = opts[:debug_return_type] || 'SpansListResponse'
145
+
146
+ # auth_names
147
+ auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth]
148
+
149
+ new_options = opts.merge(
150
+ :operation => :list_spans,
151
+ :header_params => header_params,
152
+ :query_params => query_params,
153
+ :form_params => form_params,
154
+ :body => post_body,
155
+ :auth_names => auth_names,
156
+ :return_type => return_type,
157
+ :api_version => "V2"
158
+ )
159
+
160
+ data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options)
161
+ if @api_client.config.debugging
162
+ @api_client.config.logger.debug "API called: SpansAPI#list_spans\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
163
+ end
164
+ return data, status_code, headers
165
+ end
166
+
167
+ # Search spans.
168
+ #
169
+ # Provide a paginated version of {#list_spans}, returning all items.
170
+ #
171
+ # To use it you need to use a block: list_spans_with_pagination { |item| p item }
172
+ #
173
+ # @yield [Span] Paginated items
174
+ def list_spans_with_pagination(body, opts = {})
175
+ api_version = "V2"
176
+ page_size = @api_client.get_attribute_from_path(body, "data.attributes.page.limit", 10)
177
+ @api_client.set_attribute_from_path(api_version, body, "data.attributes.page.limit", SpansListRequestData, page_size)
178
+ while true do
179
+ response = list_spans(body, opts)
180
+ @api_client.get_attribute_from_path(response, "data").each { |item| yield(item) }
181
+ if @api_client.get_attribute_from_path(response, "data").length < page_size
182
+ break
183
+ end
184
+ @api_client.set_attribute_from_path(api_version, body, "data.attributes.page.cursor", SpansListRequestData, @api_client.get_attribute_from_path(response, "meta.page.after"))
185
+ end
186
+ end
187
+
188
+ # Get a list of spans.
189
+ #
190
+ # @see #list_spans_get_with_http_info
191
+ def list_spans_get(opts = {})
192
+ data, _status_code, _headers = list_spans_get_with_http_info(opts)
193
+ data
194
+ end
195
+
196
+ # Get a list of spans.
197
+ #
198
+ # List endpoint returns spans that match a span search query.
199
+ # [Results are paginated][1].
200
+ #
201
+ # Use this endpoint to see your latest spans.
202
+ # This endpoint is rate limited to `300` requests per hour.
203
+ #
204
+ # [1]: /logs/guide/collect-multiple-logs-with-pagination?tab=v2api
205
+ #
206
+ # @param opts [Hash] the optional parameters
207
+ # @option opts [String] :filter_query Search query following spans syntax.
208
+ # @option opts [String] :filter_from Minimum timestamp for requested spans. Supports date-time ISO8601, date math, and regular timestamps (milliseconds).
209
+ # @option opts [String] :filter_to Maximum timestamp for requested spans. Supports date-time ISO8601, date math, and regular timestamps (milliseconds).
210
+ # @option opts [SpansSort] :sort Order of spans in results.
211
+ # @option opts [String] :page_cursor List following results with a cursor provided in the previous query.
212
+ # @option opts [Integer] :page_limit Maximum number of spans in the response.
213
+ # @return [Array<(SpansListResponse, Integer, Hash)>] SpansListResponse data, response status code and response headers
214
+ def list_spans_get_with_http_info(opts = {})
215
+
216
+ if @api_client.config.debugging
217
+ @api_client.config.logger.debug 'Calling API: SpansAPI.list_spans_get ...'
218
+ end
219
+ allowable_values = ['timestamp', '-timestamp']
220
+ if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort'])
221
+ fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}"
222
+ end
223
+ if @api_client.config.client_side_validation && !opts[:'page_limit'].nil? && opts[:'page_limit'] > 1000
224
+ fail ArgumentError, 'invalid value for "opts[:"page_limit"]" when calling SpansAPI.list_spans_get, must be smaller than or equal to 1000.'
225
+ end
226
+ # resource path
227
+ local_var_path = '/api/v2/spans/events'
228
+
229
+ # query parameters
230
+ query_params = opts[:query_params] || {}
231
+ query_params[:'filter[query]'] = opts[:'filter_query'] if !opts[:'filter_query'].nil?
232
+ query_params[:'filter[from]'] = opts[:'filter_from'] if !opts[:'filter_from'].nil?
233
+ query_params[:'filter[to]'] = opts[:'filter_to'] if !opts[:'filter_to'].nil?
234
+ query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?
235
+ query_params[:'page[cursor]'] = opts[:'page_cursor'] if !opts[:'page_cursor'].nil?
236
+ query_params[:'page[limit]'] = opts[:'page_limit'] if !opts[:'page_limit'].nil?
237
+
238
+ # header parameters
239
+ header_params = opts[:header_params] || {}
240
+ # HTTP header 'Accept' (if needed)
241
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
242
+
243
+ # form parameters
244
+ form_params = opts[:form_params] || {}
245
+
246
+ # http body (model)
247
+ post_body = opts[:debug_body]
248
+
249
+ # return_type
250
+ return_type = opts[:debug_return_type] || 'SpansListResponse'
251
+
252
+ # auth_names
253
+ auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth]
254
+
255
+ new_options = opts.merge(
256
+ :operation => :list_spans_get,
257
+ :header_params => header_params,
258
+ :query_params => query_params,
259
+ :form_params => form_params,
260
+ :body => post_body,
261
+ :auth_names => auth_names,
262
+ :return_type => return_type,
263
+ :api_version => "V2"
264
+ )
265
+
266
+ data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options)
267
+ if @api_client.config.debugging
268
+ @api_client.config.logger.debug "API called: SpansAPI#list_spans_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
269
+ end
270
+ return data, status_code, headers
271
+ end
272
+
273
+ # Get a list of spans.
274
+ #
275
+ # Provide a paginated version of {#list_spans_get}, returning all items.
276
+ #
277
+ # To use it you need to use a block: list_spans_get_with_pagination { |item| p item }
278
+ #
279
+ # @yield [Span] Paginated items
280
+ def list_spans_get_with_pagination(opts = {})
281
+ api_version = "V2"
282
+ page_size = @api_client.get_attribute_from_path(opts, "page_limit", 10)
283
+ @api_client.set_attribute_from_path(api_version, opts, "page_limit", Integer, page_size)
284
+ while true do
285
+ response = list_spans_get(opts)
286
+ @api_client.get_attribute_from_path(response, "data").each { |item| yield(item) }
287
+ if @api_client.get_attribute_from_path(response, "data").length < page_size
288
+ break
289
+ end
290
+ @api_client.set_attribute_from_path(api_version, opts, "page_cursor", Integer, @api_client.get_attribute_from_path(response, "meta.page.after"))
291
+ end
292
+ end
293
+ end
294
+ end
@@ -21,7 +21,7 @@ module DatadogAPIClient::V2
21
21
  class CIAppPipelineEventPipeline
22
22
  include BaseGenericModel
23
23
 
24
- # Time when the pipeline run finished. The time format must be RFC3339.
24
+ # Time when the pipeline run finished. It cannot be older than 18 hours in the past from the current time. The time format must be RFC3339.
25
25
  attr_reader :_end
26
26
 
27
27
  # Contains information of the CI error.
@@ -28,6 +28,9 @@ module DatadogAPIClient::V2
28
28
  # How to generate compliance signals. Useful for cloud_configuration rules only.
29
29
  attr_reader :compliance_signal_options
30
30
 
31
+ # Additional queries to filter matched events before they are processed.
32
+ attr_accessor :filters
33
+
31
34
  # Whether the rule is enabled.
32
35
  attr_reader :is_enabled
33
36
 
@@ -52,6 +55,7 @@ module DatadogAPIClient::V2
52
55
  {
53
56
  :'cases' => :'cases',
54
57
  :'compliance_signal_options' => :'complianceSignalOptions',
58
+ :'filters' => :'filters',
55
59
  :'is_enabled' => :'isEnabled',
56
60
  :'message' => :'message',
57
61
  :'name' => :'name',
@@ -67,6 +71,7 @@ module DatadogAPIClient::V2
67
71
  {
68
72
  :'cases' => :'Array<CloudConfigurationRuleCaseCreate>',
69
73
  :'compliance_signal_options' => :'CloudConfigurationRuleComplianceSignalOptions',
74
+ :'filters' => :'Array<SecurityMonitoringFilter>',
70
75
  :'is_enabled' => :'Boolean',
71
76
  :'message' => :'String',
72
77
  :'name' => :'String',
@@ -102,6 +107,12 @@ module DatadogAPIClient::V2
102
107
  self.compliance_signal_options = attributes[:'compliance_signal_options']
103
108
  end
104
109
 
110
+ if attributes.key?(:'filters')
111
+ if (value = attributes[:'filters']).is_a?(Array)
112
+ self.filters = value
113
+ end
114
+ end
115
+
105
116
  if attributes.key?(:'is_enabled')
106
117
  self.is_enabled = attributes[:'is_enabled']
107
118
  end
@@ -210,6 +221,7 @@ module DatadogAPIClient::V2
210
221
  self.class == o.class &&
211
222
  cases == o.cases &&
212
223
  compliance_signal_options == o.compliance_signal_options &&
224
+ filters == o.filters &&
213
225
  is_enabled == o.is_enabled &&
214
226
  message == o.message &&
215
227
  name == o.name &&
@@ -222,7 +234,7 @@ module DatadogAPIClient::V2
222
234
  # @return [Integer] Hash code
223
235
  # @!visibility private
224
236
  def hash
225
- [cases, compliance_signal_options, is_enabled, message, name, options, tags, type].hash
237
+ [cases, compliance_signal_options, filters, is_enabled, message, name, options, tags, type].hash
226
238
  end
227
239
  end
228
240
  end
@@ -21,9 +21,15 @@ module DatadogAPIClient::V2
21
21
  class CloudWorkloadSecurityAgentRuleAttributes
22
22
  include BaseGenericModel
23
23
 
24
+ # The version of the agent.
25
+ attr_accessor :agent_constraint
26
+
24
27
  # The category of the Agent rule.
25
28
  attr_accessor :category
26
29
 
30
+ # The ID of the user who created the rule.
31
+ attr_accessor :creation_author_uu_id
32
+
27
33
  # When the Agent rule was created, timestamp in milliseconds.
28
34
  attr_accessor :creation_date
29
35
 
@@ -45,6 +51,12 @@ module DatadogAPIClient::V2
45
51
  # The name of the Agent rule.
46
52
  attr_accessor :name
47
53
 
54
+ # The ID of the user who updated the rule.
55
+ attr_accessor :update_author_uu_id
56
+
57
+ # Timestamp in milliseconds when the Agent rule was last updated.
58
+ attr_accessor :update_date
59
+
48
60
  # When the Agent rule was last updated, timestamp in milliseconds.
49
61
  attr_accessor :updated_at
50
62
 
@@ -58,7 +70,9 @@ module DatadogAPIClient::V2
58
70
  # @!visibility private
59
71
  def self.attribute_map
60
72
  {
73
+ :'agent_constraint' => :'agentConstraint',
61
74
  :'category' => :'category',
75
+ :'creation_author_uu_id' => :'creationAuthorUuId',
62
76
  :'creation_date' => :'creationDate',
63
77
  :'creator' => :'creator',
64
78
  :'default_rule' => :'defaultRule',
@@ -66,6 +80,8 @@ module DatadogAPIClient::V2
66
80
  :'enabled' => :'enabled',
67
81
  :'expression' => :'expression',
68
82
  :'name' => :'name',
83
+ :'update_author_uu_id' => :'updateAuthorUuId',
84
+ :'update_date' => :'updateDate',
69
85
  :'updated_at' => :'updatedAt',
70
86
  :'updater' => :'updater',
71
87
  :'version' => :'version'
@@ -76,7 +92,9 @@ module DatadogAPIClient::V2
76
92
  # @!visibility private
77
93
  def self.openapi_types
78
94
  {
95
+ :'agent_constraint' => :'String',
79
96
  :'category' => :'String',
97
+ :'creation_author_uu_id' => :'String',
80
98
  :'creation_date' => :'Integer',
81
99
  :'creator' => :'CloudWorkloadSecurityAgentRuleCreatorAttributes',
82
100
  :'default_rule' => :'Boolean',
@@ -84,6 +102,8 @@ module DatadogAPIClient::V2
84
102
  :'enabled' => :'Boolean',
85
103
  :'expression' => :'String',
86
104
  :'name' => :'String',
105
+ :'update_author_uu_id' => :'String',
106
+ :'update_date' => :'Integer',
87
107
  :'updated_at' => :'Integer',
88
108
  :'updater' => :'CloudWorkloadSecurityAgentRuleUpdaterAttributes',
89
109
  :'version' => :'Integer'
@@ -106,10 +126,18 @@ module DatadogAPIClient::V2
106
126
  h[k.to_sym] = v
107
127
  }
108
128
 
129
+ if attributes.key?(:'agent_constraint')
130
+ self.agent_constraint = attributes[:'agent_constraint']
131
+ end
132
+
109
133
  if attributes.key?(:'category')
110
134
  self.category = attributes[:'category']
111
135
  end
112
136
 
137
+ if attributes.key?(:'creation_author_uu_id')
138
+ self.creation_author_uu_id = attributes[:'creation_author_uu_id']
139
+ end
140
+
113
141
  if attributes.key?(:'creation_date')
114
142
  self.creation_date = attributes[:'creation_date']
115
143
  end
@@ -138,6 +166,14 @@ module DatadogAPIClient::V2
138
166
  self.name = attributes[:'name']
139
167
  end
140
168
 
169
+ if attributes.key?(:'update_author_uu_id')
170
+ self.update_author_uu_id = attributes[:'update_author_uu_id']
171
+ end
172
+
173
+ if attributes.key?(:'update_date')
174
+ self.update_date = attributes[:'update_date']
175
+ end
176
+
141
177
  if attributes.key?(:'updated_at')
142
178
  self.updated_at = attributes[:'updated_at']
143
179
  end
@@ -157,7 +193,9 @@ module DatadogAPIClient::V2
157
193
  def ==(o)
158
194
  return true if self.equal?(o)
159
195
  self.class == o.class &&
196
+ agent_constraint == o.agent_constraint &&
160
197
  category == o.category &&
198
+ creation_author_uu_id == o.creation_author_uu_id &&
161
199
  creation_date == o.creation_date &&
162
200
  creator == o.creator &&
163
201
  default_rule == o.default_rule &&
@@ -165,6 +203,8 @@ module DatadogAPIClient::V2
165
203
  enabled == o.enabled &&
166
204
  expression == o.expression &&
167
205
  name == o.name &&
206
+ update_author_uu_id == o.update_author_uu_id &&
207
+ update_date == o.update_date &&
168
208
  updated_at == o.updated_at &&
169
209
  updater == o.updater &&
170
210
  version == o.version
@@ -174,7 +214,7 @@ module DatadogAPIClient::V2
174
214
  # @return [Integer] Hash code
175
215
  # @!visibility private
176
216
  def hash
177
- [category, creation_date, creator, default_rule, description, enabled, expression, name, updated_at, updater, version].hash
217
+ [agent_constraint, category, creation_author_uu_id, creation_date, creator, default_rule, description, enabled, expression, name, update_author_uu_id, update_date, updated_at, updater, version].hash
178
218
  end
179
219
  end
180
220
  end
@@ -21,6 +21,9 @@ module DatadogAPIClient::V2
21
21
  class ConfluentAccountResourceAttributes
22
22
  include BaseGenericModel
23
23
 
24
+ # Enable the `custom.consumer_lag_offset` metric, which contains extra metric tags.
25
+ attr_accessor :enable_custom_metrics
26
+
24
27
  # The ID associated with a Confluent resource.
25
28
  attr_accessor :id
26
29
 
@@ -34,6 +37,7 @@ module DatadogAPIClient::V2
34
37
  # @!visibility private
35
38
  def self.attribute_map
36
39
  {
40
+ :'enable_custom_metrics' => :'enable_custom_metrics',
37
41
  :'id' => :'id',
38
42
  :'resource_type' => :'resource_type',
39
43
  :'tags' => :'tags'
@@ -44,6 +48,7 @@ module DatadogAPIClient::V2
44
48
  # @!visibility private
45
49
  def self.openapi_types
46
50
  {
51
+ :'enable_custom_metrics' => :'Boolean',
47
52
  :'id' => :'String',
48
53
  :'resource_type' => :'String',
49
54
  :'tags' => :'Array<String>'
@@ -66,6 +71,10 @@ module DatadogAPIClient::V2
66
71
  h[k.to_sym] = v
67
72
  }
68
73
 
74
+ if attributes.key?(:'enable_custom_metrics')
75
+ self.enable_custom_metrics = attributes[:'enable_custom_metrics']
76
+ end
77
+
69
78
  if attributes.key?(:'id')
70
79
  self.id = attributes[:'id']
71
80
  end
@@ -105,6 +114,7 @@ module DatadogAPIClient::V2
105
114
  def ==(o)
106
115
  return true if self.equal?(o)
107
116
  self.class == o.class &&
117
+ enable_custom_metrics == o.enable_custom_metrics &&
108
118
  id == o.id &&
109
119
  resource_type == o.resource_type &&
110
120
  tags == o.tags
@@ -114,7 +124,7 @@ module DatadogAPIClient::V2
114
124
  # @return [Integer] Hash code
115
125
  # @!visibility private
116
126
  def hash
117
- [id, resource_type, tags].hash
127
+ [enable_custom_metrics, id, resource_type, tags].hash
118
128
  end
119
129
  end
120
130
  end
@@ -21,6 +21,9 @@ module DatadogAPIClient::V2
21
21
  class ConfluentResourceRequestAttributes
22
22
  include BaseGenericModel
23
23
 
24
+ # Enable the `custom.consumer_lag_offset` metric, which contains extra metric tags.
25
+ attr_accessor :enable_custom_metrics
26
+
24
27
  # The resource type of the Resource. Can be `kafka`, `connector`, `ksql`, or `schema_registry`.
25
28
  attr_reader :resource_type
26
29
 
@@ -31,6 +34,7 @@ module DatadogAPIClient::V2
31
34
  # @!visibility private
32
35
  def self.attribute_map
33
36
  {
37
+ :'enable_custom_metrics' => :'enable_custom_metrics',
34
38
  :'resource_type' => :'resource_type',
35
39
  :'tags' => :'tags'
36
40
  }
@@ -40,6 +44,7 @@ module DatadogAPIClient::V2
40
44
  # @!visibility private
41
45
  def self.openapi_types
42
46
  {
47
+ :'enable_custom_metrics' => :'Boolean',
43
48
  :'resource_type' => :'String',
44
49
  :'tags' => :'Array<String>'
45
50
  }
@@ -61,6 +66,10 @@ module DatadogAPIClient::V2
61
66
  h[k.to_sym] = v
62
67
  }
63
68
 
69
+ if attributes.key?(:'enable_custom_metrics')
70
+ self.enable_custom_metrics = attributes[:'enable_custom_metrics']
71
+ end
72
+
64
73
  if attributes.key?(:'resource_type')
65
74
  self.resource_type = attributes[:'resource_type']
66
75
  end
@@ -96,6 +105,7 @@ module DatadogAPIClient::V2
96
105
  def ==(o)
97
106
  return true if self.equal?(o)
98
107
  self.class == o.class &&
108
+ enable_custom_metrics == o.enable_custom_metrics &&
99
109
  resource_type == o.resource_type &&
100
110
  tags == o.tags
101
111
  end
@@ -104,7 +114,7 @@ module DatadogAPIClient::V2
104
114
  # @return [Integer] Hash code
105
115
  # @!visibility private
106
116
  def hash
107
- [resource_type, tags].hash
117
+ [enable_custom_metrics, resource_type, tags].hash
108
118
  end
109
119
  end
110
120
  end
@@ -21,6 +21,12 @@ module DatadogAPIClient::V2
21
21
  class ConfluentResourceResponseAttributes
22
22
  include BaseGenericModel
23
23
 
24
+ # Enable the `custom.consumer_lag_offset` metric, which contains extra metric tags.
25
+ attr_accessor :enable_custom_metrics
26
+
27
+ # The ID associated with the Confluent resource.
28
+ attr_accessor :id
29
+
24
30
  # The resource type of the Resource. Can be `kafka`, `connector`, `ksql`, or `schema_registry`.
25
31
  attr_reader :resource_type
26
32
 
@@ -31,6 +37,8 @@ module DatadogAPIClient::V2
31
37
  # @!visibility private
32
38
  def self.attribute_map
33
39
  {
40
+ :'enable_custom_metrics' => :'enable_custom_metrics',
41
+ :'id' => :'id',
34
42
  :'resource_type' => :'resource_type',
35
43
  :'tags' => :'tags'
36
44
  }
@@ -40,6 +48,8 @@ module DatadogAPIClient::V2
40
48
  # @!visibility private
41
49
  def self.openapi_types
42
50
  {
51
+ :'enable_custom_metrics' => :'Boolean',
52
+ :'id' => :'String',
43
53
  :'resource_type' => :'String',
44
54
  :'tags' => :'Array<String>'
45
55
  }
@@ -61,6 +71,14 @@ module DatadogAPIClient::V2
61
71
  h[k.to_sym] = v
62
72
  }
63
73
 
74
+ if attributes.key?(:'enable_custom_metrics')
75
+ self.enable_custom_metrics = attributes[:'enable_custom_metrics']
76
+ end
77
+
78
+ if attributes.key?(:'id')
79
+ self.id = attributes[:'id']
80
+ end
81
+
64
82
  if attributes.key?(:'resource_type')
65
83
  self.resource_type = attributes[:'resource_type']
66
84
  end
@@ -96,6 +114,8 @@ module DatadogAPIClient::V2
96
114
  def ==(o)
97
115
  return true if self.equal?(o)
98
116
  self.class == o.class &&
117
+ enable_custom_metrics == o.enable_custom_metrics &&
118
+ id == o.id &&
99
119
  resource_type == o.resource_type &&
100
120
  tags == o.tags
101
121
  end
@@ -104,7 +124,7 @@ module DatadogAPIClient::V2
104
124
  # @return [Integer] Hash code
105
125
  # @!visibility private
106
126
  def hash
107
- [resource_type, tags].hash
127
+ [enable_custom_metrics, id, resource_type, tags].hash
108
128
  end
109
129
  end
110
130
  end