Logs Restriction Queries

Note: This endpoint is in public beta. If you have any feedback, contact Datadog support.

A Restriction Query is a logs query that restricts which logs the logs_read_data permission grants read access to. For users whose roles have Restriction Queries, any log query they make only returns those log events that also match one of their Restriction Queries. This is true whether the user queries log events from any log-related feature, including the log explorer, Live Tail, re-hydration, or a dashboard widget.

Restriction Queries currently only support use of the following components of log events:

  • Reserved attributes
  • The log message
  • Tags

To restrict read access on log data, add a team tag to log events to indicate which teams own them, and then scope Restriction Queries to the relevant values of the team tag. Tags can be applied to log events in many ways, and a log event can have multiple tags with the same key (like team) and different values. This means the same log event can be visible to roles whose restriction queries are scoped to different team values.

You need an API and application key with Admin rights to interact with this endpoint.

See How to Set Up RBAC for Logs for details on how to add restriction queries.

Note: This endpoint is in public beta. If you have any feedback, contact Datadog support.

GET https://api.ap1.datadoghq.com/api/v2/logs/config/restriction_querieshttps://api.datadoghq.eu/api/v2/logs/config/restriction_querieshttps://api.ddog-gov.com/api/v2/logs/config/restriction_querieshttps://api.datadoghq.com/api/v2/logs/config/restriction_querieshttps://api.us3.datadoghq.com/api/v2/logs/config/restriction_querieshttps://api.us5.datadoghq.com/api/v2/logs/config/restriction_queries

개요

Returns all restriction queries, including their names and IDs.

인수

쿼리 문자열

이름

유형

설명

page[size]

integer

Size for a given page. The maximum allowed value is 100.

page[number]

integer

Specific page number to return.

응답

OK

Response containing information about multiple restriction queries.

Expand All

항목

유형

설명

data

[object]

Array of returned restriction queries.

attributes

object

Attributes of the restriction query.

created_at

date-time

Creation time of the restriction query.

modified_at

date-time

Time of last restriction query modification.

restriction_query

string

The query that defines the restriction. Only the content matching the query can be returned.

id

string

ID of the restriction query.

type

string

Restriction queries type.

default: logs_restriction_queries

{
  "data": [
    {
      "attributes": {
        "created_at": "2020-03-17T21:06:44.000Z",
        "modified_at": "2020-03-17T21:15:15.000Z",
        "restriction_query": "env:sandbox"
      },
      "id": "79a0e60a-644a-11ea-ad29-43329f7f58b5",
      "type": "logs_restriction_queries"
    }
  ]
}

Authentication error

API error response.

Expand All

항목

유형

설명

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

Too many requests

API error response.

Expand All

항목

유형

설명

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

코드 사례

                  # Curl command
curl -X GET "https://api.ap1.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/logs/config/restriction_queries" \ -H "Accept: application/json" \ -H "DD-API-KEY: ${DD_API_KEY}" \ -H "DD-APPLICATION-KEY: ${DD_APP_KEY}"

Note: This endpoint is in public beta. If you have any feedback, contact Datadog support.

POST https://api.ap1.datadoghq.com/api/v2/logs/config/restriction_querieshttps://api.datadoghq.eu/api/v2/logs/config/restriction_querieshttps://api.ddog-gov.com/api/v2/logs/config/restriction_querieshttps://api.datadoghq.com/api/v2/logs/config/restriction_querieshttps://api.us3.datadoghq.com/api/v2/logs/config/restriction_querieshttps://api.us5.datadoghq.com/api/v2/logs/config/restriction_queries

개요

Create a new restriction query for your organization. This endpoint requires the user_access_manage permission.

요청

Body Data (required)

Expand All

항목

유형

설명

data

object

Data related to the creation of a restriction query.

attributes

object

Attributes of the created restriction query.

restriction_query

string

The restriction query.

type

enum

Restriction query resource type. Allowed enum values: logs_restriction_queries

default: logs_restriction_queries

