Skip to main content

restriction_queries

Creates, updates, deletes, gets or lists a restriction_queries resource.

Overview

Namerestriction_queries
TypeResource
Iddatadog.logs.restriction_queries

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstringID of the restriction query. (example: 79a0e60a-644a-11ea-ad29-43329f7f58b5)
attributesobjectAttributes of the restriction query.
relationshipsobjectRelationships of the user object.
typestringRestriction query resource type. (logs_restriction_queries) (default: logs_restriction_queries, example: logs_restriction_queries)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_restriction_queryselectrestriction_query_idGet a restriction query in the organization specified by the restriction query's restriction_query_id.
list_restriction_queriesselectpage[size], page[number]Returns all restriction queries, including their names and IDs.
create_restriction_queryinsertCreate a new restriction query for your organization.
update_restriction_queryupdaterestriction_query_idEdit a restriction query.
replace_restriction_queryreplacerestriction_query_idReplace a restriction query.
delete_restriction_querydeleterestriction_query_idDeletes a restriction query.

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
restriction_query_idstringThe ID of the restriction query.
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.
page[number]integer (int64)Specific page number to return.
page[size]integer (int64)Number of items to return per page. The maximum allowed value is 100.

SELECT examples

Get a restriction query in the organization specified by the restriction query's restriction_query_id.

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

INSERT examples

Create a new restriction query for your organization.

INSERT INTO datadog.logs.restriction_queries (
data
)
SELECT
'{{ data }}'
RETURNING
data
;

UPDATE examples

Edit a restriction query.

UPDATE datadog.logs.restriction_queries
SET
data = '{{ data }}'
WHERE
restriction_query_id = '{{ restriction_query_id }}' --required
RETURNING
data;

REPLACE examples

Replace a restriction query.

REPLACE datadog.logs.restriction_queries
SET
data = '{{ data }}'
WHERE
restriction_query_id = '{{ restriction_query_id }}' --required
RETURNING
data;

DELETE examples

Deletes a restriction query.

DELETE FROM datadog.logs.restriction_queries
WHERE restriction_query_id = '{{ restriction_query_id }}' --required
;