diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 107e80821394..0ddf938a3fd4 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -11056,6 +11056,242 @@ components: type: string x-enum-varnames: - ARBITRARY_RULE_STATUS + ArchiveSearchCreateRehydration: + description: |- + Rehydration settings. Include this object to index the matched logs into a retained historical view. + Omit it to run an Archive Search that only scans the archive. + properties: + max_rehydrated_events: + description: |- + Maximum number of events to rehydrate. The organization's reindexing limit is configured + in millions, so this value is at least 1,000,000. + example: 1000000 + format: int64 + minimum: 1000000 + type: integer + 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 + - max_rehydrated_events + type: object + ArchiveSearchCreateRequest: + description: Request to create an Archive Search. + properties: + data: + $ref: "#/components/schemas/ArchiveSearchCreateRequestData" + required: + - data + type: object + ArchiveSearchCreateRequestAttributes: + description: Attributes accepted when creating an Archive Search. + properties: + archive_id: + description: ID of the archive to search. Use the Logs Archives API to list the archives of the organization. + example: mhmyYmyLTOaFYKvhNadu1w + type: string + description: + description: Free-text description of the Archive Search. + example: Investigating the checkout latency spike. + type: string + from: + description: Start of the time range to search, as an ISO 8601 timestamp. + example: "2026-01-01T00:00:00Z" + format: date-time + type: string + name: + description: Name of the Archive Search. + example: checkout-latency-investigation + type: string + query: + description: Log search query used to filter the archived logs. + example: service:checkout status:error + type: string + rehydration: + $ref: "#/components/schemas/ArchiveSearchCreateRehydration" + to: + description: End of the time range to search, as an ISO 8601 timestamp. Must be after `from`. + example: "2026-01-02T00:00:00Z" + format: date-time + type: string + required: + - archive_id + - name + - query + - from + - to + type: object + ArchiveSearchCreateRequestData: + description: Archive Search object to create. + properties: + attributes: + $ref: "#/components/schemas/ArchiveSearchCreateRequestAttributes" + type: + $ref: "#/components/schemas/ArchiveSearchType" + required: + - type + - attributes + type: object + ArchiveSearchRehydration: + description: |- + Rehydration settings of the Archive Search. Absent when the search only scans the archive + without indexing the results. + properties: + max_rehydrated_events: + description: Maximum number of events to rehydrate. + example: 1000000 + format: int64 + type: integer + 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 + - max_rehydrated_events + type: object + ArchiveSearchRehydrationTier: + description: Storage tier the matched logs are rehydrated into. + enum: + - standard + - flex + example: standard + type: string + x-enum-varnames: + - STANDARD + - FLEX + ArchiveSearchResponse: + description: Response containing a single Archive Search. + properties: + data: + $ref: "#/components/schemas/ArchiveSearchResponseData" + required: + - data + type: object + ArchiveSearchResponseAttributes: + description: Attributes of an Archive Search. + properties: + archive_id: + description: ID of the archive being searched. + example: mhmyYmyLTOaFYKvhNadu1w + type: string + bytes_scanned: + description: Number of bytes read from the archive at the end of the search. + example: 402764439 + format: int64 + type: integer + completed_at: + description: |- + Time the Archive Search finished, as an ISO 8601 timestamp. + Absent while the search is still running. + example: "2026-01-02T12:30:00Z" + format: date-time + type: string + created_at: + description: Time the Archive Search was created, as an ISO 8601 timestamp. + example: "2026-01-02T12:00:00Z" + format: date-time + type: string + description: + description: Free-text description of the Archive Search. + example: Investigating the checkout latency spike. + type: string + events_scanned: + description: Number of events read from the archive at the end of the search. + example: 1500 + format: int64 + type: integer + expected_duration: + description: Estimated time left before the Archive Search completes, in seconds. + example: 120 + format: int64 + type: integer + from: + description: Start of the searched time range, as an ISO 8601 timestamp. + example: "2026-01-01T00:00:00Z" + format: date-time + type: string + name: + description: Name of the Archive Search. + example: checkout-latency-investigation + type: string + query: + description: Log search query used to filter the archived logs. + example: service:checkout status:error + type: string + rehydration: + $ref: "#/components/schemas/ArchiveSearchRehydration" + status: + $ref: "#/components/schemas/ArchiveSearchStatus" + to: + description: End of the searched time range, as an ISO 8601 timestamp. + example: "2026-01-02T00:00:00Z" + format: date-time + type: string + required: + - archive_id + - name + - query + - from + - to + - status + - created_at + - events_scanned + - bytes_scanned + type: object + ArchiveSearchResponseData: + description: Archive Search object. + properties: + attributes: + $ref: "#/components/schemas/ArchiveSearchResponseAttributes" + id: + description: Unique identifier of the Archive Search. + example: nv2eu4srgyzdkulggjzg2zkmmzifa2rum5iq + type: string + type: + $ref: "#/components/schemas/ArchiveSearchType" + required: + - id + - type + - attributes + type: object + ArchiveSearchStatus: + description: Current state of an Archive Search. + enum: + - RUNNING + - COMPLETED + - FAILED + - CANCELLED + - QUOTA_REACHED + - EXPIRED + example: RUNNING + type: string + x-enum-varnames: + - RUNNING + - COMPLETED + - FAILED + - CANCELLED + - QUOTA_REACHED + - EXPIRED + ArchiveSearchType: + default: archive_search + description: Archive Search resource type. + enum: + - archive_search + example: archive_search + type: string + x-enum-varnames: + - ARCHIVE_SEARCH Argument: description: A named argument for a custom static analysis rule. properties: @@ -180479,6 +180715,156 @@ paths: operator: OR permissions: - logs_read_data + /api/v2/logs/archive_searches: + post: + description: |- + Start a search over the logs stored in an archive. + + Without a `rehydration` object, the search only scans the archive and reports how much data + matched. With one, the matched logs are also indexed into a retained historical view, which + requires the `logs_write_historical_view` permission. + operationId: CreateArchiveSearch + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/ArchiveSearchCreateRequest" + required: true + 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 + 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: Create 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/archive_searches/{archive_search_id}: + get: + description: Get a single Archive Search, including its status and the amount of archive data scanned when the search finishes. + operationId: GetArchiveSearch + 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: 402764439 + completed_at: "2026-01-02T12:30:00Z" + 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: 1000000 + retention_days: 15 + tier: standard + status: COMPLETED + 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: Get an Archive Search + 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/). /api/v2/logs/config/archive-order: get: description: |- @@ -233203,6 +233589,13 @@ tags: - description: |- Search your logs and send them to your Datadog platform over HTTP. See the [Log Management page](https://docs.datadoghq.com/logs/) for more information. name: Logs + - 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. + name: Logs Archive Searches - description: |- Archives forward all the logs ingested to a cloud storage system. diff --git a/examples/v2/logs-archive-searches/CreateArchiveSearch.ts b/examples/v2/logs-archive-searches/CreateArchiveSearch.ts new file mode 100644 index 000000000000..fb0c5aee39a3 --- /dev/null +++ b/examples/v2/logs-archive-searches/CreateArchiveSearch.ts @@ -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)); diff --git a/examples/v2/logs-archive-searches/GetArchiveSearch.ts b/examples/v2/logs-archive-searches/GetArchiveSearch.ts new file mode 100644 index 000000000000..30d6c67804c7 --- /dev/null +++ b/examples/v2/logs-archive-searches/GetArchiveSearch.ts @@ -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)); diff --git a/features/support/scenarios_model_mapping.ts b/features/support/scenarios_model_mapping.ts index 79fcf24560d9..753816f1e262 100644 --- a/features/support/scenarios_model_mapping.ts +++ b/features/support/scenarios_model_mapping.ts @@ -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", }, diff --git a/features/v2/logs_archive_searches.feature b/features/v2/logs_archive_searches.feature new file mode 100644 index 000000000000..185e088c68dc --- /dev/null +++ b/features/v2/logs_archive_searches.feature @@ -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 diff --git a/features/v2/undo.json b/features/v2/undo.json index a3ee9d72c99e..ccc3b32a417c 100644 --- a/features/v2/undo.json +++ b/features/v2/undo.json @@ -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": { diff --git a/packages/datadog-api-client-common/configuration.ts b/packages/datadog-api-client-common/configuration.ts index a06779d0d34a..0976e0c9eb42 100644 --- a/packages/datadog-api-client-common/configuration.ts +++ b/packages/datadog-api-client-common/configuration.ts @@ -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, diff --git a/packages/datadog-api-client-v2/apis/LogsArchiveSearchesApi.ts b/packages/datadog-api-client-v2/apis/LogsArchiveSearchesApi.ts new file mode 100644 index 000000000000..d5613d2dbba9 --- /dev/null +++ b/packages/datadog-api-client-v2/apis/LogsArchiveSearchesApi.ts @@ -0,0 +1,372 @@ +import { + BaseAPIRequestFactory, + RequiredError, +} from "../../datadog-api-client-common/baseapi"; +import { + Configuration, + applySecurityAuthentication, +} from "../../datadog-api-client-common/configuration"; +import { + RequestContext, + HttpMethod, + ResponseContext, +} from "../../datadog-api-client-common/http/http"; + +import { logger } from "../../../logger"; +import { ObjectSerializer } from "../models/ObjectSerializer"; +import { ApiException } from "../../datadog-api-client-common/exception"; + +import { APIErrorResponse } from "../models/APIErrorResponse"; +import { ArchiveSearchCreateRequest } from "../models/ArchiveSearchCreateRequest"; +import { ArchiveSearchResponse } from "../models/ArchiveSearchResponse"; +import { JSONAPIErrorResponse } from "../models/JSONAPIErrorResponse"; + +export class LogsArchiveSearchesApiRequestFactory extends BaseAPIRequestFactory { + public async createArchiveSearch( + body: ArchiveSearchCreateRequest, + _options?: Configuration + ): Promise { + const _config = _options || this.configuration; + + logger.warn("Using unstable operation 'createArchiveSearch'"); + if (!_config.unstableOperations["v2.createArchiveSearch"]) { + throw new Error("Unstable operation 'createArchiveSearch' is disabled"); + } + + // verify required parameter 'body' is not null or undefined + if (body === null || body === undefined) { + throw new RequiredError("body", "createArchiveSearch"); + } + + // Path Params + const localVarPath = "/api/v2/logs/archive_searches"; + + // Make Request Context + const requestContext = _config + .getServer("v2.LogsArchiveSearchesApi.createArchiveSearch") + .makeRequestContext(localVarPath, HttpMethod.POST); + requestContext.setHeaderParam("Accept", "application/json"); + requestContext.setHttpConfig(_config.httpConfig); + + // Set IaC header + if (_config.isIaC) { + requestContext.setHeaderParam("X-Datadog-Managed-By", "iac"); + } + + // Body Params + const contentType = ObjectSerializer.getPreferredMediaType([ + "application/json", + ]); + requestContext.setHeaderParam("Content-Type", contentType); + const serializedBody = ObjectSerializer.stringify( + ObjectSerializer.serialize(body, "ArchiveSearchCreateRequest", ""), + contentType + ); + requestContext.setBody(serializedBody); + + // Apply auth methods + applySecurityAuthentication(_config, requestContext, [ + "apiKeyAuth", + "appKeyAuth", + "AuthZ", + ]); + + return requestContext; + } + + public async getArchiveSearch( + archiveSearchId: string, + _options?: Configuration + ): Promise { + const _config = _options || this.configuration; + + logger.warn("Using unstable operation 'getArchiveSearch'"); + if (!_config.unstableOperations["v2.getArchiveSearch"]) { + throw new Error("Unstable operation 'getArchiveSearch' is disabled"); + } + + // verify required parameter 'archiveSearchId' is not null or undefined + if (archiveSearchId === null || archiveSearchId === undefined) { + throw new RequiredError("archiveSearchId", "getArchiveSearch"); + } + + // Path Params + const localVarPath = + "/api/v2/logs/archive_searches/{archive_search_id}".replace( + "{archive_search_id}", + encodeURIComponent(String(archiveSearchId)) + ); + + // Make Request Context + const requestContext = _config + .getServer("v2.LogsArchiveSearchesApi.getArchiveSearch") + .makeRequestContext(localVarPath, HttpMethod.GET); + requestContext.setHeaderParam("Accept", "application/json"); + requestContext.setHttpConfig(_config.httpConfig); + + // Set IaC header + if (_config.isIaC) { + requestContext.setHeaderParam("X-Datadog-Managed-By", "iac"); + } + + // Apply auth methods + applySecurityAuthentication(_config, requestContext, [ + "apiKeyAuth", + "appKeyAuth", + "AuthZ", + ]); + + return requestContext; + } +} + +export class LogsArchiveSearchesApiResponseProcessor { + /** + * Unwraps the actual response sent by the server from the response context and deserializes the response content + * to the expected objects + * + * @params response Response returned by the server for a request to createArchiveSearch + * @throws ApiException if the response code was not in [200, 299] + */ + public async createArchiveSearch( + response: ResponseContext + ): Promise { + const contentType = ObjectSerializer.normalizeMediaType( + response.headers["content-type"] + ); + if (response.httpStatusCode === 200) { + const body: ArchiveSearchResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "ArchiveSearchResponse" + ) as ArchiveSearchResponse; + return body; + } + if ( + response.httpStatusCode === 400 || + response.httpStatusCode === 403 || + response.httpStatusCode === 404 + ) { + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + let body: JSONAPIErrorResponse; + try { + body = ObjectSerializer.deserialize( + bodyText, + "JSONAPIErrorResponse" + ) as JSONAPIErrorResponse; + } catch (error) { + logger.debug(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } + throw new ApiException( + response.httpStatusCode, + body + ); + } + if (response.httpStatusCode === 429) { + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + let body: APIErrorResponse; + try { + body = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + } catch (error) { + logger.debug(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } + throw new ApiException(response.httpStatusCode, body); + } + + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { + const body: ArchiveSearchResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "ArchiveSearchResponse", + "" + ) as ArchiveSearchResponse; + return body; + } + + const body = (await response.body.text()) || ""; + throw new ApiException( + response.httpStatusCode, + 'Unknown API Status Code!\nBody: "' + body + '"' + ); + } + + /** + * Unwraps the actual response sent by the server from the response context and deserializes the response content + * to the expected objects + * + * @params response Response returned by the server for a request to getArchiveSearch + * @throws ApiException if the response code was not in [200, 299] + */ + public async getArchiveSearch( + response: ResponseContext + ): Promise { + const contentType = ObjectSerializer.normalizeMediaType( + response.headers["content-type"] + ); + if (response.httpStatusCode === 200) { + const body: ArchiveSearchResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "ArchiveSearchResponse" + ) as ArchiveSearchResponse; + return body; + } + if ( + response.httpStatusCode === 400 || + response.httpStatusCode === 403 || + response.httpStatusCode === 404 + ) { + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + let body: JSONAPIErrorResponse; + try { + body = ObjectSerializer.deserialize( + bodyText, + "JSONAPIErrorResponse" + ) as JSONAPIErrorResponse; + } catch (error) { + logger.debug(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } + throw new ApiException( + response.httpStatusCode, + body + ); + } + if (response.httpStatusCode === 429) { + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + let body: APIErrorResponse; + try { + body = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + } catch (error) { + logger.debug(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } + throw new ApiException(response.httpStatusCode, body); + } + + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { + const body: ArchiveSearchResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "ArchiveSearchResponse", + "" + ) as ArchiveSearchResponse; + return body; + } + + const body = (await response.body.text()) || ""; + throw new ApiException( + response.httpStatusCode, + 'Unknown API Status Code!\nBody: "' + body + '"' + ); + } +} + +export interface LogsArchiveSearchesApiCreateArchiveSearchRequest { + /** + * @type ArchiveSearchCreateRequest + */ + body: ArchiveSearchCreateRequest; +} + +export interface LogsArchiveSearchesApiGetArchiveSearchRequest { + /** + * Unique identifier of the Archive Search. + * @type string + */ + archiveSearchId: string; +} + +export class LogsArchiveSearchesApi { + private requestFactory: LogsArchiveSearchesApiRequestFactory; + private responseProcessor: LogsArchiveSearchesApiResponseProcessor; + private configuration: Configuration; + + public constructor( + configuration: Configuration, + requestFactory?: LogsArchiveSearchesApiRequestFactory, + responseProcessor?: LogsArchiveSearchesApiResponseProcessor + ) { + this.configuration = configuration; + this.requestFactory = + requestFactory || new LogsArchiveSearchesApiRequestFactory(configuration); + this.responseProcessor = + responseProcessor || new LogsArchiveSearchesApiResponseProcessor(); + } + + /** + * Start a search over the logs stored in an archive. + * + * Without a `rehydration` object, the search only scans the archive and reports how much data + * matched. With one, the matched logs are also indexed into a retained historical view, which + * requires the `logs_write_historical_view` permission. + * @param param The request object + */ + public createArchiveSearch( + param: LogsArchiveSearchesApiCreateArchiveSearchRequest, + options?: Configuration + ): Promise { + const requestContextPromise = this.requestFactory.createArchiveSearch( + param.body, + options + ); + return requestContextPromise.then((requestContext) => { + return this.configuration.httpApi + .send(requestContext) + .then((responseContext) => { + return this.responseProcessor.createArchiveSearch(responseContext); + }); + }); + } + + /** + * Get a single Archive Search, including its status and the amount of archive data scanned when the search finishes. + * @param param The request object + */ + public getArchiveSearch( + param: LogsArchiveSearchesApiGetArchiveSearchRequest, + options?: Configuration + ): Promise { + const requestContextPromise = this.requestFactory.getArchiveSearch( + param.archiveSearchId, + options + ); + return requestContextPromise.then((requestContext) => { + return this.configuration.httpApi + .send(requestContext) + .then((responseContext) => { + return this.responseProcessor.getArchiveSearch(responseContext); + }); + }); + } +} diff --git a/packages/datadog-api-client-v2/index.ts b/packages/datadog-api-client-v2/index.ts index dcc436db7c89..284fe8d4e4f0 100644 --- a/packages/datadog-api-client-v2/index.ts +++ b/packages/datadog-api-client-v2/index.ts @@ -955,6 +955,12 @@ export { LogsApi, } from "./apis/LogsApi"; +export { + LogsArchiveSearchesApiCreateArchiveSearchRequest, + LogsArchiveSearchesApiGetArchiveSearchRequest, + LogsArchiveSearchesApi, +} from "./apis/LogsArchiveSearchesApi"; + export { LogsArchivesApiAddReadRoleToArchiveRequest, LogsArchivesApiCreateLogsArchiveRequest, @@ -2408,6 +2414,17 @@ export { ArbitraryRuleStatusResponseArray } from "./models/ArbitraryRuleStatusRe export { ArbitraryRuleStatusResponseData } from "./models/ArbitraryRuleStatusResponseData"; export { ArbitraryRuleStatusResponseDataAttributes } from "./models/ArbitraryRuleStatusResponseDataAttributes"; export { ArbitraryRuleStatusResponseDataType } from "./models/ArbitraryRuleStatusResponseDataType"; +export { ArchiveSearchCreateRehydration } from "./models/ArchiveSearchCreateRehydration"; +export { ArchiveSearchCreateRequest } from "./models/ArchiveSearchCreateRequest"; +export { ArchiveSearchCreateRequestAttributes } from "./models/ArchiveSearchCreateRequestAttributes"; +export { ArchiveSearchCreateRequestData } from "./models/ArchiveSearchCreateRequestData"; +export { ArchiveSearchRehydration } from "./models/ArchiveSearchRehydration"; +export { ArchiveSearchRehydrationTier } from "./models/ArchiveSearchRehydrationTier"; +export { ArchiveSearchResponse } from "./models/ArchiveSearchResponse"; +export { ArchiveSearchResponseAttributes } from "./models/ArchiveSearchResponseAttributes"; +export { ArchiveSearchResponseData } from "./models/ArchiveSearchResponseData"; +export { ArchiveSearchStatus } from "./models/ArchiveSearchStatus"; +export { ArchiveSearchType } from "./models/ArchiveSearchType"; export { Argument } from "./models/Argument"; export { AsanaAccessToken } from "./models/AsanaAccessToken"; export { AsanaAccessTokenType } from "./models/AsanaAccessTokenType"; diff --git a/packages/datadog-api-client-v2/models/ArchiveSearchCreateRehydration.ts b/packages/datadog-api-client-v2/models/ArchiveSearchCreateRehydration.ts new file mode 100644 index 000000000000..2d484f43f948 --- /dev/null +++ b/packages/datadog-api-client-v2/models/ArchiveSearchCreateRehydration.ts @@ -0,0 +1,76 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { ArchiveSearchRehydrationTier } from "./ArchiveSearchRehydrationTier"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Rehydration settings. Include this object to index the matched logs into a retained historical view. + * Omit it to run an Archive Search that only scans the archive. + */ +export class ArchiveSearchCreateRehydration { + /** + * Maximum number of events to rehydrate. The organization's reindexing limit is configured + * in millions, so this value is at least 1,000,000. + */ + "maxRehydratedEvents": number; + /** + * Number of days the rehydrated logs are retained for. + */ + "retentionDays": number; + /** + * Storage tier the matched logs are rehydrated into. + */ + "tier": ArchiveSearchRehydrationTier; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + maxRehydratedEvents: { + baseName: "max_rehydrated_events", + type: "number", + required: true, + format: "int64", + }, + retentionDays: { + baseName: "retention_days", + type: "number", + required: true, + format: "int64", + }, + tier: { + baseName: "tier", + type: "ArchiveSearchRehydrationTier", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return ArchiveSearchCreateRehydration.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/ArchiveSearchCreateRequest.ts b/packages/datadog-api-client-v2/models/ArchiveSearchCreateRequest.ts new file mode 100644 index 000000000000..0b1863267f06 --- /dev/null +++ b/packages/datadog-api-client-v2/models/ArchiveSearchCreateRequest.ts @@ -0,0 +1,54 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { ArchiveSearchCreateRequestData } from "./ArchiveSearchCreateRequestData"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Request to create an Archive Search. + */ +export class ArchiveSearchCreateRequest { + /** + * Archive Search object to create. + */ + "data": ArchiveSearchCreateRequestData; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + data: { + baseName: "data", + type: "ArchiveSearchCreateRequestData", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return ArchiveSearchCreateRequest.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/ArchiveSearchCreateRequestAttributes.ts b/packages/datadog-api-client-v2/models/ArchiveSearchCreateRequestAttributes.ts new file mode 100644 index 000000000000..4e851569cc3d --- /dev/null +++ b/packages/datadog-api-client-v2/models/ArchiveSearchCreateRequestAttributes.ts @@ -0,0 +1,109 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { ArchiveSearchCreateRehydration } from "./ArchiveSearchCreateRehydration"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Attributes accepted when creating an Archive Search. + */ +export class ArchiveSearchCreateRequestAttributes { + /** + * ID of the archive to search. Use the Logs Archives API to list the archives of the organization. + */ + "archiveId": string; + /** + * Free-text description of the Archive Search. + */ + "description"?: string; + /** + * Start of the time range to search, as an ISO 8601 timestamp. + */ + "from": Date; + /** + * Name of the Archive Search. + */ + "name": string; + /** + * Log search query used to filter the archived logs. + */ + "query": string; + /** + * Rehydration settings. Include this object to index the matched logs into a retained historical view. + * Omit it to run an Archive Search that only scans the archive. + */ + "rehydration"?: ArchiveSearchCreateRehydration; + /** + * End of the time range to search, as an ISO 8601 timestamp. Must be after `from`. + */ + "to": Date; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + archiveId: { + baseName: "archive_id", + type: "string", + required: true, + }, + description: { + baseName: "description", + type: "string", + }, + from: { + baseName: "from", + type: "Date", + required: true, + format: "date-time", + }, + name: { + baseName: "name", + type: "string", + required: true, + }, + query: { + baseName: "query", + type: "string", + required: true, + }, + rehydration: { + baseName: "rehydration", + type: "ArchiveSearchCreateRehydration", + }, + to: { + baseName: "to", + type: "Date", + required: true, + format: "date-time", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return ArchiveSearchCreateRequestAttributes.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/ArchiveSearchCreateRequestData.ts b/packages/datadog-api-client-v2/models/ArchiveSearchCreateRequestData.ts new file mode 100644 index 000000000000..24bfd40e89f7 --- /dev/null +++ b/packages/datadog-api-client-v2/models/ArchiveSearchCreateRequestData.ts @@ -0,0 +1,64 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { ArchiveSearchCreateRequestAttributes } from "./ArchiveSearchCreateRequestAttributes"; +import { ArchiveSearchType } from "./ArchiveSearchType"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Archive Search object to create. + */ +export class ArchiveSearchCreateRequestData { + /** + * Attributes accepted when creating an Archive Search. + */ + "attributes": ArchiveSearchCreateRequestAttributes; + /** + * Archive Search resource type. + */ + "type": ArchiveSearchType; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + attributes: { + baseName: "attributes", + type: "ArchiveSearchCreateRequestAttributes", + required: true, + }, + type: { + baseName: "type", + type: "ArchiveSearchType", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return ArchiveSearchCreateRequestData.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/ArchiveSearchRehydration.ts b/packages/datadog-api-client-v2/models/ArchiveSearchRehydration.ts new file mode 100644 index 000000000000..56cfc7c53512 --- /dev/null +++ b/packages/datadog-api-client-v2/models/ArchiveSearchRehydration.ts @@ -0,0 +1,75 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { ArchiveSearchRehydrationTier } from "./ArchiveSearchRehydrationTier"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Rehydration settings of the Archive Search. Absent when the search only scans the archive + * without indexing the results. + */ +export class ArchiveSearchRehydration { + /** + * Maximum number of events to rehydrate. + */ + "maxRehydratedEvents": number; + /** + * Number of days the rehydrated logs are retained for. + */ + "retentionDays": number; + /** + * Storage tier the matched logs are rehydrated into. + */ + "tier": ArchiveSearchRehydrationTier; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + maxRehydratedEvents: { + baseName: "max_rehydrated_events", + type: "number", + required: true, + format: "int64", + }, + retentionDays: { + baseName: "retention_days", + type: "number", + required: true, + format: "int64", + }, + tier: { + baseName: "tier", + type: "ArchiveSearchRehydrationTier", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return ArchiveSearchRehydration.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/ArchiveSearchRehydrationTier.ts b/packages/datadog-api-client-v2/models/ArchiveSearchRehydrationTier.ts new file mode 100644 index 000000000000..70011e3284c3 --- /dev/null +++ b/packages/datadog-api-client-v2/models/ArchiveSearchRehydrationTier.ts @@ -0,0 +1,18 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ + +import { UnparsedObject } from "../../datadog-api-client-common/util"; + +/** + * Storage tier the matched logs are rehydrated into. + */ + +export type ArchiveSearchRehydrationTier = + | typeof STANDARD + | typeof FLEX + | UnparsedObject; +export const STANDARD = "standard"; +export const FLEX = "flex"; diff --git a/packages/datadog-api-client-v2/models/ArchiveSearchResponse.ts b/packages/datadog-api-client-v2/models/ArchiveSearchResponse.ts new file mode 100644 index 000000000000..10e466b10047 --- /dev/null +++ b/packages/datadog-api-client-v2/models/ArchiveSearchResponse.ts @@ -0,0 +1,54 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { ArchiveSearchResponseData } from "./ArchiveSearchResponseData"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Response containing a single Archive Search. + */ +export class ArchiveSearchResponse { + /** + * Archive Search object. + */ + "data": ArchiveSearchResponseData; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + data: { + baseName: "data", + type: "ArchiveSearchResponseData", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return ArchiveSearchResponse.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/ArchiveSearchResponseAttributes.ts b/packages/datadog-api-client-v2/models/ArchiveSearchResponseAttributes.ts new file mode 100644 index 000000000000..6bdbfbeca494 --- /dev/null +++ b/packages/datadog-api-client-v2/models/ArchiveSearchResponseAttributes.ts @@ -0,0 +1,168 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { ArchiveSearchRehydration } from "./ArchiveSearchRehydration"; +import { ArchiveSearchStatus } from "./ArchiveSearchStatus"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Attributes of an Archive Search. + */ +export class ArchiveSearchResponseAttributes { + /** + * ID of the archive being searched. + */ + "archiveId": string; + /** + * Number of bytes read from the archive at the end of the search. + */ + "bytesScanned": number; + /** + * Time the Archive Search finished, as an ISO 8601 timestamp. + * Absent while the search is still running. + */ + "completedAt"?: Date; + /** + * Time the Archive Search was created, as an ISO 8601 timestamp. + */ + "createdAt": Date; + /** + * Free-text description of the Archive Search. + */ + "description"?: string; + /** + * Number of events read from the archive at the end of the search. + */ + "eventsScanned": number; + /** + * Estimated time left before the Archive Search completes, in seconds. + */ + "expectedDuration"?: number; + /** + * Start of the searched time range, as an ISO 8601 timestamp. + */ + "from": Date; + /** + * Name of the Archive Search. + */ + "name": string; + /** + * Log search query used to filter the archived logs. + */ + "query": string; + /** + * Rehydration settings of the Archive Search. Absent when the search only scans the archive + * without indexing the results. + */ + "rehydration"?: ArchiveSearchRehydration; + /** + * Current state of an Archive Search. + */ + "status": ArchiveSearchStatus; + /** + * End of the searched time range, as an ISO 8601 timestamp. + */ + "to": Date; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + archiveId: { + baseName: "archive_id", + type: "string", + required: true, + }, + bytesScanned: { + baseName: "bytes_scanned", + type: "number", + required: true, + format: "int64", + }, + completedAt: { + baseName: "completed_at", + type: "Date", + format: "date-time", + }, + createdAt: { + baseName: "created_at", + type: "Date", + required: true, + format: "date-time", + }, + description: { + baseName: "description", + type: "string", + }, + eventsScanned: { + baseName: "events_scanned", + type: "number", + required: true, + format: "int64", + }, + expectedDuration: { + baseName: "expected_duration", + type: "number", + format: "int64", + }, + from: { + baseName: "from", + type: "Date", + required: true, + format: "date-time", + }, + name: { + baseName: "name", + type: "string", + required: true, + }, + query: { + baseName: "query", + type: "string", + required: true, + }, + rehydration: { + baseName: "rehydration", + type: "ArchiveSearchRehydration", + }, + status: { + baseName: "status", + type: "ArchiveSearchStatus", + required: true, + }, + to: { + baseName: "to", + type: "Date", + required: true, + format: "date-time", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return ArchiveSearchResponseAttributes.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/ArchiveSearchResponseData.ts b/packages/datadog-api-client-v2/models/ArchiveSearchResponseData.ts new file mode 100644 index 000000000000..f3e856a8b630 --- /dev/null +++ b/packages/datadog-api-client-v2/models/ArchiveSearchResponseData.ts @@ -0,0 +1,73 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { ArchiveSearchResponseAttributes } from "./ArchiveSearchResponseAttributes"; +import { ArchiveSearchType } from "./ArchiveSearchType"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Archive Search object. + */ +export class ArchiveSearchResponseData { + /** + * Attributes of an Archive Search. + */ + "attributes": ArchiveSearchResponseAttributes; + /** + * Unique identifier of the Archive Search. + */ + "id": string; + /** + * Archive Search resource type. + */ + "type": ArchiveSearchType; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + attributes: { + baseName: "attributes", + type: "ArchiveSearchResponseAttributes", + required: true, + }, + id: { + baseName: "id", + type: "string", + required: true, + }, + type: { + baseName: "type", + type: "ArchiveSearchType", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return ArchiveSearchResponseData.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/ArchiveSearchStatus.ts b/packages/datadog-api-client-v2/models/ArchiveSearchStatus.ts new file mode 100644 index 000000000000..c1f08bc931ad --- /dev/null +++ b/packages/datadog-api-client-v2/models/ArchiveSearchStatus.ts @@ -0,0 +1,26 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ + +import { UnparsedObject } from "../../datadog-api-client-common/util"; + +/** + * Current state of an Archive Search. + */ + +export type ArchiveSearchStatus = + | typeof RUNNING + | typeof COMPLETED + | typeof FAILED + | typeof CANCELLED + | typeof QUOTA_REACHED + | typeof EXPIRED + | UnparsedObject; +export const RUNNING = "RUNNING"; +export const COMPLETED = "COMPLETED"; +export const FAILED = "FAILED"; +export const CANCELLED = "CANCELLED"; +export const QUOTA_REACHED = "QUOTA_REACHED"; +export const EXPIRED = "EXPIRED"; diff --git a/packages/datadog-api-client-v2/models/ArchiveSearchType.ts b/packages/datadog-api-client-v2/models/ArchiveSearchType.ts new file mode 100644 index 000000000000..cf93476be885 --- /dev/null +++ b/packages/datadog-api-client-v2/models/ArchiveSearchType.ts @@ -0,0 +1,14 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ + +import { UnparsedObject } from "../../datadog-api-client-common/util"; + +/** + * Archive Search resource type. + */ + +export type ArchiveSearchType = typeof ARCHIVE_SEARCH | UnparsedObject; +export const ARCHIVE_SEARCH = "archive_search"; diff --git a/packages/datadog-api-client-v2/models/ObjectSerializer.ts b/packages/datadog-api-client-v2/models/ObjectSerializer.ts index 6cf60d78417a..c8a134f9d894 100644 --- a/packages/datadog-api-client-v2/models/ObjectSerializer.ts +++ b/packages/datadog-api-client-v2/models/ObjectSerializer.ts @@ -339,6 +339,14 @@ import { ArbitraryRuleResponseDataAttributesStrategyEvaluateGroupedByFiltersItem import { ArbitraryRuleStatusResponseArray } from "./ArbitraryRuleStatusResponseArray"; import { ArbitraryRuleStatusResponseData } from "./ArbitraryRuleStatusResponseData"; import { ArbitraryRuleStatusResponseDataAttributes } from "./ArbitraryRuleStatusResponseDataAttributes"; +import { ArchiveSearchCreateRehydration } from "./ArchiveSearchCreateRehydration"; +import { ArchiveSearchCreateRequest } from "./ArchiveSearchCreateRequest"; +import { ArchiveSearchCreateRequestAttributes } from "./ArchiveSearchCreateRequestAttributes"; +import { ArchiveSearchCreateRequestData } from "./ArchiveSearchCreateRequestData"; +import { ArchiveSearchRehydration } from "./ArchiveSearchRehydration"; +import { ArchiveSearchResponse } from "./ArchiveSearchResponse"; +import { ArchiveSearchResponseAttributes } from "./ArchiveSearchResponseAttributes"; +import { ArchiveSearchResponseData } from "./ArchiveSearchResponseData"; import { Argument } from "./Argument"; import { AsanaAccessToken } from "./AsanaAccessToken"; import { AsanaAccessTokenUpdate } from "./AsanaAccessTokenUpdate"; @@ -6530,6 +6538,16 @@ const enumsMap: { [key: string]: any[] } = { ArbitraryCostUpsertRequestDataType: ["upsert_arbitrary_rule"], ArbitraryRuleResponseDataType: ["arbitrary_rule"], ArbitraryRuleStatusResponseDataType: ["arbitrary_rule_status"], + ArchiveSearchRehydrationTier: ["standard", "flex"], + ArchiveSearchStatus: [ + "RUNNING", + "COMPLETED", + "FAILED", + "CANCELLED", + "QUOTA_REACHED", + "EXPIRED", + ], + ArchiveSearchType: ["archive_search"], AsanaAccessTokenType: ["AsanaAccessToken"], AsanaIntegrationType: ["Asana"], AssetEntityType: ["assets"], @@ -10012,6 +10030,14 @@ const typeMap: { [index: string]: any } = { ArbitraryRuleStatusResponseData: ArbitraryRuleStatusResponseData, ArbitraryRuleStatusResponseDataAttributes: ArbitraryRuleStatusResponseDataAttributes, + ArchiveSearchCreateRehydration: ArchiveSearchCreateRehydration, + ArchiveSearchCreateRequest: ArchiveSearchCreateRequest, + ArchiveSearchCreateRequestAttributes: ArchiveSearchCreateRequestAttributes, + ArchiveSearchCreateRequestData: ArchiveSearchCreateRequestData, + ArchiveSearchRehydration: ArchiveSearchRehydration, + ArchiveSearchResponse: ArchiveSearchResponse, + ArchiveSearchResponseAttributes: ArchiveSearchResponseAttributes, + ArchiveSearchResponseData: ArchiveSearchResponseData, Argument: Argument, AsanaAccessToken: AsanaAccessToken, AsanaAccessTokenUpdate: AsanaAccessTokenUpdate,