Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 33 additions & 17 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22039,7 +22039,10 @@ components:
description: Reference to connected external team.
properties:
id:
description: The connected team ID as it is referenced throughout the Datadog ecosystem.
description: |-
The connected team ID as it is referenced throughout the Datadog ecosystem.
For GitHub teams, this is `@<organization>/<team-slug>`.
For ServiceNow groups, this is `<instance_name>/<sys_id>`.
example: "@GitHubOrg/team-handle"
type: string
type:
Expand All @@ -22053,10 +22056,12 @@ components:
description: External team resource type.
enum:
- github_team
- servicenow_team
example: "github_team"
type: string
x-enum-varnames:
- GITHUB_TEAM
- SERVICENOW_TEAM
Connection:
description: The definition of `Connection` object.
properties:
Expand Down Expand Up @@ -131034,7 +131039,7 @@ components:
example: "github_sync"
type: string
source:
description: The name of the external source.
description: The name of the external source, such as `github` or `servicenow`.
example: "github"
type: string
type: object
Expand Down Expand Up @@ -132193,13 +132198,15 @@ components:
$ref: "#/components/schemas/TeamSyncSelectionStateItem"
type: array
TeamSyncAttributesSource:
description: The external source platform for team synchronization. Only "github" is supported.
description: The external source platform for team synchronization.
enum:
- github
- servicenow
example: github
type: string
x-enum-varnames:
- GITHUB
- SERVICENOW
TeamSyncAttributesSyncMembership:
default: false
description: Whether to sync members from the external team to the Datadog team. Defaults to `false` when not provided.
Expand Down Expand Up @@ -132275,8 +132282,10 @@ components:
TeamSyncSelectionStateExternalIdType:
description: |-
The type of external identifier for the selection state item.
For GitHub synchronization, the allowed values are `team` and
`organization`.
For GitHub synchronization, `team` refers to a GitHub team and
`organization` refers to a GitHub organization. For ServiceNow
synchronization, `team` refers to a ServiceNow group and
`organization` refers to a ServiceNow instance.
enum:
- team
- organization
Expand All @@ -132290,7 +132299,9 @@ components:
The external identifier value from the source
platform. For GitHub, this is the string
representation of a GitHub organization ID or team
ID.
ID. For ServiceNow, this is the instance name for
`organization`, or `<instance_name>/<sys_id>` of the
group for `team`.
example: "1"
type: string
TeamSyncSelectionStateItem:
Expand Down Expand Up @@ -245230,7 +245241,7 @@ paths:
parameters:
- $ref: "#/components/parameters/PageSize"
- $ref: "#/components/parameters/PageNumber"
- description: Filter team connections by external source systems.
- description: Filter team connections by external source systems, such as `github` or `servicenow`.
explode: false
in: query
name: filter[sources]
Expand Down Expand Up @@ -245378,7 +245389,7 @@ paths:
get:
description: |-
Get all team synchronization configurations.
Returns a list of configurations used for linking or provisioning teams with external sources like GitHub.
Returns a list of configurations used for linking or provisioning teams with external sources like GitHub or ServiceNow.
operationId: GetTeamSync
parameters:
- description: Filter by the external source platform for team synchronization
Expand Down Expand Up @@ -245422,21 +245433,26 @@ paths:
- teams_read
post:
description: |-
This endpoint configures synchronization between your existing Datadog teams and 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 endpoint configures synchronization between your existing Datadog teams and teams from
GitHub or ServiceNow by matching team names.
It evaluates all current Datadog teams and compares them against teams in the external source
connected to your Datadog account.

This operation is read-only on the GitHub side, no teams will be modified or created.
This operation is read-only on the external source side, no teams will be modified or created there.
This only creates new teams in Datadog when type is set to `provision`.

Optionally, provide `selection_state` to limit synchronization
to specific teams or organizations and their subtrees, instead
of syncing all teams.

