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
28 changes: 28 additions & 0 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49957,10 +49957,24 @@ components:
If it is set to "false", the tags will be deleted when the logs are sent to the archive.
example: false
type: boolean
lookup_attributes:
description: An array of attributes to use as lookup keys for the archive.
example: ["trace_id", "user_id"]
items:
description: A lookup attribute name.
type: string
type: array
name:
description: The archive name.
example: Nginx Archive
type: string
partitioning_attributes:
description: An array of attributes to use as partition keys for the archive. The attribute used most frequently for querying should be first.
example: ["service", "status"]
items:
description: A partition attribute name.
type: string
type: array
query:
description: The archive query/filter. Logs matching this query are included in the archive.
example: source:nginx
Expand Down Expand Up @@ -50016,10 +50030,24 @@ components:
If it is set to "false", the tags will be deleted when the logs are sent to the archive.
example: false
type: boolean
lookup_attributes:
description: An array of attributes to use as lookup keys for the archive.
example: ["trace_id", "user_id"]
items:
description: A lookup attribute name.
type: string
type: array
name:
description: The archive name.
example: Nginx Archive
type: string
partitioning_attributes:
description: An array of attributes to use as partition keys for the archive. The attribute used most frequently for querying should be first.
example: ["service", "status"]
items:
description: A partition attribute name.
type: string
type: array
query:
description: The archive query/filter. Logs matching this query are included in the archive.
example: source:nginx
Expand Down
8 changes: 8 additions & 0 deletions examples/v2/logs-archives/CreateLogsArchive.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,15 @@
type: DatadogAPIClient::V2::LogsArchiveDestinationAzureType::AZURE,
}),
include_tags: false,
lookup_attributes: [
"trace_id",
"user_id",
],
name: "Nginx Archive",
partitioning_attributes: [
"service",
"status",
],
query: "source:nginx",
rehydration_max_scan_size_in_gb: 100,
rehydration_tags: [
Expand Down
8 changes: 8 additions & 0 deletions examples/v2/logs-archives/UpdateLogsArchive.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,15 @@
type: DatadogAPIClient::V2::LogsArchiveDestinationAzureType::AZURE,
}),
include_tags: false,
lookup_attributes: [
"trace_id",
"user_id",
],
name: "Nginx Archive",
partitioning_attributes: [
"service",
"status",
],
query: "source:nginx",
rehydration_max_scan_size_in_gb: 100,
rehydration_tags: [
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": {"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"}}
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, "lookup_attributes": ["trace_id", "user_id"], "name": "Nginx Archive", "partitioning_attributes": ["service", "status"], "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": {"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"}}
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, "lookup_attributes": ["trace_id", "user_id"], "name": "Nginx Archive", "partitioning_attributes": ["service", "status"], "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": {"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"}}
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, "lookup_attributes": ["trace_id", "user_id"], "name": "Nginx Archive", "partitioning_attributes": ["service", "status"], "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": {"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"}}
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, "lookup_attributes": ["trace_id", "user_id"], "name": "Nginx Archive", "partitioning_attributes": ["service", "status"], "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": {"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"}}
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, "lookup_attributes": ["trace_id", "user_id"], "name": "Nginx Archive", "partitioning_attributes": ["service", "status"], "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
26 changes: 25 additions & 1 deletion lib/datadog_api_client/v2/models/logs_archive_attributes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,15 @@ class LogsArchiveAttributes
# If it is set to "false", the tags will be deleted when the logs are sent to the archive.
attr_accessor :include_tags

# An array of attributes to use as lookup keys for the archive.
attr_accessor :lookup_attributes

# The archive name.
attr_reader :name

# An array of attributes to use as partition keys for the archive. The attribute used most frequently for querying should be first.
attr_accessor :partitioning_attributes

# The archive query/filter. Logs matching this query are included in the archive.
attr_reader :query

Expand All @@ -55,7 +61,9 @@ def self.attribute_map
:'compression_method' => :'compression_method',
:'destination' => :'destination',
:'include_tags' => :'include_tags',
:'lookup_attributes' => :'lookup_attributes',
:'name' => :'name',
:'partitioning_attributes' => :'partitioning_attributes',
:'query' => :'query',
:'rehydration_max_scan_size_in_gb' => :'rehydration_max_scan_size_in_gb',
:'rehydration_tags' => :'rehydration_tags',
Expand All @@ -70,7 +78,9 @@ def self.openapi_types
:'compression_method' => :'LogsArchiveAttributesCompressionMethod',
:'destination' => :'LogsArchiveDestination',
:'include_tags' => :'Boolean',
:'lookup_attributes' => :'Array<String>',
:'name' => :'String',
:'partitioning_attributes' => :'Array<String>',
:'query' => :'String',
:'rehydration_max_scan_size_in_gb' => :'Integer',
:'rehydration_tags' => :'Array<String>',
Expand Down Expand Up @@ -117,10 +127,22 @@ def initialize(attributes = {})
self.include_tags = attributes[:'include_tags']
end

