Skip to content
Open
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
57 changes: 42 additions & 15 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1538,7 +1538,7 @@ components:
example: "-created_at"
type: string
ProductName:
description: Name of the product to be deleted, either `logs` or `rum`.
description: Name of the product to be deleted. Only `logs` is supported.
in: path
name: product
required: true
Expand Down Expand Up @@ -24351,6 +24351,12 @@ components:
CreateDataDeletionRequestBodyAttributes:
description: Attributes for creating a data deletion request.
properties:
displayed_total:
description: Total number of elements to be deleted as displayed to the user.
example: 100
format: int64
minimum: 1
type: integer
from:
description: Start of requested time window, milliseconds since Unix epoch.
example: 1672527600000
Expand Down Expand Up @@ -24378,6 +24384,7 @@ components:
- query
- from
- to
- displayed_total
type: object
CreateDataDeletionRequestBodyData:
description: Data needed to create a data deletion request.
Expand Down Expand Up @@ -30968,6 +30975,19 @@ components:
description: User who created the deletion request.
example: "test.user@datadoghq.com"
type: string
customer_message:
description: A message for the customer regarding the deletion request, if any.
example: "Your deletion request is being processed."
type: string
displayed_total:
description: Total number of elements to be deleted as displayed to the user.
example: 100
format: int64
type: integer
error_category:
description: The category of the error for the deletion request, if any.
example: "validation_error"
type: string
from_time:
description: Start of requested time window, milliseconds since Unix epoch.
example: 1672527600000
Expand Down Expand Up @@ -31031,6 +31051,7 @@ components:
- status
- to_time
- total_unrestricted
- displayed_total
- updated_at
type: object
DataDeletionResponseMeta:
Expand All @@ -31041,7 +31062,7 @@ components:
format: int64
type: integer
description: The total deletion requests created by product.
example: {"logs": 8, "rum": 7}
example: {"logs": 8}
type: object
count_status:
additionalProperties:
Expand Down Expand Up @@ -143031,6 +143052,21 @@ paths:
requestBody:
content:
application/json:
examples:
default:
value:
data:
attributes:
displayed_total: 100
from: 1672527600000
indexes:
- test-index
- test-index-2
query:
host: abc
service: xyz
to: 1704063600000
type: create_deletion_req
schema:
$ref: "#/components/schemas/CreateDataDeletionRequestBody"
required: true
Expand All @@ -143045,6 +143081,7 @@ paths:
attributes:
created_at: "2024-01-01T00:00:00.000000Z"
created_by: test@example.com
displayed_total: 100
from_time: 1672527600000
is_created: true
org_id: 123
Expand Down Expand Up @@ -143090,11 +143127,7 @@ paths:
x-permission:
operator: OR
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 @@ -143151,6 +143184,7 @@ paths:
- attributes:
created_at: "2024-01-01T00:00:00.000000Z"
created_by: test@example.com
displayed_total: 100
from_time: 1672527600000
is_created: true
org_id: 123
Expand Down Expand Up @@ -143190,11 +143224,7 @@ paths:
x-permission:
operator: OR
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 All @@ -143212,6 +143242,7 @@ paths:
attributes:
created_at: "2024-01-01T00:00:00.000000Z"
created_by: test@example.com
displayed_total: 100
from_time: 1672527600000
is_created: true
org_id: 123
Expand Down Expand Up @@ -143257,11 +143288,7 @@ paths:
x-permission:
operator: OR
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/deployment_gates:
get:
description: |-
Expand Down Expand Up @@ -218171,7 +218198,7 @@ tags:
information.
name: Dashboards
- description: |-
The Data Deletion API allows the user to target and delete data from the allowed products. It's currently enabled for Logs and RUM and depends on `logs_delete_data` and `rum_delete_data` permissions respectively.
The Data Deletion API allows the user to target and delete data from the allowed products. It's enabled for Logs and depends on the `logs_delete_data` permission.
name: Data Deletion
- description: Manage and run data observability monitors.
name: Data Observability
Expand Down
1 change: 0 additions & 1 deletion examples/v2/data-deletion/CancelDataDeletionRequest.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
DELETION_REQUEST_DATA_ID = environ["DELETION_REQUEST_DATA_ID"]

