teams
Creates, updates, deletes, gets or lists a teams
resource.
Overview
Name | teams |
Type | Resource |
Id | datadog.organization.teams |
Fields
The following fields are returned by SELECT
queries:
- get_team
- list_teams
Name | Datatype | Description |
---|---|---|
id | string | The team's identifier (example: aeadc05e-98a8-11ec-ac2c-da7ad0900001) |
attributes | object | Team attributes |
relationships | object | Resources related to a team |
type | string | Team type (default: team, example: team) |
Name | Datatype | Description |
---|---|---|
id | string | The team's identifier (example: aeadc05e-98a8-11ec-ac2c-da7ad0900001) |
attributes | object | Team attributes |
relationships | object | Resources related to a team |
type | string | Team type (default: team, example: team) |
Methods
The following methods are available for this resource:
Name | Accessible by | Required Params | Optional Params | Description |
---|---|---|---|---|
get_team | select | team_id , region | Get a single team using the team's id . | |
list_teams | select | region | page[number] , page[size] , sort , include , filter[keyword] , filter[me] , fields[team] | Get all teams. Can be used to search for teams using the filter[keyword] and filter[me] query parameters. |
create_team | insert | region , data__data | Create a new team. User IDs passed through the users relationship field are added to the team. | |
update_team | update | team_id , region , data__data | Update a team using the team's id .If the team_links relationship is present, the associated links are updated to be in the order they appear in the array, and any existing team links not present are removed. | |
delete_team | delete | team_id , region | Remove a team using the team's id . | |
sync_teams | exec | region , data | This endpoint attempts to link your existing Datadog teams with GitHub teams by matching their names. It evaluates all current Datadog teams and compares them against teams in the GitHub organization connected to your Datadog account, based on Datadog Team handle and GitHub Team slug (lowercased and kebab-cased). This operation is read-only on the GitHub side, no teams will be modified or created. A GitHub organization must be connected to your Datadog account, and the GitHub App integrated with Datadog must have the Members Read permission. Matching is performed by comparing the Datadog team handle to the GitHub team slugusing a normalized exact match; case is ignored and spaces are removed. No modifications are made to teams in GitHub. This will not create new Teams in Datadog. |
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) |
team_id | string | None |
fields[team] | array | List of fields that need to be fetched. |
filter[keyword] | string | Search query. Can be team name, team handle, or email of team member |
filter[me] | boolean | When true, only returns teams the current user belongs to |
include | array | Included related resources optionally requested. Allowed enum values: team_links, user_team_permissions |
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 | Specifies the order of the returned teams |
SELECT
examples
- get_team
- list_teams
Get a single team using the team's id
.
SELECT
id,
attributes,
relationships,
type
FROM datadog.organization.teams
WHERE team_id = '{{ team_id }}' -- required
AND region = '{{ region }}' -- required
;
Get all teams.
Can be used to search for teams using the filter[keyword]
and filter[me]
query parameters.
SELECT
id,
attributes,
relationships,
type
FROM datadog.organization.teams
WHERE region = '{{ region }}' -- required
AND page[number] = '{{ page[number] }}'
AND page[size] = '{{ page[size] }}'
AND sort = '{{ sort }}'
AND include = '{{ include }}'
AND filter[keyword] = '{{ filter[keyword] }}'
AND filter[me] = '{{ filter[me] }}'
AND fields[team] = '{{ fields[team] }}'
;
INSERT
examples
- create_team
- Manifest
Create a new team.
User IDs passed through the users
relationship field are added to the team.
INSERT INTO datadog.organization.teams (
data__data,
region
)
SELECT
'{{ data }}' /* required */,
'{{ region }}'
RETURNING
data
;
# Description fields are for documentation purposes
- name: teams
props:
- name: region
value: string
description: Required parameter for the teams resource.
- name: data
value: object
description: |
Team create
UPDATE
examples
- update_team
Update a team using the team's id
.
If the team_links
relationship is present, the associated links are updated to be in the order they appear in the array, and any existing team links not present are removed.
UPDATE datadog.organization.teams
SET
data__data = '{{ data }}'
WHERE
team_id = '{{ team_id }}' --required
AND region = '{{ region }}' --required
AND data__data = '{{ data }}' --required
RETURNING
data;
DELETE
examples
- delete_team
Remove a team using the team's id
.
DELETE FROM datadog.organization.teams
WHERE team_id = '{{ team_id }}' --required
AND region = '{{ region }}' --required
;
Lifecycle Methods
- sync_teams
This endpoint attempts to link your existing Datadog teams with GitHub teams by matching their names.
It evaluates all current Datadog teams and compares them against teams in the GitHub organization
connected to your Datadog account, based on Datadog Team handle and GitHub Team slug
(lowercased and kebab-cased).
This operation is read-only on the GitHub side, no teams will be modified or created.
A GitHub organization must be connected to your Datadog account,
and the GitHub App integrated with Datadog must have the Members Read
permission. Matching is performed by comparing the Datadog team handle to the GitHub team slug
using a normalized exact match; case is ignored and spaces are removed. No modifications are made
to teams in GitHub. This will not create new Teams in Datadog.
EXEC datadog.organization.teams.sync_teams
@region='{{ region }}' --required
@@json=
'{
"data": "{{ data }}"
}'
;