users
Creates, updates, deletes, gets or lists a users resource.
Overview
| Name | users |
| Type | Resource |
| Id | datadog.organization.users |
Fields
The following fields are returned by SELECT queries:
- get_user
- list_users
| Name | Datatype | Description |
|---|---|---|
id | string | ID of the user. |
attributes | object | Attributes of user object returned by the API. |
relationships | object | Relationships of the user object returned by the API. |
type | string | Users resource type. (default: users, example: users) |
| Name | Datatype | Description |
|---|---|---|
id | string | ID of the user. |
attributes | object | Attributes of user object returned by the API. |
relationships | object | Relationships of the user object returned by the API. |
type | string | Users resource type. (default: users, example: users) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_user | select | user_id, region | Get a user in the organization specified by the user’s user_id. | |
list_users | select | region | page[size], page[number], sort, sort_dir, filter, filter[status] | Get the list of all users in the organization. This list includes all users even if they are deactivated or unverified. |
create_user | insert | region, data__data | Create a user for your organization. | |
update_user | update | user_id, region, data__data | Edit a user. Can only be used with an application key belonging to an administrator user. | |
disable_user | exec | user_id, region | Disable a user. Can only be used with an application key belonging to an administrator user. |
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 |
|---|---|---|
region | string | (default: datadoghq.com) |
user_id | string | The ID of the user. |
filter | string | Filter all users by the given string. Defaults to no filtering. |
filter[status] | string | Filter on status attribute. Comma separated list, with possible values Active, Pending, and Disabled. Defaults to no filtering. |
page[number] | integer (int64) | Specific page number to return. |
page[size] | integer (int64) | Size for a given page. The maximum allowed value is 100. |
sort | string | User attribute to order results by. Sort order is ascending by default. Sort order is descending if the field is prefixed by a negative sign, for example sort=-name. Options: name, modified_at, user_count. |
sort_dir | string | Direction of sort. Options: asc, desc. |
SELECT examples
- get_user
- list_users
Get a user in the organization specified by the user’s user_id.
SELECT
id,
attributes,
relationships,
type
FROM datadog.organization.users
WHERE user_id = '{{ user_id }}' -- required
AND region = '{{ region }}' -- required
;
Get the list of all users in the organization. This list includes
all users even if they are deactivated or unverified.
SELECT
id,
attributes,
relationships,
type
FROM datadog.organization.users
WHERE region = '{{ region }}' -- required
AND page[size] = '{{ page[size] }}'
AND page[number] = '{{ page[number] }}'
AND sort = '{{ sort }}'
AND sort_dir = '{{ sort_dir }}'
AND filter = '{{ filter }}'
AND filter[status] = '{{ filter[status] }}'
;
INSERT examples
- create_user
- Manifest
Create a user for your organization.
INSERT INTO datadog.organization.users (
data__data,
region
)
SELECT
'{{ data }}' /* required */,
'{{ region }}'
RETURNING
data,
included
;
# Description fields are for documentation purposes
- name: users
props:
- name: region
value: string
description: Required parameter for the users resource.
- name: data
value: object
description: |
Object to create a user.
UPDATE examples
- update_user
Edit a user. Can only be used with an application key belonging
to an administrator user.
UPDATE datadog.organization.users
SET
data__data = '{{ data }}'
WHERE
user_id = '{{ user_id }}' --required
AND region = '{{ region }}' --required
AND data__data = '{{ data }}' --required
RETURNING
data,
included;
Lifecycle Methods
- disable_user
Disable a user. Can only be used with an application key belonging
to an administrator user.
EXEC datadog.organization.users.disable_user
@user_id='{{ user_id }}' --required,
@region='{{ region }}' --required
;