configuration = Configuration()
configuration.unstable_operations["cancel_data_deletion_request"] = True
with ApiClient(configuration) as api_client:
api_instance = DataDeletionApi(api_client)
response = api_instance.cancel_data_deletion_request(
Expand Down
2 changes: 1 addition & 1 deletion examples/v2/data-deletion/CreateDataDeletionRequest.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
body = CreateDataDeletionRequestBody(
data=CreateDataDeletionRequestBodyData(
attributes=CreateDataDeletionRequestBodyAttributes(
displayed_total=100,
_from=1672527600000,
indexes=[
"test-index",
Expand All @@ -32,7 +33,6 @@
)

configuration = Configuration()
configuration.unstable_operations["create_data_deletion_request"] = True
with ApiClient(configuration) as api_client:
api_instance = DataDeletionApi(api_client)
response = api_instance.create_data_deletion_request(product="logs", body=body)
Expand Down
1 change: 0 additions & 1 deletion examples/v2/data-deletion/GetDataDeletionRequests.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
from datadog_api_client.v2.api.data_deletion_api import DataDeletionApi

configuration = Configuration()
configuration.unstable_operations["get_data_deletion_requests"] = True
with ApiClient(configuration) as api_client:
api_instance = DataDeletionApi(api_client)
response = api_instance.get_data_deletion_requests()
Expand Down
3 changes: 0 additions & 3 deletions src/datadog_api_client/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -490,9 +490,6 @@ def __init__(
"v2.get_all_datasets": False,
"v2.get_dataset": False,
"v2.update_dataset": False,
"v2.cancel_data_deletion_request": False,
"v2.create_data_deletion_request": False,
"v2.get_data_deletion_requests": False,
"v2.create_deployment_gate": False,
"v2.create_deployment_rule": False,
"v2.delete_deployment_gate": False,
Expand Down
4 changes: 2 additions & 2 deletions src/datadog_api_client/v2/api/data_deletion_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

class DataDeletionApi:
"""
The Data Deletion API allows the user to target and delete data from the allowed products. It's currently enabled for Logs and RUM and depends on ``logs_delete_data`` and ``rum_delete_data`` permissions respectively.
The Data Deletion API allows the user to target and delete data from the allowed products. It's enabled for Logs and depends on the ``logs_delete_data`` permission.
"""

def __init__(self, api_client=None):
Expand Down Expand Up @@ -148,7 +148,7 @@ def create_data_deletion_request(

Creates a data deletion request by providing a query and a timeframe targeting the proper data.

:param product: Name of the product to be deleted, either ``logs`` or ``rum``.
:param product: Name of the product to be deleted. Only ``logs`` is supported.
:type product: str
:type body: CreateDataDeletionRequestBody
:rtype: CreateDataDeletionResponseBody
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,28 +14,45 @@


class CreateDataDeletionRequestBodyAttributes(ModelNormal):
validations = {
"displayed_total": {
"inclusive_minimum": 1,
},
}

@cached_property
def openapi_types(_):
return {
"displayed_total": (int,),
"_from": (int,),
"indexes": ([str],),
"query": ({str: (str,)},),
"to": (int,),
}

attribute_map = {
"displayed_total": "displayed_total",
"_from": "from",
"indexes": "indexes",
"query": "query",
"to": "to",
}

def __init__(
self_, _from: int, query: Dict[str, str], to: int, indexes: Union[List[str], UnsetType] = unset, **kwargs
self_,
displayed_total: int,
_from: int,
query: Dict[str, str],
to: int,
indexes: Union[List[str], UnsetType] = unset,
**kwargs,
):
"""
Attributes for creating a data deletion request.

:param displayed_total: Total number of elements to be deleted as displayed to the user.
:type displayed_total: int

:param _from: Start of requested time window, milliseconds since Unix epoch.
:type _from: int

Expand All @@ -52,6 +69,7 @@ def __init__(
kwargs["indexes"] = indexes
super().__init__(kwargs)

self_.displayed_total = displayed_total
self_._from = _from
self_.query = query
self_.to = to
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ def openapi_types(_):
return {
"created_at": (str,),
"created_by": (str,),
"customer_message": (str,),
"displayed_total": (int,),
"error_category": (str,),
"from_time": (int,),
"indexes": ([str],),
"is_created": (bool,),
Expand All @@ -35,6 +38,9 @@ def openapi_types(_):
attribute_map = {
"created_at": "created_at",
"created_by": "created_by",
"customer_message": "customer_message",
"displayed_total": "displayed_total",
"error_category": "error_category",
"from_time": "from_time",
"indexes": "indexes",
"is_created": "is_created",
Expand All @@ -52,6 +58,7 @@ def __init__(
self_,
created_at: str,
created_by: str,
displayed_total: int,
from_time: int,
is_created: bool,
org_id: int,
Expand All @@ -62,6 +69,8 @@ def __init__(
to_time: int,
total_unrestricted: int,
updated_at: str,
customer_message: Union[str, UnsetType] = unset,
error_category: Union[str, UnsetType] = unset,
indexes: Union[List[str], UnsetType] = unset,
**kwargs,
):
Expand All @@ -74,6 +83,15 @@ def __init__(
:param created_by: User who created the deletion request.
:type created_by: str

:param customer_message: A message for the customer regarding the deletion request, if any.
:type customer_message: str, optional

:param displayed_total: Total number of elements to be deleted as displayed to the user.
:type displayed_total: int

:param error_category: The category of the error for the deletion request, if any.
:type error_category: str, optional

:param from_time: Start of requested time window, milliseconds since Unix epoch.
:type from_time: int

Expand Down Expand Up @@ -107,12 +125,17 @@ def __init__(
:param updated_at: Update time of the deletion request.
:type updated_at: str
"""
if customer_message is not unset:
kwargs["customer_message"] = customer_message
if error_category is not unset:
kwargs["error_category"] = error_category
if indexes is not unset:
kwargs["indexes"] = indexes
super().__init__(kwargs)

self_.created_at = created_at
self_.created_by = created_by
self_.displayed_total = displayed_total
self_.from_time = from_time
self_.is_created = is_created
self_.org_id = org_id
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2025-01-15T14:25:54.929Z
2026-08-21T11:45:52.523Z
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2025-01-15T14:26:08.930Z
2026-08-21T11:46:24.173Z
Loading
Loading