datadog_api_client 2.0.2 → 2.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (85) hide show
  1. checksums.yaml +4 -4
  2. data/.apigentools-info +6 -6
  3. data/.generator/schemas/v1/openapi.yaml +282 -900
  4. data/.generator/schemas/v2/openapi.yaml +343 -672
  5. data/.generator/src/generator/formatter.py +1 -1
  6. data/.github/workflows/test.yml +1 -1
  7. data/.github/workflows/test_integration.yml +5 -0
  8. data/CHANGELOG.md +23 -0
  9. data/examples/v1/dashboards/CreateDashboard_1094917386.rb +37 -0
  10. data/examples/v1/dashboards/CreateDashboard_1307120899.rb +61 -0
  11. data/examples/v1/monitors/ValidateExistingMonitor.rb +1 -0
  12. data/examples/v1/monitors/ValidateMonitor.rb +1 -0
  13. data/examples/v1/monitors/ValidateMonitor_4247196452.rb +38 -0
  14. data/examples/v1/synthetics/CreateGlobalVariable.rb +1 -0
  15. data/examples/v1/synthetics/CreateGlobalVariable_1068962881.rb +23 -0
  16. data/examples/v1/synthetics/CreateSyntheticsAPITest_1279271422.rb +10 -0
  17. data/examples/v1/synthetics/CreateSyntheticsBrowserTest_2932742688.rb +6 -0
  18. data/examples/v1/synthetics/EditGlobalVariable.rb +1 -0
  19. data/examples/v1/synthetics/UpdateBrowserTest.rb +1 -0
  20. data/examples/v1/usage-metering/GetDailyCustomReports.rb +0 -3
  21. data/examples/v1/usage-metering/GetMonthlyCustomReports.rb +0 -3
  22. data/examples/v1/usage-metering/GetSpecifiedDailyCustomReports.rb +0 -3
  23. data/examples/v1/usage-metering/GetSpecifiedMonthlyCustomReports.rb +0 -3
  24. data/examples/v1/usage-metering/GetUsageAttribution.rb +0 -3
  25. data/examples/v2/metrics/SubmitMetrics_1762007427.rb +23 -0
  26. data/examples/v2/roles/UpdateRole.rb +13 -0
  27. data/examples/v2/rum/CreateRUMApplication.rb +15 -0
  28. data/examples/v2/rum/DeleteRUMApplication.rb +8 -0
  29. data/examples/v2/rum/GetRUMApplication.rb +8 -0
  30. data/examples/v2/rum/GetRUMApplications.rb +5 -0
  31. data/examples/v2/rum/UpdateRUMApplication.rb +16 -0
  32. data/examples/v2/usage-metering/GetHourlyUsage.rb +5 -0
  33. data/lib/datadog_api_client/configuration.rb +0 -5
  34. data/lib/datadog_api_client/inflector.rb +16 -0
  35. data/lib/datadog_api_client/v1/api/metrics_api.rb +1 -1
  36. data/lib/datadog_api_client/v1/api/usage_metering_api.rb +42 -62
  37. data/lib/datadog_api_client/v1/models/formula_and_function_events_data_source.rb +1 -0
  38. data/lib/datadog_api_client/v1/models/hourly_usage_attribution_usage_type.rb +1 -0
  39. data/lib/datadog_api_client/v1/models/list_stream_source.rb +1 -0
  40. data/lib/datadog_api_client/v1/models/metric_content_encoding.rb +1 -0
  41. data/lib/datadog_api_client/v1/models/monitor_options.rb +28 -1
  42. data/lib/datadog_api_client/v1/models/monitor_summary_widget_definition.rb +13 -1
  43. data/lib/datadog_api_client/v1/models/monthly_usage_attribution_supported_metrics.rb +2 -0
  44. data/lib/datadog_api_client/v1/models/monthly_usage_attribution_values.rb +21 -1
  45. data/lib/datadog_api_client/v1/models/on_missing_data_option.rb +33 -0
  46. data/lib/datadog_api_client/v1/models/synthetics_basic_auth.rb +2 -1
  47. data/lib/datadog_api_client/v1/models/synthetics_basic_auth_digest.rb +155 -0
  48. data/lib/datadog_api_client/v1/models/synthetics_basic_auth_digest_type.rb +26 -0
  49. data/lib/datadog_api_client/v1/models/synthetics_global_variable_parse_test_options.rb +11 -12
  50. data/lib/datadog_api_client/v1/models/synthetics_global_variable_parse_test_options_type.rb +1 -0
  51. data/lib/datadog_api_client/v1/models/synthetics_test_options.rb +31 -1
  52. data/lib/datadog_api_client/v1/models/synthetics_test_process_status.rb +0 -1
  53. data/lib/datadog_api_client/v1/models/synthetics_test_request.rb +15 -1
  54. data/lib/datadog_api_client/v1/models/usage_attribution_sort.rb +2 -0
  55. data/lib/datadog_api_client/v1/models/usage_attribution_supported_metrics.rb +2 -0
  56. data/lib/datadog_api_client/v1/models/usage_attribution_values.rb +21 -1
  57. data/lib/datadog_api_client/v1/models/usage_billable_summary_hour.rb +11 -1
  58. data/lib/datadog_api_client/v1/models/usage_cloud_security_posture_management_hour.rb +12 -1
  59. data/lib/datadog_api_client/v1/models/usage_summary_date.rb +11 -1
  60. data/lib/datadog_api_client/v1/models/usage_summary_date_org.rb +21 -1
  61. data/lib/datadog_api_client/v1/models/usage_summary_response.rb +11 -1
  62. data/lib/datadog_api_client/v1/models/widget_monitor_summary_sort.rb +2 -0
  63. data/lib/datadog_api_client/v2/api/events_api.rb +1 -1
  64. data/lib/datadog_api_client/v2/api/logs_api.rb +1 -1
  65. data/lib/datadog_api_client/v2/api/metrics_api.rb +1 -1
  66. data/lib/datadog_api_client/v2/api/rum_api.rb +329 -0
  67. data/lib/datadog_api_client/v2/api/security_monitoring_api.rb +3 -3
  68. data/lib/datadog_api_client/v2/models/content_encoding.rb +1 -0
  69. data/lib/datadog_api_client/v2/models/metric_content_encoding.rb +2 -0
  70. data/lib/datadog_api_client/v2/models/role_update_data.rb +11 -1
  71. data/lib/datadog_api_client/v2/models/rum_application.rb +166 -0
  72. data/lib/datadog_api_client/v2/models/rum_application_attributes.rb +279 -0
  73. data/lib/datadog_api_client/v2/models/rum_application_create.rb +145 -0
  74. data/lib/datadog_api_client/v2/models/rum_application_create_attributes.rb +132 -0
  75. data/lib/datadog_api_client/v2/models/rum_application_create_request.rb +122 -0
  76. data/lib/datadog_api_client/v2/models/rum_application_create_type.rb +26 -0
  77. data/lib/datadog_api_client/v2/models/rum_application_response.rb +111 -0
  78. data/lib/datadog_api_client/v2/models/rum_application_type.rb +26 -0
  79. data/lib/datadog_api_client/v2/models/rum_application_update.rb +155 -0
  80. data/lib/datadog_api_client/v2/models/rum_application_update_attributes.rb +121 -0
  81. data/lib/datadog_api_client/v2/models/rum_application_update_request.rb +122 -0
  82. data/lib/datadog_api_client/v2/models/rum_application_update_type.rb +26 -0
  83. data/lib/datadog_api_client/v2/models/rum_applications_response.rb +113 -0
  84. data/lib/datadog_api_client/version.rb +1 -1
  85. metadata +29 -2
