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.

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
1 change: 1 addition & 0 deletions packages/datadog-api-client/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,7 @@ apiInstance
| Jira Integration | @datadog/datadog-api-client-jira-integration | [README.md](../../services/jira-integration/README.md) |
| Key Management | @datadog/datadog-api-client-key-management | [README.md](../../services/key-management/README.md) |
| Logs | @datadog/datadog-api-client-logs | [README.md](../../services/logs/README.md) |
| Logs Archive Searches | @datadog/datadog-api-client-logs-archive-searches | [README.md](../../services/logs-archive-searches/README.md) |
| Logs Archives | @datadog/datadog-api-client-logs-archives | [README.md](../../services/logs-archives/README.md) |
| Logs Custom Destinations | @datadog/datadog-api-client-logs-custom-destinations | [README.md](../../services/logs-custom-destinations/README.md) |
| Logs Indexes | @datadog/datadog-api-client-logs-indexes | [README.md](../../services/logs-indexes/README.md) |
Expand Down
14 changes: 14 additions & 0 deletions private/bdd_runner/src/support/scenarios_model_mapping.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12846,6 +12846,20 @@ export const ScenariosModelMappings: { [key: string]: OperationMapping } = {
},
operationResponseType: "LogsListResponse",
},
"LogsArchiveSearchesApi.V2.CreateArchiveSearch": {
body: {
type: "ArchiveSearchCreateRequest",
format: "",
},
operationResponseType: "ArchiveSearchResponse",
},
"LogsArchiveSearchesApi.V2.GetArchiveSearch": {
archiveSearchId: {
type: "string",
format: "",
},
operationResponseType: "ArchiveSearchResponse",
},
"LogsArchivesApi.V2.GetLogsArchiveOrder": {
operationResponseType: "LogsArchiveOrder",
},
Expand Down
1 change: 1 addition & 0 deletions services/logs_archive_searches/.yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
nodeLinker: node-modules
48 changes: 48 additions & 0 deletions services/logs_archive_searches/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# @datadog/datadog-api-client-logs-archive-searches

## Description

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.

## Navigation

- [Installation](#installation)
- [Getting Started](#getting-started)

## Installation

```sh
# NPM
npm install @datadog/datadog-api-client-logs-archive-searches
# Yarn
yarn add @datadog/datadog-api-client-logs-archive-searches
```

## Getting Started
```ts
import { createConfiguration } from "@datadog/datadog-api-client";
import { LogsArchiveSearchesApiV2 } from "@datadog/datadog-api-client-logs-archive-searches";
import { v2 } from "@datadog/datadog-api-client-logs-archive-searches";

const configuration = createConfiguration();
// Enable unstable operations
const configurationOpts = {
unstableOperations: {
"LogsArchiveSearchesApi.v2.createArchiveSearch": true
}
}

const configuration = createConfiguration(configurationOpts);
const apiInstance = new LogsArchiveSearchesApiV2(configuration);
const params = {/* parameters */};

apiInstance.createArchiveSearch(params).then((data) => {
console.log("API called successfully. Returned data: " + JSON.stringify(data));
}).catch((error) => {
console.error("Error calling API: " + error);
});
```
43 changes: 43 additions & 0 deletions services/logs_archive_searches/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{
"name": "@datadog/datadog-api-client-logs-archive-searches",
"description": "",
"author": "",
"keywords": [
"api",
"fetch",
"typescript"
],
"license": "Apache-2.0",
"licenses": [
{
"type": "Apache-2.0",
"url": "http://www.apache.org/licenses/LICENSE-2.0"
}
],
"repository": {
"type": "git",
"url": "https://github.com/DataDog/datadog-api-client-typescript.git",
"directory": "services/logs-archive-searches"
},
"files": [
"dist/**/*"
],
"main": "./dist/index.js",
"typings": "./dist/index.d.ts",
"scripts": {
"prepack": "yarn workspace @datadog/datadog-api-client build && yarn build",
"build": "yarn generate-version-files && tsc",
"generate-version-files": "node -p \"'export const version = ' + JSON.stringify(require('./package.json').version)\" > src/version.ts"
},
"dependencies": {
"@datadog/datadog-api-client": "^2.0.0-beta.2"
},
"devDependencies": {
"typescript": "5.8.3"
},
"engines": {
"node": ">=18.0.0"
},
"version": "0.0.1",
"packageManager": "yarn@4.9.1"
}
3 changes: 3 additions & 0 deletions services/logs_archive_searches/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export * as v2 from "./v2";

export { LogsArchiveSearchesApi as LogsArchiveSearchesApiV2 } from "./v2/LogsArchiveSearchesApi";
Loading
Loading