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
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
2 changes: 2 additions & 0 deletions examples/v2/logs-archives/CreateLogsArchive.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.LogsArchivesApi;
import com.datadog.api.client.v2.model.LogsArchive;
import com.datadog.api.client.v2.model.LogsArchiveAttributesCompressionMethod;
import com.datadog.api.client.v2.model.LogsArchiveCreateRequest;
import com.datadog.api.client.v2.model.LogsArchiveCreateRequestAttributes;
import com.datadog.api.client.v2.model.LogsArchiveCreateRequestDefinition;
Expand All @@ -24,6 +25,7 @@ public static void main(String[] args) {
new LogsArchiveCreateRequestDefinition()
.attributes(
new LogsArchiveCreateRequestAttributes()
.compressionMethod(LogsArchiveAttributesCompressionMethod.GZIP)
.destination(
new LogsArchiveCreateRequestDestination(
new LogsArchiveDestinationAzure()
Expand Down
2 changes: 2 additions & 0 deletions examples/v2/logs-archives/UpdateLogsArchive.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.LogsArchivesApi;
import com.datadog.api.client.v2.model.LogsArchive;
import com.datadog.api.client.v2.model.LogsArchiveAttributesCompressionMethod;
import com.datadog.api.client.v2.model.LogsArchiveCreateRequest;
import com.datadog.api.client.v2.model.LogsArchiveCreateRequestAttributes;
import com.datadog.api.client.v2.model.LogsArchiveCreateRequestDefinition;
Expand All @@ -24,6 +25,7 @@ public static void main(String[] args) {
new LogsArchiveCreateRequestDefinition()
.attributes(
new LogsArchiveCreateRequestAttributes()
.compressionMethod(LogsArchiveAttributesCompressionMethod.GZIP)
.destination(
new LogsArchiveCreateRequestDestination(
new LogsArchiveDestinationAzure()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

/** The attributes associated with the archive. */
@JsonPropertyOrder({
LogsArchiveAttributes.JSON_PROPERTY_COMPRESSION_METHOD,
LogsArchiveAttributes.JSON_PROPERTY_DESTINATION,
LogsArchiveAttributes.JSON_PROPERTY_INCLUDE_TAGS,
LogsArchiveAttributes.JSON_PROPERTY_NAME,
Expand All @@ -34,6 +35,10 @@
value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator")
public class LogsArchiveAttributes {
@JsonIgnore public boolean unparsed = false;
public static final String JSON_PROPERTY_COMPRESSION_METHOD = "compression_method";
private LogsArchiveAttributesCompressionMethod compressionMethod =
LogsArchiveAttributesCompressionMethod.GZIP;

public static final String JSON_PROPERTY_DESTINATION = "destination";
private LogsArchiveDestination destination;

Expand Down Expand Up @@ -72,6 +77,32 @@ public LogsArchiveAttributes(
this.query = query;
}

public LogsArchiveAttributes compressionMethod(
LogsArchiveAttributesCompressionMethod compressionMethod) {
this.compressionMethod = compressionMethod;
this.unparsed |= !compressionMethod.isValid();
return this;
}

/**
* The type of compression for the archive.
*
* @return compressionMethod
*/
@jakarta.annotation.Nullable
@JsonProperty(JSON_PROPERTY_COMPRESSION_METHOD)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public LogsArchiveAttributesCompressionMethod getCompressionMethod() {
return compressionMethod;
}

public void setCompressionMethod(LogsArchiveAttributesCompressionMethod compressionMethod) {
if (!compressionMethod.isValid()) {
this.unparsed = true;
}
this.compressionMethod = compressionMethod;
}

public LogsArchiveAttributes destination(LogsArchiveDestination destination) {
this.destination = destination;
if (destination != null) {
Expand Down Expand Up @@ -300,7 +331,8 @@ public boolean equals(Object o) {
return false;
}
LogsArchiveAttributes logsArchiveAttributes = (LogsArchiveAttributes) o;
return Objects.equals(this.destination, logsArchiveAttributes.destination)
return Objects.equals(this.compressionMethod, logsArchiveAttributes.compressionMethod)
&& Objects.equals(this.destination, logsArchiveAttributes.destination)
&& Objects.equals(this.includeTags, logsArchiveAttributes.includeTags)
&& Objects.equals(this.name, logsArchiveAttributes.name)
&& Objects.equals(this.query, logsArchiveAttributes.query)
Expand All @@ -314,6 +346,7 @@ public boolean equals(Object o) {
@Override
public int hashCode() {
return Objects.hash(
compressionMethod,
destination,
includeTags,
name,
Expand All @@ -328,6 +361,7 @@ public int hashCode() {
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class LogsArchiveAttributes {\n");
sb.append(" compressionMethod: ").append(toIndentedString(compressionMethod)).append("\n");
sb.append(" destination: ").append(toIndentedString(destination)).append("\n");
sb.append(" includeTags: ").append(toIndentedString(includeTags)).append("\n");
sb.append(" name: ").append(toIndentedString(name)).append("\n");
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
/*
* 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 2019-Present Datadog, Inc.
*/

package com.datadog.api.client.v2.model;

import com.datadog.api.client.ModelEnum;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.SerializerProvider;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.StdSerializer;
import java.io.IOException;
import java.util.Arrays;
import java.util.HashSet;
import java.util.Set;

/** The type of compression for the archive. */
@JsonSerialize(
using =
LogsArchiveAttributesCompressionMethod.LogsArchiveAttributesCompressionMethodSerializer
.class)
public class LogsArchiveAttributesCompressionMethod extends ModelEnum<String> {

private static final Set<String> allowedValues =
new HashSet<String>(Arrays.asList("GZIP", "ZSTD"));

public static final LogsArchiveAttributesCompressionMethod GZIP =
new LogsArchiveAttributesCompressionMethod("GZIP");
public static final LogsArchiveAttributesCompressionMethod ZSTD =
new LogsArchiveAttributesCompressionMethod("ZSTD");

LogsArchiveAttributesCompressionMethod(String value) {
super(value, allowedValues);
}

public static class LogsArchiveAttributesCompressionMethodSerializer
extends StdSerializer<LogsArchiveAttributesCompressionMethod> {
public LogsArchiveAttributesCompressionMethodSerializer(
Class<LogsArchiveAttributesCompressionMethod> t) {
super(t);
}

public LogsArchiveAttributesCompressionMethodSerializer() {
this(null);
}

@Override
public void serialize(
LogsArchiveAttributesCompressionMethod value,
JsonGenerator jgen,
SerializerProvider provider)
throws IOException, JsonProcessingException {
jgen.writeObject(value.value);
}
}

@JsonCreator
public static LogsArchiveAttributesCompressionMethod fromValue(String value) {
return new LogsArchiveAttributesCompressionMethod(value);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

/** The attributes associated with the archive. */
@JsonPropertyOrder({
LogsArchiveCreateRequestAttributes.JSON_PROPERTY_COMPRESSION_METHOD,
LogsArchiveCreateRequestAttributes.JSON_PROPERTY_DESTINATION,
LogsArchiveCreateRequestAttributes.JSON_PROPERTY_INCLUDE_TAGS,
LogsArchiveCreateRequestAttributes.JSON_PROPERTY_NAME,
Expand All @@ -33,6 +34,10 @@
value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator")
public class LogsArchiveCreateRequestAttributes {
@JsonIgnore public boolean unparsed = false;
public static final String JSON_PROPERTY_COMPRESSION_METHOD = "compression_method";
private LogsArchiveAttributesCompressionMethod compressionMethod =
LogsArchiveAttributesCompressionMethod.GZIP;

public static final String JSON_PROPERTY_DESTINATION = "destination";
private LogsArchiveCreateRequestDestination destination;

Expand Down Expand Up @@ -66,6 +71,32 @@ public LogsArchiveCreateRequestAttributes(
this.query = query;
}

public LogsArchiveCreateRequestAttributes compressionMethod(
LogsArchiveAttributesCompressionMethod compressionMethod) {
this.compressionMethod = compressionMethod;
this.unparsed |= !compressionMethod.isValid();
return this;
}

/**
* The type of compression for the archive.
*
* @return compressionMethod
*/
@jakarta.annotation.Nullable
@JsonProperty(JSON_PROPERTY_COMPRESSION_METHOD)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public LogsArchiveAttributesCompressionMethod getCompressionMethod() {
return compressionMethod;
}

public void setCompressionMethod(LogsArchiveAttributesCompressionMethod compressionMethod) {
if (!compressionMethod.isValid()) {
this.unparsed = true;
}
this.compressionMethod = compressionMethod;
}

public LogsArchiveCreateRequestAttributes destination(
LogsArchiveCreateRequestDestination destination) {
this.destination = destination;
Expand Down Expand Up @@ -269,7 +300,9 @@ public boolean equals(Object o) {
}
LogsArchiveCreateRequestAttributes logsArchiveCreateRequestAttributes =
(LogsArchiveCreateRequestAttributes) o;
return Objects.equals(this.destination, logsArchiveCreateRequestAttributes.destination)
return Objects.equals(
this.compressionMethod, logsArchiveCreateRequestAttributes.compressionMethod)
&& Objects.equals(this.destination, logsArchiveCreateRequestAttributes.destination)
&& Objects.equals(this.includeTags, logsArchiveCreateRequestAttributes.includeTags)
&& Objects.equals(this.name, logsArchiveCreateRequestAttributes.name)
&& Objects.equals(this.query, logsArchiveCreateRequestAttributes.query)
Expand All @@ -284,6 +317,7 @@ public boolean equals(Object o) {
@Override
public int hashCode() {
return Objects.hash(
compressionMethod,
destination,
includeTags,
name,
Expand All @@ -297,6 +331,7 @@ public int hashCode() {
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class LogsArchiveCreateRequestAttributes {\n");
sb.append(" compressionMethod: ").append(toIndentedString(compressionMethod)).append("\n");
sb.append(" destination: ").append(toIndentedString(destination)).append("\n");
sb.append(" includeTags: ").append(toIndentedString(includeTags)).append("\n");
sb.append(" name: ").append(toIndentedString(name)).append("\n");
Expand Down
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
Loading