datadog_api_client 2.15.0 → 2.16.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.apigentools-info +6 -6
- data/.generator/schemas/v1/openapi.yaml +643 -123
- data/.generator/schemas/v2/openapi.yaml +1815 -195
- data/.generator/src/generator/templates/api_client.j2 +19 -1
- data/.generator/src/generator/templates/model_base.j2 +1 -0
- data/CHANGELOG.md +30 -0
- data/examples/v1/dashboards/CreateDashboard_1754992756.rb +44 -0
- data/examples/v1/dashboards/CreateDashboard_2278756614.rb +91 -0
- data/examples/v1/monitors/CreateMonitor_1539578087.rb +36 -0
- data/examples/v1/synthetics/CreateSyntheticsBrowserTest.rb +1 -1
- data/examples/v1/synthetics/CreateSyntheticsBrowserTest_2932742688.rb +1 -1
- data/examples/v1/synthetics/CreateSyntheticsBrowserTest_397420811.rb +1 -1
- data/examples/v1/usage-metering/GetUsageCIApp.rb +4 -1
- data/examples/v1/usage-metering/GetUsageCWS.rb +4 -1
- data/examples/v1/usage-metering/GetUsageCloudSecurityPostureManagement.rb +1 -1
- data/examples/v2/apm-retention-filters/CreateApmRetentionFilter.rb +20 -0
- data/examples/v2/apm-retention-filters/DeleteApmRetentionFilter.rb +8 -0
- data/examples/v2/apm-retention-filters/GetApmRetentionFilter.rb +8 -0
- data/examples/v2/apm-retention-filters/ListApmRetentionFilters.rb +5 -0
- data/examples/v2/apm-retention-filters/ReorderApmRetentionFilters.rb +18 -0
- data/examples/v2/apm-retention-filters/UpdateApmRetentionFilter.rb +24 -0
- data/examples/v2/ci-visibility-pipelines/CreateCIAppPipelineEvent.rb +0 -3
- data/examples/v2/ci-visibility-pipelines/CreateCIAppPipelineEvent_129899466.rb +0 -8
- data/examples/v2/container-images/ListContainerImages.rb +8 -0
- data/examples/v2/container-images/ListContainerImages_3088586393.rb +11 -0
- data/examples/v2/container-images/ListContainerImages_3974828736.rb +11 -0
- data/examples/v2/gcp-integration/CreateGCPSTSAccount_109518525.rb +19 -0
- data/examples/v2/powerpack/CreatePowerpack.rb +47 -0
- data/examples/v2/powerpack/DeletePowerpack.rb +8 -0
- data/examples/v2/powerpack/GetPowerpack.rb +8 -0
- data/examples/v2/powerpack/ListPowerpacks.rb +8 -0
- data/examples/v2/powerpack/ListPowerpacks_1173755071.rb +8 -0
- data/examples/v2/powerpack/UpdatePowerpack.rb +50 -0
- data/examples/v2/rum/CreateRUMApplication.rb +1 -1
- data/examples/v2/service-accounts/CreateServiceAccountApplicationKey.rb +5 -7
- data/examples/v2/service-accounts/DeleteServiceAccountApplicationKey.rb +7 -1
- data/examples/v2/service-accounts/GetServiceAccountApplicationKey.rb +7 -1
- data/examples/v2/service-accounts/ListServiceAccountApplicationKeys.rb +4 -1
- data/examples/v2/service-accounts/UpdateServiceAccountApplicationKey.rb +11 -9
- data/examples/v2/service-definition/CreateOrUpdateServiceDefinitions.rb +23 -12
- data/examples/v2/service-definition/CreateOrUpdateServiceDefinitions_2621709423.rb +53 -0
- data/lib/datadog_api_client/api_client.rb +19 -1
- data/lib/datadog_api_client/configuration.rb +1 -1
- data/lib/datadog_api_client/inflector.rb +80 -0
- data/lib/datadog_api_client/v1/api/monitors_api.rb +1 -20
- data/lib/datadog_api_client/v1/api/usage_metering_api.rb +6 -6
- data/lib/datadog_api_client/v1/api/webhooks_integration_api.rb +1 -1
- data/lib/datadog_api_client/v1/model_base.rb +1 -0
- data/lib/datadog_api_client/v1/models/hourly_usage_attribution_usage_type.rb +6 -4
- data/lib/datadog_api_client/v1/models/ip_prefixes_global.rb +94 -0
- data/lib/datadog_api_client/v1/models/ip_ranges.rb +11 -1
- data/lib/datadog_api_client/v1/models/monitor_options_custom_schedule.rb +82 -0
- data/lib/datadog_api_client/v1/models/monitor_options_custom_schedule_recurrence.rb +100 -0
- data/lib/datadog_api_client/v1/models/monitor_options_scheduling_options.rb +11 -1
- data/lib/datadog_api_client/v1/models/monthly_usage_attribution_supported_metrics.rb +4 -0
- data/lib/datadog_api_client/v1/models/monthly_usage_attribution_values.rb +45 -5
- data/lib/datadog_api_client/v1/models/powerpack_template_variable_contents.rb +131 -0
- data/lib/datadog_api_client/v1/models/powerpack_template_variables.rb +94 -0
- data/lib/datadog_api_client/v1/models/powerpack_widget_definition.rb +169 -0
- data/lib/datadog_api_client/v1/models/powerpack_widget_definition_type.rb +26 -0
- data/lib/datadog_api_client/v1/models/split_config.rb +181 -0
- data/lib/datadog_api_client/v1/models/split_config_sort_compute.rb +119 -0
- data/lib/datadog_api_client/v1/models/split_dimension.rb +98 -0
- data/lib/datadog_api_client/v1/models/split_graph_source_widget_definition.rb +70 -0
- data/lib/datadog_api_client/v1/models/split_graph_viz_size.rb +29 -0
- data/lib/datadog_api_client/v1/models/split_graph_widget_definition.rb +191 -0
- data/lib/datadog_api_client/v1/models/split_graph_widget_definition_type.rb +26 -0
- data/lib/datadog_api_client/v1/models/split_sort.rb +108 -0
- data/lib/datadog_api_client/v1/models/split_vector_entry_item.rb +125 -0
- data/lib/datadog_api_client/v1/models/usage_attribution_values.rb +4 -4
- data/lib/datadog_api_client/v1/models/usage_cloud_security_posture_management_hour.rb +8 -8
- data/lib/datadog_api_client/v1/models/usage_cloud_security_posture_management_response.rb +2 -2
- data/lib/datadog_api_client/v1/models/usage_summary_date.rb +148 -8
- data/lib/datadog_api_client/v1/models/usage_summary_date_org.rb +148 -8
- data/lib/datadog_api_client/v1/models/usage_summary_response.rb +148 -8
- data/lib/datadog_api_client/v1/models/widget_definition.rb +8 -6
- data/lib/datadog_api_client/v2/api/apm_retention_filters_api.rb +423 -0
- data/lib/datadog_api_client/v2/api/ci_visibility_pipelines_api.rb +4 -10
- data/lib/datadog_api_client/v2/api/ci_visibility_tests_api.rb +3 -3
- data/lib/datadog_api_client/v2/api/container_images_api.rb +129 -0
- data/lib/datadog_api_client/v2/api/incidents_api.rb +1 -1
- data/lib/datadog_api_client/v2/api/powerpack_api.rb +383 -0
- data/lib/datadog_api_client/v2/api/service_definition_api.rb +2 -2
- data/lib/datadog_api_client/v2/api/usage_metering_api.rb +1 -1
- data/lib/datadog_api_client/v2/model_base.rb +1 -0
- data/lib/datadog_api_client/v2/models/apm_retention_filter_type.rb +26 -0
- data/lib/datadog_api_client/v2/models/container_image.rb +100 -0
- data/lib/datadog_api_client/v2/models/container_image_attributes.rb +261 -0
- data/lib/datadog_api_client/v2/models/container_image_flavor.rb +120 -0
- data/lib/datadog_api_client/v2/models/container_image_group.rb +110 -0
- data/lib/datadog_api_client/v2/models/container_image_group_attributes.rb +100 -0
- data/lib/datadog_api_client/v2/models/container_image_group_images_relationships_link.rb +92 -0
- data/lib/datadog_api_client/v2/models/container_image_group_relationships.rb +80 -0
- data/lib/datadog_api_client/v2/models/container_image_group_relationships_links.rb +80 -0
- data/lib/datadog_api_client/v2/models/container_image_group_type.rb +26 -0
- data/lib/datadog_api_client/v2/models/container_image_item.rb +63 -0
- data/lib/datadog_api_client/v2/models/container_image_meta.rb +80 -0
- data/lib/datadog_api_client/v2/models/container_image_meta_page.rb +160 -0
- data/lib/datadog_api_client/v2/models/container_image_meta_page_type.rb +26 -0
- data/lib/datadog_api_client/v2/models/container_image_type.rb +26 -0
- data/lib/datadog_api_client/v2/models/container_image_vulnerabilities.rb +140 -0
- data/lib/datadog_api_client/v2/models/container_images_response.rb +102 -0
- data/lib/datadog_api_client/v2/models/container_images_response_links.rb +130 -0
- data/lib/datadog_api_client/v2/models/data_scalar_column.rb +2 -2
- data/lib/datadog_api_client/v2/models/gcpsts_service_account_attributes.rb +13 -1
- data/lib/datadog_api_client/v2/models/group_scalar_column.rb +2 -2
- data/lib/datadog_api_client/v2/models/list_powerpacks_response.rb +114 -0
- data/lib/datadog_api_client/v2/models/powerpack.rb +80 -0
- data/lib/datadog_api_client/v2/models/powerpack_attributes.rb +164 -0
- data/lib/datadog_api_client/v2/models/powerpack_data.rb +110 -0
- data/lib/datadog_api_client/v2/models/powerpack_group_widget.rb +108 -0
- data/lib/datadog_api_client/v2/models/powerpack_group_widget_definition.rb +162 -0
- data/lib/datadog_api_client/v2/models/powerpack_group_widget_layout.rb +177 -0
- data/lib/datadog_api_client/v2/models/powerpack_inner_widget_layout.rb +177 -0
- data/lib/datadog_api_client/v2/models/powerpack_inner_widgets.rb +108 -0
- data/lib/datadog_api_client/v2/models/powerpack_relationships.rb +80 -0
- data/lib/datadog_api_client/v2/models/powerpack_response.rb +92 -0
- data/lib/datadog_api_client/v2/models/powerpack_response_links.rb +129 -0
- data/lib/datadog_api_client/v2/models/powerpack_template_variable.rb +110 -0
- data/lib/datadog_api_client/v2/models/powerpacks_response_meta.rb +80 -0
- data/lib/datadog_api_client/v2/models/powerpacks_response_meta_pagination.rb +150 -0
- data/lib/datadog_api_client/v2/models/reorder_retention_filters_request.rb +100 -0
- data/lib/datadog_api_client/v2/models/restriction_policy_binding.rb +1 -1
- data/lib/datadog_api_client/v2/models/retention_filter.rb +140 -0
- data/lib/datadog_api_client/v2/models/retention_filter_all.rb +140 -0
- data/lib/datadog_api_client/v2/models/retention_filter_all_attributes.rb +181 -0
- data/lib/datadog_api_client/v2/models/retention_filter_all_type.rb +28 -0
- data/lib/datadog_api_client/v2/models/retention_filter_attributes.rb +181 -0
- data/lib/datadog_api_client/v2/models/retention_filter_create_attributes.rb +183 -0
- data/lib/datadog_api_client/v2/models/retention_filter_create_data.rb +119 -0
- data/lib/datadog_api_client/v2/models/retention_filter_create_request.rb +98 -0
- data/lib/datadog_api_client/v2/models/retention_filter_response.rb +80 -0
- data/lib/datadog_api_client/v2/models/retention_filter_type.rb +26 -0
- data/lib/datadog_api_client/v2/models/retention_filter_update_data.rb +140 -0
- data/lib/datadog_api_client/v2/models/retention_filter_update_request.rb +98 -0
- data/lib/datadog_api_client/v2/models/retention_filter_without_attributes.rb +119 -0
- data/lib/datadog_api_client/v2/models/retention_filters_response.rb +100 -0
- data/lib/datadog_api_client/v2/models/scalar_column_type_group.rb +26 -0
- data/lib/datadog_api_client/v2/models/scalar_column_type_number.rb +26 -0
- data/lib/datadog_api_client/v2/models/scalar_meta.rb +8 -0
- data/lib/datadog_api_client/v2/models/service_definition_schema.rb +2 -1
- data/lib/datadog_api_client/v2/models/service_definition_schema_versions.rb +1 -0
- data/lib/datadog_api_client/v2/models/service_definition_v2_dot2.rb +247 -0
- data/lib/datadog_api_client/v2/models/service_definition_v2_dot2_contact.rb +129 -0
- data/lib/datadog_api_client/v2/models/service_definition_v2_dot2_integrations.rb +90 -0
- data/lib/datadog_api_client/v2/models/service_definition_v2_dot2_link.rb +150 -0
- data/lib/datadog_api_client/v2/models/service_definition_v2_dot2_opsgenie.rb +108 -0
- data/lib/datadog_api_client/v2/models/service_definition_v2_dot2_opsgenie_region.rb +27 -0
- data/lib/datadog_api_client/v2/models/service_definition_v2_dot2_pagerduty.rb +80 -0
- data/lib/datadog_api_client/v2/models/service_definition_v2_dot2_type.rb +32 -0
- data/lib/datadog_api_client/v2/models/service_definition_v2_dot2_version.rb +26 -0
- data/lib/datadog_api_client/v2/models/service_definitions_create_request.rb +1 -0
- data/lib/datadog_api_client/v2/models/spans_filter.rb +80 -0
- data/lib/datadog_api_client/v2/models/spans_filter_create.rb +98 -0
- data/lib/datadog_api_client/version.rb +1 -1
- data/run-tests.sh +6 -5
- metadata +102 -9
- data/examples/v1/usage-metering/GetUsageCIApp_1064440884.rb +0 -8
- data/examples/v1/usage-metering/GetUsageCWS_736958514.rb +0 -8
- data/examples/v2/service-accounts/CreateServiceAccountApplicationKey_1761876297.rb +0 -17
- data/examples/v2/service-accounts/DeleteServiceAccountApplicationKey_992091161.rb +0 -11
- data/examples/v2/service-accounts/GetServiceAccountApplicationKey_819075131.rb +0 -11
- data/examples/v2/service-accounts/ListServiceAccountApplicationKeys_1268914341.rb +0 -8
- data/examples/v2/service-accounts/UpdateServiceAccountApplicationKey_768415790.rb +0 -22
@@ -81,6 +81,7 @@ module {{ module_name }}
|
|
81
81
|
end
|
82
82
|
|
83
83
|
if @config.debugging
|
84
|
+
@config.logger.debug "HTTP response header\n#{response.headers}\n"
|
84
85
|
@config.logger.debug "HTTP response body ~BEGIN~\n#{response.body}\n~END~\n"
|
85
86
|
end
|
86
87
|
|
@@ -139,6 +140,18 @@ module {{ module_name }}
|
|
139
140
|
sleep_time
|
140
141
|
end
|
141
142
|
|
143
|
+
#Redact api and app key in the request header
|
144
|
+
def sanitize_request_header(request_header)
|
145
|
+
sanitized_headers= request_header.dup
|
146
|
+
keys_to_redact = ["DD-API-KEY", "DD-APPLICATION-KEY"]
|
147
|
+
keys_to_redact.each do |key_to_redact|
|
148
|
+
if sanitized_headers.key?(key_to_redact)
|
149
|
+
sanitized_headers[key_to_redact] = "REDACTED"
|
150
|
+
end
|
151
|
+
end
|
152
|
+
return sanitized_headers
|
153
|
+
end
|
154
|
+
|
142
155
|
# Build the HTTP request
|
143
156
|
#
|
144
157
|
# @param [String] http_method HTTP method/verb (e.g. POST)
|
@@ -181,11 +194,16 @@ module {{ module_name }}
|
|
181
194
|
# set custom cert, if provided
|
182
195
|
req_opts[:ssl_ca_file] = File.read(@config.ssl_ca_cert) if @config.ssl_ca_cert
|
183
196
|
|
197
|
+
if @config.debugging
|
198
|
+
@config.logger.debug "HTTP request url\n#{url}\n"
|
199
|
+
@config.logger.debug "HTTP request header\n#{sanitize_request_header(header_params)}\n"
|
200
|
+
end
|
201
|
+
|
184
202
|
if ["POST", "PATCH", "PUT", "DELETE"].include?(http_method.const_get(:METHOD))
|
185
203
|
req_body = build_request_body(header_params, form_params, opts[:body])
|
186
204
|
req_opts.update :body => req_body
|
187
205
|
if @config.debugging
|
188
|
-
@config.logger.debug "HTTP request body
|
206
|
+
@config.logger.debug "HTTP request body ~BEGIN~\n#{req_body}\n~END~\n"
|
189
207
|
end
|
190
208
|
end
|
191
209
|
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,35 @@
|
|
1
1
|
# CHANGELOG
|
2
2
|
|
3
|
+
## 2.16.0 / 2023-10-16
|
4
|
+
|
5
|
+
### Fixed
|
6
|
+
* Fix schema for query scalar API by @api-clients-generation-pipeline in https://github.com/DataDog/datadog-api-client-ruby/pull/1542
|
7
|
+
* Remove the application key from CreateCIAppPipelineEvent endpoint by @api-clients-generation-pipeline in https://github.com/DataDog/datadog-api-client-ruby/pull/1551
|
8
|
+
* Document 403 on team endpoints by @api-clients-generation-pipeline in https://github.com/DataDog/datadog-api-client-ruby/pull/1559
|
9
|
+
* Powerpack improve group_widget object by @api-clients-generation-pipeline in https://github.com/DataDog/datadog-api-client-ruby/pull/1572
|
10
|
+
* Remove escalation message default by @api-clients-generation-pipeline in https://github.com/DataDog/datadog-api-client-ruby/pull/1585
|
11
|
+
### Added
|
12
|
+
* Add split graph widget to dashboard schema by @api-clients-generation-pipeline in https://github.com/DataDog/datadog-api-client-ruby/pull/1529
|
13
|
+
* Update public docs for CSM Enterprise and CSPM by @api-clients-generation-pipeline in https://github.com/DataDog/datadog-api-client-ruby/pull/1539
|
14
|
+
* Add serverless apps to usage and usage attribution by @api-clients-generation-pipeline in https://github.com/DataDog/datadog-api-client-ruby/pull/1557
|
15
|
+
* Add Network Device Monitoring Netflow to usage by @api-clients-generation-pipeline in https://github.com/DataDog/datadog-api-client-ruby/pull/1565
|
16
|
+
* Add Powerpacks endpoints to public api spec by @api-clients-generation-pipeline in https://github.com/DataDog/datadog-api-client-ruby/pull/1540
|
17
|
+
* Add account-tags to GCP Service Account Attributes by @api-clients-generation-pipeline in https://github.com/DataDog/datadog-api-client-ruby/pull/1550
|
18
|
+
* Add powerpack widget to dashboard schema by @api-clients-generation-pipeline in https://github.com/DataDog/datadog-api-client-ruby/pull/1567
|
19
|
+
* Add custom schedule to monitor scheduling options by @api-clients-generation-pipeline in https://github.com/DataDog/datadog-api-client-ruby/pull/1553
|
20
|
+
* Service Catalog support service definition schema v2.2 by @api-clients-generation-pipeline in https://github.com/DataDog/datadog-api-client-ruby/pull/1577
|
21
|
+
* Powerpack pagination and test fixes by @api-clients-generation-pipeline in https://github.com/DataDog/datadog-api-client-ruby/pull/1581
|
22
|
+
* Add support for container images endpoint by @api-clients-generation-pipeline in https://github.com/DataDog/datadog-api-client-ruby/pull/1580
|
23
|
+
* Add global IP ranges to spec by @api-clients-generation-pipeline in https://github.com/DataDog/datadog-api-client-ruby/pull/1250
|
24
|
+
### Changed
|
25
|
+
* Add APM retention filter api documentation by @api-clients-generation-pipeline in https://github.com/DataDog/datadog-api-client-ruby/pull/1528
|
26
|
+
* Update request requirements of CI Visibility public pipelines write API by @api-clients-generation-pipeline in https://github.com/DataDog/datadog-api-client-ruby/pull/1561
|
27
|
+
* Add get APM retention filter endpoint by @api-clients-generation-pipeline in https://github.com/DataDog/datadog-api-client-ruby/pull/1563
|
28
|
+
* Remove beta label notice on create pipeline API endpoint by @api-clients-generation-pipeline in https://github.com/DataDog/datadog-api-client-ruby/pull/1579
|
29
|
+
|
30
|
+
|
31
|
+
**Full Changelog**: https://github.com/DataDog/datadog-api-client-ruby/compare/v2.15.0...v2.16.0
|
32
|
+
|
3
33
|
## 2.15.0 / 2023-09-14
|
4
34
|
|
5
35
|
### Fixed
|
@@ -0,0 +1,44 @@
|
|
1
|
+
# Create a new dashboard with powerpack widget
|
2
|
+
|
3
|
+
require "datadog_api_client"
|
4
|
+
api_instance = DatadogAPIClient::V1::DashboardsAPI.new
|
5
|
+
|
6
|
+
# there is a valid "powerpack" in the system
|
7
|
+
POWERPACK_DATA_ID = ENV["POWERPACK_DATA_ID"]
|
8
|
+
|
9
|
+
body = DatadogAPIClient::V1::Dashboard.new({
|
10
|
+
title: "Example-Dashboard with powerpack widget",
|
11
|
+
layout_type: DatadogAPIClient::V1::DashboardLayoutType::ORDERED,
|
12
|
+
widgets: [
|
13
|
+
DatadogAPIClient::V1::Widget.new({
|
14
|
+
definition: DatadogAPIClient::V1::PowerpackWidgetDefinition.new({
|
15
|
+
type: DatadogAPIClient::V1::PowerpackWidgetDefinitionType::POWERPACK,
|
16
|
+
powerpack_id: POWERPACK_DATA_ID,
|
17
|
+
template_variables: DatadogAPIClient::V1::PowerpackTemplateVariables.new({
|
18
|
+
controlled_externally: [],
|
19
|
+
controlled_by_powerpack: [
|
20
|
+
DatadogAPIClient::V1::PowerpackTemplateVariableContents.new({
|
21
|
+
name: "foo",
|
22
|
+
prefix: "bar",
|
23
|
+
values: [
|
24
|
+
"baz",
|
25
|
+
"qux",
|
26
|
+
"quuz",
|
27
|
+
],
|
28
|
+
}),
|
29
|
+
],
|
30
|
+
}),
|
31
|
+
}),
|
32
|
+
layout: DatadogAPIClient::V1::WidgetLayout.new({
|
33
|
+
x: 1,
|
34
|
+
y: 1,
|
35
|
+
width: 2,
|
36
|
+
height: 2,
|
37
|
+
is_column_break: false,
|
38
|
+
}),
|
39
|
+
}),
|
40
|
+
],
|
41
|
+
description: "description",
|
42
|
+
is_read_only: false,
|
43
|
+
})
|
44
|
+
p api_instance.create_dashboard(body)
|
@@ -0,0 +1,91 @@
|
|
1
|
+
# Create a new dashboard with split graph widget
|
2
|
+
|
3
|
+
require "datadog_api_client"
|
4
|
+
api_instance = DatadogAPIClient::V1::DashboardsAPI.new
|
5
|
+
|
6
|
+
body = DatadogAPIClient::V1::Dashboard.new({
|
7
|
+
title: "Example-Dashboard",
|
8
|
+
description: "",
|
9
|
+
widgets: [
|
10
|
+
DatadogAPIClient::V1::Widget.new({
|
11
|
+
layout: DatadogAPIClient::V1::WidgetLayout.new({
|
12
|
+
x: 0,
|
13
|
+
y: 0,
|
14
|
+
width: 12,
|
15
|
+
height: 8,
|
16
|
+
}),
|
17
|
+
definition: DatadogAPIClient::V1::SplitGraphWidgetDefinition.new({
|
18
|
+
title: "",
|
19
|
+
type: DatadogAPIClient::V1::SplitGraphWidgetDefinitionType::SPLIT_GROUP,
|
20
|
+
source_widget_definition: DatadogAPIClient::V1::TimeseriesWidgetDefinition.new({
|
21
|
+
title: "",
|
22
|
+
title_size: "16",
|
23
|
+
title_align: DatadogAPIClient::V1::WidgetTextAlign::LEFT,
|
24
|
+
type: DatadogAPIClient::V1::TimeseriesWidgetDefinitionType::TIMESERIES,
|
25
|
+
requests: [
|
26
|
+
DatadogAPIClient::V1::TimeseriesWidgetRequest.new({
|
27
|
+
response_format: DatadogAPIClient::V1::FormulaAndFunctionResponseFormat::TIMESERIES,
|
28
|
+
queries: [
|
29
|
+
DatadogAPIClient::V1::FormulaAndFunctionMetricQueryDefinition.new({
|
30
|
+
name: "query1",
|
31
|
+
data_source: DatadogAPIClient::V1::FormulaAndFunctionMetricDataSource::METRICS,
|
32
|
+
query: "avg:system.cpu.user{*}",
|
33
|
+
}),
|
34
|
+
],
|
35
|
+
style: DatadogAPIClient::V1::WidgetRequestStyle.new({
|
36
|
+
palette: "dog_classic",
|
37
|
+
line_type: DatadogAPIClient::V1::WidgetLineType::SOLID,
|
38
|
+
line_width: DatadogAPIClient::V1::WidgetLineWidth::NORMAL,
|
39
|
+
}),
|
40
|
+
display_type: DatadogAPIClient::V1::WidgetDisplayType::LINE,
|
41
|
+
}),
|
42
|
+
],
|
43
|
+
}),
|
44
|
+
split_config: DatadogAPIClient::V1::SplitConfig.new({
|
45
|
+
split_dimensions: [
|
46
|
+
DatadogAPIClient::V1::SplitDimension.new({
|
47
|
+
one_graph_per: "service",
|
48
|
+
}),
|
49
|
+
],
|
50
|
+
limit: 24,
|
51
|
+
sort: DatadogAPIClient::V1::SplitSort.new({
|
52
|
+
compute: DatadogAPIClient::V1::SplitConfigSortCompute.new({
|
53
|
+
aggregation: "sum",
|
54
|
+
metric: "system.cpu.user",
|
55
|
+
}),
|
56
|
+
order: DatadogAPIClient::V1::WidgetSort::DESCENDING,
|
57
|
+
}),
|
58
|
+
static_splits: [
|
59
|
+
[
|
60
|
+
DatadogAPIClient::V1::SplitVectorEntryItem.new({
|
61
|
+
tag_key: "service",
|
62
|
+
tag_values: [
|
63
|
+
"cassandra",
|
64
|
+
],
|
65
|
+
}),
|
66
|
+
DatadogAPIClient::V1::SplitVectorEntryItem.new({
|
67
|
+
tag_key: "datacenter",
|
68
|
+
tag_values: [],
|
69
|
+
}),
|
70
|
+
],
|
71
|
+
[
|
72
|
+
DatadogAPIClient::V1::SplitVectorEntryItem.new({
|
73
|
+
tag_key: "demo",
|
74
|
+
tag_values: [
|
75
|
+
"env",
|
76
|
+
],
|
77
|
+
}),
|
78
|
+
],
|
79
|
+
],
|
80
|
+
}),
|
81
|
+
size: DatadogAPIClient::V1::SplitGraphVizSize::MD,
|
82
|
+
has_uniform_y_axes: true,
|
83
|
+
}),
|
84
|
+
}),
|
85
|
+
],
|
86
|
+
template_variables: [],
|
87
|
+
layout_type: DatadogAPIClient::V1::DashboardLayoutType::ORDERED,
|
88
|
+
is_read_only: false,
|
89
|
+
notify_list: [],
|
90
|
+
})
|
91
|
+
p api_instance.create_dashboard(body)
|
@@ -0,0 +1,36 @@
|
|
1
|
+
# Create a metric monitor with a custom schedule returns "OK" response
|
2
|
+
|
3
|
+
require "datadog_api_client"
|
4
|
+
api_instance = DatadogAPIClient::V1::MonitorsAPI.new
|
5
|
+
|
6
|
+
body = DatadogAPIClient::V1::Monitor.new({
|
7
|
+
message: "some message Notify: @hipchat-channel",
|
8
|
+
name: "Example-Monitor",
|
9
|
+
query: "avg(current_1mo):avg:system.load.5{*} > 0.5",
|
10
|
+
tags: [],
|
11
|
+
options: DatadogAPIClient::V1::MonitorOptions.new({
|
12
|
+
thresholds: DatadogAPIClient::V1::MonitorThresholds.new({
|
13
|
+
critical: 0.5,
|
14
|
+
}),
|
15
|
+
notify_audit: false,
|
16
|
+
on_missing_data: DatadogAPIClient::V1::OnMissingDataOption::DEFAULT,
|
17
|
+
include_tags: false,
|
18
|
+
scheduling_options: DatadogAPIClient::V1::MonitorOptionsSchedulingOptions.new({
|
19
|
+
evaluation_window: DatadogAPIClient::V1::MonitorOptionsSchedulingOptionsEvaluationWindow.new({
|
20
|
+
day_starts: "04:00",
|
21
|
+
month_starts: 1,
|
22
|
+
}),
|
23
|
+
custom_schedule: DatadogAPIClient::V1::MonitorOptionsCustomSchedule.new({
|
24
|
+
recurrences: [
|
25
|
+
DatadogAPIClient::V1::MonitorOptionsCustomScheduleRecurrence.new({
|
26
|
+
rrule: "FREQ=DAILY;INTERVAL=1",
|
27
|
+
timezone: "America/Los_Angeles",
|
28
|
+
start: "2024-10-26T09:13:00",
|
29
|
+
}),
|
30
|
+
],
|
31
|
+
}),
|
32
|
+
}),
|
33
|
+
}),
|
34
|
+
type: DatadogAPIClient::V1::MonitorType::QUERY_ALERT,
|
35
|
+
})
|
36
|
+
p api_instance.create_monitor(body)
|
@@ -40,7 +40,7 @@ body = DatadogAPIClient::V1::SyntheticsBrowserTest.new({
|
|
40
40
|
min_location_failed: 1,
|
41
41
|
no_screenshot: true,
|
42
42
|
_retry: DatadogAPIClient::V1::SyntheticsTestOptionsRetry.new({
|
43
|
-
count:
|
43
|
+
count: 2,
|
44
44
|
interval: 10,
|
45
45
|
}),
|
46
46
|
rum_settings: DatadogAPIClient::V1::SyntheticsBrowserTestRumSettings.new({
|
@@ -2,4 +2,7 @@
|
|
2
2
|
|
3
3
|
require "datadog_api_client"
|
4
4
|
api_instance = DatadogAPIClient::V1::UsageMeteringAPI.new
|
5
|
-
|
5
|
+
opts = {
|
6
|
+
end_hr: (Time.now + -3 * 86400),
|
7
|
+
}
|
8
|
+
p api_instance.get_usage_ci_app((Time.now + -5 * 86400), opts)
|
@@ -2,4 +2,7 @@
|
|
2
2
|
|
3
3
|
require "datadog_api_client"
|
4
4
|
api_instance = DatadogAPIClient::V1::UsageMeteringAPI.new
|
5
|
-
|
5
|
+
opts = {
|
6
|
+
end_hr: (Time.now + -3 * 86400),
|
7
|
+
}
|
8
|
+
p api_instance.get_usage_cws((Time.now + -5 * 86400), opts)
|
@@ -0,0 +1,20 @@
|
|
1
|
+
# Create a retention filter returns "OK" response
|
2
|
+
|
3
|
+
require "datadog_api_client"
|
4
|
+
api_instance = DatadogAPIClient::V2::APMRetentionFiltersAPI.new
|
5
|
+
|
6
|
+
body = DatadogAPIClient::V2::RetentionFilterCreateRequest.new({
|
7
|
+
data: DatadogAPIClient::V2::RetentionFilterCreateData.new({
|
8
|
+
attributes: DatadogAPIClient::V2::RetentionFilterCreateAttributes.new({
|
9
|
+
enabled: true,
|
10
|
+
filter: DatadogAPIClient::V2::SpansFilterCreate.new({
|
11
|
+
query: "@http.status_code:200 service:my-service",
|
12
|
+
}),
|
13
|
+
filter_type: DatadogAPIClient::V2::RetentionFilterType::SPANS_SAMPLING_PROCESSOR,
|
14
|
+
name: "my retention filter",
|
15
|
+
rate: 1.0,
|
16
|
+
}),
|
17
|
+
type: DatadogAPIClient::V2::ApmRetentionFilterType::APM_RETENTION_FILTER,
|
18
|
+
}),
|
19
|
+
})
|
20
|
+
p api_instance.create_apm_retention_filter(body)
|
@@ -0,0 +1,8 @@
|
|
1
|
+
# Delete a retention filter returns "OK" response
|
2
|
+
|
3
|
+
require "datadog_api_client"
|
4
|
+
api_instance = DatadogAPIClient::V2::APMRetentionFiltersAPI.new
|
5
|
+
|
6
|
+
# there is a valid "retention_filter" in the system
|
7
|
+
RETENTION_FILTER_DATA_ID = ENV["RETENTION_FILTER_DATA_ID"]
|
8
|
+
p api_instance.delete_apm_retention_filter(RETENTION_FILTER_DATA_ID)
|
@@ -0,0 +1,8 @@
|
|
1
|
+
# Get a given APM retention filter returns "OK" response
|
2
|
+
|
3
|
+
require "datadog_api_client"
|
4
|
+
api_instance = DatadogAPIClient::V2::APMRetentionFiltersAPI.new
|
5
|
+
|
6
|
+
# there is a valid "retention_filter" in the system
|
7
|
+
RETENTION_FILTER_DATA_ID = ENV["RETENTION_FILTER_DATA_ID"]
|
8
|
+
p api_instance.get_apm_retention_filter(RETENTION_FILTER_DATA_ID)
|
@@ -0,0 +1,18 @@
|
|
1
|
+
# Re-order retention filters returns "OK" response
|
2
|
+
|
3
|
+
require "datadog_api_client"
|
4
|
+
api_instance = DatadogAPIClient::V2::APMRetentionFiltersAPI.new
|
5
|
+
|
6
|
+
body = DatadogAPIClient::V2::ReorderRetentionFiltersRequest.new({
|
7
|
+
data: [
|
8
|
+
DatadogAPIClient::V2::RetentionFilterWithoutAttributes.new({
|
9
|
+
id: "jdZrilSJQLqzb6Cu7aub9Q",
|
10
|
+
type: DatadogAPIClient::V2::ApmRetentionFilterType::APM_RETENTION_FILTER,
|
11
|
+
}),
|
12
|
+
DatadogAPIClient::V2::RetentionFilterWithoutAttributes.new({
|
13
|
+
id: "7RBOb7dLSYWI01yc3pIH8w",
|
14
|
+
type: DatadogAPIClient::V2::ApmRetentionFilterType::APM_RETENTION_FILTER,
|
15
|
+
}),
|
16
|
+
],
|
17
|
+
})
|
18
|
+
p api_instance.reorder_apm_retention_filters(body)
|
@@ -0,0 +1,24 @@
|
|
1
|
+
# Update a retention filter returns "OK" response
|
2
|
+
|
3
|
+
require "datadog_api_client"
|
4
|
+
api_instance = DatadogAPIClient::V2::APMRetentionFiltersAPI.new
|
5
|
+
|
6
|
+
# there is a valid "retention_filter" in the system
|
7
|
+
RETENTION_FILTER_DATA_ID = ENV["RETENTION_FILTER_DATA_ID"]
|
8
|
+
|
9
|
+
body = DatadogAPIClient::V2::RetentionFilterUpdateRequest.new({
|
10
|
+
data: DatadogAPIClient::V2::RetentionFilterUpdateData.new({
|
11
|
+
attributes: DatadogAPIClient::V2::RetentionFilterCreateAttributes.new({
|
12
|
+
name: "test",
|
13
|
+
rate: 0.9,
|
14
|
+
filter: DatadogAPIClient::V2::SpansFilterCreate.new({
|
15
|
+
query: "@_top_level:1 test:service-demo",
|
16
|
+
}),
|
17
|
+
enabled: true,
|
18
|
+
filter_type: DatadogAPIClient::V2::RetentionFilterType::SPANS_SAMPLING_PROCESSOR,
|
19
|
+
}),
|
20
|
+
id: "test-id",
|
21
|
+
type: DatadogAPIClient::V2::ApmRetentionFilterType::APM_RETENTION_FILTER,
|
22
|
+
}),
|
23
|
+
})
|
24
|
+
p api_instance.update_apm_retention_filter(RETENTION_FILTER_DATA_ID, body)
|
@@ -1,9 +1,6 @@
|
|
1
1
|
# Send pipeline event returns "Request accepted for processing" response
|
2
2
|
|
3
3
|
require "datadog_api_client"
|
4
|
-
DatadogAPIClient.configure do |config|
|
5
|
-
config.unstable_operations["v2.create_ci_app_pipeline_event".to_sym] = true
|
6
|
-
end
|
7
4
|
api_instance = DatadogAPIClient::V2::CIVisibilityPipelinesAPI.new
|
8
5
|
|
9
6
|
body = DatadogAPIClient::V2::CIAppCreatePipelineEventRequest.new({
|
@@ -1,9 +1,6 @@
|
|
1
1
|
# Send pipeline job event returns "Request accepted for processing" response
|
2
2
|
|
3
3
|
require "datadog_api_client"
|
4
|
-
DatadogAPIClient.configure do |config|
|
5
|
-
config.unstable_operations["v2.create_ci_app_pipeline_event".to_sym] = true
|
6
|
-
end
|
7
4
|
api_instance = DatadogAPIClient::V2::CIVisibilityPipelinesAPI.new
|
8
5
|
|
9
6
|
body = DatadogAPIClient::V2::CIAppCreatePipelineEventRequest.new({
|
@@ -19,11 +16,6 @@ body = DatadogAPIClient::V2::CIAppCreatePipelineEventRequest.new({
|
|
19
16
|
pipeline_unique_id: "3eacb6f3-ff04-4e10-8a9c-46e6d054024a",
|
20
17
|
pipeline_name: "Deploy to AWS",
|
21
18
|
url: "https://my-ci-provider.example/jobs/my-jobs/run/1",
|
22
|
-
git: DatadogAPIClient::V2::CIAppGitInfo.new({
|
23
|
-
repository_url: "https://github.com/DataDog/datadog-agent",
|
24
|
-
sha: "7f263865994b76066c4612fd1965215e7dcb4cd2",
|
25
|
-
author_email: "john.doe@email.com",
|
26
|
-
}),
|
27
19
|
}),
|
28
20
|
}),
|
29
21
|
type: DatadogAPIClient::V2::CIAppCreatePipelineEventRequestDataType::CIPIPELINE_RESOURCE_REQUEST,
|
@@ -0,0 +1,8 @@
|
|
1
|
+
# Get all Container Images returns "OK" response
|
2
|
+
|
3
|
+
require "datadog_api_client"
|
4
|
+
DatadogAPIClient.configure do |config|
|
5
|
+
config.unstable_operations["v2.list_container_images".to_sym] = true
|
6
|
+
end
|
7
|
+
api_instance = DatadogAPIClient::V2::ContainerImagesAPI.new
|
8
|
+
p api_instance.list_container_images()
|
@@ -0,0 +1,11 @@
|
|
1
|
+
# Get all Container Images returns "OK" response with pagination
|
2
|
+
|
3
|
+
require "datadog_api_client"
|
4
|
+
DatadogAPIClient.configure do |config|
|
5
|
+
config.unstable_operations["v2.list_container_images".to_sym] = true
|
6
|
+
end
|
7
|
+
api_instance = DatadogAPIClient::V2::ContainerImagesAPI.new
|
8
|
+
opts = {
|
9
|
+
page_size: 2,
|
10
|
+
}
|
11
|
+
api_instance.list_container_images_with_pagination(opts) { |item| puts item }
|
@@ -0,0 +1,11 @@
|
|
1
|
+
# Get all Container Image groups returns "OK" response
|
2
|
+
|
3
|
+
require "datadog_api_client"
|
4
|
+
DatadogAPIClient.configure do |config|
|
5
|
+
config.unstable_operations["v2.list_container_images".to_sym] = true
|
6
|
+
end
|
7
|
+
api_instance = DatadogAPIClient::V2::ContainerImagesAPI.new
|
8
|
+
opts = {
|
9
|
+
group_by: "short_image",
|
10
|
+
}
|
11
|
+
p api_instance.list_container_images(opts)
|
@@ -0,0 +1,19 @@
|
|
1
|
+
# Create a new entry for your service account with account_tags returns "OK" response
|
2
|
+
|
3
|
+
require "datadog_api_client"
|
4
|
+
api_instance = DatadogAPIClient::V2::GCPIntegrationAPI.new
|
5
|
+
|
6
|
+
body = DatadogAPIClient::V2::GCPSTSServiceAccountCreateRequest.new({
|
7
|
+
data: DatadogAPIClient::V2::GCPSTSServiceAccountData.new({
|
8
|
+
attributes: DatadogAPIClient::V2::GCPSTSServiceAccountAttributes.new({
|
9
|
+
account_tags: [
|
10
|
+
"lorem",
|
11
|
+
"ipsum",
|
12
|
+
],
|
13
|
+
client_email: "252bf553ef04b351@test-project.iam.gserviceaccount.com",
|
14
|
+
host_filters: [],
|
15
|
+
}),
|
16
|
+
type: DatadogAPIClient::V2::GCPServiceAccountType::GCP_SERVICE_ACCOUNT,
|
17
|
+
}),
|
18
|
+
})
|
19
|
+
p api_instance.create_gcpsts_account(body)
|
@@ -0,0 +1,47 @@
|
|
1
|
+
# Create a new powerpack returns "OK" response
|
2
|
+
|
3
|
+
require "datadog_api_client"
|
4
|
+
api_instance = DatadogAPIClient::V2::PowerpackAPI.new
|
5
|
+
|
6
|
+
body = DatadogAPIClient::V2::Powerpack.new({
|
7
|
+
data: DatadogAPIClient::V2::PowerpackData.new({
|
8
|
+
attributes: DatadogAPIClient::V2::PowerpackAttributes.new({
|
9
|
+
description: "Sample powerpack",
|
10
|
+
group_widget: DatadogAPIClient::V2::PowerpackGroupWidget.new({
|
11
|
+
definition: DatadogAPIClient::V2::PowerpackGroupWidgetDefinition.new({
|
12
|
+
layout_type: "ordered",
|
13
|
+
show_title: true,
|
14
|
+
title: "Sample Powerpack",
|
15
|
+
type: "group",
|
16
|
+
widgets: [
|
17
|
+
DatadogAPIClient::V2::PowerpackInnerWidgets.new({
|
18
|
+
definition: {
|
19
|
+
"content": "test", "type": "note",
|
20
|
+
},
|
21
|
+
}),
|
22
|
+
],
|
23
|
+
}),
|
24
|
+
layout: DatadogAPIClient::V2::PowerpackGroupWidgetLayout.new({
|
25
|
+
height: 3,
|
26
|
+
width: 12,
|
27
|
+
x: 0,
|
28
|
+
y: 0,
|
29
|
+
}),
|
30
|
+
}),
|
31
|
+
name: "Example-Powerpack",
|
32
|
+
tags: [
|
33
|
+
"tag:sample",
|
34
|
+
],
|
35
|
+
template_variables: [
|
36
|
+
DatadogAPIClient::V2::PowerpackTemplateVariable.new({
|
37
|
+
defaults: [
|
38
|
+
"*",
|
39
|
+
],
|
40
|
+
name: "sample",
|
41
|
+
}),
|
42
|
+
],
|
43
|
+
}),
|
44
|
+
type: "powerpack",
|
45
|
+
}),
|
46
|
+
})
|
47
|
+
p api_instance.create_powerpack(body)
|
@@ -0,0 +1,8 @@
|
|
1
|
+
# Delete a powerpack returns "OK" response
|
2
|
+
|
3
|
+
require "datadog_api_client"
|
4
|
+
api_instance = DatadogAPIClient::V2::PowerpackAPI.new
|
5
|
+
|
6
|
+
# there is a valid "powerpack" in the system
|
7
|
+
POWERPACK_DATA_ID = ENV["POWERPACK_DATA_ID"]
|
8
|
+
api_instance.delete_powerpack(POWERPACK_DATA_ID)
|
@@ -0,0 +1,8 @@
|
|
1
|
+
# Get a Powerpack returns "OK" response
|
2
|
+
|
3
|
+
require "datadog_api_client"
|
4
|
+
api_instance = DatadogAPIClient::V2::PowerpackAPI.new
|
5
|
+
|
6
|
+
# there is a valid "powerpack" in the system
|
7
|
+
POWERPACK_DATA_ID = ENV["POWERPACK_DATA_ID"]
|
8
|
+
p api_instance.get_powerpack(POWERPACK_DATA_ID)
|
@@ -0,0 +1,50 @@
|
|
1
|
+
# Update a powerpack returns "OK" response
|
2
|
+
|
3
|
+
require "datadog_api_client"
|
4
|
+
api_instance = DatadogAPIClient::V2::PowerpackAPI.new
|
5
|
+
|
6
|
+
# there is a valid "powerpack" in the system
|
7
|
+
POWERPACK_DATA_ID = ENV["POWERPACK_DATA_ID"]
|
8
|
+
|
9
|
+
body = DatadogAPIClient::V2::Powerpack.new({
|
10
|
+
data: DatadogAPIClient::V2::PowerpackData.new({
|
11
|
+
attributes: DatadogAPIClient::V2::PowerpackAttributes.new({
|
12
|
+
description: "Sample powerpack",
|
13
|
+
group_widget: DatadogAPIClient::V2::PowerpackGroupWidget.new({
|
14
|
+
definition: DatadogAPIClient::V2::PowerpackGroupWidgetDefinition.new({
|
15
|
+
layout_type: "ordered",
|
16
|
+
show_title: true,
|
17
|
+
title: "Sample Powerpack",
|
18
|
+
type: "group",
|
19
|
+
widgets: [
|
20
|
+
DatadogAPIClient::V2::PowerpackInnerWidgets.new({
|
21
|
+
definition: {
|
22
|
+
"content": "test", "type": "note",
|
23
|
+
},
|
24
|
+
}),
|
25
|
+
],
|
26
|
+
}),
|
27
|
+
layout: DatadogAPIClient::V2::PowerpackGroupWidgetLayout.new({
|
28
|
+
height: 3,
|
29
|
+
width: 12,
|
30
|
+
x: 0,
|
31
|
+
y: 0,
|
32
|
+
}),
|
33
|
+
}),
|
34
|
+
name: "Example-Powerpack",
|
35
|
+
tags: [
|
36
|
+
"tag:sample",
|
37
|
+
],
|
38
|
+
template_variables: [
|
39
|
+
DatadogAPIClient::V2::PowerpackTemplateVariable.new({
|
40
|
+
defaults: [
|
41
|
+
"*",
|
42
|
+
],
|
43
|
+
name: "sample",
|
44
|
+
}),
|
45
|
+
],
|
46
|
+
}),
|
47
|
+
type: "powerpack",
|
48
|
+
}),
|
49
|
+
})
|
50
|
+
p api_instance.update_powerpack(POWERPACK_DATA_ID, body)
|
@@ -6,7 +6,7 @@ api_instance = DatadogAPIClient::V2::RUMAPI.new
|
|
6
6
|
body = DatadogAPIClient::V2::RUMApplicationCreateRequest.new({
|
7
7
|
data: DatadogAPIClient::V2::RUMApplicationCreate.new({
|
8
8
|
attributes: DatadogAPIClient::V2::RUMApplicationCreateAttributes.new({
|
9
|
-
name: "
|
9
|
+
name: "test-rum-5c67ebb32077e1d9",
|
10
10
|
type: "ios",
|
11
11
|
}),
|
12
12
|
type: DatadogAPIClient::V2::RUMApplicationCreateType::RUM_APPLICATION_CREATE,
|