datadog_api_client 2.21.0 → 2.22.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (102) hide show
  1. checksums.yaml +4 -4
  2. data/.apigentools-info +4 -4
  3. data/.generator/schemas/v1/openapi.yaml +180 -637
  4. data/.generator/schemas/v2/openapi.yaml +515 -33
  5. data/.github/workflows/prepare_release.yml +2 -2
  6. data/.github/workflows/publish.yml +2 -2
  7. data/.github/workflows/release.yml +2 -2
  8. data/.github/workflows/test.yml +1 -1
  9. data/CHANGELOG.md +24 -0
  10. data/Gemfile +1 -1
  11. data/examples/v1/aws-integration/CreateAWSAccount.rb +1 -1
  12. data/examples/v1/aws-integration/CreateNewAWSExternalID.rb +1 -0
  13. data/examples/v1/aws-integration/UpdateAWSAccount.rb +1 -1
  14. data/examples/v1/synthetics/CreateSyntheticsAPITest_1241981394.rb +118 -0
  15. data/examples/v1/synthetics/UpdateBrowserTest.rb +3 -0
  16. data/examples/v2/apm-retention-filters/UpdateApmRetentionFilter.rb +2 -2
  17. data/examples/v2/authn-mappings/CreateAuthNMapping.rb +1 -1
  18. data/examples/v2/authn-mappings/UpdateAuthNMapping.rb +1 -1
  19. data/examples/v2/cloud-workload-security/CreateCSMThreatsAgentRule.rb +1 -1
  20. data/examples/v2/gcp-integration/CreateGCPSTSAccount.rb +1 -1
  21. data/examples/v2/gcp-integration/CreateGCPSTSAccount_109518525.rb +1 -1
  22. data/examples/v2/gcp-integration/CreateGCPSTSAccount_130557025.rb +1 -1
  23. data/examples/v2/gcp-integration/CreateGCPSTSAccount_194782945.rb +1 -1
  24. data/examples/v2/gcp-integration/CreateGCPSTSAccount_2597004741.rb +1 -1
  25. data/examples/v2/gcp-integration/CreateGCPSTSAccount_4235664992.rb +1 -1
  26. data/examples/v2/gcp-integration/UpdateGCPSTSAccount.rb +1 -1
  27. data/examples/v2/gcp-integration/UpdateGCPSTSAccount_2241994060.rb +1 -1
  28. data/examples/v2/gcp-integration/UpdateGCPSTSAccount_3205636354.rb +1 -1
  29. data/examples/v2/logs-custom-destinations/UpdateLogsCustomDestination.rb +4 -0
  30. data/examples/v2/metrics/QueryScalarData_3112571352.rb +2 -2
  31. data/examples/v2/metrics/QueryTimeseriesData_301142940.rb +3 -3
  32. data/examples/v2/security-monitoring/CreateSecurityMonitoringSuppression_3192265332.rb +19 -0
  33. data/examples/v2/security-monitoring/ValidateSecurityMonitoringRule.rb +42 -0
  34. data/examples/v2/service-definition/CreateOrUpdateServiceDefinitions.rb +4 -0
  35. data/examples/v2/service-level-objectives/CreateSLOReportJob.rb +20 -0
  36. data/examples/v2/service-level-objectives/GetSLOReport.rb +8 -0
  37. data/examples/v2/service-level-objectives/GetSLOReportJobStatus.rb +11 -0
  38. data/lib/datadog_api_client/configuration.rb +3 -0
  39. data/lib/datadog_api_client/inflector.rb +20 -7
  40. data/lib/datadog_api_client/v1/api/usage_metering_api.rb +104 -131
  41. data/lib/datadog_api_client/v1/models/aws_account.rb +12 -2
  42. data/lib/datadog_api_client/v1/models/hourly_usage_attribution_usage_type.rb +2 -0
  43. data/lib/datadog_api_client/v1/models/monitor_options.rb +4 -1
  44. data/lib/datadog_api_client/v1/models/monthly_usage_attribution_supported_metrics.rb +4 -0
  45. data/lib/datadog_api_client/v1/models/monthly_usage_attribution_values.rb +41 -1
  46. data/lib/datadog_api_client/v1/models/series.rb +1 -1
  47. data/lib/datadog_api_client/v1/models/slo_time_slice_condition.rb +14 -2
  48. data/lib/datadog_api_client/v1/models/slo_time_slice_interval.rb +29 -0
  49. data/lib/datadog_api_client/v1/models/slo_time_slice_spec.rb +1 -1
  50. data/lib/datadog_api_client/v1/models/synthetics_test_request.rb +13 -1
  51. data/lib/datadog_api_client/v1/models/synthetics_test_request_body_file.rb +175 -0
  52. data/lib/datadog_api_client/v1/models/synthetics_test_request_body_type.rb +2 -0
  53. data/lib/datadog_api_client/v2/api/apm_retention_filters_api.rb +6 -0
  54. data/lib/datadog_api_client/v2/api/metrics_api.rb +1 -1
  55. data/lib/datadog_api_client/v2/api/security_monitoring_api.rb +67 -0
  56. data/lib/datadog_api_client/v2/api/service_level_objectives_api.rb +245 -0
  57. data/lib/datadog_api_client/v2/api/usage_metering_api.rb +12 -3
  58. data/lib/datadog_api_client/v2/models/authn_mapping_create_data.rb +1 -1
  59. data/lib/datadog_api_client/v2/models/authn_mapping_create_relationships.rb +37 -54
  60. data/lib/datadog_api_client/v2/models/authn_mapping_included.rb +2 -1
  61. data/lib/datadog_api_client/v2/models/authn_mapping_relationship_to_role.rb +98 -0
  62. data/lib/datadog_api_client/v2/models/authn_mapping_relationship_to_team.rb +98 -0
  63. data/lib/datadog_api_client/v2/models/authn_mapping_relationships.rb +14 -4
  64. data/lib/datadog_api_client/{v1/models/usage_attribution_metadata.rb → v2/models/authn_mapping_team.rb} +31 -23
  65. data/lib/datadog_api_client/v2/models/authn_mapping_team_attributes.rb +212 -0
  66. data/lib/datadog_api_client/v2/models/authn_mapping_update_data.rb +1 -1
  67. data/lib/datadog_api_client/v2/models/authn_mapping_update_relationships.rb +37 -54
  68. data/lib/datadog_api_client/v2/models/custom_destination_type.rb +1 -1
  69. data/lib/datadog_api_client/v2/models/dora_deployment_request_attributes.rb +1 -1
  70. data/lib/datadog_api_client/v2/models/metric_series.rb +1 -1
  71. data/lib/datadog_api_client/v2/models/relationship_to_team.rb +80 -0
  72. data/lib/datadog_api_client/{v1/models/usage_attribution_response.rb → v2/models/relationship_to_team_data.rb} +21 -23
  73. data/lib/datadog_api_client/v2/models/retention_filter_update_attributes.rb +183 -0
  74. data/lib/datadog_api_client/v2/models/retention_filter_update_data.rb +1 -1
  75. data/lib/datadog_api_client/v2/models/security_monitoring_rule_update_payload.rb +1 -1
  76. data/lib/datadog_api_client/v2/models/security_monitoring_signal_rule_create_payload.rb +1 -1
  77. data/lib/datadog_api_client/v2/models/security_monitoring_signal_rule_response.rb +1 -1
  78. data/lib/datadog_api_client/v2/models/security_monitoring_standard_rule_create_payload.rb +1 -1
  79. data/lib/datadog_api_client/v2/models/security_monitoring_standard_rule_response.rb +1 -1
  80. data/lib/datadog_api_client/v2/models/security_monitoring_suppression_attributes.rb +11 -1
  81. data/lib/datadog_api_client/v2/models/security_monitoring_suppression_create_attributes.rb +13 -14
  82. data/lib/datadog_api_client/v2/models/security_monitoring_suppression_update_attributes.rb +11 -1
  83. data/lib/datadog_api_client/v2/models/service_definition_v2_dot2.rb +13 -1
  84. data/lib/datadog_api_client/v2/models/slo_report_create_request.rb +98 -0
  85. data/lib/datadog_api_client/v2/models/slo_report_create_request_attributes.rb +160 -0
  86. data/lib/datadog_api_client/{v1/models/usage_attribution_pagination.rb → v2/models/slo_report_create_request_data.rb} +29 -51
  87. data/lib/datadog_api_client/v2/models/slo_report_interval.rb +27 -0
  88. data/lib/datadog_api_client/v2/models/slo_report_post_response.rb +80 -0
  89. data/lib/datadog_api_client/v2/models/slo_report_post_response_data.rb +90 -0
  90. data/lib/datadog_api_client/v2/models/slo_report_status.rb +29 -0
  91. data/lib/datadog_api_client/v2/models/slo_report_status_get_response.rb +80 -0
  92. data/lib/datadog_api_client/v2/models/slo_report_status_get_response_attributes.rb +80 -0
  93. data/lib/datadog_api_client/v2/models/slo_report_status_get_response_data.rb +100 -0
  94. data/lib/datadog_api_client/v2/models/timeseries_response_series.rb +8 -0
  95. data/lib/datadog_api_client/v2/models/user_teams_response.rb +13 -1
  96. data/lib/datadog_api_client/version.rb +1 -1
  97. metadata +51 -33
  98. data/examples/v1/usage-metering/GetUsageAttribution.rb +0 -9
  99. data/lib/datadog_api_client/v1/models/usage_attribution_body.rb +0 -152
  100. data/lib/datadog_api_client/v1/models/usage_attribution_sort.rb +0 -63
  101. data/lib/datadog_api_client/v1/models/usage_attribution_supported_metrics.rb +0 -74
  102. data/lib/datadog_api_client/v1/models/usage_attribution_values.rb +0 -590