{
  "data": {
    "attributes": {
      "restriction_query": "env:sandbox"
    },
    "type": "logs_restriction_queries"
  }
}

응답

OK

Response containing information about a single restriction query.

Expand All

항목

유형

설명

data

object

Restriction query object returned by the API.

attributes

object

Attributes of the restriction query.

created_at

date-time

Creation time of the restriction query.

modified_at

date-time

Time of last restriction query modification.

restriction_query

string

The query that defines the restriction. Only the content matching the query can be returned.

id

string

ID of the restriction query.

type

string

Restriction queries type.

default: logs_restriction_queries

{
  "data": {
    "attributes": {
      "created_at": "2020-03-17T21:06:44.000Z",
      "modified_at": "2020-03-17T21:15:15.000Z",
      "restriction_query": "env:sandbox"
    },
    "id": "79a0e60a-644a-11ea-ad29-43329f7f58b5",
    "type": "logs_restriction_queries"
  }
}

Bad Request

API error response.

Expand All

항목

유형

설명

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

Authentication error

API error response.

Expand All

항목

유형

설명

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

Too many requests

API error response.

Expand All

항목

유형

설명

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

코드 사례

                  # Curl command
curl -X POST "https://api.ap1.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/logs/config/restriction_queries" \ -H "Accept: application/json" \ -H "Content-Type: application/json" \ -H "DD-API-KEY: ${DD_API_KEY}" \ -H "DD-APPLICATION-KEY: ${DD_APP_KEY}" \ -d @- << EOF {} EOF

Note: This endpoint is in public beta. If you have any feedback, contact Datadog support.

GET https://api.ap1.datadoghq.com/api/v2/logs/config/restriction_queries/{restriction_query_id}https://api.datadoghq.eu/api/v2/logs/config/restriction_queries/{restriction_query_id}https://api.ddog-gov.com/api/v2/logs/config/restriction_queries/{restriction_query_id}https://api.datadoghq.com/api/v2/logs/config/restriction_queries/{restriction_query_id}https://api.us3.datadoghq.com/api/v2/logs/config/restriction_queries/{restriction_query_id}https://api.us5.datadoghq.com/api/v2/logs/config/restriction_queries/{restriction_query_id}

개요

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

인수

경로 파라미터

이름

유형

설명

restriction_query_id [required]

string

The ID of the restriction query.

응답

OK

Response containing information about a single restriction query.

Expand All

항목

유형

설명

data

object

Restriction query object returned by the API.

attributes

object

Attributes of the restriction query.

created_at

date-time

Creation time of the restriction query.

modified_at

date-time

Time of last restriction query modification.

restriction_query

string

The query that defines the restriction. Only the content matching the query can be returned.

id

string

ID of the restriction query.

relationships

object

Relationships of the restriction query object.

roles

object

Relationship to roles.

data

[object]

An array containing type and the unique identifier of a role.

id

string

The unique identifier of the role.

type

enum

Roles type. Allowed enum values: roles

default: roles

type

enum

Restriction query resource type. Allowed enum values: logs_restriction_queries

default: logs_restriction_queries

included

[ <oneOf>]

Array of objects related to the restriction query.

Option 1

object

Partial role object.

attributes

object

Attributes of the role for a restriction query.

name

string

The role name.

id

string

ID of the role.

type

string

Role resource type.

default: roles

{
  "data": {
    "attributes": {
      "created_at": "2020-03-17T21:06:44.000Z",
      "modified_at": "2020-03-17T21:15:15.000Z",
      "restriction_query": "env:sandbox"
    },
    "id": "79a0e60a-644a-11ea-ad29-43329f7f58b5",
    "relationships": {
      "roles": {
        "data": [
          {
            "id": "3653d3c6-0c75-11ea-ad28-fb5701eabc7d",
            "type": "roles"
          }
        ]
      }
    },
    "type": "logs_restriction_queries"
  },
  "included": [
    {
      "attributes": {
        "name": "Datadog Admin Role"
      },
      "id": "<ROLE_ID>",
      "type": "roles"
    }
  ]
}