if attributes.key?(:'lookup_attributes')
if (value = attributes[:'lookup_attributes']).is_a?(Array)
self.lookup_attributes = value
end
end

if attributes.key?(:'name')
self.name = attributes[:'name']
end

if attributes.key?(:'partitioning_attributes')
if (value = attributes[:'partitioning_attributes']).is_a?(Array)
self.partitioning_attributes = value
end
end

if attributes.key?(:'query')
self.query = attributes[:'query']
end
Expand Down Expand Up @@ -198,7 +220,9 @@ def ==(o)
compression_method == o.compression_method &&
destination == o.destination &&
include_tags == o.include_tags &&
lookup_attributes == o.lookup_attributes &&
name == o.name &&
partitioning_attributes == o.partitioning_attributes &&
query == o.query &&
rehydration_max_scan_size_in_gb == o.rehydration_max_scan_size_in_gb &&
rehydration_tags == o.rehydration_tags &&
Expand All @@ -210,7 +234,7 @@ def ==(o)
# @return [Integer] Hash code
# @!visibility private
def hash
[compression_method, destination, include_tags, name, query, rehydration_max_scan_size_in_gb, rehydration_tags, state, additional_properties].hash
[compression_method, destination, include_tags, lookup_attributes, name, partitioning_attributes, query, rehydration_max_scan_size_in_gb, rehydration_tags, state, additional_properties].hash
end
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,15 @@ class LogsArchiveCreateRequestAttributes
# If it is set to "false", the tags will be deleted when the logs are sent to the archive.
attr_accessor :include_tags

# An array of attributes to use as lookup keys for the archive.
attr_accessor :lookup_attributes

# The archive name.
attr_reader :name

# An array of attributes to use as partition keys for the archive. The attribute used most frequently for querying should be first.
attr_accessor :partitioning_attributes

# The archive query/filter. Logs matching this query are included in the archive.
attr_reader :query

Expand All @@ -52,7 +58,9 @@ def self.attribute_map
:'compression_method' => :'compression_method',
:'destination' => :'destination',
:'include_tags' => :'include_tags',
:'lookup_attributes' => :'lookup_attributes',
:'name' => :'name',
:'partitioning_attributes' => :'partitioning_attributes',
:'query' => :'query',
:'rehydration_max_scan_size_in_gb' => :'rehydration_max_scan_size_in_gb',
:'rehydration_tags' => :'rehydration_tags'
Expand All @@ -66,7 +74,9 @@ def self.openapi_types
:'compression_method' => :'LogsArchiveAttributesCompressionMethod',
:'destination' => :'LogsArchiveCreateRequestDestination',
:'include_tags' => :'Boolean',
:'lookup_attributes' => :'Array<String>',
:'name' => :'String',
:'partitioning_attributes' => :'Array<String>',
:'query' => :'String',
:'rehydration_max_scan_size_in_gb' => :'Integer',
:'rehydration_tags' => :'Array<String>'
Expand Down Expand Up @@ -111,10 +121,22 @@ def initialize(attributes = {})
self.include_tags = attributes[:'include_tags']
end

if attributes.key?(:'lookup_attributes')
if (value = attributes[:'lookup_attributes']).is_a?(Array)
self.lookup_attributes = value
end
end

if attributes.key?(:'name')
self.name = attributes[:'name']
end

if attributes.key?(:'partitioning_attributes')
if (value = attributes[:'partitioning_attributes']).is_a?(Array)
self.partitioning_attributes = value
end
end

if attributes.key?(:'query')
self.query = attributes[:'query']
end
Expand Down Expand Up @@ -199,7 +221,9 @@ def ==(o)
compression_method == o.compression_method &&
destination == o.destination &&
include_tags == o.include_tags &&
lookup_attributes == o.lookup_attributes &&
name == o.name &&
partitioning_attributes == o.partitioning_attributes &&
query == o.query &&
rehydration_max_scan_size_in_gb == o.rehydration_max_scan_size_in_gb &&
rehydration_tags == o.rehydration_tags &&
Expand All @@ -210,7 +234,7 @@ def ==(o)
# @return [Integer] Hash code
# @!visibility private
def hash
[compression_method, destination, include_tags, name, query, rehydration_max_scan_size_in_gb, rehydration_tags, additional_properties].hash
[compression_method, destination, include_tags, lookup_attributes, name, partitioning_attributes, query, rehydration_max_scan_size_in_gb, rehydration_tags, additional_properties].hash
end
end
end
Loading