@@ -31,10 +31,10 @@ jobs:
31
31
  git config user.name "${GIT_AUTHOR_NAME}"
32
32
  git config user.email "${GIT_AUTHOR_EMAIL}"
33
33
 
34
- - name: Set up Ruby 2.6
34
+ - name: Set up Ruby 2.7
35
35
  uses: ruby/setup-ruby@v1
36
36
  with:
37
- ruby-version: 2.6
37
+ ruby-version: 2.7
38
38
 
39
39
  - name: Calculate version
40
40
  id: get_version
@@ -15,10 +15,10 @@ jobs:
15
15
  with:
16
16
  ref: ${{ github.event.release.tag_name }}
17
17
 
18
- - name: Set up Ruby 2.6
18
+ - name: Set up Ruby 2.7
19
19
  uses: ruby/setup-ruby@v1
20
20
  with:
21
- ruby-version: 2.6
21
+ ruby-version: 2.7
22
22
 
23
23
  - run: bundle install
24
24
 
@@ -54,10 +54,10 @@ jobs:
54
54
  git config user.name "${GIT_AUTHOR_NAME}"
55
55
  git config user.email "${GIT_AUTHOR_EMAIL}"
56
56
 
57
- - name: Set up Ruby 2.6
57
+ - name: Set up Ruby 2.7
58
58
  uses: ruby/setup-ruby@v1
