archives
Creates, updates, deletes, gets or lists an archives
resource.
Overview
Name | archives |
Type | Resource |
Id | datadog.logs.archives |
Fields
The following fields are returned by SELECT
queries:
- get_logs_archive
- list_logs_archives
Name | Datatype | Description |
---|---|---|
id | string | The archive ID. (example: a2zcMylnM4OCHpYusxIi3g) |
attributes | object | The attributes associated with the archive. |
type | string | The type of the resource. The value should always be archives. (default: archives, example: archives) |
Name | Datatype | Description |
---|---|---|
id | string | The archive ID. (example: a2zcMylnM4OCHpYusxIi3g) |
attributes | object | The attributes associated with the archive. |
type | string | The type of the resource. The value should always be archives. (default: archives, example: archives) |
Methods
The following methods are available for this resource:
Name | Accessible by | Required Params | Optional Params | Description |
---|---|---|---|---|
get_logs_archive | select | archive_id , region | Get a specific archive from your organization. | |
list_logs_archives | select | region | Get the list of configured logs archives with their definitions. | |
create_logs_archive | insert | region | Create an archive in your organization. | |
update_logs_archive | replace | archive_id , region | Update a given archive configuration. Note: Using this method updates your archive configuration by replacing your current configuration with the new one sent to your Datadog organization. | |
delete_logs_archive | delete | archive_id , region | Delete a given archive from your organization. |
Parameters
Parameters can be passed in the WHERE
clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
Name | Datatype | Description |
---|---|---|
archive_id | string | The ID of the archive. |
region | string | (default: datadoghq.com) |
SELECT
examples
- get_logs_archive
- list_logs_archives
Get a specific archive from your organization.
SELECT
id,
attributes,
type
FROM datadog.logs.archives
WHERE archive_id = '{{ archive_id }}' -- required
AND region = '{{ region }}' -- required
;
Get the list of configured logs archives with their definitions.
SELECT
id,
attributes,
type
FROM datadog.logs.archives
WHERE region = '{{ region }}' -- required
;
INSERT
examples
- create_logs_archive
- Manifest
Create an archive in your organization.
INSERT INTO datadog.logs.archives (
data__data,
region
)
SELECT
'{{ data }}',
'{{ region }}'
RETURNING
data
;
# Description fields are for documentation purposes
- name: archives
props:
- name: region
value: string
description: Required parameter for the archives resource.
- name: data
value: object
description: |
The definition of an archive.
REPLACE
examples
- update_logs_archive
Update a given archive configuration.
Note: Using this method updates your archive configuration by replacing
your current configuration with the new one sent to your Datadog organization.
REPLACE datadog.logs.archives
SET
data__data = '{{ data }}'
WHERE
archive_id = '{{ archive_id }}' --required
AND region = '{{ region }}' --required
RETURNING
data;
DELETE
examples
- delete_logs_archive
Delete a given archive from your organization.
DELETE FROM datadog.logs.archives
WHERE archive_id = '{{ archive_id }}' --required
AND region = '{{ region }}' --required
;