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 (team) (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 (team) (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 | Get a single team using the team's id. | |
list_teams | select | page[number], page[size], sort, include, filter[keyword], filter[me], fields[team] | Get all teams.<br />Can be used to search for teams using the filter[keyword] and filter[me] query parameters. | |
create_team | insert | data | Create a new team.<br />User IDs passed through the users relationship field are added to the team. | |
update_team | update | team_id, data | Update a team using the team's id.<br />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 | Remove a team using the team's id. | |
sync_teams | exec | data | This endpoint configures synchronization between your existing Datadog teams and GitHub teams by matching their names.<br />It evaluates all current Datadog teams and compares them against teams in the GitHub organization<br />connected to your Datadog account, based on Datadog Team handle and GitHub Team slug<br />(lowercased and kebab-cased).<br /><br />This operation is read-only on the GitHub side, no teams will be modified or created.<br /><br />Optionally, provide selection_state to limit synchronization<br />to specific teams or organizations and their subtrees, instead<br />of syncing all teams.<br /><br />[A GitHub organization must be connected to your Datadog account](https://docs.datadoghq.com/integrations/github/),<br />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<br />using a normalized exact match; case is ignored and spaces are removed. No modifications are made<br />to teams in GitHub. This only creates new teams in Datadog when type is set to provision. |
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 |
|---|---|---|
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. |
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) | Number of items to return per 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
;
Get all teams.<br />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 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.<br />User IDs passed through the users relationship field are added to the team.
INSERT INTO datadog.organization.teams (
data
)
SELECT
'{{ data }}' /* required */
RETURNING
data
;
# Description fields are for documentation purposes
- name: teams
props:
- name: data
description: |
Team create
value:
attributes:
avatar: "{{ avatar }}"
banner: {{ banner }}
description: "{{ description }}"
handle: "{{ handle }}"
hidden_modules:
- "{{ hidden_modules }}"
name: "{{ name }}"
visible_modules:
- "{{ visible_modules }}"
relationships:
users:
data:
- id: "{{ id }}"
type: "{{ type }}"
type: "{{ type }}"
UPDATE examples
- update_team
Update a team using the team's id.<br />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 }}'
WHERE
team_id = '{{ team_id }}' --required
AND 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
;
Lifecycle Methods
EXEC variables use wire (API) names.
- sync_teams
This endpoint configures synchronization between your existing Datadog teams and GitHub teams by matching their names.<br />It evaluates all current Datadog teams and compares them against teams in the GitHub organization<br />connected to your Datadog account, based on Datadog Team handle and GitHub Team slug<br />(lowercased and kebab-cased).<br /><br />This operation is read-only on the GitHub side, no teams will be modified or created.<br /><br />Optionally, provide selection_state to limit synchronization<br />to specific teams or organizations and their subtrees, instead<br />of syncing all teams.<br /><br />[A GitHub organization must be connected to your Datadog account](https://docs.datadoghq.com/integrations/github/),<br />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<br />using a normalized exact match; case is ignored and spaces are removed. No modifications are made<br />to teams in GitHub. This only creates new teams in Datadog when type is set to provision.
EXEC datadog.organization.teams.sync_teams
@@json=
'{
"data": "{{ data }}"
}'
;