59
59
  with:
60
- ruby-version: 2.6
60
+ ruby-version: 2.7
61
61
 
62
62
  - name: Bump Gem version
63
63
  run: |
@@ -74,7 +74,7 @@ jobs:
74
74
  test:
75
75
  strategy:
76
76
  matrix:
77
- ruby-version: ["2.6", "3.2", "jruby"]
77
+ ruby-version: ["2.7", "3.2", "jruby"]
78
78
  platform: [ubuntu-latest]
79
79
  runs-on: ${{ matrix.platform }}
80
80
  if: (github.event.pull_request.draft == false && !contains(github.event.pull_request.labels.*.name, 'ci/skip') && !contains(github.event.pull_request.head.ref, 'datadog-api-spec/test/')) || github.event_name == 'schedule'
data/CHANGELOG.md CHANGED
@@ -1,5 +1,29 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## 2.22.0 / 2024-04-11
4
+
5
+ ### Fixed
6
+ * Update Cleanup script to use GCP STS endpoint by @api-clients-generation-pipeline in https://github.com/DataDog/datadog-api-client-ruby/pull/1762
7
+ * Add include data to get team memberships response by @api-clients-generation-pipeline in https://github.com/DataDog/datadog-api-client-ruby/pull/1748
8
+ ### Added
9
+ * Add `ci-pipeline-fingerprints` field in v2.2 by @api-clients-generation-pipeline in https://github.com/DataDog/datadog-api-client-ruby/pull/1768
10
+ * Add validation endpoint for Security Monitoring Rules by @api-clients-generation-pipeline in https://github.com/DataDog/datadog-api-client-ruby/pull/1787
11
+ * Add UA documentation for online_archive and incident_management by @api-clients-generation-pipeline in https://github.com/DataDog/datadog-api-client-ruby/pull/1789
12
+ * Mark `unit` as nullable by @api-clients-generation-pipeline in https://github.com/DataDog/datadog-api-client-ruby/pull/1791
13
+ * Add query_interval_seconds to time-slice SLO condition parameters by @api-clients-generation-pipeline in https://github.com/DataDog/datadog-api-client-ruby/pull/1793
14
+ * Support providing files for the file upload feature when creating a Synthetic API test by @api-clients-generation-pipeline in https://github.com/DataDog/datadog-api-client-ruby/pull/1792
15
+ * Adding SLO Reporting API Documentation by @api-clients-generation-pipeline in https://github.com/DataDog/datadog-api-client-ruby/pull/1764
16
+ * Security Monitoring Suppression - Add data_exclusion_query field by @api-clients-generation-pipeline in https://github.com/DataDog/datadog-api-client-ruby/pull/1797
17
+ * aws api adding extended and deprecating old resource collection field by @api-clients-generation-pipeline in https://github.com/DataDog/datadog-api-client-ruby/pull/1795
18
+ ### Changed
19
+ * Add Team relationship to AuthNMappings by @api-clients-generation-pipeline in https://github.com/DataDog/datadog-api-client-ruby/pull/1726
20
+ ### Deprecated
21
+ * Remove deprecated /api/v1/usage/attribution by @api-clients-generation-pipeline in https://github.com/DataDog/datadog-api-client-ruby/pull/1778
22
+ * Deprecate legacy hourly usage metering endpoints by @api-clients-generation-pipeline in https://github.com/DataDog/datadog-api-client-ruby/pull/1774
23
+
24
+
25
+ **Full Changelog**: https://github.com/DataDog/datadog-api-client-ruby/compare/v2.21.0...v2.22.0
26
+
3
27
  ## 2.21.0 / 2024-03-13
4
28
 
5
29
  ### Fixed
data/Gemfile CHANGED
@@ -6,7 +6,7 @@ gemspec
6
6
 
7
7
  group :development, :test do
8
8
  gem 'activesupport'
9
- gem 'cucumber'
9
+ gem 'cucumber', '~> 9.1.1'
10
10
  gem 'ddtrace', '>=1.0.0.beta1'
11
11
  gem 'gem-release'
12
12
  gem 'rake', '~> 13.0.1'
@@ -13,6 +13,7 @@ body = DatadogAPIClient::V1::AWSAccount.new({
13
13
  "us-east-1",
14
14
  "us-west-2",
15
15
  ],
16
+ extended_resource_collection_enabled: true,
16
17
  filter_tags: [
17
18
  "$KEY:$VALUE",
18
19
  ],
@@ -20,7 +21,6 @@ body = DatadogAPIClient::V1::AWSAccount.new({
20
21
  "$KEY:$VALUE",
21
22
  ],
22
23
  metrics_collection_enabled: false,
23
- resource_collection_enabled: true,
24
24
  role_name: "DatadogAWSIntegrationRole",
25
25
  })