@@ -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(k) # otherwise there is a missing required parameters
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"],
@@ -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,28 @@
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
+
3
26
  ## 2.0.2 / 2022-08-03
4
27
 
5
28
  ### Fixed
@@ -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)
@@ -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,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)
@@ -7,6 +7,9 @@ api_instance = DatadogAPIClient::V2::RolesAPI.new
7
7
  ROLE_DATA_ATTRIBUTES_NAME = ENV["ROLE_DATA_ATTRIBUTES_NAME"]
8
8
  ROLE_DATA_ID = ENV["ROLE_DATA_ID"]
9
9
 
10
+ # there is a valid "permission" in the system
11
+ PERMISSION_ID = ENV["PERMISSION_ID"]
12
+
10
13
  body = DatadogAPIClient::V2::RoleUpdateRequest.new({
11
14
  data: DatadogAPIClient::V2::RoleUpdateData.new({
12
15
  id: ROLE_DATA_ID,
@@ -14,6 +17,16 @@ body = DatadogAPIClient::V2::RoleUpdateRequest.new({
14
17
  attributes: DatadogAPIClient::V2::RoleUpdateAttributes.new({
15
18
  name: "developers-updated",
16
19
  }),
20
+ relationships: DatadogAPIClient::V2::RoleRelationships.new({
21
+ permissions: DatadogAPIClient::V2::RelationshipToPermissions.new({
22
+ data: [
23
+ DatadogAPIClient::V2::RelationshipToPermissionData.new({
24
+ id: PERMISSION_ID,
25
+ type: DatadogAPIClient::V2::PermissionsType::PERMISSIONS,
26
+ }),
27
+ ],
28
+ }),
29
+ }),
17
30
  }),
18
31
  })
19
32
  p api_instance.update_role(ROLE_DATA_ID, body)
@@ -0,0 +1,15 @@
1
+ # Create a new RUM application returns "OK" response
2
+
3
+ require "datadog_api_client"
4
+ api_instance = DatadogAPIClient::V2::RUMAPI.new
5
+
6
+ body = DatadogAPIClient::V2::RUMApplicationCreateRequest.new({
7
+ data: DatadogAPIClient::V2::RUMApplicationCreate.new({
8
+ attributes: DatadogAPIClient::V2::RUMApplicationCreateAttributes.new({
9
+ name: "my_new_rum_application",
10
+ type: "ios",
11
+ }),
12
+ type: DatadogAPIClient::V2::RUMApplicationCreateType::RUM_APPLICATION_CREATE,
13
+ }),
14
+ })
15
+ p api_instance.create_rum_application(body)
@@ -0,0 +1,8 @@
1
+ # Delete a RUM application returns "No Content" response
2
+
3
+ require "datadog_api_client"
4
+ api_instance = DatadogAPIClient::V2::RUMAPI.new
5
+
6
+ # there is a valid "rum_application" in the system
7
+ RUM_APPLICATION_DATA_ID = ENV["RUM_APPLICATION_DATA_ID"]
8
+ api_instance.delete_rum_application(RUM_APPLICATION_DATA_ID)
@@ -0,0 +1,8 @@
1
+ # Get a RUM application returns "OK" response
2
+
3
+ require "datadog_api_client"
4
+ api_instance = DatadogAPIClient::V2::RUMAPI.new
5
+
6
+ # there is a valid "rum_application" in the system
7
+ RUM_APPLICATION_DATA_ID = ENV["RUM_APPLICATION_DATA_ID"]
8
+ p api_instance.get_rum_application(RUM_APPLICATION_DATA_ID)
@@ -0,0 +1,5 @@
1
+ # List all the RUM applications returns "OK" response
2
+
3
+ require "datadog_api_client"
4
+ api_instance = DatadogAPIClient::V2::RUMAPI.new
5
+ p api_instance.get_rum_applications()
@@ -0,0 +1,16 @@
1
+ # Update a RUM application returns "OK" response
2
+
3
+ require "datadog_api_client"
4
+ api_instance = DatadogAPIClient::V2::RUMAPI.new
5
+
6
+ body = DatadogAPIClient::V2::RUMApplicationUpdateRequest.new({
7
+ data: DatadogAPIClient::V2::RUMApplicationUpdate.new({
8
+ attributes: DatadogAPIClient::V2::RUMApplicationUpdateAttributes.new({
9
+ name: "updated_name_for_my_existing_rum_application",
10
+ type: "browser",
11
+ }),
12
+ id: "abcd1234-0000-0000-abcd-1234abcd5678",
13
+ type: DatadogAPIClient::V2::RUMApplicationUpdateType::RUM_APPLICATION_UPDATE,
14
+ }),
15
+ })
16
+ p api_instance.update_rum_application("id", body)
@@ -0,0 +1,5 @@
1
+ # Get hourly usage by product family returns "OK" response
2
+
3
+ require "datadog_api_client"
4
+ api_instance = DatadogAPIClient::V2::UsageMeteringAPI.new
5
+ p api_instance.get_hourly_usage((Time.now + -3 * 86400), "infra_hosts")
@@ -158,11 +158,6 @@ module DatadogAPIClient
158
158
  @compress = true
159
159
  @logger = defined?(Rails) ? Rails.logger : Logger.new(STDOUT)
160
160
  @unstable_operations = {
161
- "v1.get_daily_custom_reports": false,
162
- "v1.get_monthly_custom_reports": false,
163
- "v1.get_specified_daily_custom_reports": false,
164
- "v1.get_specified_monthly_custom_reports": false,
165
- "v1.get_usage_attribution": false,
166
161
  "v1.get_slo_history": false,
167
162
  "v1.search_slo": false,
168
163
  "v2.list_events": false,
@@ -340,6 +340,7 @@ module DatadogAPIClient
340
340
  "v1.notebook_update_request" => "NotebookUpdateRequest",
341
341
  "v1.note_widget_definition" => "NoteWidgetDefinition",
342
342
  "v1.note_widget_definition_type" => "NoteWidgetDefinitionType",
343
+ "v1.on_missing_data_option" => "OnMissingDataOption",
343
344
  "v1.organization" => "Organization",
344
345
  "v1.organization_billing" => "OrganizationBilling",
345
346
  "v1.organization_create_body" => "OrganizationCreateBody",
@@ -464,6 +465,8 @@ module DatadogAPIClient
464
465
  "v1.synthetics_assertion_target" => "SyntheticsAssertionTarget",
465
466
  "v1.synthetics_assertion_type" => "SyntheticsAssertionType",
466
467
  "v1.synthetics_basic_auth" => "SyntheticsBasicAuth",
468
+ "v1.synthetics_basic_auth_digest" => "SyntheticsBasicAuthDigest",
469
+ "v1.synthetics_basic_auth_digest_type" => "SyntheticsBasicAuthDigestType",
467
470
  "v1.synthetics_basic_auth_ntlm" => "SyntheticsBasicAuthNTLM",
468
471
  "v1.synthetics_basic_auth_ntlm_type" => "SyntheticsBasicAuthNTLMType",
469
472
  "v1.synthetics_basic_auth_sigv4" => "SyntheticsBasicAuthSigv4",
@@ -1109,6 +1112,19 @@ module DatadogAPIClient
1109
1112
  "v2.rum_aggregation_buckets_response" => "RUMAggregationBucketsResponse",
1110
1113
  "v2.rum_aggregation_function" => "RUMAggregationFunction",
1111
1114
  "v2.rum_analytics_aggregate_response" => "RUMAnalyticsAggregateResponse",
1115
+ "v2.rum_application" => "RUMApplication",
1116
+ "v2.rum_application_attributes" => "RUMApplicationAttributes",
1117
+ "v2.rum_application_create" => "RUMApplicationCreate",
1118
+ "v2.rum_application_create_attributes" => "RUMApplicationCreateAttributes",
1119
+ "v2.rum_application_create_request" => "RUMApplicationCreateRequest",
1120
+ "v2.rum_application_create_type" => "RUMApplicationCreateType",
1121
+ "v2.rum_application_response" => "RUMApplicationResponse",
1122
+ "v2.rum_applications_response" => "RUMApplicationsResponse",
1123
+ "v2.rum_application_type" => "RUMApplicationType",
1124
+ "v2.rum_application_update" => "RUMApplicationUpdate",
1125
+ "v2.rum_application_update_attributes" => "RUMApplicationUpdateAttributes",
1126
+ "v2.rum_application_update_request" => "RUMApplicationUpdateRequest",
1127
+ "v2.rum_application_update_type" => "RUMApplicationUpdateType",
1112
1128
  "v2.rum_bucket_response" => "RUMBucketResponse",
1113
1129
  "v2.rum_compute" => "RUMCompute",
1114
1130
  "v2.rum_compute_type" => "RUMComputeType",
@@ -406,7 +406,7 @@ module DatadogAPIClient::V1
406
406
  if @api_client.config.debugging
407
407
  @api_client.config.logger.debug 'Calling API: MetricsAPI.submit_metrics ...'
408
408
  end
409
- allowable_values = ['deflate']
409
+ allowable_values = ['deflate', 'gzip']
410
410
  if @api_client.config.client_side_validation && opts[:'content_encoding'] && !allowable_values.include?(opts[:'content_encoding'])
411
411
  fail ArgumentError, "invalid value for \"content_encoding\", must be one of #{allowable_values}"
412
412
  end