diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 382c9233aa58..e1e1f1984db5 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -41379,6 +41379,8 @@ components: LogsArchiveAttributes: description: The attributes associated with the archive. properties: + compression_method: + $ref: "#/components/schemas/LogsArchiveAttributesCompressionMethod" destination: $ref: "#/components/schemas/LogsArchiveDestination" include_tags: @@ -41416,6 +41418,17 @@ components: - query - destination type: object + LogsArchiveAttributesCompressionMethod: + default: GZIP + description: The type of compression for the archive. + enum: + - GZIP + - ZSTD + example: GZIP + type: string + x-enum-varnames: + - GZIP + - ZSTD LogsArchiveCreateRequest: description: The logs archive. properties: @@ -41425,6 +41438,8 @@ components: LogsArchiveCreateRequestAttributes: description: The attributes associated with the archive. properties: + compression_method: + $ref: "#/components/schemas/LogsArchiveAttributesCompressionMethod" destination: $ref: "#/components/schemas/LogsArchiveCreateRequestDestination" include_tags: @@ -106036,6 +106051,7 @@ paths: value: data: attributes: + compression_method: GZIP destination: container: container-name storage_account: account-name @@ -106175,6 +106191,7 @@ paths: value: data: attributes: + compression_method: GZIP destination: container: container-name storage_account: account-name diff --git a/features/v2/logs_archives.feature b/features/v2/logs_archives.feature index a6de8c72d4bd..4b58769df54e 100644 --- a/features/v2/logs_archives.feature +++ b/features/v2/logs_archives.feature @@ -12,14 +12,14 @@ Feature: Logs Archives @generated @skip @team:DataDog/logs-backend @team:DataDog/logs-forwarding Scenario: Create an archive returns "Bad Request" response Given new "CreateLogsArchive" request - And body with value {"data": {"attributes": {"destination": {"container": "container-name", "integration": {"client_id": "aaaaaaaa-1a1a-1a1a-1a1a-aaaaaaaaaaaa", "tenant_id": "aaaaaaaa-1a1a-1a1a-1a1a-aaaaaaaaaaaa"}, "storage_account": "account-name", "type": "azure"}, "include_tags": false, "name": "Nginx Archive", "query": "source:nginx", "rehydration_max_scan_size_in_gb": 100, "rehydration_tags": ["team:intake", "team:app"]}, "type": "archives"}} + And body with value {"data": {"attributes": {"compression_method": "GZIP", "destination": {"container": "container-name", "integration": {"client_id": "aaaaaaaa-1a1a-1a1a-1a1a-aaaaaaaaaaaa", "tenant_id": "aaaaaaaa-1a1a-1a1a-1a1a-aaaaaaaaaaaa"}, "storage_account": "account-name", "type": "azure"}, "include_tags": false, "name": "Nginx Archive", "query": "source:nginx", "rehydration_max_scan_size_in_gb": 100, "rehydration_tags": ["team:intake", "team:app"]}, "type": "archives"}} When the request is sent Then the response status is 400 Bad Request @generated @skip @team:DataDog/logs-backend @team:DataDog/logs-forwarding Scenario: Create an archive returns "OK" response Given new "CreateLogsArchive" request - And body with value {"data": {"attributes": {"destination": {"container": "container-name", "integration": {"client_id": "aaaaaaaa-1a1a-1a1a-1a1a-aaaaaaaaaaaa", "tenant_id": "aaaaaaaa-1a1a-1a1a-1a1a-aaaaaaaaaaaa"}, "storage_account": "account-name", "type": "azure"}, "include_tags": false, "name": "Nginx Archive", "query": "source:nginx", "rehydration_max_scan_size_in_gb": 100, "rehydration_tags": ["team:intake", "team:app"]}, "type": "archives"}} + And body with value {"data": {"attributes": {"compression_method": "GZIP", "destination": {"container": "container-name", "integration": {"client_id": "aaaaaaaa-1a1a-1a1a-1a1a-aaaaaaaaaaaa", "tenant_id": "aaaaaaaa-1a1a-1a1a-1a1a-aaaaaaaaaaaa"}, "storage_account": "account-name", "type": "azure"}, "include_tags": false, "name": "Nginx Archive", "query": "source:nginx", "rehydration_max_scan_size_in_gb": 100, "rehydration_tags": ["team:intake", "team:app"]}, "type": "archives"}} When the request is sent Then the response status is 200 OK @@ -150,7 +150,7 @@ Feature: Logs Archives Scenario: Update an archive returns "Bad Request" response Given new "UpdateLogsArchive" request And request contains "archive_id" parameter from "REPLACE.ME" - And body with value {"data": {"attributes": {"destination": {"container": "container-name", "integration": {"client_id": "aaaaaaaa-1a1a-1a1a-1a1a-aaaaaaaaaaaa", "tenant_id": "aaaaaaaa-1a1a-1a1a-1a1a-aaaaaaaaaaaa"}, "storage_account": "account-name", "type": "azure"}, "include_tags": false, "name": "Nginx Archive", "query": "source:nginx", "rehydration_max_scan_size_in_gb": 100, "rehydration_tags": ["team:intake", "team:app"]}, "type": "archives"}} + And body with value {"data": {"attributes": {"compression_method": "GZIP", "destination": {"container": "container-name", "integration": {"client_id": "aaaaaaaa-1a1a-1a1a-1a1a-aaaaaaaaaaaa", "tenant_id": "aaaaaaaa-1a1a-1a1a-1a1a-aaaaaaaaaaaa"}, "storage_account": "account-name", "type": "azure"}, "include_tags": false, "name": "Nginx Archive", "query": "source:nginx", "rehydration_max_scan_size_in_gb": 100, "rehydration_tags": ["team:intake", "team:app"]}, "type": "archives"}} When the request is sent Then the response status is 400 Bad Request @@ -158,7 +158,7 @@ Feature: Logs Archives Scenario: Update an archive returns "Not found" response Given new "UpdateLogsArchive" request And request contains "archive_id" parameter from "REPLACE.ME" - And body with value {"data": {"attributes": {"destination": {"container": "container-name", "integration": {"client_id": "aaaaaaaa-1a1a-1a1a-1a1a-aaaaaaaaaaaa", "tenant_id": "aaaaaaaa-1a1a-1a1a-1a1a-aaaaaaaaaaaa"}, "storage_account": "account-name", "type": "azure"}, "include_tags": false, "name": "Nginx Archive", "query": "source:nginx", "rehydration_max_scan_size_in_gb": 100, "rehydration_tags": ["team:intake", "team:app"]}, "type": "archives"}} + And body with value {"data": {"attributes": {"compression_method": "GZIP", "destination": {"container": "container-name", "integration": {"client_id": "aaaaaaaa-1a1a-1a1a-1a1a-aaaaaaaaaaaa", "tenant_id": "aaaaaaaa-1a1a-1a1a-1a1a-aaaaaaaaaaaa"}, "storage_account": "account-name", "type": "azure"}, "include_tags": false, "name": "Nginx Archive", "query": "source:nginx", "rehydration_max_scan_size_in_gb": 100, "rehydration_tags": ["team:intake", "team:app"]}, "type": "archives"}} When the request is sent Then the response status is 404 Not found @@ -166,7 +166,7 @@ Feature: Logs Archives Scenario: Update an archive returns "OK" response Given new "UpdateLogsArchive" request And request contains "archive_id" parameter from "REPLACE.ME" - And body with value {"data": {"attributes": {"destination": {"container": "container-name", "integration": {"client_id": "aaaaaaaa-1a1a-1a1a-1a1a-aaaaaaaaaaaa", "tenant_id": "aaaaaaaa-1a1a-1a1a-1a1a-aaaaaaaaaaaa"}, "storage_account": "account-name", "type": "azure"}, "include_tags": false, "name": "Nginx Archive", "query": "source:nginx", "rehydration_max_scan_size_in_gb": 100, "rehydration_tags": ["team:intake", "team:app"]}, "type": "archives"}} + And body with value {"data": {"attributes": {"compression_method": "GZIP", "destination": {"container": "container-name", "integration": {"client_id": "aaaaaaaa-1a1a-1a1a-1a1a-aaaaaaaaaaaa", "tenant_id": "aaaaaaaa-1a1a-1a1a-1a1a-aaaaaaaaaaaa"}, "storage_account": "account-name", "type": "azure"}, "include_tags": false, "name": "Nginx Archive", "query": "source:nginx", "rehydration_max_scan_size_in_gb": 100, "rehydration_tags": ["team:intake", "team:app"]}, "type": "archives"}} When the request is sent Then the response status is 200 OK diff --git a/services/logs_archives/src/v2/index.ts b/services/logs_archives/src/v2/index.ts index 71da93da3fba..9fba29c1b37f 100644 --- a/services/logs_archives/src/v2/index.ts +++ b/services/logs_archives/src/v2/index.ts @@ -13,6 +13,7 @@ export { export { APIErrorResponse } from "./models/APIErrorResponse"; export { LogsArchive } from "./models/LogsArchive"; export { LogsArchiveAttributes } from "./models/LogsArchiveAttributes"; +export { LogsArchiveAttributesCompressionMethod } from "./models/LogsArchiveAttributesCompressionMethod"; export { LogsArchiveCreateRequest } from "./models/LogsArchiveCreateRequest"; export { LogsArchiveCreateRequestAttributes } from "./models/LogsArchiveCreateRequestAttributes"; export { LogsArchiveCreateRequestDefinition } from "./models/LogsArchiveCreateRequestDefinition"; diff --git a/services/logs_archives/src/v2/models/LogsArchiveAttributes.ts b/services/logs_archives/src/v2/models/LogsArchiveAttributes.ts index 711e996a8b5e..ab6d7e448269 100644 --- a/services/logs_archives/src/v2/models/LogsArchiveAttributes.ts +++ b/services/logs_archives/src/v2/models/LogsArchiveAttributes.ts @@ -1,5 +1,6 @@ import { AttributeTypeMap } from "@datadog/datadog-api-client"; +import { LogsArchiveAttributesCompressionMethod } from "./LogsArchiveAttributesCompressionMethod"; import { LogsArchiveDestination } from "./LogsArchiveDestination"; import { LogsArchiveState } from "./LogsArchiveState"; @@ -7,6 +8,10 @@ import { LogsArchiveState } from "./LogsArchiveState"; * The attributes associated with the archive. */ export class LogsArchiveAttributes { + /** + * The type of compression for the archive. + */ + "compressionMethod"?: LogsArchiveAttributesCompressionMethod; /** * An archive's destination. */ @@ -51,6 +56,10 @@ export class LogsArchiveAttributes { * @ignore */ static readonly attributeTypeMap: AttributeTypeMap = { + compressionMethod: { + baseName: "compression_method", + type: "LogsArchiveAttributesCompressionMethod", + }, destination: { baseName: "destination", type: "LogsArchiveDestination", diff --git a/services/logs_archives/src/v2/models/LogsArchiveAttributesCompressionMethod.ts b/services/logs_archives/src/v2/models/LogsArchiveAttributesCompressionMethod.ts new file mode 100644 index 000000000000..743615a924b1 --- /dev/null +++ b/services/logs_archives/src/v2/models/LogsArchiveAttributesCompressionMethod.ts @@ -0,0 +1,11 @@ +import { UnparsedObject } from "@datadog/datadog-api-client"; + +/** + * The type of compression for the archive. + */ +export type LogsArchiveAttributesCompressionMethod = + | typeof GZIP + | typeof ZSTD + | UnparsedObject; +export const GZIP = "GZIP"; +export const ZSTD = "ZSTD"; diff --git a/services/logs_archives/src/v2/models/LogsArchiveCreateRequestAttributes.ts b/services/logs_archives/src/v2/models/LogsArchiveCreateRequestAttributes.ts index ddcc1ba4fd2f..ca21d48e35dd 100644 --- a/services/logs_archives/src/v2/models/LogsArchiveCreateRequestAttributes.ts +++ b/services/logs_archives/src/v2/models/LogsArchiveCreateRequestAttributes.ts @@ -1,11 +1,16 @@ import { AttributeTypeMap } from "@datadog/datadog-api-client"; +import { LogsArchiveAttributesCompressionMethod } from "./LogsArchiveAttributesCompressionMethod"; import { LogsArchiveCreateRequestDestination } from "./LogsArchiveCreateRequestDestination"; /** * The attributes associated with the archive. */ export class LogsArchiveCreateRequestAttributes { + /** + * The type of compression for the archive. + */ + "compressionMethod"?: LogsArchiveAttributesCompressionMethod; /** * An archive's destination. */ @@ -46,6 +51,10 @@ export class LogsArchiveCreateRequestAttributes { * @ignore */ static readonly attributeTypeMap: AttributeTypeMap = { + compressionMethod: { + baseName: "compression_method", + type: "LogsArchiveAttributesCompressionMethod", + }, destination: { baseName: "destination", type: "LogsArchiveCreateRequestDestination", diff --git a/services/logs_archives/src/v2/models/TypingInfo.ts b/services/logs_archives/src/v2/models/TypingInfo.ts index a6e865cad4a3..d0c9b5119d20 100644 --- a/services/logs_archives/src/v2/models/TypingInfo.ts +++ b/services/logs_archives/src/v2/models/TypingInfo.ts @@ -31,6 +31,7 @@ import { RolesResponse } from "./RolesResponse"; export const TypingInfo: ModelTypingInfo = { enumsMap: { + LogsArchiveAttributesCompressionMethod: ["GZIP", "ZSTD"], LogsArchiveDestinationAzureType: ["azure"], LogsArchiveDestinationGCSType: ["gcs"], LogsArchiveDestinationS3Type: ["s3"],