Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .apigentools-info
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
"spec_versions": {
"v1": {
"apigentools_version": "1.6.6",
"regenerated": "2024-12-13 14:48:47.640089",
"spec_repo_commit": "5392df51"
"regenerated": "2024-12-13 15:30:16.623767",
"spec_repo_commit": "e7a707af"
},
"v2": {
"apigentools_version": "1.6.6",
"regenerated": "2024-12-13 14:48:47.659296",
"spec_repo_commit": "5392df51"
"regenerated": "2024-12-13 15:30:16.642650",
"spec_repo_commit": "e7a707af"
}
}
}
9 changes: 9 additions & 0 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31356,6 +31356,9 @@ paths:
permissions:
- rum_delete_data
- logs_delete_data
x-unstable: '**Note**: This endpoint is in Preview. If you have any feedback,

contact [Datadog support](https://docs.datadoghq.com/help/).'
/api/v2/deletion/requests:
get:
description: Gets a list of data deletion requests based on several filter parameters.
Expand Down Expand Up @@ -31431,6 +31434,9 @@ paths:
permissions:
- rum_delete_data
- logs_delete_data
x-unstable: '**Note**: This endpoint is in Preview. If you have any feedback,

contact [Datadog support](https://docs.datadoghq.com/help/).'
/api/v2/deletion/requests/{id}/cancel:
put:
description: Cancels a data deletion request by providing its ID.
Expand Down Expand Up @@ -31473,6 +31479,9 @@ paths:
permissions:
- rum_delete_data
- logs_delete_data
x-unstable: '**Note**: This endpoint is in Preview. If you have any feedback,

contact [Datadog support](https://docs.datadoghq.com/help/).'
/api/v2/domain_allowlist:
get:
description: Get the domain allowlist for an organization.
Expand Down
3 changes: 3 additions & 0 deletions examples/v2/data-deletion/CancelDataDeletionRequest.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# Cancels a data deletion request returns "OK" response

require "datadog_api_client"
DatadogAPIClient.configure do |config|
config.unstable_operations["v2.cancel_data_deletion_request".to_sym] = true
end
api_instance = DatadogAPIClient::V2::DataDeletionAPI.new

# there is a valid "deletion_request" in the system
Expand Down
3 changes: 3 additions & 0 deletions examples/v2/data-deletion/CreateDataDeletionRequest.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# Creates a data deletion request returns "OK" response

require "datadog_api_client"
DatadogAPIClient.configure do |config|
config.unstable_operations["v2.create_data_deletion_request".to_sym] = true
end
api_instance = DatadogAPIClient::V2::DataDeletionAPI.new

body = DatadogAPIClient::V2::CreateDataDeletionRequestBody.new({
Expand Down
3 changes: 3 additions & 0 deletions examples/v2/data-deletion/GetDataDeletionRequests.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Gets a list of data deletion requests returns "OK" response

require "datadog_api_client"
DatadogAPIClient.configure do |config|
config.unstable_operations["v2.get_data_deletion_requests".to_sym] = true
end
api_instance = DatadogAPIClient::V2::DataDeletionAPI.new
p api_instance.get_data_deletion_requests()
24 changes: 16 additions & 8 deletions features/v2/data_deletion.feature
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,16 @@ Feature: Data Deletion

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

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

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

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

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

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

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

@team:DataDog/supportability-engineering
Scenario: Gets a list of data deletion requests returns "OK" response
Given there is a valid "deletion_request" in the system
Given operation "GetDataDeletionRequests" enabled
And there is a valid "deletion_request" in the system
And new "GetDataDeletionRequests" request
When the request is sent
Then the response status is 200 OK
3 changes: 3 additions & 0 deletions lib/datadog_api_client/configuration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,9 @@ def initialize
"v2.get_active_billing_dimensions": false,
"v2.get_billing_dimension_mapping": false,
"v2.get_monthly_cost_attribution": false,
"v2.cancel_data_deletion_request": false,
"v2.create_data_deletion_request": false,
"v2.get_data_deletion_requests": false,
"v2.create_dora_deployment": false,
"v2.create_dora_incident": false,
"v2.create_incident": false,
Expand Down
18 changes: 18 additions & 0 deletions lib/datadog_api_client/v2/api/data_deletion_api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,12 @@ def cancel_data_deletion_request(id, opts = {})
# @param opts [Hash] the optional parameters
# @return [Array<(CancelDataDeletionResponseBody, Integer, Hash)>] CancelDataDeletionResponseBody data, response status code and response headers
def cancel_data_deletion_request_with_http_info(id, opts = {})
unstable_enabled = @api_client.config.unstable_operations["v2.cancel_data_deletion_request".to_sym]
if unstable_enabled
@api_client.config.logger.warn format("Using unstable operation '%s'", "v2.cancel_data_deletion_request")
else
raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.cancel_data_deletion_request"))
end

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

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

if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: DataDeletionAPI.get_data_deletion_requests ...'
Expand Down
Loading