Skip to content
Open
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
17 changes: 17 additions & 0 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand All @@ -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:
Expand Down Expand Up @@ -106036,6 +106051,7 @@ paths:
value:
data:
attributes:
compression_method: GZIP
destination:
container: container-name
storage_account: account-name
Expand Down Expand Up @@ -106175,6 +106191,7 @@ paths:
value:
data:
attributes:
compression_method: GZIP
destination:
container: container-name
storage_account: account-name
Expand Down
10 changes: 5 additions & 5 deletions features/v2/logs_archives.feature
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -150,23 +150,23 @@ 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

@generated @skip @team:DataDog/logs-backend @team:DataDog/logs-forwarding
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

@generated @skip @team:DataDog/logs-backend @team:DataDog/logs-forwarding
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

Expand Down
1 change: 1 addition & 0 deletions services/logs_archives/src/v2/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
import { AttributeTypeMap } from "@datadog/datadog-api-client";

import { LogsArchiveAttributesCompressionMethod } from "./LogsArchiveAttributesCompressionMethod";
import { LogsArchiveDestination } from "./LogsArchiveDestination";
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.
*/
Expand Down Expand Up @@ -51,6 +56,10 @@ export class LogsArchiveAttributes {
* @ignore
*/
static readonly attributeTypeMap: AttributeTypeMap = {
compressionMethod: {
baseName: "compression_method",
type: "LogsArchiveAttributesCompressionMethod",
},
destination: {
baseName: "destination",
type: "LogsArchiveDestination",
Expand Down
Original file line number Diff line number Diff line change
@@ -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";
Original file line number Diff line number Diff line change
@@ -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.
*/
Expand Down Expand Up @@ -46,6 +51,10 @@ export class LogsArchiveCreateRequestAttributes {
* @ignore
*/
static readonly attributeTypeMap: AttributeTypeMap = {
compressionMethod: {
baseName: "compression_method",
type: "LogsArchiveAttributesCompressionMethod",
},
destination: {
baseName: "destination",
type: "LogsArchiveCreateRequestDestination",
Expand Down
1 change: 1 addition & 0 deletions services/logs_archives/src/v2/models/TypingInfo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import { RolesResponse } from "./RolesResponse";

export const TypingInfo: ModelTypingInfo = {
enumsMap: {
LogsArchiveAttributesCompressionMethod: ["GZIP", "ZSTD"],
LogsArchiveDestinationAzureType: ["azure"],
LogsArchiveDestinationGCSType: ["gcs"],
LogsArchiveDestinationS3Type: ["s3"],
Expand Down
Loading