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
278 changes: 278 additions & 0 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11004,6 +11004,68 @@ components:
- type
- attributes
type: object
ArchiveSearchListResponse:
description: Response containing multiple Archive Searches.
properties:
data:
description: Array of Archive Searches.
items:
$ref: "#/components/schemas/ArchiveSearchResponseData"
type: array
meta:
$ref: "#/components/schemas/ArchiveSearchListResponseMeta"
required:
- data
type: object
ArchiveSearchListResponseMeta:
description: Metadata of the Archive Searches response.
properties:
truncated:
description: Whether more Archive Searches exist beyond the ones returned.
example: false
type: boolean
type: object
ArchiveSearchRehydrateRequest:
description: Request to rehydrate an Archive Search.
properties:
data:
$ref: "#/components/schemas/ArchiveSearchRehydrateRequestData"
required:
- data
type: object
ArchiveSearchRehydrateRequestAttributes:
description: Attributes accepted when rehydrating an Archive Search.
properties:
rehydration:
$ref: "#/components/schemas/ArchiveSearchRehydrateRequestRehydration"
required:
- rehydration
type: object
ArchiveSearchRehydrateRequestData:
description: Archive Search object to rehydrate.
properties:
attributes:
$ref: "#/components/schemas/ArchiveSearchRehydrateRequestAttributes"
type:
$ref: "#/components/schemas/ArchiveSearchType"
required:
- type
- attributes
type: object
ArchiveSearchRehydrateRequestRehydration:
description: Rehydration settings to apply.
properties:
retention_days:
description: Number of days the rehydrated logs are retained for.
example: 15
format: int64
type: integer
tier:
$ref: "#/components/schemas/ArchiveSearchRehydrationTier"
required:
- retention_days
- tier
type: object
ArchiveSearchRehydration:
description: |-
Rehydration settings of the Archive Search. Absent when the search only scans the archive
Expand Down Expand Up @@ -199559,6 +199621,60 @@ paths:
permissions:
- logs_read_data
/api/v2/logs/archive_searches:
get:
description: |-
List the organization's Archive Searches that haven't expired, up to 5,000. When more
exist, `meta.truncated` is `true`.
operationId: ListArchiveSearches
responses:
"200":
content:
application/json:
examples:
default:
value:
data:
- attributes:
archive_id: mhmyYmyLTOaFYKvhNadu1w
bytes_scanned: 0
created_at: "2026-01-02T12:00:00Z"
description: Investigating the checkout latency spike.
events_scanned: 0
expected_duration: 120
from: "2026-01-01T00:00:00Z"
name: checkout-latency-investigation
query: service:checkout status:error
status: RUNNING
to: "2026-01-02T00:00:00Z"
id: nv2eu4srgyzdkulggjzg2zkmmzifa2rum5iq
type: archive_search
meta:
truncated: false
schema:
$ref: "#/components/schemas/ArchiveSearchListResponse"
description: OK
"403":
content:
application/json:
schema:
$ref: "#/components/schemas/JSONAPIErrorResponse"
description: Forbidden
"429":
$ref: "#/components/responses/TooManyRequestsResponse"
security:
- apiKeyAuth: []
appKeyAuth: []
- AuthZ: []
summary: List Archive Searches
tags:
- Logs Archive Searches
"x-permission":
operator: OR
permissions:
- logs_read_data
x-unstable: |-
**Note**: This endpoint is in preview and is subject to change.
If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).
post:
description: |-
Start a search over the logs stored in an archive.
Expand Down Expand Up @@ -199708,6 +199824,168 @@ paths:
x-unstable: |-
**Note**: This endpoint is in preview and is subject to change.
If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).
patch:
description: |-
Turn a plain Archive Search into a Search & Rehydration by indexing the matched logs into a
retained historical view. Rehydration is the only thing this endpoint can change, and it only
applies to a search that has already finished scanning.
operationId: RehydrateArchiveSearch
parameters:
- description: Unique identifier of the Archive Search.
example: nv2eu4srgyzdkulggjzg2zkmmzifa2rum5iq
in: path
name: archive_search_id
required: true
schema:
type: string
requestBody:
content:
application/json:
schema:
$ref: "#/components/schemas/ArchiveSearchRehydrateRequest"
required: true
responses:
"200":
content:
application/json:
examples:
default:
value:
data:
attributes:
archive_id: mhmyYmyLTOaFYKvhNadu1w
bytes_scanned: 402764439
created_at: "2026-01-02T12:00:00Z"
description: Investigating the checkout latency spike.
events_scanned: 1500
from: "2026-01-01T00:00:00Z"
name: checkout-latency-investigation
query: service:checkout status:error
rehydration:
max_rehydrated_events: 100000
retention_days: 15
tier: standard
status: RUNNING
to: "2026-01-02T00:00:00Z"
id: nv2eu4srgyzdkulggjzg2zkmmzifa2rum5iq
type: archive_search
schema:
$ref: "#/components/schemas/ArchiveSearchResponse"
description: OK
"400":
content:
application/json:
schema:
$ref: "#/components/schemas/JSONAPIErrorResponse"
description: Bad Request
"403":
content:
application/json:
schema:
$ref: "#/components/schemas/JSONAPIErrorResponse"
description: Forbidden
"404":
content:
application/json:
schema:
$ref: "#/components/schemas/JSONAPIErrorResponse"
description: Not Found
"412":
content:
application/json:
schema:
$ref: "#/components/schemas/JSONAPIErrorResponse"
description: Precondition Failed
"429":
$ref: "#/components/responses/TooManyRequestsResponse"
security:
- apiKeyAuth: []
appKeyAuth: []
- AuthZ: []
summary: Rehydrate an Archive Search
tags:
- Logs Archive Searches
"x-permission":
operator: OR
permissions:
- logs_write_historical_view
x-unstable: |-
**Note**: This endpoint is in preview and is subject to change.
If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).
/api/v2/logs/archive_searches/{archive_search_id}/cancel:
post:
description: |-
Cancel a running Archive Search. Cancelling an Archive Search that has already finished is a
no-op: it returns the resource unchanged instead of returning an error.
operationId: CancelArchiveSearch
parameters:
- description: Unique identifier of the Archive Search.
example: nv2eu4srgyzdkulggjzg2zkmmzifa2rum5iq
in: path
name: archive_search_id
required: true
schema:
type: string
responses:
"200":
content:
application/json:
examples:
default:
value:
data:
attributes:
archive_id: mhmyYmyLTOaFYKvhNadu1w
bytes_scanned: 102400
completed_at: "2026-01-02T12:05:00Z"
created_at: "2026-01-02T12:00:00Z"
description: Investigating the checkout latency spike.
events_scanned: 500
from: "2026-01-01T00:00:00Z"
name: checkout-latency-investigation
query: service:checkout status:error
status: CANCELLED
to: "2026-01-02T00:00:00Z"
id: nv2eu4srgyzdkulggjzg2zkmmzifa2rum5iq
type: archive_search
schema:
$ref: "#/components/schemas/ArchiveSearchResponse"
description: OK
"400":
content:
application/json:
schema:
$ref: "#/components/schemas/JSONAPIErrorResponse"
description: Bad Request
"403":
content:
application/json:
schema:
$ref: "#/components/schemas/JSONAPIErrorResponse"
description: Forbidden
"404":
content:
application/json:
schema:
$ref: "#/components/schemas/JSONAPIErrorResponse"
description: Not Found
"429":
$ref: "#/components/responses/TooManyRequestsResponse"
security:
- apiKeyAuth: []
appKeyAuth: []
- AuthZ: []
summary: Cancel an Archive Search
tags:
- Logs Archive Searches
"x-permission":
operator: OR
permissions:
- logs_write_historical_view
- logs_write_archive_search
x-unstable: |-
**Note**: This endpoint is in preview and is subject to change.
If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).
/api/v2/logs/config/archive-order:
get:
description: |-
Expand Down
18 changes: 18 additions & 0 deletions examples/v2/logs-archive-searches/CancelArchiveSearch.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
"""
Cancel an Archive Search returns "OK" response
"""