Bad Request

API error response.

Expand All

항목

유형

설명

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

Authentication error

API error response.

Expand All

항목

유형

설명

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

Not found

API error response.

Expand All

항목

유형

설명

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

Too many requests

API error response.

Expand All

항목

유형

설명

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

코드 사례

                  # Path parameters
export restriction_query_id="CHANGE_ME"
# Curl command
curl -X GET "https://api.ap1.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/logs/config/restriction_queries/${restriction_query_id}" \ -H "Accept: application/json" \ -H "DD-API-KEY: ${DD_API_KEY}" \ -H "DD-APPLICATION-KEY: ${DD_APP_KEY}"

Note: This endpoint is in public beta. If you have any feedback, contact Datadog support.

PATCH https://api.ap1.datadoghq.com/api/v2/logs/config/restriction_queries/{restriction_query_id}https://api.datadoghq.eu/api/v2/logs/config/restriction_queries/{restriction_query_id}https://api.ddog-gov.com/api/v2/logs/config/restriction_queries/{restriction_query_id}https://api.datadoghq.com/api/v2/logs/config/restriction_queries/{restriction_query_id}https://api.us3.datadoghq.com/api/v2/logs/config/restriction_queries/{restriction_query_id}https://api.us5.datadoghq.com/api/v2/logs/config/restriction_queries/{restriction_query_id}

개요

Edit a restriction query. This endpoint requires the user_access_manage permission.

인수

경로 파라미터

이름

유형

설명

restriction_query_id [required]

string

The ID of the restriction query.

요청

Body Data (required)

Expand All

항목

유형

설명

data

object

Data related to the update of a restriction query.

attributes

object

Attributes of the edited restriction query.

restriction_query

string

The restriction query.

type

enum

Restriction query resource type. Allowed enum values: logs_restriction_queries

default: logs_restriction_queries

{
  "data": {
    "attributes": {
      "restriction_query": "env:sandbox"
    },
    "type": "logs_restriction_queries"
  }
}

응답

OK

Response containing information about a single restriction query.

Expand All

항목

유형

설명

data

object

Restriction query object returned by the API.

attributes

object

Attributes of the restriction query.

created_at

date-time

Creation time of the restriction query.

modified_at

date-time

Time of last restriction query modification.

restriction_query

string

The query that defines the restriction. Only the content matching the query can be returned.

id

string

ID of the restriction query.

type

string

Restriction queries type.

default: logs_restriction_queries

{
  "data": {
    "attributes": {
      "created_at": "2020-03-17T21:06:44.000Z",
      "modified_at": "2020-03-17T21:15:15.000Z",
      "restriction_query": "env:sandbox"
    },
    "id": "79a0e60a-644a-11ea-ad29-43329f7f58b5",
    "type": "logs_restriction_queries"
  }
}

Bad Request

API error response.

Expand All

항목

유형

설명

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

Authentication error

API error response.

Expand All

항목

유형

설명

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

Not found

API error response.

Expand All

항목

유형

설명

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

Too many requests

API error response.

Expand All

항목

유형

설명

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

코드 사례

                  # Path parameters
export restriction_query_id="CHANGE_ME"
# Curl command
curl -X PATCH "https://api.ap1.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/logs/config/restriction_queries/${restriction_query_id}" \ -H "Accept: application/json" \ -H "Content-Type: application/json" \ -H "DD-API-KEY: ${DD_API_KEY}" \ -H "DD-APPLICATION-KEY: ${DD_APP_KEY}" \ -d @- << EOF {} EOF

Note: This endpoint is in public beta. If you have any feedback, contact Datadog support.

