datadog_api_client 2.0.0 → 2.1.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.
- checksums.yaml +4 -4
- data/.apigentools-info +6 -6
- data/.generator/conftest.py +2 -1
- data/.generator/schemas/v1/openapi.yaml +284 -902
- data/.generator/schemas/v2/openapi.yaml +343 -672
- data/.generator/src/generator/formatter.py +1 -1
- data/.generator/src/generator/templates/example.j2 +5 -0
- data/.github/workflows/test.yml +1 -1
- data/.github/workflows/test_integration.yml +5 -0
- data/CHANGELOG.md +42 -0
- data/README.md +13 -13
- data/examples/v1/dashboards/CreateDashboard_1094917386.rb +37 -0
- data/examples/v1/dashboards/CreateDashboard_1307120899.rb +61 -0
- data/examples/v1/monitors/ValidateExistingMonitor.rb +1 -0
- data/examples/v1/monitors/ValidateMonitor.rb +1 -0
- data/examples/v1/monitors/ValidateMonitor_4247196452.rb +38 -0
- data/examples/v1/pagerduty-integration/DeletePagerDutyIntegrationService.rb +2 -2
- data/examples/v1/synthetics/CreateGlobalVariable.rb +1 -0
- data/examples/v1/synthetics/CreateGlobalVariable_1068962881.rb +23 -0
- data/examples/v1/synthetics/CreateSyntheticsAPITest_1279271422.rb +10 -0
- data/examples/v1/synthetics/CreateSyntheticsBrowserTest_2932742688.rb +6 -0
- data/examples/v1/synthetics/EditGlobalVariable.rb +1 -0
- data/examples/v1/synthetics/UpdateBrowserTest.rb +1 -0
- data/examples/v1/usage-metering/GetDailyCustomReports.rb +0 -3
- data/examples/v1/usage-metering/GetMonthlyCustomReports.rb +0 -3
- data/examples/v1/usage-metering/GetSpecifiedDailyCustomReports.rb +0 -3
- data/examples/v1/usage-metering/GetSpecifiedMonthlyCustomReports.rb +0 -3
- data/examples/v1/usage-metering/GetUsageAttribution.rb +0 -3
- data/examples/v2/audit/ListAuditLogs_1275402458.rb +8 -0
- data/examples/v2/audit/SearchAuditLogs_3215529662.rb +22 -0
- data/examples/v2/events/ListEvents_1527584014.rb +13 -0
- data/examples/v2/events/SearchEvents_3856995058.rb +25 -0
- data/examples/v2/incidents/ListIncidents_2665616954.rb +11 -0
- data/examples/v2/logs/ListLogsGet_738202670.rb +8 -0
- data/examples/v2/logs/ListLogs_3138392594.rb +25 -0
- data/examples/v2/metrics/SubmitMetrics_1762007427.rb +23 -0
- data/examples/v2/processes/ListProcesses_797840471.rb +8 -0
- data/examples/v2/roles/UpdateRole.rb +13 -0
- data/examples/v2/rum/CreateRUMApplication.rb +15 -0
- data/examples/v2/rum/DeleteRUMApplication.rb +8 -0
- data/examples/v2/rum/GetRUMApplication.rb +8 -0
- data/examples/v2/rum/GetRUMApplications.rb +5 -0
- data/examples/v2/rum/ListRUMEvents_2680821282.rb +8 -0
- data/examples/v2/rum/SearchRUMEvents_574690310.rb +21 -0
- data/examples/v2/rum/UpdateRUMApplication.rb +16 -0
- data/examples/v2/security-monitoring/ListSecurityMonitoringSignals_3960412991.rb +8 -0
- data/examples/v2/security-monitoring/SearchSecurityMonitoringSignals_1309350146.rb +20 -0
- data/examples/v2/usage-metering/GetHourlyUsage.rb +5 -0
- data/lib/datadog_api_client/configuration.rb +0 -5
- data/lib/datadog_api_client/inflector.rb +16 -0
- data/lib/datadog_api_client/v1/api/metrics_api.rb +1 -1
- data/lib/datadog_api_client/v1/api/usage_metering_api.rb +42 -62
- data/lib/datadog_api_client/v1/models/formula_and_function_events_data_source.rb +1 -0
- data/lib/datadog_api_client/v1/models/hourly_usage_attribution_usage_type.rb +1 -0
- data/lib/datadog_api_client/v1/models/list_stream_source.rb +1 -0
- data/lib/datadog_api_client/v1/models/metric_content_encoding.rb +1 -0
- data/lib/datadog_api_client/v1/models/monitor_options.rb +28 -1
- data/lib/datadog_api_client/v1/models/monitor_summary_widget_definition.rb +13 -1
- data/lib/datadog_api_client/v1/models/monthly_usage_attribution_supported_metrics.rb +2 -0
- data/lib/datadog_api_client/v1/models/monthly_usage_attribution_values.rb +21 -1
- data/lib/datadog_api_client/v1/models/on_missing_data_option.rb +33 -0
- data/lib/datadog_api_client/v1/models/synthetics_basic_auth.rb +2 -1
- data/lib/datadog_api_client/v1/models/synthetics_basic_auth_digest.rb +155 -0
- data/lib/datadog_api_client/v1/models/synthetics_basic_auth_digest_type.rb +26 -0
- data/lib/datadog_api_client/v1/models/synthetics_global_variable_parse_test_options.rb +11 -12
- data/lib/datadog_api_client/v1/models/synthetics_global_variable_parse_test_options_type.rb +1 -0
- data/lib/datadog_api_client/v1/models/synthetics_test_options.rb +31 -1
- data/lib/datadog_api_client/v1/models/synthetics_test_process_status.rb +0 -1
- data/lib/datadog_api_client/v1/models/synthetics_test_request.rb +15 -1
- data/lib/datadog_api_client/v1/models/usage_attribution_sort.rb +2 -0
- data/lib/datadog_api_client/v1/models/usage_attribution_supported_metrics.rb +2 -0
- data/lib/datadog_api_client/v1/models/usage_attribution_values.rb +21 -1
- data/lib/datadog_api_client/v1/models/usage_billable_summary_hour.rb +11 -1
- data/lib/datadog_api_client/v1/models/usage_cloud_security_posture_management_hour.rb +12 -1
- data/lib/datadog_api_client/v1/models/usage_summary_date.rb +11 -1
- data/lib/datadog_api_client/v1/models/usage_summary_date_org.rb +21 -1
- data/lib/datadog_api_client/v1/models/usage_summary_response.rb +11 -1
- data/lib/datadog_api_client/v1/models/widget_monitor_summary_sort.rb +2 -0
- data/lib/datadog_api_client/v2/api/events_api.rb +1 -1
- data/lib/datadog_api_client/v2/api/logs_api.rb +1 -1
- data/lib/datadog_api_client/v2/api/metrics_api.rb +1 -1
- data/lib/datadog_api_client/v2/api/rum_api.rb +329 -0
- data/lib/datadog_api_client/v2/api/security_monitoring_api.rb +3 -3
- data/lib/datadog_api_client/v2/models/content_encoding.rb +1 -0
- data/lib/datadog_api_client/v2/models/metric_content_encoding.rb +2 -0
- data/lib/datadog_api_client/v2/models/role_update_data.rb +11 -1
- data/lib/datadog_api_client/v2/models/rum_application.rb +166 -0
- data/lib/datadog_api_client/v2/models/rum_application_attributes.rb +279 -0
- data/lib/datadog_api_client/v2/models/rum_application_create.rb +145 -0
- data/lib/datadog_api_client/v2/models/rum_application_create_attributes.rb +132 -0
- data/lib/datadog_api_client/v2/models/rum_application_create_request.rb +122 -0
- data/lib/datadog_api_client/v2/models/rum_application_create_type.rb +26 -0
- data/lib/datadog_api_client/v2/models/rum_application_response.rb +111 -0
- data/lib/datadog_api_client/v2/models/rum_application_type.rb +26 -0
- data/lib/datadog_api_client/v2/models/rum_application_update.rb +155 -0
- data/lib/datadog_api_client/v2/models/rum_application_update_attributes.rb +121 -0
- data/lib/datadog_api_client/v2/models/rum_application_update_request.rb +122 -0
- data/lib/datadog_api_client/v2/models/rum_application_update_type.rb +26 -0
- data/lib/datadog_api_client/v2/models/rum_applications_response.rb +113 -0
- data/lib/datadog_api_client/version.rb +1 -1
- data/lib/datadog_api_client.rb +6 -4
- metadata +41 -3
- data/lib/datadog_api_client/v2.rb +0 -595
|
@@ -136,7 +136,7 @@ def format_parameters(kwargs, spec, replace_values=None, has_body=False):
|
|
|
136
136
|
required = p.get("required", False)
|
|
137
137
|
k = snake_case(p["name"])
|
|
138
138
|
if required:
|
|
139
|
-
v = kwargs.pop(
|
|
139
|
+
v = kwargs.pop(p["name"]) # otherwise there is a missing required parameters
|
|
140
140
|
value = format_data_with_schema(
|
|
141
141
|
v["value"],
|
|
142
142
|
p["schema"],
|
|
@@ -33,8 +33,13 @@ opts = {
|
|
|
33
33
|
{%- endfor %}
|
|
34
34
|
}
|
|
35
35
|
{%- endif %}
|
|
36
|
+
|
|
37
|
+
{%- if context.pagination %}
|
|
38
|
+
api_instance.{{ context.api_request.operation_id|snake_case }}_with_pagination({{ parameters }}) { |item| puts item }
|
|
39
|
+
{%- else %}
|
|
36
40
|
{%- if context.status_code != 204 %}
|
|
37
41
|
p api_instance.{{ context.api_request.operation_id|snake_case }}({{ parameters }})
|
|
38
42
|
{%- else %}
|
|
39
43
|
api_instance.{{ context.api_request.operation_id|snake_case }}({{ parameters }})
|
|
40
44
|
{%- endif %}
|
|
45
|
+
{%- endif %}
|
data/.github/workflows/test.yml
CHANGED
|
@@ -128,5 +128,5 @@ jobs:
|
|
|
128
128
|
with:
|
|
129
129
|
github-token: ${{ steps.get_token.outputs.token }}
|
|
130
130
|
repo: datadog-api-spec
|
|
131
|
-
status: ${{ needs.test.result == 'success' && needs.examples.result == 'success' && 'success' || 'failure' }}
|
|
131
|
+
status: ${{ (needs.test.result == 'cancelled' || needs.examples.result == 'cancelled') && 'pending' || needs.test.result == 'success' && needs.examples.result == 'success' && 'success' || 'failure' }}
|
|
132
132
|
context: unit
|
|
@@ -2,6 +2,7 @@ name: Run Integration Tests
|
|
|
2
2
|
|
|
3
3
|
on:
|
|
4
4
|
pull_request:
|
|
5
|
+
types: [opened, synchronize, reopened, ready_for_review]
|
|
5
6
|
branches:
|
|
6
7
|
- master
|
|
7
8
|
schedule:
|
|
@@ -49,6 +50,10 @@ jobs:
|
|
|
49
50
|
repo: datadog-api-spec
|
|
50
51
|
status: pending
|
|
51
52
|
context: integration
|
|
53
|
+
- name: Install system zstd
|
|
54
|
+
run: |
|
|
55
|
+
sudo apt-get -y install zstd
|
|
56
|
+
echo "ZSTANDARD_LIBRARY=$(find /usr/lib -iname libzstd.so.1)" >> $GITHUB_ENV
|
|
52
57
|
- name: Set up Ruby 3.1
|
|
53
58
|
uses: ruby/setup-ruby@v1
|
|
54
59
|
with:
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,47 @@
|
|
|
1
1
|
# CHANGELOG
|
|
2
2
|
|
|
3
|
+
## 2.1.0 / 2022-08-31
|
|
4
|
+
|
|
5
|
+
### Added
|
|
6
|
+
* Add support for digest auth in synthetics tests by @api-clients-generation-pipeline in https://github.com/DataDog/datadog-api-client-ruby/pull/1021
|
|
7
|
+
* Add support for RUM application endpoints by @api-clients-generation-pipeline in https://github.com/DataDog/datadog-api-client-ruby/pull/1022
|
|
8
|
+
* add priority parameters for dashboard monitor summary widget by @api-clients-generation-pipeline in https://github.com/DataDog/datadog-api-client-ruby/pull/1026
|
|
9
|
+
* Add `logs_pattern_stream` to `list_stream` widget source by @api-clients-generation-pipeline in https://github.com/DataDog/datadog-api-client-ruby/pull/1028
|
|
10
|
+
* Add group_retention_duration and on_missing_data monitor options by @api-clients-generation-pipeline in https://github.com/DataDog/datadog-api-client-ruby/pull/1024
|
|
11
|
+
* Expose CSPM aws host count in Usage Metering API by @api-clients-generation-pipeline in https://github.com/DataDog/datadog-api-client-ruby/pull/1041
|
|
12
|
+
* Add estimated ingested logs attribution by @api-clients-generation-pipeline in https://github.com/DataDog/datadog-api-client-ruby/pull/1005
|
|
13
|
+
* Add org region to usage summary and billable usage summary by @api-clients-generation-pipeline in https://github.com/DataDog/datadog-api-client-ruby/pull/1034
|
|
14
|
+
* add compression methods to metric payloads by @api-clients-generation-pipeline in https://github.com/DataDog/datadog-api-client-ruby/pull/1001
|
|
15
|
+
* Add role relationships to RoleUpdateData by @api-clients-generation-pipeline in https://github.com/DataDog/datadog-api-client-ruby/pull/1038
|
|
16
|
+
* Add `ci_tests` enum to FormulaAndFunctionEventsDataSource by @api-clients-generation-pipeline in https://github.com/DataDog/datadog-api-client-ruby/pull/1035
|
|
17
|
+
* Add missing options and request option to synthetics test by @api-clients-generation-pipeline in https://github.com/DataDog/datadog-api-client-ruby/pull/1027
|
|
18
|
+
* Add support for global variable from multistep synthetics tests by @api-clients-generation-pipeline in https://github.com/DataDog/datadog-api-client-ruby/pull/993
|
|
19
|
+
### Changed
|
|
20
|
+
* update deprecated usage attribution API docs to direct users to migra… by @api-clients-generation-pipeline in https://github.com/DataDog/datadog-api-client-ruby/pull/1029
|
|
21
|
+
* [Synthetics] remove started form eventType enum by @api-clients-generation-pipeline in https://github.com/DataDog/datadog-api-client-ruby/pull/1031
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
**Full Changelog**: https://github.com/DataDog/datadog-api-client-ruby/compare/v2.0.2...v2.1.0
|
|
25
|
+
|
|
26
|
+
## 2.0.2 / 2022-08-03
|
|
27
|
+
|
|
28
|
+
### Fixed
|
|
29
|
+
* Update Pagerduty operation `DeletePagerDutyIntegrationService` response status code by @api-clients-generation-pipeline in https://github.com/DataDog/datadog-api-client-ruby/pull/1004
|
|
30
|
+
* Don't try to load model_base on eager_load by @skarimo in https://github.com/DataDog/datadog-api-client-ruby/pull/1018
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
**Full Changelog**: https://github.com/DataDog/datadog-api-client-ruby/compare/v2.0.1...v2.0.2
|
|
34
|
+
|
|
35
|
+
## 2.0.1 / 2022-08-02
|
|
36
|
+
|
|
37
|
+
### Fixed
|
|
38
|
+
* Configure Zeitwerk with absolute paths by @anakinj in https://github.com/DataDog/datadog-api-client-ruby/pull/1010
|
|
39
|
+
|
|
40
|
+
## New Contributors
|
|
41
|
+
* @anakinj made their first contribution in https://github.com/DataDog/datadog-api-client-ruby/pull/1010
|
|
42
|
+
|
|
43
|
+
**Full Changelog**: https://github.com/DataDog/datadog-api-client-ruby/compare/v2.0.0...v2.0.1
|
|
44
|
+
|
|
3
45
|
## 2.0.0 / 2022-08-01
|
|
4
46
|
|
|
5
47
|
### Fixed
|
data/README.md
CHANGED
|
@@ -27,7 +27,7 @@ The following steps will help you quickly start interacting with Datadog APIs us
|
|
|
27
27
|
3. (optional) You can configure site and [authentication](#authentication) using environment variables or code block:
|
|
28
28
|
|
|
29
29
|
```ruby
|
|
30
|
-
DatadogAPIClient
|
|
30
|
+
DatadogAPIClient.configure do |config|
|
|
31
31
|
config.server_variables[:site] = 'datadoghq.eu'
|
|
32
32
|
end
|
|
33
33
|
```
|
|
@@ -78,7 +78,7 @@ api_instance = DatadogAPIClient::V1::IPRangesAPI.new
|
|
|
78
78
|
begin
|
|
79
79
|
result = api_instance.get_ip_ranges
|
|
80
80
|
p result
|
|
81
|
-
rescue DatadogAPIClient::
|
|
81
|
+
rescue DatadogAPIClient::APIError => e
|
|
82
82
|
puts "Error when calling IPRangesAPI->get_ip_ranges: #{e}"
|
|
83
83
|
end
|
|
84
84
|
```
|
|
@@ -88,7 +88,7 @@ end
|
|
|
88
88
|
Authenticate with the API by providing your API and Application keys in the configuration:
|
|
89
89
|
|
|
90
90
|
```ruby
|
|
91
|
-
DatadogAPIClient
|
|
91
|
+
DatadogAPIClient.configure do |config|
|
|
92
92
|
config.api_key = ENV['NON_STANDARD_NAME_FOR_DD_API_KEY']
|
|
93
93
|
config.application_key = ENV['NON_STANDARD_NAME_FOR_DD_APP_KEY']
|
|
94
94
|
end
|
|
@@ -99,8 +99,8 @@ end
|
|
|
99
99
|
This client includes access to Datadog API endpoints while they are in an unstable state and may undergo breaking changes. An extra configuration step is required to enable these endpoints:
|
|
100
100
|
|
|
101
101
|
```ruby
|
|
102
|
-
DatadogAPIClient
|
|
103
|
-
config.unstable_operations[:'<unstable_operation_id>'] = true
|
|
102
|
+
DatadogAPIClient.configure do |config|
|
|
103
|
+
config.unstable_operations[:'<api_version>.<unstable_operation_id>'] = true
|
|
104
104
|
end
|
|
105
105
|
```
|
|
106
106
|
|
|
@@ -111,9 +111,9 @@ where `<unstable_operation_id>` is the name of the method used to interact with
|
|
|
111
111
|
When talking to a different server, like the `eu` instance, change the `server_variables` on your configuration object:
|
|
112
112
|
|
|
113
113
|
```ruby
|
|
114
|
-
config = DatadogAPIClient::
|
|
114
|
+
config = DatadogAPIClient::Configuration.new
|
|
115
115
|
config.server_variables["site"] = "datadoghq.eu"
|
|
116
|
-
client = DatadogAPIClient::
|
|
116
|
+
client = DatadogAPIClient::APIClient.new(config)
|
|
117
117
|
```
|
|
118
118
|
|
|
119
119
|
### Disable compressed payloads
|
|
@@ -122,9 +122,9 @@ If you want to disable GZIP compressed responses, set the `compress` flag
|
|
|
122
122
|
on your configuration object:
|
|
123
123
|
|
|
124
124
|
```ruby
|
|
125
|
-
config = DatadogAPIClient::
|
|
125
|
+
config = DatadogAPIClient::Configuration.new
|
|
126
126
|
config.compress = false
|
|
127
|
-
client = DatadogAPIClient::
|
|
127
|
+
client = DatadogAPIClient::APIClient.new(config)
|
|
128
128
|
```
|
|
129
129
|
|
|
130
130
|
### Enable requests logging
|
|
@@ -133,9 +133,9 @@ If you want to enable requests logging, set the `debugging` flag
|
|
|
133
133
|
on your configuration object:
|
|
134
134
|
|
|
135
135
|
```ruby
|
|
136
|
-
config = DatadogAPIClient::
|
|
136
|
+
config = DatadogAPIClient::Configuration.new
|
|
137
137
|
config.debugging = true
|
|
138
|
-
client = DatadogAPIClient::
|
|
138
|
+
client = DatadogAPIClient::APIClient.new(config)
|
|
139
139
|
```
|
|
140
140
|
|
|
141
141
|
### Pagination
|
|
@@ -145,8 +145,8 @@ For example, to retrieve all your incidents:
|
|
|
145
145
|
|
|
146
146
|
```ruby
|
|
147
147
|
require "datadog_api_client"
|
|
148
|
-
DatadogAPIClient
|
|
149
|
-
config.unstable_operations[:list_incidents] = true
|
|
148
|
+
DatadogAPIClient.configure do |config|
|
|
149
|
+
config.unstable_operations[:'v2.list_incidents'] = true
|
|
150
150
|
end
|
|
151
151
|
api_instance = DatadogAPIClient::V2::IncidentsAPI.new
|
|
152
152
|
api_instance.list_incidents_with_pagination() do |incident|
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# Create a new dashboard with manage_status widget and show_priority parameter
|
|
2
|
+
|
|
3
|
+
require "datadog_api_client"
|
|
4
|
+
api_instance = DatadogAPIClient::V1::DashboardsAPI.new
|
|
5
|
+
|
|
6
|
+
body = DatadogAPIClient::V1::Dashboard.new({
|
|
7
|
+
title: "Example-Create_a_new_dashboard_with_manage_status_widget_and_show_priority_parameter",
|
|
8
|
+
description: "",
|
|
9
|
+
widgets: [
|
|
10
|
+
DatadogAPIClient::V1::Widget.new({
|
|
11
|
+
layout: DatadogAPIClient::V1::WidgetLayout.new({
|
|
12
|
+
x: 0,
|
|
13
|
+
y: 0,
|
|
14
|
+
width: 50,
|
|
15
|
+
height: 25,
|
|
16
|
+
}),
|
|
17
|
+
definition: DatadogAPIClient::V1::MonitorSummaryWidgetDefinition.new({
|
|
18
|
+
type: DatadogAPIClient::V1::MonitorSummaryWidgetDefinitionType::MANAGE_STATUS,
|
|
19
|
+
summary_type: DatadogAPIClient::V1::WidgetSummaryType::MONITORS,
|
|
20
|
+
display_format: DatadogAPIClient::V1::WidgetMonitorSummaryDisplayFormat::COUNTS_AND_LIST,
|
|
21
|
+
color_preference: DatadogAPIClient::V1::WidgetColorPreference::TEXT,
|
|
22
|
+
hide_zero_counts: true,
|
|
23
|
+
show_last_triggered: false,
|
|
24
|
+
query: "",
|
|
25
|
+
sort: DatadogAPIClient::V1::WidgetMonitorSummarySort::PRIORITY_ASCENDING,
|
|
26
|
+
count: 50,
|
|
27
|
+
start: 0,
|
|
28
|
+
show_priority: false,
|
|
29
|
+
}),
|
|
30
|
+
}),
|
|
31
|
+
],
|
|
32
|
+
template_variables: [],
|
|
33
|
+
layout_type: DatadogAPIClient::V1::DashboardLayoutType::FREE,
|
|
34
|
+
is_read_only: false,
|
|
35
|
+
notify_list: [],
|
|
36
|
+
})
|
|
37
|
+
p api_instance.create_dashboard(body)
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
# Create a new timeseries widget with ci_tests data source
|
|
2
|
+
|
|
3
|
+
require "datadog_api_client"
|
|
4
|
+
api_instance = DatadogAPIClient::V1::DashboardsAPI.new
|
|
5
|
+
|
|
6
|
+
body = DatadogAPIClient::V1::Dashboard.new({
|
|
7
|
+
title: "Example-Create_a_new_timeseries_widget_with_ci_tests_data_source with ci_tests datasource",
|
|
8
|
+
widgets: [
|
|
9
|
+
DatadogAPIClient::V1::Widget.new({
|
|
10
|
+
definition: DatadogAPIClient::V1::TimeseriesWidgetDefinition.new({
|
|
11
|
+
title: "",
|
|
12
|
+
show_legend: true,
|
|
13
|
+
legend_layout: DatadogAPIClient::V1::TimeseriesWidgetLegendLayout::AUTO,
|
|
14
|
+
legend_columns: [
|
|
15
|
+
DatadogAPIClient::V1::TimeseriesWidgetLegendColumn::AVG,
|
|
16
|
+
DatadogAPIClient::V1::TimeseriesWidgetLegendColumn::MIN,
|
|
17
|
+
DatadogAPIClient::V1::TimeseriesWidgetLegendColumn::MAX,
|
|
18
|
+
DatadogAPIClient::V1::TimeseriesWidgetLegendColumn::VALUE,
|
|
19
|
+
DatadogAPIClient::V1::TimeseriesWidgetLegendColumn::SUM,
|
|
20
|
+
],
|
|
21
|
+
time: DatadogAPIClient::V1::WidgetTime.new({}),
|
|
22
|
+
type: DatadogAPIClient::V1::TimeseriesWidgetDefinitionType::TIMESERIES,
|
|
23
|
+
requests: [
|
|
24
|
+
DatadogAPIClient::V1::TimeseriesWidgetRequest.new({
|
|
25
|
+
formulas: [
|
|
26
|
+
DatadogAPIClient::V1::WidgetFormula.new({
|
|
27
|
+
formula: "query1",
|
|
28
|
+
}),
|
|
29
|
+
],
|
|
30
|
+
queries: [
|
|
31
|
+
DatadogAPIClient::V1::FormulaAndFunctionEventQueryDefinition.new({
|
|
32
|
+
data_source: DatadogAPIClient::V1::FormulaAndFunctionEventsDataSource::CI_TESTS,
|
|
33
|
+
name: "query1",
|
|
34
|
+
search: DatadogAPIClient::V1::FormulaAndFunctionEventQueryDefinitionSearch.new({
|
|
35
|
+
query: "test_level:test",
|
|
36
|
+
}),
|
|
37
|
+
indexes: [
|
|
38
|
+
"*",
|
|
39
|
+
],
|
|
40
|
+
compute: DatadogAPIClient::V1::FormulaAndFunctionEventQueryDefinitionCompute.new({
|
|
41
|
+
aggregation: DatadogAPIClient::V1::FormulaAndFunctionEventAggregation::COUNT,
|
|
42
|
+
}),
|
|
43
|
+
group_by: [],
|
|
44
|
+
}),
|
|
45
|
+
],
|
|
46
|
+
response_format: DatadogAPIClient::V1::FormulaAndFunctionResponseFormat::TIMESERIES,
|
|
47
|
+
style: DatadogAPIClient::V1::WidgetRequestStyle.new({
|
|
48
|
+
palette: "dog_classic",
|
|
49
|
+
line_type: DatadogAPIClient::V1::WidgetLineType::SOLID,
|
|
50
|
+
line_width: DatadogAPIClient::V1::WidgetLineWidth::NORMAL,
|
|
51
|
+
}),
|
|
52
|
+
display_type: DatadogAPIClient::V1::WidgetDisplayType::LINE,
|
|
53
|
+
}),
|
|
54
|
+
],
|
|
55
|
+
}),
|
|
56
|
+
}),
|
|
57
|
+
],
|
|
58
|
+
layout_type: DatadogAPIClient::V1::DashboardLayoutType::ORDERED,
|
|
59
|
+
reflow_type: DatadogAPIClient::V1::DashboardReflowType::AUTO,
|
|
60
|
+
})
|
|
61
|
+
p api_instance.create_dashboard(body)
|
|
@@ -27,6 +27,7 @@ body = DatadogAPIClient::V1::Monitor.new({
|
|
|
27
27
|
no_data_timeframe: nil,
|
|
28
28
|
notify_audit: false,
|
|
29
29
|
notify_no_data: false,
|
|
30
|
+
on_missing_data: DatadogAPIClient::V1::OnMissingDataOption::SHOW_AND_NOTIFY_NO_DATA,
|
|
30
31
|
renotify_interval: 60,
|
|
31
32
|
require_full_window: true,
|
|
32
33
|
timeout_h: 24,
|
|
@@ -24,6 +24,7 @@ body = DatadogAPIClient::V1::Monitor.new({
|
|
|
24
24
|
no_data_timeframe: nil,
|
|
25
25
|
notify_audit: false,
|
|
26
26
|
notify_no_data: false,
|
|
27
|
+
on_missing_data: DatadogAPIClient::V1::OnMissingDataOption::SHOW_AND_NOTIFY_NO_DATA,
|
|
27
28
|
renotify_interval: 60,
|
|
28
29
|
require_full_window: true,
|
|
29
30
|
timeout_h: 24,
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# Validate a multi-alert monitor returns "OK" response
|
|
2
|
+
|
|
3
|
+
require "datadog_api_client"
|
|
4
|
+
api_instance = DatadogAPIClient::V1::MonitorsAPI.new
|
|
5
|
+
|
|
6
|
+
body = DatadogAPIClient::V1::Monitor.new({
|
|
7
|
+
name: "Example-Validate_a_multi_alert_monitor_returns_OK_response",
|
|
8
|
+
type: DatadogAPIClient::V1::MonitorType::LOG_ALERT,
|
|
9
|
+
query: 'logs("service:foo AND type:error").index("main").rollup("count").by("source").last("5m") > 2',
|
|
10
|
+
message: "some message Notify: @hipchat-channel",
|
|
11
|
+
tags: [
|
|
12
|
+
"test:examplevalidateamultialertmonitorreturnsokresponse",
|
|
13
|
+
"env:ci",
|
|
14
|
+
],
|
|
15
|
+
priority: 3,
|
|
16
|
+
options: DatadogAPIClient::V1::MonitorOptions.new({
|
|
17
|
+
enable_logs_sample: true,
|
|
18
|
+
escalation_message: "the situation has escalated",
|
|
19
|
+
evaluation_delay: 700,
|
|
20
|
+
group_retention_duration: "2d",
|
|
21
|
+
groupby_simple_monitor: false,
|
|
22
|
+
include_tags: true,
|
|
23
|
+
locked: false,
|
|
24
|
+
new_host_delay: 600,
|
|
25
|
+
no_data_timeframe: nil,
|
|
26
|
+
notify_audit: false,
|
|
27
|
+
notify_no_data: false,
|
|
28
|
+
on_missing_data: DatadogAPIClient::V1::OnMissingDataOption::SHOW_AND_NOTIFY_NO_DATA,
|
|
29
|
+
renotify_interval: 60,
|
|
30
|
+
require_full_window: true,
|
|
31
|
+
timeout_h: 24,
|
|
32
|
+
thresholds: DatadogAPIClient::V1::MonitorThresholds.new({
|
|
33
|
+
critical: 2,
|
|
34
|
+
warning: 1,
|
|
35
|
+
}),
|
|
36
|
+
}),
|
|
37
|
+
})
|
|
38
|
+
p api_instance.validate_monitor(body)
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
# Delete a single service object returns "
|
|
1
|
+
# Delete a single service object returns "No Content" response
|
|
2
2
|
|
|
3
3
|
require "datadog_api_client"
|
|
4
4
|
api_instance = DatadogAPIClient::V1::PagerDutyIntegrationAPI.new
|
|
5
|
-
|
|
5
|
+
api_instance.delete_pager_duty_integration_service("service_name")
|
|
@@ -13,6 +13,7 @@ body = DatadogAPIClient::V1::SyntheticsGlobalVariable.new({
|
|
|
13
13
|
name: "MY_VARIABLE",
|
|
14
14
|
parse_test_options: DatadogAPIClient::V1::SyntheticsGlobalVariableParseTestOptions.new({
|
|
15
15
|
field: "content-type",
|
|
16
|
+
local_variable_name: "LOCAL_VARIABLE",
|
|
16
17
|
parser: DatadogAPIClient::V1::SyntheticsVariableParser.new({
|
|
17
18
|
type: DatadogAPIClient::V1::SyntheticsGlobalVariableParserType::REGEX,
|
|
18
19
|
value: ".*",
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# Create a global variable from test returns "OK" response
|
|
2
|
+
|
|
3
|
+
require "datadog_api_client"
|
|
4
|
+
api_instance = DatadogAPIClient::V1::SyntheticsAPI.new
|
|
5
|
+
|
|
6
|
+
# there is a valid "synthetics_api_test_multi_step" in the system
|
|
7
|
+
SYNTHETICS_API_TEST_MULTI_STEP_PUBLIC_ID = ENV["SYNTHETICS_API_TEST_MULTI_STEP_PUBLIC_ID"]
|
|
8
|
+
|
|
9
|
+
body = DatadogAPIClient::V1::SyntheticsGlobalVariable.new({
|
|
10
|
+
description: "",
|
|
11
|
+
name: "GLOBAL_VARIABLE_PAYLOAD",
|
|
12
|
+
tags: [],
|
|
13
|
+
value: DatadogAPIClient::V1::SyntheticsGlobalVariableValue.new({
|
|
14
|
+
secure: false,
|
|
15
|
+
value: "",
|
|
16
|
+
}),
|
|
17
|
+
parse_test_public_id: SYNTHETICS_API_TEST_MULTI_STEP_PUBLIC_ID,
|
|
18
|
+
parse_test_options: DatadogAPIClient::V1::SyntheticsGlobalVariableParseTestOptions.new({
|
|
19
|
+
type: DatadogAPIClient::V1::SyntheticsGlobalVariableParseTestOptionsType::LOCAL_VARIABLE,
|
|
20
|
+
local_variable_name: "EXTRACTED_VALUE",
|
|
21
|
+
}),
|
|
22
|
+
})
|
|
23
|
+
p api_instance.create_global_variable(body)
|
|
@@ -23,6 +23,16 @@ body = DatadogAPIClient::V1::SyntheticsAPITest.new({
|
|
|
23
23
|
target: 200,
|
|
24
24
|
}),
|
|
25
25
|
],
|
|
26
|
+
extracted_values: [
|
|
27
|
+
DatadogAPIClient::V1::SyntheticsParsingOptions.new({
|
|
28
|
+
field: "server",
|
|
29
|
+
name: "EXTRACTED_VALUE",
|
|
30
|
+
parser: DatadogAPIClient::V1::SyntheticsVariableParser.new({
|
|
31
|
+
type: DatadogAPIClient::V1::SyntheticsGlobalVariableParserType::RAW,
|
|
32
|
+
}),
|
|
33
|
+
type: DatadogAPIClient::V1::SyntheticsGlobalVariableParseTestOptionsType::HTTP_HEADER,
|
|
34
|
+
}),
|
|
35
|
+
],
|
|
26
36
|
is_critical: true,
|
|
27
37
|
name: "request is sent",
|
|
28
38
|
request: DatadogAPIClient::V1::SyntheticsTestRequest.new({
|
|
@@ -17,6 +17,9 @@ body = DatadogAPIClient::V1::SyntheticsBrowserTest.new({
|
|
|
17
17
|
request: DatadogAPIClient::V1::SyntheticsTestRequest.new({
|
|
18
18
|
method: DatadogAPIClient::V1::HTTPMethod::GET,
|
|
19
19
|
url: "https://datadoghq.com",
|
|
20
|
+
certificate_domains: [
|
|
21
|
+
"https://datadoghq.com",
|
|
22
|
+
],
|
|
20
23
|
}),
|
|
21
24
|
set_cookie: "name:test",
|
|
22
25
|
}),
|
|
@@ -49,6 +52,9 @@ body = DatadogAPIClient::V1::SyntheticsBrowserTest.new({
|
|
|
49
52
|
ci: DatadogAPIClient::V1::SyntheticsTestCiOptions.new({
|
|
50
53
|
execution_rule: DatadogAPIClient::V1::SyntheticsTestExecutionRule::SKIPPED,
|
|
51
54
|
}),
|
|
55
|
+
ignore_server_certificate_error: true,
|
|
56
|
+
disable_csp: true,
|
|
57
|
+
initial_navigation_timeout: 200,
|
|
52
58
|
}),
|
|
53
59
|
tags: [
|
|
54
60
|
"testing:browser",
|
|
@@ -13,6 +13,7 @@ body = DatadogAPIClient::V1::SyntheticsGlobalVariable.new({
|
|
|
13
13
|
name: "MY_VARIABLE",
|
|
14
14
|
parse_test_options: DatadogAPIClient::V1::SyntheticsGlobalVariableParseTestOptions.new({
|
|
15
15
|
field: "content-type",
|
|
16
|
+
local_variable_name: "LOCAL_VARIABLE",
|
|
16
17
|
parser: DatadogAPIClient::V1::SyntheticsVariableParser.new({
|
|
17
18
|
type: DatadogAPIClient::V1::SyntheticsGlobalVariableParserType::REGEX,
|
|
18
19
|
value: ".*",
|
|
@@ -22,6 +22,7 @@ body = DatadogAPIClient::V1::SyntheticsBrowserTest.new({
|
|
|
22
22
|
cert: DatadogAPIClient::V1::SyntheticsTestRequestCertificateItem.new({}),
|
|
23
23
|
key: DatadogAPIClient::V1::SyntheticsTestRequestCertificateItem.new({}),
|
|
24
24
|
}),
|
|
25
|
+
certificate_domains: [],
|
|
25
26
|
method: DatadogAPIClient::V1::HTTPMethod::GET,
|
|
26
27
|
proxy: DatadogAPIClient::V1::SyntheticsTestRequestProxy.new({
|
|
27
28
|
url: "https://example.com",
|
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
# Get the list of available daily custom reports returns "OK" response
|
|
2
2
|
|
|
3
3
|
require "datadog_api_client"
|
|
4
|
-
DatadogAPIClient::V2.configure do |config|
|
|
5
|
-
config.unstable_operations["v1.get_daily_custom_reports".to_sym] = true
|
|
6
|
-
end
|
|
7
4
|
api_instance = DatadogAPIClient::V1::UsageMeteringAPI.new
|
|
8
5
|
p api_instance.get_daily_custom_reports()
|
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
# Get the list of available monthly custom reports returns "OK" response
|
|
2
2
|
|
|
3
3
|
require "datadog_api_client"
|
|
4
|
-
DatadogAPIClient::V2.configure do |config|
|
|
5
|
-
config.unstable_operations["v1.get_monthly_custom_reports".to_sym] = true
|
|
6
|
-
end
|
|
7
4
|
api_instance = DatadogAPIClient::V1::UsageMeteringAPI.new
|
|
8
5
|
p api_instance.get_monthly_custom_reports()
|
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
# Get specified daily custom reports returns "OK" response
|
|
2
2
|
|
|
3
3
|
require "datadog_api_client"
|
|
4
|
-
DatadogAPIClient::V2.configure do |config|
|
|
5
|
-
config.unstable_operations["v1.get_specified_daily_custom_reports".to_sym] = true
|
|
6
|
-
end
|
|
7
4
|
api_instance = DatadogAPIClient::V1::UsageMeteringAPI.new
|
|
8
5
|
p api_instance.get_specified_daily_custom_reports("2022-03-20")
|
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
# Get specified monthly custom reports returns "OK" response
|
|
2
2
|
|
|
3
3
|
require "datadog_api_client"
|
|
4
|
-
DatadogAPIClient::V2.configure do |config|
|
|
5
|
-
config.unstable_operations["v1.get_specified_monthly_custom_reports".to_sym] = true
|
|
6
|
-
end
|
|
7
4
|
api_instance = DatadogAPIClient::V1::UsageMeteringAPI.new
|
|
8
5
|
p api_instance.get_specified_monthly_custom_reports("2021-05-01")
|
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
# Get usage attribution returns "OK" response
|
|
2
2
|
|
|
3
3
|
require "datadog_api_client"
|
|
4
|
-
DatadogAPIClient::V2.configure do |config|
|
|
5
|
-
config.unstable_operations["v1.get_usage_attribution".to_sym] = true
|
|
6
|
-
end
|
|
7
4
|
api_instance = DatadogAPIClient::V1::UsageMeteringAPI.new
|
|
8
5
|
opts = {
|
|
9
6
|
offset: 0,
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# Search Audit Logs events returns "OK" response with pagination
|
|
2
|
+
|
|
3
|
+
require "datadog_api_client"
|
|
4
|
+
api_instance = DatadogAPIClient::V2::AuditAPI.new
|
|
5
|
+
|
|
6
|
+
body = DatadogAPIClient::V2::AuditLogsSearchEventsRequest.new({
|
|
7
|
+
filter: DatadogAPIClient::V2::AuditLogsQueryFilter.new({
|
|
8
|
+
from: "now-15m",
|
|
9
|
+
to: "now",
|
|
10
|
+
}),
|
|
11
|
+
options: DatadogAPIClient::V2::AuditLogsQueryOptions.new({
|
|
12
|
+
timezone: "GMT",
|
|
13
|
+
}),
|
|
14
|
+
page: DatadogAPIClient::V2::AuditLogsQueryPageOptions.new({
|
|
15
|
+
limit: 2,
|
|
16
|
+
}),
|
|
17
|
+
sort: DatadogAPIClient::V2::AuditLogsSort::TIMESTAMP_ASCENDING,
|
|
18
|
+
})
|
|
19
|
+
opts = {
|
|
20
|
+
body: body,
|
|
21
|
+
}
|
|
22
|
+
api_instance.search_audit_logs_with_pagination(opts) { |item| puts item }
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# Get a list of events returns "OK" response with pagination
|
|
2
|
+
|
|
3
|
+
require "datadog_api_client"
|
|
4
|
+
DatadogAPIClient::V2.configure do |config|
|
|
5
|
+
config.unstable_operations["v2.list_events".to_sym] = true
|
|
6
|
+
end
|
|
7
|
+
api_instance = DatadogAPIClient::V2::EventsAPI.new
|
|
8
|
+
opts = {
|
|
9
|
+
filter_from: "now-15m",
|
|
10
|
+
filter_to: "now",
|
|
11
|
+
page_limit: 2,
|
|
12
|
+
}
|
|
13
|
+
api_instance.list_events_with_pagination(opts) { |item| puts item }
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# Search events returns "OK" response with pagination
|
|
2
|
+
|
|
3
|
+
require "datadog_api_client"
|
|
4
|
+
DatadogAPIClient::V2.configure do |config|
|
|
5
|
+
config.unstable_operations["v2.search_events".to_sym] = true
|
|
6
|
+
end
|
|
7
|
+
api_instance = DatadogAPIClient::V2::EventsAPI.new
|
|
8
|
+
|
|
9
|
+
body = DatadogAPIClient::V2::EventsListRequest.new({
|
|
10
|
+
filter: DatadogAPIClient::V2::EventsQueryFilter.new({
|
|
11
|
+
from: "now-15m",
|
|
12
|
+
to: "now",
|
|
13
|
+
}),
|
|
14
|
+
options: DatadogAPIClient::V2::EventsQueryOptions.new({
|
|
15
|
+
timezone: "GMT",
|
|
16
|
+
}),
|
|
17
|
+
page: DatadogAPIClient::V2::EventsRequestPage.new({
|
|
18
|
+
limit: 2,
|
|
19
|
+
}),
|
|
20
|
+
sort: DatadogAPIClient::V2::EventsSort::TIMESTAMP_ASCENDING,
|
|
21
|
+
})
|
|
22
|
+
opts = {
|
|
23
|
+
body: body,
|
|
24
|
+
}
|
|
25
|
+
api_instance.search_events_with_pagination(opts) { |item| puts item }
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# Get a list of incidents returns "OK" response with pagination
|
|
2
|
+
|
|
3
|
+
require "datadog_api_client"
|
|
4
|
+
DatadogAPIClient::V2.configure do |config|
|
|
5
|
+
config.unstable_operations["v2.list_incidents".to_sym] = true
|
|
6
|
+
end
|
|
7
|
+
api_instance = DatadogAPIClient::V2::IncidentsAPI.new
|
|
8
|
+
opts = {
|
|
9
|
+
page_size: 2,
|
|
10
|
+
}
|
|
11
|
+
api_instance.list_incidents_with_pagination(opts) { |item| puts item }
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# Search logs returns "OK" response with pagination
|
|
2
|
+
|
|
3
|
+
require "datadog_api_client"
|
|
4
|
+
api_instance = DatadogAPIClient::V2::LogsAPI.new
|
|
5
|
+
|
|
6
|
+
body = DatadogAPIClient::V2::LogsListRequest.new({
|
|
7
|
+
filter: DatadogAPIClient::V2::LogsQueryFilter.new({
|
|
8
|
+
from: "now-15m",
|
|
9
|
+
indexes: [
|
|
10
|
+
"main",
|
|
11
|
+
],
|
|
12
|
+
to: "now",
|
|
13
|
+
}),
|
|
14
|
+
options: DatadogAPIClient::V2::LogsQueryOptions.new({
|
|
15
|
+
timezone: "GMT",
|
|
16
|
+
}),
|
|
17
|
+
page: DatadogAPIClient::V2::LogsListRequestPage.new({
|
|
18
|
+
limit: 2,
|
|
19
|
+
}),
|
|
20
|
+
sort: DatadogAPIClient::V2::LogsSort::TIMESTAMP_ASCENDING,
|
|
21
|
+
})
|
|
22
|
+
opts = {
|
|
23
|
+
body: body,
|
|
24
|
+
}
|
|
25
|
+
api_instance.list_logs_with_pagination(opts) { |item| puts item }
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# Submit metrics with compression returns "Payload accepted" response
|
|
2
|
+
|
|
3
|
+
require "datadog_api_client"
|
|
4
|
+
api_instance = DatadogAPIClient::V2::MetricsAPI.new
|
|
5
|
+
|
|
6
|
+
body = DatadogAPIClient::V2::MetricPayload.new({
|
|
7
|
+
series: [
|
|
8
|
+
DatadogAPIClient::V2::MetricSeries.new({
|
|
9
|
+
metric: "system.load.1",
|
|
10
|
+
type: DatadogAPIClient::V2::MetricIntakeType::UNSPECIFIED,
|
|
11
|
+
points: [
|
|
12
|
+
DatadogAPIClient::V2::MetricPoint.new({
|
|
13
|
+
timestamp: Time.now.to_i,
|
|
14
|
+
value: 0.7,
|
|
15
|
+
}),
|
|
16
|
+
],
|
|
17
|
+
}),
|
|
18
|
+
],
|
|
19
|
+
})
|
|
20
|
+
opts = {
|
|
21
|
+
content_encoding: MetricContentEncoding::ZSTD1,
|
|
22
|
+
}
|
|
23
|
+
p api_instance.submit_metrics(body, opts)
|