from os import environ
from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.logs_archive_searches_api import LogsArchiveSearchesApi

configuration = Configuration()
configuration.access_token = environ["DD_BEARER_TOKEN"]
configuration.unstable_operations["cancel_archive_search"] = True
with ApiClient(configuration) as api_client:
api_instance = LogsArchiveSearchesApi(api_client)
response = api_instance.cancel_archive_search(
archive_search_id="archive_search_id",
)

print(response)
16 changes: 16 additions & 0 deletions examples/v2/logs-archive-searches/ListArchiveSearches.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
"""
List Archive Searches returns "OK" response
"""

from os import environ
from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.logs_archive_searches_api import LogsArchiveSearchesApi

configuration = Configuration()
configuration.access_token = environ["DD_BEARER_TOKEN"]
configuration.unstable_operations["list_archive_searches"] = True
with ApiClient(configuration) as api_client:
api_instance = LogsArchiveSearchesApi(api_client)
response = api_instance.list_archive_searches()

print(response)
38 changes: 38 additions & 0 deletions examples/v2/logs-archive-searches/RehydrateArchiveSearch.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
"""
Rehydrate an Archive Search returns "OK" response
"""

from os import environ
from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.logs_archive_searches_api import LogsArchiveSearchesApi
from datadog_api_client.v2.model.archive_search_rehydrate_request import ArchiveSearchRehydrateRequest
from datadog_api_client.v2.model.archive_search_rehydrate_request_attributes import (
ArchiveSearchRehydrateRequestAttributes,
)
from datadog_api_client.v2.model.archive_search_rehydrate_request_data import ArchiveSearchRehydrateRequestData
from datadog_api_client.v2.model.archive_search_rehydrate_request_rehydration import (
ArchiveSearchRehydrateRequestRehydration,
)
from datadog_api_client.v2.model.archive_search_rehydration_tier import ArchiveSearchRehydrationTier
from datadog_api_client.v2.model.archive_search_type import ArchiveSearchType

body = ArchiveSearchRehydrateRequest(
data=ArchiveSearchRehydrateRequestData(
attributes=ArchiveSearchRehydrateRequestAttributes(
rehydration=ArchiveSearchRehydrateRequestRehydration(
retention_days=15,
tier=ArchiveSearchRehydrationTier.STANDARD,
),
),
type=ArchiveSearchType.ARCHIVE_SEARCH,
),
)

configuration = Configuration()
configuration.access_token = environ["DD_BEARER_TOKEN"]
configuration.unstable_operations["rehydrate_archive_search"] = True
with ApiClient(configuration) as api_client:
api_instance = LogsArchiveSearchesApi(api_client)
response = api_instance.rehydrate_archive_search(archive_search_id="archive_search_id", body=body)

print(response)
3 changes: 3 additions & 0 deletions src/datadog_api_client/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -710,8 +710,11 @@ def __init__(
"v2.list_jira_accounts": False,
"v2.list_jira_issue_templates": False,
"v2.update_jira_issue_template": False,
"v2.cancel_archive_search": False,
"v2.create_archive_search": False,
"v2.get_archive_search": False,
"v2.list_archive_searches": False,
"v2.rehydrate_archive_search": False,
"v2.add_role_to_restriction_query": False,
"v2.create_restriction_query": False,
"v2.delete_restriction_query": False,
Expand Down
Loading
Loading