[A GitHub organization must be connected to your Datadog account](https://docs.datadoghq.com/integrations/github/),
**GitHub**: [A GitHub organization must be connected to your Datadog account](https://docs.datadoghq.com/integrations/github/),
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 only creates new teams in Datadog when type is set to `provision`.
(lowercased and kebab-cased) using a normalized exact match; case is ignored and spaces are removed.

**ServiceNow**: [The ServiceNow integration must be configured for your Datadog account](https://docs.datadoghq.com/integrations/servicenow/).
Active assignment groups from every configured ServiceNow instance are synchronized, and the ServiceNow
group hierarchy is preserved. When `sync_membership` is enabled, group members are matched to Datadog
users by email address.
operationId: SyncTeams
requestBody:
content:
Expand Down Expand Up @@ -245472,7 +245488,7 @@ paths:
appKeyAuth: []
- AuthZ:
- teams_manage
summary: Link Teams with GitHub Teams
summary: Link teams with external teams
tags:
- Teams
x-codegen-request-body-name: body
Expand Down
2 changes: 1 addition & 1 deletion examples/v2/teams/SyncTeams.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
Link Teams with GitHub Teams returns "OK" response
Link teams with external teams returns "OK" response
"""

from os import environ
Expand Down
29 changes: 17 additions & 12 deletions src/datadog_api_client/v2/api/teams_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -1490,7 +1490,7 @@ def get_team_sync(
"""Get team sync configurations.

Get all team synchronization configurations.
Returns a list of configurations used for linking or provisioning teams with external sources like GitHub.
Returns a list of configurations used for linking or provisioning teams with external sources like GitHub or ServiceNow.

:param filter_source: Filter by the external source platform for team synchronization
:type filter_source: TeamSyncAttributesSource
Expand Down Expand Up @@ -1625,7 +1625,7 @@ def list_team_connections(
:type page_size: int, optional
:param page_number: Specific page number to return.
:type page_number: int, optional
:param filter_sources: Filter team connections by external source systems.
:param filter_sources: Filter team connections by external source systems, such as ``github`` or ``servicenow``.
:type filter_sources: [str], optional
:param filter_team_ids: Filter team connections by Datadog team IDs.
:type filter_team_ids: [str], optional
Expand Down Expand Up @@ -1674,7 +1674,7 @@ def list_team_connections_with_pagination(
:type page_size: int, optional
:param page_number: Specific page number to return.
:type page_number: int, optional
:param filter_sources: Filter team connections by external source systems.
:param filter_sources: Filter team connections by external source systems, such as ``github`` or ``servicenow``.
:type filter_sources: [str], optional
:param filter_team_ids: Filter team connections by Datadog team IDs.
:type filter_team_ids: [str], optional
Expand Down Expand Up @@ -1975,23 +1975,28 @@ def sync_teams(
self,
body: TeamSyncRequest,
) -> None:
"""Link Teams with GitHub Teams.
"""Link teams with external teams.

This endpoint configures synchronization between your existing Datadog teams and 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 endpoint configures synchronization between your existing Datadog teams and teams from
GitHub or ServiceNow by matching team names.
It evaluates all current Datadog teams and compares them against teams in the external source
connected to your Datadog account.

This operation is read-only on the GitHub side, no teams will be modified or created.
This operation is read-only on the external source side, no teams will be modified or created there.
This only creates new teams in Datadog when type is set to ``provision``.

Optionally, provide ``selection_state`` to limit synchronization
to specific teams or organizations and their subtrees, instead
of syncing all teams.

`A GitHub organization must be connected to your Datadog account <https://docs.datadoghq.com/integrations/github/>`_ ,
**GitHub** : `A GitHub organization must be connected to your Datadog account <https://docs.datadoghq.com/integrations/github/>`_ ,
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 only creates new teams in Datadog when type is set to ``provision``.
(lowercased and kebab-cased) using a normalized exact match; case is ignored and spaces are removed.

**ServiceNow** : `The ServiceNow integration must be configured for your Datadog account <https://docs.datadoghq.com/integrations/servicenow/>`_.
Active assignment groups from every configured ServiceNow instance are synchronized, and the ServiceNow
group hierarchy is preserved. When ``sync_membership`` is enabled, group members are matched to Datadog
users by email address.

:type body: TeamSyncRequest
:rtype: None
Expand Down
2 changes: 2 additions & 0 deletions src/datadog_api_client/v2/model/connected_team_ref_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ def __init__(self_, id: str, type: ConnectedTeamRefDataType, **kwargs):
Reference to connected external team.

:param id: The connected team ID as it is referenced throughout the Datadog ecosystem.
For GitHub teams, this is ``@<organization>/<team-slug>``.
For ServiceNow groups, this is ``<instance_name>/<sys_id>``.
:type id: str

:param type: External team resource type.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,16 @@ class ConnectedTeamRefDataType(ModelSimple):
"""
External team resource type.

:param value: If omitted defaults to "github_team". Must be one of ["github_team"].
:param value: If omitted defaults to "github_team". Must be one of ["github_team", "servicenow_team"].
:type value: str
"""

allowed_values = {
"github_team",
"servicenow_team",
}
GITHUB_TEAM: ClassVar["ConnectedTeamRefDataType"]
SERVICENOW_TEAM: ClassVar["ConnectedTeamRefDataType"]

@cached_property
def openapi_types(_):
Expand All @@ -33,3 +35,4 @@ def openapi_types(_):


ConnectedTeamRefDataType.GITHUB_TEAM = ConnectedTeamRefDataType("github_team")
ConnectedTeamRefDataType.SERVICENOW_TEAM = ConnectedTeamRefDataType("servicenow_team")
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def __init__(self_, managed_by: Union[str, UnsetType] = unset, source: Union[str
:param managed_by: The entity that manages this team connection.
:type managed_by: str, optional

:param source: The name of the external source.
:param source: The name of the external source, such as ``github`` or ``servicenow``.
:type source: str, optional
"""
if managed_by is not unset:
Expand Down
2 changes: 1 addition & 1 deletion src/datadog_api_client/v2/model/team_sync_attributes.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def __init__(
items and their subtrees.
:type selection_state: [TeamSyncSelectionStateItem], optional

:param source: The external source platform for team synchronization. Only "github" is supported.
:param source: The external source platform for team synchronization.
:type source: TeamSyncAttributesSource

:param sync_membership: Whether to sync members from the external team to the Datadog team. Defaults to ``false`` when not provided.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,18 @@

class TeamSyncAttributesSource(ModelSimple):
"""
The external source platform for team synchronization. Only "github" is supported.
The external source platform for team synchronization.

:param value: If omitted defaults to "github". Must be one of ["github"].
:param value: Must be one of ["github", "servicenow"].
:type value: str
"""

allowed_values = {
"github",
"servicenow",
}
GITHUB: ClassVar["TeamSyncAttributesSource"]
SERVICENOW: ClassVar["TeamSyncAttributesSource"]

@cached_property
def openapi_types(_):
Expand All @@ -33,3 +35,4 @@ def openapi_types(_):


TeamSyncAttributesSource.GITHUB = TeamSyncAttributesSource("github")
TeamSyncAttributesSource.SERVICENOW = TeamSyncAttributesSource("servicenow")
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,18 @@ def __init__(self_, type: TeamSyncSelectionStateExternalIdType, value: str, **kw
The external identifier for a team or organization in the source platform.

:param type: The type of external identifier for the selection state item.
For GitHub synchronization, the allowed values are ``team`` and
``organization``.
For GitHub synchronization, ``team`` refers to a GitHub team and
``organization`` refers to a GitHub organization. For ServiceNow
synchronization, ``team`` refers to a ServiceNow group and
``organization`` refers to a ServiceNow instance.
:type type: TeamSyncSelectionStateExternalIdType

:param value: The external identifier value from the source
platform. For GitHub, this is the string
representation of a GitHub organization ID or team
ID.
ID. For ServiceNow, this is the instance name for
``organization`` , or ``<instance_name>/<sys_id>`` of the
group for ``team``.
:type value: str
"""
super().__init__(kwargs)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,10 @@
class TeamSyncSelectionStateExternalIdType(ModelSimple):
"""
The type of external identifier for the selection state item.
For GitHub synchronization, the allowed values are `team` and
`organization`.
For GitHub synchronization, `team` refers to a GitHub team and
`organization` refers to a GitHub organization. For ServiceNow
synchronization, `team` refers to a ServiceNow group and
`organization` refers to a ServiceNow instance.

:param value: Must be one of ["team", "organization"].
:type value: str
Expand Down
4 changes: 2 additions & 2 deletions tests/generated-test/test-runner-data/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -12197,8 +12197,8 @@
{
"feature": "Teams",
"feature_file": "../../v2/features/teams.feature",
"file": "v2/teams/link-teams-with-github-teams-returns-no-content-response.json",
"scenario": "Link Teams with GitHub Teams returns \"No Content\" response",
"file": "v2/teams/link-teams-with-external-teams-returns-no-content-response.json",
"scenario": "Link teams with external teams returns \"No Content\" response",
"version": "v2"
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"api": "Teams",
"expected_status": 204,
"feature": "Teams",
"id": "v2/Teams/Link Teams with GitHub Teams returns \"No Content\" response",
"id": "v2/Teams/Link teams with external teams returns \"No Content\" response",
"operation_id": "SyncTeams",
"request": {
"body": {
Expand Down Expand Up @@ -36,7 +36,7 @@
"parameters": [],
"path": "/api/v2/team/sync"
},
"scenario": "Link Teams with GitHub Teams returns \"No Content\" response",
"scenario": "Link teams with external teams returns \"No Content\" response",
"schema_version": 1,
"version": "v2"
}
4 changes: 2 additions & 2 deletions tests/generated-test/test-server-data/v2/teams.json
Original file line number Diff line number Diff line change
Expand Up @@ -4394,7 +4394,7 @@
},
{
"feature": "Teams",
"frozen_at": "2026-03-04T16:01:34.366Z",
"frozen_at": "2026-10-19T16:23:49.447Z",
"interactions": [
{
"request": {
Expand Down Expand Up @@ -4434,7 +4434,7 @@
}
}
],
"scenario": "Link Teams with GitHub Teams returns \"No Content\" response",
"scenario": "Link teams with external teams returns \"No Content\" response",
"version": "v2"
},
{
Expand Down
4 changes: 2 additions & 2 deletions tests/v2/features/teams.feature
Original file line number Diff line number Diff line change
Expand Up @@ -463,14 +463,14 @@ Feature: Teams
And the response "data" has length 0

@team:ddoghq/aaa-omg
Scenario: Link Teams with GitHub Teams returns "No Content" response
Scenario: Link teams with external teams returns "No Content" response
Given new "SyncTeams" request
And body with value {"data": {"attributes": {"source": "github", "type": "link", "selection_state": [{"external_id": {"type": "organization", "value": "1"}}]}, "type": "team_sync_bulk"}}
When the request is sent
Then the response status is 204 No Content

@generated @skip @team:ddoghq/aaa-omg
Scenario: Link Teams with GitHub Teams returns "OK" response
Scenario: Link teams with external teams returns "OK" response
Given new "SyncTeams" request
And body with value {"data": {"attributes": {"source": "github", "type": "link"}, "type": "team_sync_bulk"}}
When the request is sent
Expand Down
Loading