DELETE https://api.ap1.datadoghq.com/api/v2/logs/config/restriction_queries/{restriction_query_id}https://api.datadoghq.eu/api/v2/logs/config/restriction_queries/{restriction_query_id}https://api.ddog-gov.com/api/v2/logs/config/restriction_queries/{restriction_query_id}https://api.datadoghq.com/api/v2/logs/config/restriction_queries/{restriction_query_id}https://api.us3.datadoghq.com/api/v2/logs/config/restriction_queries/{restriction_query_id}https://api.us5.datadoghq.com/api/v2/logs/config/restriction_queries/{restriction_query_id}

개요

Deletes a restriction query. This endpoint requires the user_access_manage permission.

인수

경로 파라미터

이름

유형

설명

restriction_query_id [required]

string

The ID of the restriction query.

응답

OK

Bad Request

API error response.

Expand All

항목

유형

설명

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

Authentication error

API error response.

Expand All

항목

유형

설명

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

Not found

API error response.

Expand All

항목

유형

설명

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

Too many requests

API error response.

Expand All

항목

유형

설명

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

코드 사례

                  # Path parameters
export restriction_query_id="CHANGE_ME"
# Curl command
curl -X DELETE "https://api.ap1.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/logs/config/restriction_queries/${restriction_query_id}" \ -H "DD-API-KEY: ${DD_API_KEY}" \ -H "DD-APPLICATION-KEY: ${DD_APP_KEY}"

Note: This endpoint is in public beta. If you have any feedback, contact Datadog support.

GET https://api.ap1.datadoghq.com/api/v2/logs/config/restriction_queries/{restriction_query_id}/roleshttps://api.datadoghq.eu/api/v2/logs/config/restriction_queries/{restriction_query_id}/roleshttps://api.ddog-gov.com/api/v2/logs/config/restriction_queries/{restriction_query_id}/roleshttps://api.datadoghq.com/api/v2/logs/config/restriction_queries/{restriction_query_id}/roleshttps://api.us3.datadoghq.com/api/v2/logs/config/restriction_queries/{restriction_query_id}/roleshttps://api.us5.datadoghq.com/api/v2/logs/config/restriction_queries/{restriction_query_id}/roles

개요

Returns all roles that have a given restriction query.

인수

경로 파라미터

이름

유형

설명

restriction_query_id [required]

string

The ID of the restriction query.

쿼리 문자열

이름

유형

설명

page[size]

integer

Size for a given page. The maximum allowed value is 100.

page[number]

integer

Specific page number to return.

응답

OK

Response containing information about roles attached to a restriction query.

Expand All

항목

유형

설명

data

[object]

Array of roles.

attributes

object

Attributes of the role for a restriction query.

name

string

The role name.

id

string

ID of the role.

type

string

Role resource type.

default: roles

{
  "data": [
    {
      "attributes": {
        "name": "Datadog Admin Role"
      },
      "id": "<ROLE_ID>",
      "type": "roles"
    }
  ]
}

Bad Request

API error response.

Expand All

항목

유형

설명

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

Authentication error

API error response.

Expand All

항목

유형

설명

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

Not found

API error response.

Expand All

항목

유형

설명

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

Too many requests

API error response.

Expand All

항목

유형

설명

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

코드 사례

                  # Path parameters
export restriction_query_id="CHANGE_ME"
# Curl command
curl -X GET "https://api.ap1.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/logs/config/restriction_queries/${restriction_query_id}/roles" \ -H "Accept: application/json" \ -H "DD-API-KEY: ${DD_API_KEY}" \ -H "DD-APPLICATION-KEY: ${DD_APP_KEY}"

Note: This endpoint is in public beta. If you have any feedback, contact Datadog support.

POST https://api.ap1.datadoghq.com/api/v2/logs/config/restriction_queries/{restriction_query_id}/roleshttps://api.datadoghq.eu/api/v2/logs/config/restriction_queries/{restriction_query_id}/roleshttps://api.ddog-gov.com/api/v2/logs/config/restriction_queries/{restriction_query_id}/roleshttps://api.datadoghq.com/api/v2/logs/config/restriction_queries/{restriction_query_id}/roleshttps://api.us3.datadoghq.com/api/v2/logs/config/restriction_queries/{restriction_query_id}/roleshttps://api.us5.datadoghq.com/api/v2/logs/config/restriction_queries/{restriction_query_id}/roles

