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
393 changes: 393 additions & 0 deletions .generator/schemas/v2/openapi.yaml

Large diffs are not rendered by default.

45 changes: 45 additions & 0 deletions examples/v2/logs-archive-searches/CreateArchiveSearch.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
/**
* Create an Archive Search returns "OK" response
*/

import { client, v2 } from "@datadog/datadog-api-client";

const configuration = client.createConfiguration({
authMethods: {
AuthZ: {
accessToken: process.env.DD_BEARER_TOKEN as string,
},
},
});
configuration.unstableOperations["v2.createArchiveSearch"] = true;
const apiInstance = new v2.LogsArchiveSearchesApi(configuration);

const params: v2.LogsArchiveSearchesApiCreateArchiveSearchRequest = {
body: {
data: {
attributes: {
archiveId: "mhmyYmyLTOaFYKvhNadu1w",
description: "Investigating the checkout latency spike.",
from: new Date(2026, 1, 1, 0, 0, 0, 0),
name: "checkout-latency-investigation",
query: "service:checkout status:error",
rehydration: {
maxRehydratedEvents: 1000000,
retentionDays: 15,
tier: "standard",
},
to: new Date(2026, 1, 2, 0, 0, 0, 0),
},
type: "archive_search",
},
},
};

apiInstance
.createArchiveSearch(params)
.then((data: v2.ArchiveSearchResponse) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
})
.catch((error: any) => console.error(error));
28 changes: 28 additions & 0 deletions examples/v2/logs-archive-searches/GetArchiveSearch.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/**
* Get an Archive Search returns "OK" response
*/

import { client, v2 } from "@datadog/datadog-api-client";

const configuration = client.createConfiguration({
authMethods: {
AuthZ: {
accessToken: process.env.DD_BEARER_TOKEN as string,
},
},
});
configuration.unstableOperations["v2.getArchiveSearch"] = true;
const apiInstance = new v2.LogsArchiveSearchesApi(configuration);

const params: v2.LogsArchiveSearchesApiGetArchiveSearchRequest = {
archiveSearchId: "archive_search_id",
};

