diff --git a/.generator/schemas/v1/openapi.yaml b/.generator/schemas/v1/openapi.yaml index 150bd49be13..832230d382b 100644 --- a/.generator/schemas/v1/openapi.yaml +++ b/.generator/schemas/v1/openapi.yaml @@ -6152,6 +6152,16 @@ components: example: 15 format: int64 type: integer + tags: + description: A list of tags associated with the index. Tags must be in `key:value` + format. + example: + - team:backend + - env:production + items: + description: A single tag using the format `key:value`. + type: string + type: array required: - name - filter @@ -6239,6 +6249,16 @@ components: example: 15 format: int64 type: integer + tags: + description: A list of tags associated with the index. Tags must be in `key:value` + format. + example: + - team:backend + - env:production + items: + description: A single tag using the format `key:value`. + type: string + type: array required: - filter type: object diff --git a/examples/v1/logs-indexes/CreateLogsIndex.java b/examples/v1/logs-indexes/CreateLogsIndex.java index 8f00ff849e6..591003d2bb9 100644 --- a/examples/v1/logs-indexes/CreateLogsIndex.java +++ b/examples/v1/logs-indexes/CreateLogsIndex.java @@ -8,6 +8,7 @@ import com.datadog.api.client.v1.model.LogsExclusionFilter; import com.datadog.api.client.v1.model.LogsFilter; import com.datadog.api.client.v1.model.LogsIndex; +import java.util.Arrays; import java.util.Collections; public class Example { @@ -28,7 +29,8 @@ public static void main(String[] args) { .filter(new LogsFilter().query("source:python")) .name("main") .numFlexLogsRetentionDays(360L) - .numRetentionDays(15L); + .numRetentionDays(15L) + .tags(Arrays.asList("team:backend", "env:production")); try { LogsIndex result = apiInstance.createLogsIndex(body); diff --git a/examples/v1/logs-indexes/UpdateLogsIndex.java b/examples/v1/logs-indexes/UpdateLogsIndex.java index 4af4a3b4537..5ada6ac53bc 100644 --- a/examples/v1/logs-indexes/UpdateLogsIndex.java +++ b/examples/v1/logs-indexes/UpdateLogsIndex.java @@ -9,6 +9,7 @@ import com.datadog.api.client.v1.model.LogsFilter; import com.datadog.api.client.v1.model.LogsIndex; import com.datadog.api.client.v1.model.LogsIndexUpdateRequest; +import java.util.Arrays; import java.util.Collections; public class Example { @@ -29,7 +30,8 @@ public static void main(String[] args) { .name("payment"))) .filter(new LogsFilter().query("source:python")) .numFlexLogsRetentionDays(360L) - .numRetentionDays(15L); + .numRetentionDays(15L) + .tags(Arrays.asList("team:backend", "env:production")); try { LogsIndex result = apiInstance.updateLogsIndex("name", body); diff --git a/src/main/java/com/datadog/api/client/v1/model/LogsIndex.java b/src/main/java/com/datadog/api/client/v1/model/LogsIndex.java index 4b7c10d58f0..39701af498e 100644 --- a/src/main/java/com/datadog/api/client/v1/model/LogsIndex.java +++ b/src/main/java/com/datadog/api/client/v1/model/LogsIndex.java @@ -29,7 +29,8 @@ LogsIndex.JSON_PROPERTY_IS_RATE_LIMITED, LogsIndex.JSON_PROPERTY_NAME, LogsIndex.JSON_PROPERTY_NUM_FLEX_LOGS_RETENTION_DAYS, - LogsIndex.JSON_PROPERTY_NUM_RETENTION_DAYS + LogsIndex.JSON_PROPERTY_NUM_RETENTION_DAYS, + LogsIndex.JSON_PROPERTY_TAGS }) @jakarta.annotation.Generated( value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") @@ -64,6 +65,9 @@ public class LogsIndex { public static final String JSON_PROPERTY_NUM_RETENTION_DAYS = "num_retention_days"; private Long numRetentionDays; + public static final String JSON_PROPERTY_TAGS = "tags"; + private List tags = null; + public LogsIndex() {} @JsonCreator @@ -279,6 +283,35 @@ public void setNumRetentionDays(Long numRetentionDays) { this.numRetentionDays = numRetentionDays; } + public LogsIndex tags(List tags) { + this.tags = tags; + return this; + } + + public LogsIndex addTagsItem(String tagsItem) { + if (this.tags == null) { + this.tags = new ArrayList<>(); + } + this.tags.add(tagsItem); + return this; + } + + /** + * A list of tags associated with the index. Tags must be in key:value format. + * + * @return tags + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TAGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getTags() { + return tags; + } + + public void setTags(List tags) { + this.tags = tags; + } + /** * A container for additional, undeclared properties. This is a holder for any undeclared * properties as specified with the 'additionalProperties' keyword in the OAS document. @@ -346,6 +379,7 @@ public boolean equals(Object o) { && Objects.equals(this.name, logsIndex.name) && Objects.equals(this.numFlexLogsRetentionDays, logsIndex.numFlexLogsRetentionDays) && Objects.equals(this.numRetentionDays, logsIndex.numRetentionDays) + && Objects.equals(this.tags, logsIndex.tags) && Objects.equals(this.additionalProperties, logsIndex.additionalProperties); } @@ -361,6 +395,7 @@ public int hashCode() { name, numFlexLogsRetentionDays, numRetentionDays, + tags, additionalProperties); } @@ -381,6 +416,7 @@ public String toString() { .append(toIndentedString(numFlexLogsRetentionDays)) .append("\n"); sb.append(" numRetentionDays: ").append(toIndentedString(numRetentionDays)).append("\n"); + sb.append(" tags: ").append(toIndentedString(tags)).append("\n"); sb.append(" additionalProperties: ") .append(toIndentedString(additionalProperties)) .append("\n"); diff --git a/src/main/java/com/datadog/api/client/v1/model/LogsIndexUpdateRequest.java b/src/main/java/com/datadog/api/client/v1/model/LogsIndexUpdateRequest.java index ec0da00ca88..89736d6ac98 100644 --- a/src/main/java/com/datadog/api/client/v1/model/LogsIndexUpdateRequest.java +++ b/src/main/java/com/datadog/api/client/v1/model/LogsIndexUpdateRequest.java @@ -28,7 +28,8 @@ LogsIndexUpdateRequest.JSON_PROPERTY_EXCLUSION_FILTERS, LogsIndexUpdateRequest.JSON_PROPERTY_FILTER, LogsIndexUpdateRequest.JSON_PROPERTY_NUM_FLEX_LOGS_RETENTION_DAYS, - LogsIndexUpdateRequest.JSON_PROPERTY_NUM_RETENTION_DAYS + LogsIndexUpdateRequest.JSON_PROPERTY_NUM_RETENTION_DAYS, + LogsIndexUpdateRequest.JSON_PROPERTY_TAGS }) @jakarta.annotation.Generated( value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") @@ -60,6 +61,9 @@ public class LogsIndexUpdateRequest { public static final String JSON_PROPERTY_NUM_RETENTION_DAYS = "num_retention_days"; private Long numRetentionDays; + public static final String JSON_PROPERTY_TAGS = "tags"; + private List tags = null; + public LogsIndexUpdateRequest() {} @JsonCreator @@ -269,6 +273,35 @@ public void setNumRetentionDays(Long numRetentionDays) { this.numRetentionDays = numRetentionDays; } + public LogsIndexUpdateRequest tags(List tags) { + this.tags = tags; + return this; + } + + public LogsIndexUpdateRequest addTagsItem(String tagsItem) { + if (this.tags == null) { + this.tags = new ArrayList<>(); + } + this.tags.add(tagsItem); + return this; + } + + /** + * A list of tags associated with the index. Tags must be in key:value format. + * + * @return tags + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TAGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getTags() { + return tags; + } + + public void setTags(List tags) { + this.tags = tags; + } + /** * A container for additional, undeclared properties. This is a holder for any undeclared * properties as specified with the 'additionalProperties' keyword in the OAS document. @@ -336,6 +369,7 @@ public boolean equals(Object o) { && Objects.equals( this.numFlexLogsRetentionDays, logsIndexUpdateRequest.numFlexLogsRetentionDays) && Objects.equals(this.numRetentionDays, logsIndexUpdateRequest.numRetentionDays) + && Objects.equals(this.tags, logsIndexUpdateRequest.tags) && Objects.equals(this.additionalProperties, logsIndexUpdateRequest.additionalProperties); } @@ -350,6 +384,7 @@ public int hashCode() { filter, numFlexLogsRetentionDays, numRetentionDays, + tags, additionalProperties); } @@ -369,6 +404,7 @@ public String toString() { .append(toIndentedString(numFlexLogsRetentionDays)) .append("\n"); sb.append(" numRetentionDays: ").append(toIndentedString(numRetentionDays)).append("\n"); + sb.append(" tags: ").append(toIndentedString(tags)).append("\n"); sb.append(" additionalProperties: ") .append(toIndentedString(additionalProperties)) .append("\n"); diff --git a/src/test/resources/com/datadog/api/client/v1/api/logs_indexes.feature b/src/test/resources/com/datadog/api/client/v1/api/logs_indexes.feature index e94fea2c62f..8277ce4ae24 100644 --- a/src/test/resources/com/datadog/api/client/v1/api/logs_indexes.feature +++ b/src/test/resources/com/datadog/api/client/v1/api/logs_indexes.feature @@ -11,21 +11,21 @@ Feature: Logs Indexes @generated @skip @team:DataDog/logs-backend @team:DataDog/logs-core Scenario: Create an index returns "Invalid Parameter Error" response Given new "CreateLogsIndex" request - And body with value {"daily_limit": 300000000, "daily_limit_reset": {"reset_time": "14:00", "reset_utc_offset": "+02:00"}, "daily_limit_warning_threshold_percentage": 70, "exclusion_filters": [{"filter": {"query": "*", "sample_rate": 1.0}, "name": "payment"}], "filter": {"query": "source:python"}, "name": "main", "num_flex_logs_retention_days": 360, "num_retention_days": 15} + And body with value {"daily_limit": 300000000, "daily_limit_reset": {"reset_time": "14:00", "reset_utc_offset": "+02:00"}, "daily_limit_warning_threshold_percentage": 70, "exclusion_filters": [{"filter": {"query": "*", "sample_rate": 1.0}, "name": "payment"}], "filter": {"query": "source:python"}, "name": "main", "num_flex_logs_retention_days": 360, "num_retention_days": 15, "tags": ["team:backend", "env:production"]} When the request is sent Then the response status is 400 Invalid Parameter Error @generated @skip @team:DataDog/logs-backend @team:DataDog/logs-core Scenario: Create an index returns "OK" response Given new "CreateLogsIndex" request - And body with value {"daily_limit": 300000000, "daily_limit_reset": {"reset_time": "14:00", "reset_utc_offset": "+02:00"}, "daily_limit_warning_threshold_percentage": 70, "exclusion_filters": [{"filter": {"query": "*", "sample_rate": 1.0}, "name": "payment"}], "filter": {"query": "source:python"}, "name": "main", "num_flex_logs_retention_days": 360, "num_retention_days": 15} + And body with value {"daily_limit": 300000000, "daily_limit_reset": {"reset_time": "14:00", "reset_utc_offset": "+02:00"}, "daily_limit_warning_threshold_percentage": 70, "exclusion_filters": [{"filter": {"query": "*", "sample_rate": 1.0}, "name": "payment"}], "filter": {"query": "source:python"}, "name": "main", "num_flex_logs_retention_days": 360, "num_retention_days": 15, "tags": ["team:backend", "env:production"]} When the request is sent Then the response status is 200 OK @generated @skip @team:DataDog/logs-backend @team:DataDog/logs-core Scenario: Create an index returns "Unprocessable Entity" response Given new "CreateLogsIndex" request - And body with value {"daily_limit": 300000000, "daily_limit_reset": {"reset_time": "14:00", "reset_utc_offset": "+02:00"}, "daily_limit_warning_threshold_percentage": 70, "exclusion_filters": [{"filter": {"query": "*", "sample_rate": 1.0}, "name": "payment"}], "filter": {"query": "source:python"}, "name": "main", "num_flex_logs_retention_days": 360, "num_retention_days": 15} + And body with value {"daily_limit": 300000000, "daily_limit_reset": {"reset_time": "14:00", "reset_utc_offset": "+02:00"}, "daily_limit_warning_threshold_percentage": 70, "exclusion_filters": [{"filter": {"query": "*", "sample_rate": 1.0}, "name": "payment"}], "filter": {"query": "source:python"}, "name": "main", "num_flex_logs_retention_days": 360, "num_retention_days": 15, "tags": ["team:backend", "env:production"]} When the request is sent Then the response status is 422 Unprocessable Entity @@ -73,7 +73,7 @@ Feature: Logs Indexes Scenario: Update an index returns "Invalid Parameter Error" response Given new "UpdateLogsIndex" request And request contains "name" parameter from "REPLACE.ME" - And body with value {"daily_limit": 300000000, "daily_limit_reset": {"reset_time": "14:00", "reset_utc_offset": "+02:00"}, "daily_limit_warning_threshold_percentage": 70, "disable_daily_limit": false, "exclusion_filters": [{"filter": {"query": "*", "sample_rate": 1.0}, "name": "payment"}], "filter": {"query": "source:python"}, "num_flex_logs_retention_days": 360, "num_retention_days": 15} + And body with value {"daily_limit": 300000000, "daily_limit_reset": {"reset_time": "14:00", "reset_utc_offset": "+02:00"}, "daily_limit_warning_threshold_percentage": 70, "disable_daily_limit": false, "exclusion_filters": [{"filter": {"query": "*", "sample_rate": 1.0}, "name": "payment"}], "filter": {"query": "source:python"}, "num_flex_logs_retention_days": 360, "num_retention_days": 15, "tags": ["team:backend", "env:production"]} When the request is sent Then the response status is 400 Invalid Parameter Error @@ -81,7 +81,7 @@ Feature: Logs Indexes Scenario: Update an index returns "OK" response Given new "UpdateLogsIndex" request And request contains "name" parameter from "REPLACE.ME" - And body with value {"daily_limit": 300000000, "daily_limit_reset": {"reset_time": "14:00", "reset_utc_offset": "+02:00"}, "daily_limit_warning_threshold_percentage": 70, "disable_daily_limit": false, "exclusion_filters": [{"filter": {"query": "*", "sample_rate": 1.0}, "name": "payment"}], "filter": {"query": "source:python"}, "num_flex_logs_retention_days": 360, "num_retention_days": 15} + And body with value {"daily_limit": 300000000, "daily_limit_reset": {"reset_time": "14:00", "reset_utc_offset": "+02:00"}, "daily_limit_warning_threshold_percentage": 70, "disable_daily_limit": false, "exclusion_filters": [{"filter": {"query": "*", "sample_rate": 1.0}, "name": "payment"}], "filter": {"query": "source:python"}, "num_flex_logs_retention_days": 360, "num_retention_days": 15, "tags": ["team:backend", "env:production"]} When the request is sent Then the response status is 200 OK