Associer Teams à GitHub Teams
https://api.datadoghq.com/api/v2/team/synchttps://api.us3.datadoghq.com/api/v2/team/synchttps://api.us5.datadoghq.com/api/v2/team/synchttps://api.datadoghq.eu/api/v2/team/synchttps://api.ap1.datadoghq.com/api/v2/team/synchttps://api.ap2.datadoghq.com/api/v2/team/synchttps://api.uk1.datadoghq.com/api/v2/team/synchttps://api.ddog-gov.com/api/v2/team/synchttps://api.us2.ddog-gov.com/api/v2/team/syncPrésentation
Cet endpoint tente d'associer vos équipes Datadog existantes à des équipes GitHub en comparant leurs noms. Il évalue toutes les équipes Datadog actuelles et les compare aux équipes de l'organisation GitHub connectée à votre compte Datadog, en se basant sur le handle d'équipe Datadog et le slug d'équipe GitHub (en minuscules et au format kebab-case).
Cette opération est en lecture seule côté GitHub ; aucune équipe ne sera modifiée ou créée.
Une organisation GitHub doit être connectée à votre compte Datadog,
et l'application GitHub intégrée à Datadog doit disposer de l'autorisation Members Read. La correspondance est effectuée en comparant le handle d'équipe Datadog au slug d'équipe GitHub à l'aide d'une correspondance exacte normalisée ; la casse est ignorée et les espaces sont supprimés. Aucune modification n'est apportée aux équipes dans GitHub. Cette opération crée uniquement de nouvelles équipes dans Datadog lorsque le type est défini sur provision.
OAuth apps require the teams_manage authorization scope to access this endpoint.
Requête
Body Data (required)
data [required]Requête de synchronisation d'équipe.
attributes [required]Team sync attributes.
frequencyHow often the sync process should be run. Defaults to once when not provided.
once, continuously, pausedselection_stateSpecifies which teams or organizations to sync. When provided, synchronization is limited to the specified items and their subtrees.
external_id [required]The external identifier for a team or organization in the source platform.
type [required]The type of external identifier for the selection state item.
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.
team, organizationvalue [required]The external identifier value from the source
platform. For GitHub, this is the string
representation of a GitHub organization ID or team
ID. For ServiceNow, this is the instance name for
organization, or <instance_name>/<sys_id> of the
group for team.
operationThe operation to perform on the selected hierarchy.
When set to include, synchronization covers the
referenced teams or organizations.
includescopeThe scope of the selection. When set to subtree,
synchronization includes the referenced team or
organization and everything nested under it.
subtreesource [required]The external source platform for team synchronization.
github, servicenowsync_membershipWhether to sync members from the external team to the Datadog team. Defaults to false when not provided.
falsetype [required]The type of synchronization operation. "link" connects teams by matching names. "provision" creates new teams when no match is found.
link, provisionidThe sync's identifier
type [required]Team sync bulk type.
team_sync_bulk{
"data": {
"attributes": {
"source": "github",
"type": "link",
"selection_state": [
{
"external_id": {
"type": "organization",
"value": "1"
}
}
]
},
"type": "team_sync_bulk"
}
}Réponse
OK
No Content
Forbidden
API error response.
errors [required]A list of errors.
{
"errors": [
"Bad Request"
]
}Too many requests
API error response.
errors [required]A list of errors.
{
"errors": [
"Bad Request"
]
}Internal Server Error - Unexpected error during linking.
API error response.
errors [required]A list of errors.
{
"errors": [
"Bad Request"
]
}Exemple de code
# Set your Datadog site and credentials
export DD_SITE="datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X POST "https://api.${DD_SITE}/api/v2/team/sync" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"data": {
"attributes": {
"source": "github",
"type": "link",
"selection_state": [
{
"external_id": {
"type": "organization",
"value": "1"
}
}
]
},
"type": "team_sync_bulk"
}
}
EOF# Set your Datadog site and credentials
export DD_SITE="us3.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X POST "https://api.${DD_SITE}/api/v2/team/sync" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"data": {
"attributes": {
"source": "github",
"type": "link",
"selection_state": [
{
"external_id": {
"type": "organization",
"value": "1"
}
}
]
},
"type": "team_sync_bulk"
}
}
EOF# Set your Datadog site and credentials
export DD_SITE="us5.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X POST "https://api.${DD_SITE}/api/v2/team/sync" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"data": {
"attributes": {
"source": "github",
"type": "link",
"selection_state": [
{
"external_id": {
"type": "organization",
"value": "1"
}
}
]
},
"type": "team_sync_bulk"
}
}
EOF# Set your Datadog site and credentials
export DD_SITE="datadoghq.eu"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X POST "https://api.${DD_SITE}/api/v2/team/sync" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"data": {
"attributes": {
"source": "github",
"type": "link",
"selection_state": [
{
"external_id": {
"type": "organization",
"value": "1"
}
}
]
},
"type": "team_sync_bulk"
}
}
EOF# Set your Datadog site and credentials
export DD_SITE="ap1.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X POST "https://api.${DD_SITE}/api/v2/team/sync" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"data": {
"attributes": {
"source": "github",
"type": "link",
"selection_state": [
{
"external_id": {
"type": "organization",
"value": "1"
}
}
]
},
"type": "team_sync_bulk"
}
}
EOF# Set your Datadog site and credentials
export DD_SITE="ap2.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X POST "https://api.${DD_SITE}/api/v2/team/sync" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"data": {
"attributes": {
"source": "github",
"type": "link",
"selection_state": [
{
"external_id": {
"type": "organization",
"value": "1"
}
}
]
},
"type": "team_sync_bulk"
}
}
EOF# Set your Datadog site and credentials
export DD_SITE="uk1.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X POST "https://api.${DD_SITE}/api/v2/team/sync" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"data": {
"attributes": {
"source": "github",
"type": "link",
"selection_state": [
{
"external_id": {
"type": "organization",
"value": "1"
}
}
]
},
"type": "team_sync_bulk"
}
}
EOF# Set your Datadog site and credentials
export DD_SITE="ddog-gov.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X POST "https://api.${DD_SITE}/api/v2/team/sync" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"data": {
"attributes": {
"source": "github",
"type": "link",
"selection_state": [
{
"external_id": {
"type": "organization",
"value": "1"
}
}
]
},
"type": "team_sync_bulk"
}
}
EOF# Set your Datadog site and credentials
export DD_SITE="us2.ddog-gov.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X POST "https://api.${DD_SITE}/api/v2/team/sync" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"data": {
"attributes": {
"source": "github",
"type": "link",
"selection_state": [
{
"external_id": {
"type": "organization",
"value": "1"
}
}
]
},
"type": "team_sync_bulk"
}
}
EOF// Link Teams with GitHub Teams returns "OK" response
package main
import (
"context"
"fmt"
"os"
"github.com/DataDog/datadog-api-client-go/v2/api/datadog"
"github.com/DataDog/datadog-api-client-go/v2/api/datadogV2"
)
func main() {
body := datadogV2.TeamSyncRequest{
Data: datadogV2.TeamSyncData{
Attributes: datadogV2.TeamSyncAttributes{
Source: datadogV2.TEAMSYNCATTRIBUTESSOURCE_GITHUB,
Type: datadogV2.TEAMSYNCATTRIBUTESTYPE_LINK,
},
Type: datadogV2.TEAMSYNCBULKTYPE_TEAM_SYNC_BULK,
},
}
ctx := datadog.NewDefaultContext(context.Background())
ctx = context.WithValue(ctx, datadog.ContextAccessToken, os.Getenv("DD_BEARER_TOKEN"))
configuration := datadog.NewConfiguration()
apiClient := datadog.NewAPIClient(configuration)
api := datadogV2.NewTeamsApi(apiClient)
r, err := api.SyncTeams(ctx, body)
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `TeamsApi.SyncTeams`: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
}
Instructions
First install the library and its dependencies and then save the example to main.go and run following commands:
DD_SITE="datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" go run "main.go"DD_SITE="us3.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" go run "main.go"DD_SITE="us5.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" go run "main.go"DD_SITE="datadoghq.eu" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" go run "main.go"DD_SITE="ap1.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" go run "main.go"DD_SITE="ap2.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" go run "main.go"DD_SITE="uk1.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" go run "main.go"DD_SITE="ddog-gov.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" go run "main.go"DD_SITE="us2.ddog-gov.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" go run "main.go"// Link Teams with GitHub Teams returns "OK" response
import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.TeamsApi;
import com.datadog.api.client.v2.model.TeamSyncAttributes;
import com.datadog.api.client.v2.model.TeamSyncAttributesSource;
import com.datadog.api.client.v2.model.TeamSyncAttributesType;
import com.datadog.api.client.v2.model.TeamSyncBulkType;
import com.datadog.api.client.v2.model.TeamSyncData;
import com.datadog.api.client.v2.model.TeamSyncRequest;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = ApiClient.getDefaultApiClient();
defaultClient.setAccessToken(System.getenv("DD_BEARER_TOKEN"));
TeamsApi apiInstance = new TeamsApi(defaultClient);
TeamSyncRequest body =
new TeamSyncRequest()
.data(
new TeamSyncData()
.attributes(
new TeamSyncAttributes()
.source(TeamSyncAttributesSource.GITHUB)
.type(TeamSyncAttributesType.LINK))
.type(TeamSyncBulkType.TEAM_SYNC_BULK));
try {
apiInstance.syncTeams(body);
} catch (ApiException e) {
System.err.println("Exception when calling TeamsApi#syncTeams");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Instructions
First install the library and its dependencies and then save the example to Example.java and run following commands:
DD_SITE="datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" java "Example.java"DD_SITE="us3.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" java "Example.java"DD_SITE="us5.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" java "Example.java"DD_SITE="datadoghq.eu" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" java "Example.java"DD_SITE="ap1.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" java "Example.java"DD_SITE="ap2.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" java "Example.java"DD_SITE="uk1.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" java "Example.java"DD_SITE="ddog-gov.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" java "Example.java"DD_SITE="us2.ddog-gov.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" java "Example.java""""
Link Teams with GitHub Teams returns "OK" response
"""
from os import environ
from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.teams_api import TeamsApi
from datadog_api_client.v2.model.team_sync_attributes import TeamSyncAttributes
from datadog_api_client.v2.model.team_sync_attributes_source import TeamSyncAttributesSource
from datadog_api_client.v2.model.team_sync_attributes_type import TeamSyncAttributesType
from datadog_api_client.v2.model.team_sync_bulk_type import TeamSyncBulkType
from datadog_api_client.v2.model.team_sync_data import TeamSyncData
from datadog_api_client.v2.model.team_sync_request import TeamSyncRequest
body = TeamSyncRequest(
data=TeamSyncData(
attributes=TeamSyncAttributes(
source=TeamSyncAttributesSource.GITHUB,
type=TeamSyncAttributesType.LINK,
),
type=TeamSyncBulkType.TEAM_SYNC_BULK,
),
)
configuration = Configuration()
configuration.access_token = environ["DD_BEARER_TOKEN"]
with ApiClient(configuration) as api_client:
api_instance = TeamsApi(api_client)
api_instance.sync_teams(body=body)
Instructions
First install the library and its dependencies and then save the example to example.py and run following commands:
DD_SITE="datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" python3 "example.py"DD_SITE="us3.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" python3 "example.py"DD_SITE="us5.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" python3 "example.py"DD_SITE="datadoghq.eu" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" python3 "example.py"DD_SITE="ap1.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" python3 "example.py"DD_SITE="ap2.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" python3 "example.py"DD_SITE="uk1.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" python3 "example.py"DD_SITE="ddog-gov.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" python3 "example.py"DD_SITE="us2.ddog-gov.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" python3 "example.py"# Link Teams with GitHub Teams returns "OK" response
require "datadog_api_client"
DatadogAPIClient.configure do |config|
config.access_token = ENV["DD_BEARER_TOKEN"]
end
api_instance = DatadogAPIClient::V2::TeamsAPI.new
body = DatadogAPIClient::V2::TeamSyncRequest.new({
data: DatadogAPIClient::V2::TeamSyncData.new({
attributes: DatadogAPIClient::V2::TeamSyncAttributes.new({
source: DatadogAPIClient::V2::TeamSyncAttributesSource::GITHUB,
type: DatadogAPIClient::V2::TeamSyncAttributesType::LINK,
}),
type: DatadogAPIClient::V2::TeamSyncBulkType::TEAM_SYNC_BULK,
}),
})
p api_instance.sync_teams(body)
Instructions
First install the library and its dependencies and then save the example to example.rb and run following commands:
DD_SITE="datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" rb "example.rb"DD_SITE="us3.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" rb "example.rb"DD_SITE="us5.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" rb "example.rb"DD_SITE="datadoghq.eu" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" rb "example.rb"DD_SITE="ap1.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" rb "example.rb"DD_SITE="ap2.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" rb "example.rb"DD_SITE="uk1.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" rb "example.rb"DD_SITE="ddog-gov.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" rb "example.rb"DD_SITE="us2.ddog-gov.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" rb "example.rb"// Link Teams with GitHub Teams returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_teams::TeamsAPI;
use datadog_api_client::datadogV2::model::TeamSyncAttributes;
use datadog_api_client::datadogV2::model::TeamSyncAttributesSource;
use datadog_api_client::datadogV2::model::TeamSyncAttributesType;
use datadog_api_client::datadogV2::model::TeamSyncBulkType;
use datadog_api_client::datadogV2::model::TeamSyncData;
use datadog_api_client::datadogV2::model::TeamSyncRequest;
#[tokio::main]
async fn main() {
let body = TeamSyncRequest::new(TeamSyncData::new(
TeamSyncAttributes::new(
TeamSyncAttributesSource::GITHUB,
TeamSyncAttributesType::LINK,
),
TeamSyncBulkType::TEAM_SYNC_BULK,
));
let configuration = datadog::Configuration::new();
let api = TeamsAPI::with_config(configuration);
let resp = api.sync_teams(body).await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}
Instructions
First install the library and its dependencies and then save the example to src/main.rs and run following commands:
DD_SITE="datadoghq.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo runDD_SITE="us3.datadoghq.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo runDD_SITE="us5.datadoghq.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo runDD_SITE="datadoghq.eu" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo runDD_SITE="ap1.datadoghq.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo runDD_SITE="ap2.datadoghq.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo runDD_SITE="uk1.datadoghq.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo runDD_SITE="ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo runDD_SITE="us2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo run/**
* Link Teams with GitHub Teams returns "OK" response
*/
import { client, v2 } from "@datadog/datadog-api-client";
const configuration = client.createConfiguration({
authMethods: {
AuthZ: {
accessToken: process.env.DD_BEARER_TOKEN as string,
},
},
});
const apiInstance = new v2.TeamsApi(configuration);
const params: v2.TeamsApiSyncTeamsRequest = {
body: {
data: {
attributes: {
source: "github",
type: "link",
},
type: "team_sync_bulk",
},
},
};
apiInstance
.syncTeams(params)
.then((data: any) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
})
.catch((error: any) => console.error(error));
Instructions
First install the library and its dependencies and then save the example to example.ts and run following commands:
DD_SITE="datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" tsc "example.ts"DD_SITE="us3.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" tsc "example.ts"DD_SITE="us5.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" tsc "example.ts"DD_SITE="datadoghq.eu" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" tsc "example.ts"DD_SITE="ap1.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" tsc "example.ts"DD_SITE="ap2.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" tsc "example.ts"DD_SITE="uk1.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" tsc "example.ts"DD_SITE="ddog-gov.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" tsc "example.ts"DD_SITE="us2.ddog-gov.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" tsc "example.ts"