개요

Adds a role to a restriction query. This endpoint requires the user_access_manage permission.

인수

경로 파라미터

이름

유형

설명

restriction_query_id [required]

string

The ID of the restriction query.

요청

Body Data (required)

Expand All

항목

유형

설명

data

object

Relationship to role object.

id

string

The unique identifier of the role.

type

enum

Roles type. Allowed enum values: roles

default: roles

{
  "data": {
    "id": "3653d3c6-0c75-11ea-ad28-fb5701eabc7d",
    "type": "roles"
  }
}

응답

OK

Bad Request

API error response.

Expand All

항목

유형

설명

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

Authentication error

API error response.

Expand All

항목

유형

설명

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

Not found

API error response.

Expand All

항목

유형

설명

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

Too many requests

API error response.

Expand All

항목

유형

설명

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

코드 사례

                  # Path parameters
export restriction_query_id="CHANGE_ME"
# Curl command
curl -X POST "https://api.ap1.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/logs/config/restriction_queries/${restriction_query_id}/roles" \ -H "Content-Type: application/json" \ -H "DD-API-KEY: ${DD_API_KEY}" \ -H "DD-APPLICATION-KEY: ${DD_APP_KEY}" \ -d @- << EOF {} EOF

Note: This endpoint is in public beta. If you have any feedback, contact Datadog support.

DELETE https://api.ap1.datadoghq.com/api/v2/logs/config/restriction_queries/{restriction_query_id}/roleshttps://api.datadoghq.eu/api/v2/logs/config/restriction_queries/{restriction_query_id}/roleshttps://api.ddog-gov.com/api/v2/logs/config/restriction_queries/{restriction_query_id}/roleshttps://api.datadoghq.com/api/v2/logs/config/restriction_queries/{restriction_query_id}/roleshttps://api.us3.datadoghq.com/api/v2/logs/config/restriction_queries/{restriction_query_id}/roleshttps://api.us5.datadoghq.com/api/v2/logs/config/restriction_queries/{restriction_query_id}/roles

개요

Removes a role from a restriction query. This endpoint requires the user_access_manage permission.

인수

경로 파라미터

이름

유형

설명

restriction_query_id [required]

string

The ID of the restriction query.

요청

Body Data (required)

Expand All

항목

유형

설명

data

object

Relationship to role object.

id

string

The unique identifier of the role.

type

enum

Roles type. Allowed enum values: roles

default: roles

{
  "data": {
    "id": "3653d3c6-0c75-11ea-ad28-fb5701eabc7d",
    "type": "roles"
  }
}

응답

OK

Bad Request

API error response.

Expand All

항목

유형

설명

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

Authentication error

API error response.

Expand All

항목

유형

설명

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

Not found

API error response.

Expand All

항목

유형

설명

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

Too many requests

API error response.

Expand All

항목

유형

설명

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

코드 사례

                  # Path parameters
export restriction_query_id="CHANGE_ME"
# Curl command
curl -X DELETE "https://api.ap1.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/logs/config/restriction_queries/${restriction_query_id}/roles" \ -H "Content-Type: application/json" \ -H "DD-API-KEY: ${DD_API_KEY}" \ -H "DD-APPLICATION-KEY: ${DD_APP_KEY}" \ -d @- << EOF {} EOF

Note: This endpoint is in public beta. If you have any feedback, contact Datadog support.

GET https://api.ap1.datadoghq.com/api/v2/logs/config/restriction_queries/user/{user_id}https://api.datadoghq.eu/api/v2/logs/config/restriction_queries/user/{user_id}https://api.ddog-gov.com/api/v2/logs/config/restriction_queries/user/{user_id}https://api.datadoghq.com/api/v2/logs/config/restriction_queries/user/{user_id}https://api.us3.datadoghq.com/api/v2/logs/config/restriction_queries/user/{user_id}https://api.us5.datadoghq.com/api/v2/logs/config/restriction_queries/user/{user_id}

