Skip to content

Commit 4491f95

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Marks the paths as unstable since the API is in private beta (#2146)
Co-authored-by: ci.datadog-api-spec <[email protected]>
1 parent 748c6ca commit 4491f95

File tree

8 files changed

+59
-12
lines changed

8 files changed

+59
-12
lines changed

.apigentools-info

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
"spec_versions": {
55
"v1": {
66
"apigentools_version": "1.6.6",
7-
"regenerated": "2024-12-13 14:48:47.640089",
8-
"spec_repo_commit": "5392df51"
7+
"regenerated": "2024-12-13 15:30:16.623767",
8+
"spec_repo_commit": "e7a707af"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.6",
12-
"regenerated": "2024-12-13 14:48:47.659296",
13-
"spec_repo_commit": "5392df51"
12+
"regenerated": "2024-12-13 15:30:16.642650",
13+
"spec_repo_commit": "e7a707af"
1414
}
1515
}
1616
}

.generator/schemas/v2/openapi.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31356,6 +31356,9 @@ paths:
3135631356
permissions:
3135731357
- rum_delete_data
3135831358
- logs_delete_data
31359+
x-unstable: '**Note**: This endpoint is in Preview. If you have any feedback,
31360+
31361+
contact [Datadog support](https://docs.datadoghq.com/help/).'
3135931362
/api/v2/deletion/requests:
3136031363
get:
3136131364
description: Gets a list of data deletion requests based on several filter parameters.
@@ -31431,6 +31434,9 @@ paths:
3143131434
permissions:
3143231435
- rum_delete_data
3143331436
- logs_delete_data
31437+
x-unstable: '**Note**: This endpoint is in Preview. If you have any feedback,
31438+
31439+
contact [Datadog support](https://docs.datadoghq.com/help/).'
3143431440
/api/v2/deletion/requests/{id}/cancel:
3143531441
put:
3143631442
description: Cancels a data deletion request by providing its ID.
@@ -31473,6 +31479,9 @@ paths:
3147331479
permissions:
3147431480
- rum_delete_data
3147531481
- logs_delete_data
31482+
x-unstable: '**Note**: This endpoint is in Preview. If you have any feedback,
31483+
31484+
contact [Datadog support](https://docs.datadoghq.com/help/).'
3147631485
/api/v2/domain_allowlist:
3147731486
get:
3147831487
description: Get the domain allowlist for an organization.

examples/v2/data-deletion/CancelDataDeletionRequest.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
# Cancels a data deletion request returns "OK" response
22

33
require "datadog_api_client"
4+
DatadogAPIClient.configure do |config|
5+
config.unstable_operations["v2.cancel_data_deletion_request".to_sym] = true
6+
end
47
api_instance = DatadogAPIClient::V2::DataDeletionAPI.new
58

69
# there is a valid "deletion_request" in the system

examples/v2/data-deletion/CreateDataDeletionRequest.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
# Creates a data deletion request returns "OK" response
22

33
require "datadog_api_client"
4+
DatadogAPIClient.configure do |config|
5+
config.unstable_operations["v2.create_data_deletion_request".to_sym] = true
6+
end
47
api_instance = DatadogAPIClient::V2::DataDeletionAPI.new
58

69
body = DatadogAPIClient::V2::CreateDataDeletionRequestBody.new({
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# Gets a list of data deletion requests returns "OK" response
22

33
require "datadog_api_client"
4+
DatadogAPIClient.configure do |config|
5+
config.unstable_operations["v2.get_data_deletion_requests".to_sym] = true
6+
end
47
api_instance = DatadogAPIClient::V2::DataDeletionAPI.new
58
p api_instance.get_data_deletion_requests()

features/v2/data_deletion.feature

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,16 @@ Feature: Data Deletion
1111

1212
@replay-only @team:DataDog/supportability-engineering
1313
Scenario: Cancels a data deletion request returns "Bad Request" response
14-
Given new "CancelDataDeletionRequest" request
14+
Given operation "CancelDataDeletionRequest" enabled
15+
And new "CancelDataDeletionRequest" request
1516
And request contains "id" parameter with value "id-1"
1617
When the request is sent
1718
Then the response status is 400 Bad Request
1819

1920
@team:DataDog/supportability-engineering
2021
Scenario: Cancels a data deletion request returns "OK" response
21-
Given there is a valid "deletion_request" in the system
22+
Given operation "CancelDataDeletionRequest" enabled
23+
And there is a valid "deletion_request" in the system
2224
And new "CancelDataDeletionRequest" request
2325
And request contains "id" parameter from "deletion_request.data.id"
2426
When the request is sent
@@ -30,22 +32,25 @@ Feature: Data Deletion
3032

3133
@replay-only @team:DataDog/supportability-engineering
3234
Scenario: Cancels a data deletion request returns "Precondition failed error" response
33-
Given new "CancelDataDeletionRequest" request
35+
Given operation "CancelDataDeletionRequest" enabled
36+
And new "CancelDataDeletionRequest" request
3437
And request contains "id" parameter with value "-1"
3538
When the request is sent
3639
Then the response status is 412 Precondition failed error
3740

3841
@generated @skip @team:DataDog/supportability-engineering
3942
Scenario: Creates a data deletion request returns "Bad Request" response
40-
Given new "CreateDataDeletionRequest" request
43+
Given operation "CreateDataDeletionRequest" enabled
44+
And new "CreateDataDeletionRequest" request
4145
And request contains "product" parameter from "REPLACE.ME"
4246
And body with value {"data": {"attributes": {"from": 1672527600000, "indexes": ["test-index", "test-index-2"], "query": {"host": "abc", "service": "xyz"}, "to": 1704063600000}}}
4347
When the request is sent
4448
Then the response status is 400 Bad Request
4549

4650
@team:DataDog/supportability-engineering
4751
Scenario: Creates a data deletion request returns "OK" response
48-
Given new "CreateDataDeletionRequest" request
52+
Given operation "CreateDataDeletionRequest" enabled
53+
And new "CreateDataDeletionRequest" request
4954
And request contains "product" parameter with value "logs"
5055
And body with value {"data": {"attributes": {"from": 1672527600000, "indexes": ["test-index", "test-index-2"], "query": {"host": "abc", "service": "xyz"}, "to": 1704063600000}}}
5156
When the request is sent
@@ -56,21 +61,24 @@ Feature: Data Deletion
5661

5762
@replay-only @team:DataDog/supportability-engineering
5863
Scenario: Creates a data deletion request returns "Precondition failed error" response
59-
Given new "CreateDataDeletionRequest" request
64+
Given operation "CreateDataDeletionRequest" enabled
65+
And new "CreateDataDeletionRequest" request
6066
And request contains "product" parameter with value "logs"
6167
And body with value {"data": {"attributes": {"from": 1672527600000, "indexes": ["test-index", "test-index-2"], "query": {}, "to": 1704063600000}}}
6268
When the request is sent
6369
Then the response status is 412 Precondition failed error
6470

6571
@generated @skip @team:DataDog/supportability-engineering
6672
Scenario: Gets a list of data deletion requests returns "Bad Request" response
67-
Given new "GetDataDeletionRequests" request
73+
Given operation "GetDataDeletionRequests" enabled
74+
And new "GetDataDeletionRequests" request
6875
When the request is sent
6976
Then the response status is 400 Bad Request
7077

7178
@team:DataDog/supportability-engineering
7279
Scenario: Gets a list of data deletion requests returns "OK" response
73-
Given there is a valid "deletion_request" in the system
80+
Given operation "GetDataDeletionRequests" enabled
81+
And there is a valid "deletion_request" in the system
7482
And new "GetDataDeletionRequests" request
7583
When the request is sent
7684
Then the response status is 200 OK

lib/datadog_api_client/configuration.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,9 @@ def initialize
197197
"v2.get_active_billing_dimensions": false,
198198
"v2.get_billing_dimension_mapping": false,
199199
"v2.get_monthly_cost_attribution": false,
200+
"v2.cancel_data_deletion_request": false,
201+
"v2.create_data_deletion_request": false,
202+
"v2.get_data_deletion_requests": false,
200203
"v2.create_dora_deployment": false,
201204
"v2.create_dora_incident": false,
202205
"v2.create_incident": false,

lib/datadog_api_client/v2/api/data_deletion_api.rb

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,12 @@ def cancel_data_deletion_request(id, opts = {})
3939
# @param opts [Hash] the optional parameters
4040
# @return [Array<(CancelDataDeletionResponseBody, Integer, Hash)>] CancelDataDeletionResponseBody data, response status code and response headers
4141
def cancel_data_deletion_request_with_http_info(id, opts = {})
42+
unstable_enabled = @api_client.config.unstable_operations["v2.cancel_data_deletion_request".to_sym]
43+
if unstable_enabled
44+
@api_client.config.logger.warn format("Using unstable operation '%s'", "v2.cancel_data_deletion_request")
45+
else
46+
raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.cancel_data_deletion_request"))
47+
end
4248

4349
if @api_client.config.debugging
4450
@api_client.config.logger.debug 'Calling API: DataDeletionAPI.cancel_data_deletion_request ...'
@@ -105,6 +111,12 @@ def create_data_deletion_request(product, body, opts = {})
105111
# @param opts [Hash] the optional parameters
106112
# @return [Array<(CreateDataDeletionResponseBody, Integer, Hash)>] CreateDataDeletionResponseBody data, response status code and response headers
107113
def create_data_deletion_request_with_http_info(product, body, opts = {})
114+
unstable_enabled = @api_client.config.unstable_operations["v2.create_data_deletion_request".to_sym]
115+
if unstable_enabled
116+
@api_client.config.logger.warn format("Using unstable operation '%s'", "v2.create_data_deletion_request")
117+
else
118+
raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.create_data_deletion_request"))
119+
end
108120

109121
if @api_client.config.debugging
110122
@api_client.config.logger.debug 'Calling API: DataDeletionAPI.create_data_deletion_request ...'
@@ -180,6 +192,12 @@ def get_data_deletion_requests(opts = {})
180192
# @option opts [Integer] :page_size Sets the page size of the search.
181193
# @return [Array<(GetDataDeletionsResponseBody, Integer, Hash)>] GetDataDeletionsResponseBody data, response status code and response headers
182194
def get_data_deletion_requests_with_http_info(opts = {})
195+
unstable_enabled = @api_client.config.unstable_operations["v2.get_data_deletion_requests".to_sym]
196+
if unstable_enabled
197+
@api_client.config.logger.warn format("Using unstable operation '%s'", "v2.get_data_deletion_requests")
198+
else
199+
raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.get_data_deletion_requests"))
200+
end
183201

184202
if @api_client.config.debugging
185203
@api_client.config.logger.debug 'Calling API: DataDeletionAPI.get_data_deletion_requests ...'

0 commit comments

Comments
 (0)