26
26
  p api_instance.create_aws_account(body)
@@ -13,6 +13,7 @@ body = DatadogAPIClient::V1::AWSAccount.new({
13
13
  "us-east-1",
14
14
  "us-west-2",
15
15
  ],
16
+ extended_resource_collection_enabled: true,
16
17
  filter_tags: [
17
18
  "$KEY:$VALUE",
18
19
  ],
@@ -13,6 +13,7 @@ body = DatadogAPIClient::V1::AWSAccount.new({
13
13
  "us-east-1",
14
14
  "us-west-2",
15
15
  ],
16
+ extended_resource_collection_enabled: true,
16
17
  filter_tags: [
17
18
  "$KEY:$VALUE",
18
19
  ],
@@ -20,7 +21,6 @@ body = DatadogAPIClient::V1::AWSAccount.new({
20
21
  "$KEY:$VALUE",
21
22
  ],
22
23
  metrics_collection_enabled: true,
23
- resource_collection_enabled: true,
24
24
  role_name: "DatadogAWSIntegrationRole",
25
25
  })
26
26
  opts = {
@@ -0,0 +1,118 @@
1
+ # Create an API test with a file payload returns "OK - Returns the created test details." response
2
+
3
+ require "datadog_api_client"
4
+ api_instance = DatadogAPIClient::V1::SyntheticsAPI.new
5
+
6
+ body = DatadogAPIClient::V1::SyntheticsAPITest.new({
7
+ config: DatadogAPIClient::V1::SyntheticsAPITestConfig.new({
8
+ assertions: [
9
+ DatadogAPIClient::V1::SyntheticsAssertionTarget.new({
10
+ operator: DatadogAPIClient::V1::SyntheticsAssertionOperator::IS,
11
+ property: "{{ PROPERTY }}",
12
+ target: "text/html",
13
+ type: DatadogAPIClient::V1::SyntheticsAssertionType::HEADER,
14
+ }),
15
+ DatadogAPIClient::V1::SyntheticsAssertionTarget.new({
16
+ operator: DatadogAPIClient::V1::SyntheticsAssertionOperator::LESS_THAN,
17
+ target: 2000,
18
+ type: DatadogAPIClient::V1::SyntheticsAssertionType::RESPONSE_TIME,
19
+ timings_scope: DatadogAPIClient::V1::SyntheticsAssertionTimingsScope::WITHOUT_DNS,
20
+ }),
21
+ DatadogAPIClient::V1::SyntheticsAssertionJSONPathTarget.new({
22
+ operator: DatadogAPIClient::V1::SyntheticsAssertionJSONPathOperator::VALIDATES_JSON_PATH,
23
+ target: DatadogAPIClient::V1::SyntheticsAssertionJSONPathTargetTarget.new({
24
+ json_path: "topKey",
25
+ operator: "isNot",
26
+ target_value: "0",
27
+ }),
28
+ type: DatadogAPIClient::V1::SyntheticsAssertionType::BODY,
29
+ }),
30
+ DatadogAPIClient::V1::SyntheticsAssertionXPathTarget.new({
31
+ operator: DatadogAPIClient::V1::SyntheticsAssertionXPathOperator::VALIDATES_X_PATH,
32
+ target: DatadogAPIClient::V1::SyntheticsAssertionXPathTargetTarget.new({
33
+ x_path: "target-xpath",
34
+ target_value: "0",
35
+ operator: "contains",
36
+ }),
37
+ type: DatadogAPIClient::V1::SyntheticsAssertionType::BODY,
38
+ }),
39
+ ],
40
+ config_variables: [
41
+ DatadogAPIClient::V1::SyntheticsConfigVariable.new({
42
+ example: "content-type",
43
+ name: "PROPERTY",
44
+ pattern: "content-type",
45
+ type: DatadogAPIClient::V1::SyntheticsConfigVariableType::TEXT,
46
+ }),
47
+ ],
48
+ request: DatadogAPIClient::V1::SyntheticsTestRequest.new({
49
+ certificate: DatadogAPIClient::V1::SyntheticsTestRequestCertificate.new({
50
+ cert: DatadogAPIClient::V1::SyntheticsTestRequestCertificateItem.new({
51
+ content: "cert-content",
52
+ filename: "cert-filename",
53
+ updated_at: "2020-10-16T09:23:24.857Z",
54
+ }),
55
+ key: DatadogAPIClient::V1::SyntheticsTestRequestCertificateItem.new({
56
+ content: "key-content",
57
+ filename: "key-filename",
58
+ updated_at: "2020-10-16T09:23:24.857Z",
59
+ }),
60
+ }),
61
+ headers: {
62
+ unique: "examplesynthetic",
63
+ },
64
+ method: "GET",
65
+ timeout: 10,
66
+ url: "https://datadoghq.com",
67
+ proxy: DatadogAPIClient::V1::SyntheticsTestRequestProxy.new({
68
+ url: "https://datadoghq.com",
69
+ headers: {},
70
+ }),
71
+ body_type: DatadogAPIClient::V1::SyntheticsTestRequestBodyType::APPLICATION_OCTET_STREAM,
72
+ files: [
73
+ DatadogAPIClient::V1::SyntheticsTestRequestBodyFile.new({
74
+ name: "file name",
75
+ content: "file content",
76
+ type: "file type",
77
+ }),
78
+ ],
79
+ basic_auth: DatadogAPIClient::V1::SyntheticsBasicAuthOauthClient.new({
80
+ access_token_url: "https://datadog-token.com",
81
+ audience: "audience",
82
+ client_id: "client-id",
83
+ client_secret: "client-secret",
84
+ resource: "resource",
85
+ scope: "yoyo",
86
+ token_api_authentication: DatadogAPIClient::V1::SyntheticsBasicAuthOauthTokenApiAuthentication::HEADER,
87
+ type: DatadogAPIClient::V1::SyntheticsBasicAuthOauthClientType::OAUTH_CLIENT,
88
+ }),
89
+ persist_cookies: true,
90
+ }),
91
+ }),
92
+ locations: [
93
+ "aws:us-east-2",
94
+ ],
95
+ message: "BDD test payload: synthetics_api_http_test_payload.json",
96
+ name: "Example-Synthetic",
97
+ options: DatadogAPIClient::V1::SyntheticsTestOptions.new({
98
+ accept_self_signed: false,
99
+ allow_insecure: true,
100
+ follow_redirects: true,
101
+ min_failure_duration: 10,
102
+ min_location_failed: 1,
103
+ monitor_name: "Example-Synthetic",
104
+ monitor_priority: 5,
105
+ _retry: DatadogAPIClient::V1::SyntheticsTestOptionsRetry.new({
106
+ count: 3,
107
+ interval: 10,
108
+ }),
109
+ tick_every: 60,
110
+ http_version: DatadogAPIClient::V1::SyntheticsTestOptionsHTTPVersion::HTTP2,
111
+ }),
112
+ subtype: DatadogAPIClient::V1::SyntheticsTestDetailsSubType::HTTP,
113
+ tags: [
114
+ "testing:api",
115
+ ],
116
+ type: DatadogAPIClient::V1::SyntheticsAPITestType::API,
117
+ })
118
+ p api_instance.create_synthetics_api_test(body)
@@ -26,6 +26,9 @@ body = DatadogAPIClient::V1::SyntheticsBrowserTest.new({
26
26
  key: DatadogAPIClient::V1::SyntheticsTestRequestCertificateItem.new({}),
27
27
  }),
28
28
  certificate_domains: [],
29
+ files: [
30
+ DatadogAPIClient::V1::SyntheticsTestRequestBodyFile.new({}),
31
+ ],
29
32
  http_version: DatadogAPIClient::V1::SyntheticsTestOptionsHTTPVersion::HTTP1,
30
33
  proxy: DatadogAPIClient::V1::SyntheticsTestRequestProxy.new({
31
34
  url: "https://example.com",
@@ -8,14 +8,14 @@ RETENTION_FILTER_DATA_ID = ENV["RETENTION_FILTER_DATA_ID"]
8
8
 
9
9
  body = DatadogAPIClient::V2::RetentionFilterUpdateRequest.new({
10
10
  data: DatadogAPIClient::V2::RetentionFilterUpdateData.new({
11
- attributes: DatadogAPIClient::V2::RetentionFilterCreateAttributes.new({
11
+ attributes: DatadogAPIClient::V2::RetentionFilterUpdateAttributes.new({
12
12
  name: "test",
13
13
  rate: 0.9,
14
14
  filter: DatadogAPIClient::V2::SpansFilterCreate.new({
15
15
  query: "@_top_level:1 test:service-demo",
16
16
  }),
17
17
  enabled: true,
18
- filter_type: DatadogAPIClient::V2::RetentionFilterType::SPANS_SAMPLING_PROCESSOR,
18
+ filter_type: DatadogAPIClient::V2::RetentionFilterAllType::SPANS_SAMPLING_PROCESSOR,
19
19
  }),
20
20
  id: "test-id",
21
21
  type: DatadogAPIClient::V2::ApmRetentionFilterType::APM_RETENTION_FILTER,
@@ -12,7 +12,7 @@ body = DatadogAPIClient::V2::AuthNMappingCreateRequest.new({
12
12
  attribute_key: "exampleauthnmapping",
13
13
  attribute_value: "Example-AuthN-Mapping",
14
14
  }),
15
- relationships: DatadogAPIClient::V2::AuthNMappingCreateRelationships.new({
15
+ relationships: DatadogAPIClient::V2::AuthNMappingRelationshipToRole.new({
16
16
  role: DatadogAPIClient::V2::RelationshipToRole.new({
17
17
  data: DatadogAPIClient::V2::RelationshipToRoleData.new({
18
18
  id: ROLE_DATA_ID,
@@ -16,7 +16,7 @@ body = DatadogAPIClient::V2::AuthNMappingUpdateRequest.new({
16
16
  attribute_value: "Development",
17
17
  }),
18
18
  id: AUTHN_MAPPING_DATA_ID,
19
- relationships: DatadogAPIClient::V2::AuthNMappingUpdateRelationships.new({
19
+ relationships: DatadogAPIClient::V2::AuthNMappingRelationshipToRole.new({
20
20
  role: DatadogAPIClient::V2::RelationshipToRole.new({
21
21
  data: DatadogAPIClient::V2::RelationshipToRoleData.new({
22
22
  id: ROLE_DATA_ID,
@@ -9,7 +9,7 @@ body = DatadogAPIClient::V2::CloudWorkloadSecurityAgentRuleCreateRequest.new({
9
9
  description: "My Agent rule",
10
10
  enabled: true,
11
11
  expression: 'exec.file.name == "sh"',
12
- name: "my_agent_rule",
12
+ name: "examplecloudworkloadsecurity",
13
13
  }),
14
14
  type: DatadogAPIClient::V2::CloudWorkloadSecurityAgentRuleType::AGENT_RULE,
15
15
  }),
@@ -6,7 +6,7 @@ api_instance = DatadogAPIClient::V2::GCPIntegrationAPI.new
6
6
  body = DatadogAPIClient::V2::GCPSTSServiceAccountCreateRequest.new({
7
7
  data: DatadogAPIClient::V2::GCPSTSServiceAccountData.new({
8
8
  attributes: DatadogAPIClient::V2::GCPSTSServiceAccountAttributes.new({
9
- client_email: "252bf553ef04b351@test-project.iam.gserviceaccount.com",
9
+ client_email: "Test-252bf553ef04b351@test-project.iam.gserviceaccount.com",
10
10
  host_filters: [],
11
11
  }),
12
12
  type: DatadogAPIClient::V2::GCPServiceAccountType::GCP_SERVICE_ACCOUNT,
@@ -10,7 +10,7 @@ body = DatadogAPIClient::V2::GCPSTSServiceAccountCreateRequest.new({
10
10
  "lorem",
11
11
  "ipsum",
12
12
  ],
13
- client_email: "252bf553ef04b351@test-project.iam.gserviceaccount.com",
13
+ client_email: "Test-252bf553ef04b351@test-project.iam.gserviceaccount.com",
14
14
  host_filters: [],
15
15
  }),
16
16
  type: DatadogAPIClient::V2::GCPServiceAccountType::GCP_SERVICE_ACCOUNT,
@@ -7,7 +7,7 @@ body = DatadogAPIClient::V2::GCPSTSServiceAccountCreateRequest.new({
7
7
  data: DatadogAPIClient::V2::GCPSTSServiceAccountData.new({
8
8
  attributes: DatadogAPIClient::V2::GCPSTSServiceAccountAttributes.new({
9
9
  resource_collection_enabled: true,
10
- client_email: "252bf553ef04b351@test-project.iam.gserviceaccount.com",
10
+ client_email: "Test-252bf553ef04b351@test-project.iam.gserviceaccount.com",
11
11
  host_filters: [],
12
12
  }),
13
13
  type: DatadogAPIClient::V2::GCPServiceAccountType::GCP_SERVICE_ACCOUNT,
@@ -9,7 +9,7 @@ body = DatadogAPIClient::V2::GCPSTSServiceAccountCreateRequest.new({
9
9
  cloud_run_revision_filters: [
10
10
  "meh:bleh",
11
11
  ],
12
- client_email: "252bf553ef04b351@test-project.iam.gserviceaccount.com",
12
+ client_email: "Test-252bf553ef04b351@test-project.iam.gserviceaccount.com",
13
13
  host_filters: [],
14
14
  }),
15
15
  type: DatadogAPIClient::V2::GCPServiceAccountType::GCP_SERVICE_ACCOUNT,
@@ -7,7 +7,7 @@ body = DatadogAPIClient::V2::GCPSTSServiceAccountCreateRequest.new({
7
7
  data: DatadogAPIClient::V2::GCPSTSServiceAccountData.new({
8
8
  attributes: DatadogAPIClient::V2::GCPSTSServiceAccountAttributes.new({
9
9
  is_security_command_center_enabled: true,
10
- client_email: "252bf553ef04b351@test-project.iam.gserviceaccount.com",
10
+ client_email: "Test-252bf553ef04b351@test-project.iam.gserviceaccount.com",
11
11
  host_filters: [],
12
12
  }),
13
13
  type: DatadogAPIClient::V2::GCPServiceAccountType::GCP_SERVICE_ACCOUNT,
@@ -8,7 +8,7 @@ body = DatadogAPIClient::V2::GCPSTSServiceAccountCreateRequest.new({
8
8
  attributes: DatadogAPIClient::V2::GCPSTSServiceAccountAttributes.new({
9
9
  is_cspm_enabled: true,
10
10
  resource_collection_enabled: true,
11
- client_email: "252bf553ef04b351@test-project.iam.gserviceaccount.com",
11
+ client_email: "Test-252bf553ef04b351@test-project.iam.gserviceaccount.com",
12
12
  host_filters: [],
13
13
  }),
14
14
  type: DatadogAPIClient::V2::GCPServiceAccountType::GCP_SERVICE_ACCOUNT,
@@ -9,7 +9,7 @@ GCP_STS_ACCOUNT_DATA_ID = ENV["GCP_STS_ACCOUNT_DATA_ID"]
9
9
  body = DatadogAPIClient::V2::GCPSTSServiceAccountUpdateRequest.new({
10
10
  data: DatadogAPIClient::V2::GCPSTSServiceAccountUpdateRequestData.new({
11
11
  attributes: DatadogAPIClient::V2::GCPSTSServiceAccountAttributes.new({
12
- client_email: "252bf553ef04b351@example.com",
12
+ client_email: "Test-252bf553ef04b351@example.com",
13
13
  host_filters: [
14
14
  "foo:bar",
15
15
  ],
@@ -9,7 +9,7 @@ GCP_STS_ACCOUNT_DATA_ID = ENV["GCP_STS_ACCOUNT_DATA_ID"]
9
9
  body = DatadogAPIClient::V2::GCPSTSServiceAccountUpdateRequest.new({
10
10
  data: DatadogAPIClient::V2::GCPSTSServiceAccountUpdateRequestData.new({
11
11
  attributes: DatadogAPIClient::V2::GCPSTSServiceAccountAttributes.new({
12
- client_email: "252bf553ef04b351@example.com",
12
+ client_email: "Test-252bf553ef04b351@example.com",
13
13
  cloud_run_revision_filters: [
14
14
  "merp:derp",
15
15
  ],
@@ -9,7 +9,7 @@ GCP_STS_ACCOUNT_DATA_ID = ENV["GCP_STS_ACCOUNT_DATA_ID"]
9
9
  body = DatadogAPIClient::V2::GCPSTSServiceAccountUpdateRequest.new({
10
10
  data: DatadogAPIClient::V2::GCPSTSServiceAccountUpdateRequestData.new({
11
11
  attributes: DatadogAPIClient::V2::GCPSTSServiceAccountAttributes.new({
12
- client_email: "252bf553ef04b351@example.com",
12
+ client_email: "Test-252bf553ef04b351@example.com",
13
13
  resource_collection_enabled: true,
14
14
  }),
15
15
  id: GCP_STS_ACCOUNT_DATA_ID,
@@ -10,6 +10,10 @@ body = DatadogAPIClient::V2::CustomDestinationUpdateRequest.new({
10
10
  data: DatadogAPIClient::V2::CustomDestinationUpdateRequestDefinition.new({
11
11
  attributes: DatadogAPIClient::V2::CustomDestinationUpdateRequestAttributes.new({
12
12
  name: "Nginx logs (Updated)",
13
+ query: "source:nginx",
14
+ enabled: false,
15
+ forward_tags: false,
16
+ forward_tags_restriction_list_type: DatadogAPIClient::V2::CustomDestinationAttributeTagsRestrictionListType::BLOCK_LIST,
13
17
  }),
14
18
  type: DatadogAPIClient::V2::CustomDestinationType::CUSTOM_DESTINATION,
15
19
  id: CUSTOM_DESTINATION_DATA_ID,
@@ -18,7 +18,7 @@ body = DatadogAPIClient::V2::ScalarFormulaQueryRequest.new({
18
18
  }),
19
19
  }),
20
20
  ],
21
- from: 1671612804000,
21
+ from: 1636625471000,
22
22
  queries: [
23
23
  DatadogAPIClient::V2::MetricsScalarQuery.new({
24
24
  aggregator: DatadogAPIClient::V2::MetricsAggregator::AVG,
@@ -27,7 +27,7 @@ body = DatadogAPIClient::V2::ScalarFormulaQueryRequest.new({
27
27
  name: "a",
28
28
  }),
29
29
  ],
30
- to: 1671620004000,
30
+ to: 1636629071000,
31
31
  }),
32
32
  type: DatadogAPIClient::V2::ScalarFormulaRequestType::SCALAR_REQUEST,
33
33
  }),
@@ -18,16 +18,16 @@ body = DatadogAPIClient::V2::TimeseriesFormulaQueryRequest.new({
18
18
  }),
19
19
  }),
20
20
  ],
21
- from: 1671612804000,
21
+ from: 1636625471000,
22
22
  interval: 5000,
23
23
  queries: [
24
24
  DatadogAPIClient::V2::MetricsTimeseriesQuery.new({
25
25
  data_source: DatadogAPIClient::V2::MetricsDataSource::METRICS,
26
- query: "avg:system.cpu.user{*}",
26
+ query: "avg:datadog.estimated_usage.metrics.custom{*}",
27
27
  name: "a",
28
28
  }),
29
29
  ],
30
- to: 1671620004000,
30
+ to: 1636629071000,
31
31
  }),
32
32
  type: DatadogAPIClient::V2::TimeseriesFormulaRequestType::TIMESERIES_REQUEST,
33
33
  }),
@@ -0,0 +1,19 @@
1
+ # Create a suppression rule with an exclusion query returns "OK" response
2
+
3
+ require "datadog_api_client"
4
+ api_instance = DatadogAPIClient::V2::SecurityMonitoringAPI.new
5
+
6
+ body = DatadogAPIClient::V2::SecurityMonitoringSuppressionCreateRequest.new({
7
+ data: DatadogAPIClient::V2::SecurityMonitoringSuppressionCreateData.new({
8
+ attributes: DatadogAPIClient::V2::SecurityMonitoringSuppressionCreateAttributes.new({
9
+ description: "This rule suppresses low-severity signals in staging environments.",
10
+ enabled: true,
11
+ expiration_date: 1703187336000,
12
+ name: "Example-Security-Monitoring",
13
+ rule_query: "type:log_detection source:cloudtrail",
14
+ data_exclusion_query: "account_id:12345",
15
+ }),
16
+ type: DatadogAPIClient::V2::SecurityMonitoringSuppressionType::SUPPRESSIONS,
17
+ }),
18
+ })
19
+ p api_instance.create_security_monitoring_suppression(body)
@@ -0,0 +1,42 @@
1
+ # Validate a detection rule returns "OK" response
2
+
3
+ require "datadog_api_client"
4
+ api_instance = DatadogAPIClient::V2::SecurityMonitoringAPI.new
5
+
6
+ body = DatadogAPIClient::V2::SecurityMonitoringStandardRuleCreatePayload.new({
7
+ cases: [
8
+ DatadogAPIClient::V2::SecurityMonitoringRuleCaseCreate.new({
9
+ name: "",
10
+ status: DatadogAPIClient::V2::SecurityMonitoringRuleSeverity::INFO,
11
+ notifications: [],
12
+ condition: "a > 0",
13
+ }),
14
+ ],
15
+ has_extended_title: true,
16
+ is_enabled: true,
17
+ message: "My security monitoring rule",
18
+ name: "My security monitoring rule",
19
+ options: DatadogAPIClient::V2::SecurityMonitoringRuleOptions.new({
20
+ evaluation_window: DatadogAPIClient::V2::SecurityMonitoringRuleEvaluationWindow::THIRTY_MINUTES,
21
+ keep_alive: DatadogAPIClient::V2::SecurityMonitoringRuleKeepAlive::THIRTY_MINUTES,
22
+ max_signal_duration: DatadogAPIClient::V2::SecurityMonitoringRuleMaxSignalDuration::THIRTY_MINUTES,
23
+ detection_method: DatadogAPIClient::V2::SecurityMonitoringRuleDetectionMethod::THRESHOLD,
24
+ }),
25
+ queries: [
26
+ DatadogAPIClient::V2::SecurityMonitoringStandardRuleQuery.new({
27
+ query: "source:source_here",
28
+ group_by_fields: [
29
+ "@userIdentity.assumed_role",
30
+ ],
31
+ distinct_fields: [],
32
+ aggregation: DatadogAPIClient::V2::SecurityMonitoringRuleQueryAggregation::COUNT,
33
+ name: "",
34
+ }),
35
+ ],
36
+ tags: [
37
+ "env:prod",
38
+ "team:security",
39
+ ],
40
+ type: DatadogAPIClient::V2::SecurityMonitoringRuleTypeCreate::LOG_DETECTION,
41
+ })
42
+ api_instance.validate_security_monitoring_rule(body)
@@ -5,6 +5,10 @@ api_instance = DatadogAPIClient::V2::ServiceDefinitionAPI.new
5
5
 
6
6
  body = DatadogAPIClient::V2::ServiceDefinitionV2Dot2.new({
7
7
  application: "my-app",
8
+ ci_pipeline_fingerprints: [
9
+ "j88xdEy0J5lc",
10
+ "eZ7LMljCk8vo",
11
+ ],
8
12
  contacts: [
9
13
  DatadogAPIClient::V2::ServiceDefinitionV2Dot2Contact.new({
10
14
  contact: "https://teams.microsoft.com/myteam",
@@ -0,0 +1,20 @@
1
+ # Create a new SLO report returns "OK" response
2
+
3
+ require "datadog_api_client"
4
+ DatadogAPIClient.configure do |config|
5
+ config.unstable_operations["v2.create_slo_report_job".to_sym] = true
6
+ end
7
+ api_instance = DatadogAPIClient::V2::ServiceLevelObjectivesAPI.new
8
+
9
+ body = DatadogAPIClient::V2::SloReportCreateRequest.new({
10
+ data: DatadogAPIClient::V2::SloReportCreateRequestData.new({
11
+ attributes: DatadogAPIClient::V2::SloReportCreateRequestAttributes.new({
12
+ from_ts: 1690901870,
13
+ to_ts: 1706803070,
14
+ query: 'slo_type:metric "SLO Reporting Test"',
15
+ interval: DatadogAPIClient::V2::SLOReportInterval::MONTHLY,
16
+ timezone: "America/New_York",
17
+ }),
18
+ }),
19
+ })
20
+ p api_instance.create_slo_report_job(body)
@@ -0,0 +1,8 @@
1
+ # Get SLO report returns "OK" response
2
+
3
+ require "datadog_api_client"
4
+ DatadogAPIClient.configure do |config|
5
+ config.unstable_operations["v2.get_slo_report".to_sym] = true
6
+ end
7
+ api_instance = DatadogAPIClient::V2::ServiceLevelObjectivesAPI.new
8
+ p api_instance.get_slo_report("9fb2dc2a-ead0-11ee-a174-9fe3a9d7627f")
@@ -0,0 +1,11 @@
1
+ # Get SLO report status returns "OK" response
2
+
3
+ require "datadog_api_client"
4
+ DatadogAPIClient.configure do |config|
5
+ config.unstable_operations["v2.get_slo_report_job_status".to_sym] = true
6
+ end
7
+ api_instance = DatadogAPIClient::V2::ServiceLevelObjectivesAPI.new
8
+
9
+ # there is a valid "report" in the system
10
+ REPORT_DATA_ID = ENV["REPORT_DATA_ID"]
11
+ p api_instance.get_slo_report_job_status(REPORT_DATA_ID)
@@ -230,6 +230,9 @@ module DatadogAPIClient
230
230
  "v2.get_incident_service": false,
231
231
  "v2.list_incident_services": false,
232
232
  "v2.update_incident_service": false,
233
+ "v2.create_slo_report_job": false,
234
+ "v2.get_slo_report": false,
235
+ "v2.get_slo_report_job_status": false,
233
236
  "v2.create_incident_team": false,
234
237
  "v2.delete_incident_team": false,
235
238
  "v2.get_incident_team": false,