개요

Get all restriction queries for a given user.

인수

경로 파라미터

이름

유형

설명

user_id [required]

string

The ID of the user.

응답

OK

Response containing information about multiple restriction queries.

Expand All

항목

유형

설명

data

[object]

Array of returned restriction queries.

attributes

object

Attributes of the restriction query.

created_at

date-time

Creation time of the restriction query.

modified_at

date-time

Time of last restriction query modification.

restriction_query

string

The query that defines the restriction. Only the content matching the query can be returned.

id

string

ID of the restriction query.

type

string

Restriction queries type.

default: logs_restriction_queries

{
  "data": [
    {
      "attributes": {
        "created_at": "2020-03-17T21:06:44.000Z",
        "modified_at": "2020-03-17T21:15:15.000Z",
        "restriction_query": "env:sandbox"
      },
      "id": "79a0e60a-644a-11ea-ad29-43329f7f58b5",
      "type": "logs_restriction_queries"
    }
  ]
}

Bad Request

API error response.

Expand All

항목

유형

설명

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

Authentication error

API error response.

Expand All

항목

유형

설명

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

Too many requests

API error response.

Expand All

항목

유형

설명

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

코드 사례

                  # Path parameters
export user_id="CHANGE_ME"
# Curl command
curl -X GET "https://api.ap1.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/logs/config/restriction_queries/user/${user_id}" \ -H "Accept: application/json" \ -H "DD-API-KEY: ${DD_API_KEY}" \ -H "DD-APPLICATION-KEY: ${DD_APP_KEY}"

Note: This endpoint is in public beta. If you have any feedback, contact Datadog support.

GET https://api.ap1.datadoghq.com/api/v2/logs/config/restriction_queries/role/{role_id}https://api.datadoghq.eu/api/v2/logs/config/restriction_queries/role/{role_id}https://api.ddog-gov.com/api/v2/logs/config/restriction_queries/role/{role_id}https://api.datadoghq.com/api/v2/logs/config/restriction_queries/role/{role_id}https://api.us3.datadoghq.com/api/v2/logs/config/restriction_queries/role/{role_id}https://api.us5.datadoghq.com/api/v2/logs/config/restriction_queries/role/{role_id}

개요

Get restriction query for a given role.

인수

경로 파라미터

이름

유형

설명

role_id [required]

string

The ID of the role.

응답

OK

Response containing information about multiple restriction queries.

Expand All

항목

유형

설명

data

[object]

Array of returned restriction queries.

attributes

object

Attributes of the restriction query.

created_at

date-time

Creation time of the restriction query.

modified_at

date-time

Time of last restriction query modification.

restriction_query

string

The query that defines the restriction. Only the content matching the query can be returned.

id

string

ID of the restriction query.

type

string

Restriction queries type.

default: logs_restriction_queries

{
  "data": [
    {
      "attributes": {
        "created_at": "2020-03-17T21:06:44.000Z",
        "modified_at": "2020-03-17T21:15:15.000Z",
        "restriction_query": "env:sandbox"
      },
      "id": "79a0e60a-644a-11ea-ad29-43329f7f58b5",
      "type": "logs_restriction_queries"
    }
  ]
}

Bad Request

API error response.

Expand All

항목

유형

설명

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

Authentication error

API error response.

Expand All

항목

유형

설명

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

Too many requests

API error response.

Expand All

항목

유형

설명

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

코드 사례

                  # Path parameters
export role_id="CHANGE_ME"
# Curl command
curl -X GET "https://api.ap1.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/logs/config/restriction_queries/role/${role_id}" \ -H "Accept: application/json" \ -H "DD-API-KEY: ${DD_API_KEY}" \ -H "DD-APPLICATION-KEY: ${DD_APP_KEY}"