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
20 changes: 20 additions & 0 deletions .generator/schemas/v1/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion examples/v1/logs-indexes/CreateLogsIndex.java
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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);
Expand Down
4 changes: 3 additions & 1 deletion examples/v1/logs-indexes/UpdateLogsIndex.java
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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);
Expand Down
38 changes: 37 additions & 1 deletion src/main/java/com/datadog/api/client/v1/model/LogsIndex.java
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -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<String> tags = null;

public LogsIndex() {}

@JsonCreator
Expand Down Expand Up @@ -279,6 +283,35 @@ public void setNumRetentionDays(Long numRetentionDays) {
this.numRetentionDays = numRetentionDays;
}

public LogsIndex tags(List<String> 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 <code>key:value</code> format.
*
* @return tags
*/
@jakarta.annotation.Nullable
@JsonProperty(JSON_PROPERTY_TAGS)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public List<String> getTags() {
return tags;
}

public void setTags(List<String> 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.
Expand Down Expand Up @@ -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);
}

Expand All @@ -361,6 +395,7 @@ public int hashCode() {
name,
numFlexLogsRetentionDays,
numRetentionDays,
tags,
additionalProperties);
}

Expand All @@ -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");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -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<String> tags = null;

public LogsIndexUpdateRequest() {}

@JsonCreator
Expand Down Expand Up @@ -269,6 +273,35 @@ public void setNumRetentionDays(Long numRetentionDays) {
this.numRetentionDays = numRetentionDays;
}

public LogsIndexUpdateRequest tags(List<String> 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 <code>key:value</code> format.
*
* @return tags
*/
@jakarta.annotation.Nullable
@JsonProperty(JSON_PROPERTY_TAGS)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public List<String> getTags() {
return tags;
}

public void setTags(List<String> 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.
Expand Down Expand Up @@ -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);
}

Expand All @@ -350,6 +384,7 @@ public int hashCode() {
filter,
numFlexLogsRetentionDays,
numRetentionDays,
tags,
additionalProperties);
}

Expand All @@ -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");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -73,15 +73,15 @@ 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

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

Expand Down
Loading