apiInstance
.getArchiveSearch(params)
.then((data: v2.ArchiveSearchResponse) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
})
.catch((error: any) => console.error(error));
14 changes: 14 additions & 0 deletions features/support/scenarios_model_mapping.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12821,6 +12821,20 @@ export const ScenariosModelMappings: {[key: string]: {[key: string]: any}} = {
},
"operationResponseType": "LogsListResponse",
},
"v2.CreateArchiveSearch": {
"body": {
"type": "ArchiveSearchCreateRequest",
"format": "",
},
"operationResponseType": "ArchiveSearchResponse",
},
"v2.GetArchiveSearch": {
"archiveSearchId": {
"type": "string",
"format": "",
},
"operationResponseType": "ArchiveSearchResponse",
},
"v2.GetLogsArchiveOrder": {
"operationResponseType": "LogsArchiveOrder",
},
Expand Down
60 changes: 60 additions & 0 deletions features/v2/logs_archive_searches.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
@endpoint(logs-archive-searches) @endpoint(logs-archive-searches-v2)
Feature: Logs Archive Searches
Search the logs stored in a Logs Archive without reindexing them, and
optionally rehydrate the matches into a retained historical view. See the
[Rehydrating from
Archives](https://app.datadoghq.com/logs/pipelines/historical-views) page
for the searches currently running in Datadog.

Background:
Given a valid "apiKeyAuth" key in the system
And a valid "appKeyAuth" key in the system
And an instance of "LogsArchiveSearches" API

@generated @skip @team:DataDog/logs-federated-search @team:DataDog/logs-routing
Scenario: Create an Archive Search returns "Bad Request" response
Given operation "CreateArchiveSearch" enabled
And new "CreateArchiveSearch" request
And body with value {"data": {"attributes": {"archive_id": "mhmyYmyLTOaFYKvhNadu1w", "description": "Investigating the checkout latency spike.", "from": "2026-01-01T00:00:00Z", "name": "checkout-latency-investigation", "query": "service:checkout status:error", "rehydration": {"max_rehydrated_events": 1000000, "retention_days": 15, "tier": "standard"}, "to": "2026-01-02T00:00:00Z"}, "type": "archive_search"}}
When the request is sent
Then the response status is 400 Bad Request

@generated @skip @team:DataDog/logs-federated-search @team:DataDog/logs-routing
Scenario: Create an Archive Search returns "Not Found" response
Given operation "CreateArchiveSearch" enabled
And new "CreateArchiveSearch" request
And body with value {"data": {"attributes": {"archive_id": "mhmyYmyLTOaFYKvhNadu1w", "description": "Investigating the checkout latency spike.", "from": "2026-01-01T00:00:00Z", "name": "checkout-latency-investigation", "query": "service:checkout status:error", "rehydration": {"max_rehydrated_events": 1000000, "retention_days": 15, "tier": "standard"}, "to": "2026-01-02T00:00:00Z"}, "type": "archive_search"}}
When the request is sent
Then the response status is 404 Not Found

@generated @skip @team:DataDog/logs-federated-search @team:DataDog/logs-routing
Scenario: Create an Archive Search returns "OK" response
Given operation "CreateArchiveSearch" enabled
And new "CreateArchiveSearch" request
And body with value {"data": {"attributes": {"archive_id": "mhmyYmyLTOaFYKvhNadu1w", "description": "Investigating the checkout latency spike.", "from": "2026-01-01T00:00:00Z", "name": "checkout-latency-investigation", "query": "service:checkout status:error", "rehydration": {"max_rehydrated_events": 1000000, "retention_days": 15, "tier": "standard"}, "to": "2026-01-02T00:00:00Z"}, "type": "archive_search"}}
When the request is sent
Then the response status is 200 OK

@generated @skip @team:DataDog/logs-federated-search @team:DataDog/logs-routing
Scenario: Get an Archive Search returns "Bad Request" response
Given operation "GetArchiveSearch" enabled
And new "GetArchiveSearch" request
And request contains "archive_search_id" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 400 Bad Request

@generated @skip @team:DataDog/logs-federated-search @team:DataDog/logs-routing
Scenario: Get an Archive Search returns "Not Found" response
Given operation "GetArchiveSearch" enabled
And new "GetArchiveSearch" request
And request contains "archive_search_id" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 404 Not Found

@generated @skip @team:DataDog/logs-federated-search @team:DataDog/logs-routing
Scenario: Get an Archive Search returns "OK" response
Given operation "GetArchiveSearch" enabled
And new "GetArchiveSearch" request
And request contains "archive_search_id" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 200 OK
12 changes: 12 additions & 0 deletions features/v2/undo.json
Original file line number Diff line number Diff line change
Expand Up @@ -5331,6 +5331,18 @@
"type": "safe"
}
},
"CreateArchiveSearch": {
"tag": "Logs Archive Searches",
"undo": {
"type": "unsafe"
}
},
"GetArchiveSearch": {
"tag": "Logs Archive Searches",
"undo": {
"type": "safe"
}
},
"GetLogsArchiveOrder": {
"tag": "Logs Archives",
"undo": {
Expand Down
2 changes: 2 additions & 0 deletions packages/datadog-api-client-common/configuration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -664,6 +664,8 @@ export function createConfiguration(
"v2.listJiraAccounts": false,
"v2.listJiraIssueTemplates": false,
"v2.updateJiraIssueTemplate": false,
"v2.createArchiveSearch": false,
"v2.getArchiveSearch": false,
"v2.addRoleToRestrictionQuery": false,
"v2.createRestrictionQuery": false,
"v2.deleteRestrictionQuery": false,
Expand Down
Loading
Loading