Skip to main content

archive_read_roles

Creates, updates, deletes, gets or lists an archive_read_roles resource.

Overview

Namearchive_read_roles
TypeResource
Iddatadog.logs.archive_read_roles

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstringThe unique identifier of the role.
attributesobjectAttributes of the role.
relationshipsobjectRelationships of the role object returned by the API.
typestringRoles type. (roles) (default: roles, example: roles)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
list_archive_read_rolesselectarchive_idReturns all read roles a given archive is restricted to.
add_read_role_to_archiveinsertarchive_idAdds a read role to an archive. ([Roles API](https:​//docs.datadoghq.com/api/v2/roles/))
remove_role_from_archivedeletearchive_idRemoves a role from an archive. ([Roles API](https:​//docs.datadoghq.com/api/v2/roles/))

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.

NameDatatypeDescription
archive_idstringThe ID of the archive.
sitestringThe Datadog site (region) for your organization, for example datadoghq.com, us3.datadoghq.com, us5.datadoghq.com, ap1.datadoghq.com, ap2.datadoghq.com, datadoghq.eu, ddog-gov.com. Resolved from the DD_SITE environment variable when set. Optional: defaults to datadoghq.com, or the value of the DD_SITE environment variable when set; a WHERE value overrides both.

SELECT examples

Returns all read roles a given archive is restricted to.

SELECT
id,
attributes,
relationships,
type
FROM datadog.logs.archive_read_roles
WHERE archive_id = '{{ archive_id }}' -- required
;

INSERT examples

Adds a read role to an archive. (Roles API)

INSERT INTO datadog.logs.archive_read_roles (
data,
archive_id
)
SELECT
'{{ data }}',
'{{ archive_id }}'
;

DELETE examples

Removes a role from an archive. (Roles API)

DELETE FROM datadog.logs.archive_read_roles
WHERE archive_id = '{{ archive_id }}' --required
;