restriction_policies
Creates, updates, deletes, gets or lists a restriction_policies resource.
Overview
| Name | restriction_policies |
| Type | Resource |
| Id | datadog.organization.restriction_policies |
Fields
The following fields are returned by SELECT queries:
- get_restriction_policy
| Name | Datatype | Description |
|---|---|---|
id | string | The identifier, always equivalent to the value specified in the resource_id path parameter. (example: dashboard:abc-def-ghi) |
attributes | object | Restriction policy attributes. |
type | string | Restriction policy type. (restriction_policy) (default: restriction_policy, example: restriction_policy) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_restriction_policy | select | resource_id | Retrieves the restriction policy associated with a specified resource. | |
update_restriction_policy | replace | resource_id, data | allow_self_lockout | Updates the restriction policy associated with a resource.<br /><br />#### Supported resources<br />Restriction policies can be applied to the following resources:<br />- Dashboards: dashboard<br />- Integration Services: integration-service<br />- Integration Webhooks: integration-webhook<br />- Notebooks: notebook<br />- Powerpacks: powerpack<br />- Reference Tables: reference-table<br />- Security Rules: security-rule<br />- Service Level Objectives: slo<br />- Synthetic Global Variables: synthetics-global-variable<br />- Synthetic Tests: synthetics-test<br />- Synthetic Private Locations: synthetics-private-location<br />- Monitors: monitor<br />- Workflows: workflow<br />- App Builder Apps: app-builder-app<br />- Connections: connection<br />- Connection Groups: connection-group<br />- RUM Applications: rum-application<br />- Cross Org Connections: cross-org-connection<br />- Spreadsheets: spreadsheet<br />- On-Call Schedules: on-call-schedule<br />- On-Call Escalation Policies: on-call-escalation-policy<br />- On-Call Team Routing Rules: on-call-team-routing-rules<br />- Logs Pipelines: logs-pipeline<br />- Case Management Projects: case-management-project<br />- Monitor Notification Rules: monitor-notification-rule<br />- Status Pages: status-page<br />- Feature Flags: feature-flag<br /><br />#### Supported relations for resources<br />Resource Type | Supported Relations<br />----------------------------|--------------------------<br />Dashboards | viewer, editor<br />Integration Services | viewer, editor<br />Integration Webhooks | viewer, editor<br />Notebooks | viewer, editor<br />Powerpacks | viewer, editor<br />Security Rules | viewer, editor<br />Service Level Objectives | viewer, editor<br />Synthetic Global Variables | viewer, editor<br />Synthetic Tests | viewer, editor<br />Synthetic Private Locations | viewer, editor<br />Monitors | viewer, editor<br />Reference Tables | viewer, editor<br />Workflows | viewer, runner, editor<br />App Builder Apps | viewer, editor<br />Connections | viewer, resolver, editor<br />Connection Groups | viewer, editor<br />RUM Application | viewer, editor<br />Cross Org Connections | viewer, editor<br />Spreadsheets | viewer, editor<br />On-Call Schedules | viewer, overrider, editor<br />On-Call Escalation Policies | viewer, editor<br />On-Call Team Routing Rules | viewer, editor<br />Logs Pipelines | viewer, processors_editor, editor<br />Case Management Projects | viewer, contributor, manager<br />Monitor Notification Rules | viewer, editor<br />Status Pages | viewer, responder, manager<br />Feature Flags | viewer, contributor, editor |
delete_restriction_policy | delete | resource_id | Deletes the restriction policy associated with a specified resource. |
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 |
|---|---|---|
resource_id | string | Identifier, formatted as type:id. Supported types: dashboard, integration-service, integration-webhook, notebook, powerpack, reference-table, security-rule, slo, synthetics-global-variable, synthetics-test, synthetics-private-location, monitor, workflow, app-builder-app, connection, connection-group, rum-application, cross-org-connection, spreadsheet, on-call-schedule, on-call-escalation-policy, on-call-team-routing-rules, logs-pipeline, case-management-project, monitor-notification-rule, status-page, feature-flag. (example: dashboard:abc-def-ghi) |
site | string | The 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. |
allow_self_lockout | boolean | Allows admins (users with the user_access_manage permission) to remove their own access from the resource if set to true. By default, this is set to false, preventing admins from locking themselves out. |
SELECT examples
- get_restriction_policy
Retrieves the restriction policy associated with a specified resource.
SELECT
id,
attributes,
type
FROM datadog.organization.restriction_policies
WHERE resource_id = '{{ resource_id }}' -- required
;
REPLACE examples
- update_restriction_policy
Updates the restriction policy associated with a resource.<br /><br />#### Supported resources<br />Restriction policies can be applied to the following resources:<br />- Dashboards: dashboard<br />- Integration Services: integration-service<br />- Integration Webhooks: integration-webhook<br />- Notebooks: notebook<br />- Powerpacks: powerpack<br />- Reference Tables: reference-table<br />- Security Rules: security-rule<br />- Service Level Objectives: slo<br />- Synthetic Global Variables: synthetics-global-variable<br />- Synthetic Tests: synthetics-test<br />- Synthetic Private Locations: synthetics-private-location<br />- Monitors: monitor<br />- Workflows: workflow<br />- App Builder Apps: app-builder-app<br />- Connections: connection<br />- Connection Groups: connection-group<br />- RUM Applications: rum-application<br />- Cross Org Connections: cross-org-connection<br />- Spreadsheets: spreadsheet<br />- On-Call Schedules: on-call-schedule<br />- On-Call Escalation Policies: on-call-escalation-policy<br />- On-Call Team Routing Rules: on-call-team-routing-rules<br />- Logs Pipelines: logs-pipeline<br />- Case Management Projects: case-management-project<br />- Monitor Notification Rules: monitor-notification-rule<br />- Status Pages: status-page<br />- Feature Flags: feature-flag<br /><br />#### Supported relations for resources<br />Resource Type | Supported Relations<br />----------------------------|--------------------------<br />Dashboards | viewer, editor<br />Integration Services | viewer, editor<br />Integration Webhooks | viewer, editor<br />Notebooks | viewer, editor<br />Powerpacks | viewer, editor<br />Security Rules | viewer, editor<br />Service Level Objectives | viewer, editor<br />Synthetic Global Variables | viewer, editor<br />Synthetic Tests | viewer, editor<br />Synthetic Private Locations | viewer, editor<br />Monitors | viewer, editor<br />Reference Tables | viewer, editor<br />Workflows | viewer, runner, editor<br />App Builder Apps | viewer, editor<br />Connections | viewer, resolver, editor<br />Connection Groups | viewer, editor<br />RUM Application | viewer, editor<br />Cross Org Connections | viewer, editor<br />Spreadsheets | viewer, editor<br />On-Call Schedules | viewer, overrider, editor<br />On-Call Escalation Policies | viewer, editor<br />On-Call Team Routing Rules | viewer, editor<br />Logs Pipelines | viewer, processors_editor, editor<br />Case Management Projects | viewer, contributor, manager<br />Monitor Notification Rules | viewer, editor<br />Status Pages | viewer, responder, manager<br />Feature Flags | viewer, contributor, editor
REPLACE datadog.organization.restriction_policies
SET
data = '{{ data }}'
WHERE
resource_id = '{{ resource_id }}' --required
AND data = '{{ data }}' --required
AND allow_self_lockout = {{ allow_self_lockout}}
RETURNING
data;
DELETE examples
- delete_restriction_policy
Deletes the restriction policy associated with a specified resource.
DELETE FROM datadog.organization.restriction_policies
WHERE resource_id = '{{ resource_id }}' --required
;