On-call 팀 라우팅 규칙 가져오기
https://api.datadoghq.com/api/v2/on-call/teams/{team_id}/routing-ruleshttps://api.us3.datadoghq.com/api/v2/on-call/teams/{team_id}/routing-ruleshttps://api.us5.datadoghq.com/api/v2/on-call/teams/{team_id}/routing-ruleshttps://api.datadoghq.eu/api/v2/on-call/teams/{team_id}/routing-ruleshttps://api.ap1.datadoghq.com/api/v2/on-call/teams/{team_id}/routing-ruleshttps://api.ap2.datadoghq.com/api/v2/on-call/teams/{team_id}/routing-ruleshttps://api.uk1.datadoghq.com/api/v2/on-call/teams/{team_id}/routing-ruleshttps://api.ddog-gov.com/api/v2/on-call/teams/{team_id}/routing-ruleshttps://api.us2.ddog-gov.com/api/v2/on-call/teams/{team_id}/routing-rules개요
팀의 On-Call 라우팅 규칙을 가져옵니다.
인수
경로 파라미터
team_id [required]The team ID
쿼리 문자열
includeComma-separated list of included relationships to be returned. Allowed values: rules, rules.policy.
응답
OK
Represents a complete set of team routing rules, including data and optionally included related resources.
dataRepresents the top-level data object for team routing rules, containing the ID, relationships, and resource type.
idSpecifies the unique identifier of this team routing rules record.
relationshipsSpecifies relationships for team routing rules, including rule references.
rulesHolds references to a set of routing rules in a relationship.
dataAn array of references to the routing rules associated with this team.
id [required]Specifies the unique identifier for the related routing rule.
type [required]Indicates that the resource is of type 'team_routing_rules'.
team_routing_rulesteam_routing_rulestype [required]Team routing rules resource type.
team_routing_rulesteam_routing_rulesincludedProvides related routing rules or other included resources.
<type=team_routing_rules>Represents a routing rule, including its attributes, relationships, and unique identifier.
attributesDefines the configurable attributes of a routing rule, such as actions, query, time restriction, and urgency.
actionsSpecifies the list of actions to perform when the routing rule matches.
<type=send_slack_message>Sends a message to a Slack channel.
channel [required]The channel ID.
type [required]Indicates that the action is a send Slack message action.
send_slack_messagesend_slack_messageworkspace [required]The workspace ID.
<type=send_teams_message>Sends a message to a Microsoft Teams channel.
channel [required]The channel ID.
team [required]The team ID.
tenant [required]The tenant ID.
type [required]Indicates that the action is a send Microsoft Teams message action.
send_teams_messagesend_teams_message<type=workflow>Triggers a Workflow Automation.
handle [required]The handle of the Workflow Automation to trigger.
type [required]Indicates that the action triggers a Workflow Automation.
workflowworkflow<type=escalation_policy>Triggers an escalation policy.
ack_timeout_minutesThe number of minutes before an acknowledged page is re-triggered.
policy_id [required]The ID of the escalation policy to route to.
support_hoursSupport hours during which the escalation policy will be executed. Outside of these hours, the escalation policy will be on hold and triggered once the next support hours window starts. This is mutually exclusive with the top-level time_restriction field on the routing rule.
restrictionsThe list of support hours time windows.
end_dayA day of the week.
monday, tuesday, wednesday, thursday, friday, saturday, sundayend_timeSpecifies the ending time for this restriction.
start_dayA day of the week.
monday, tuesday, wednesday, thursday, friday, saturday, sundaystart_timeSpecifies the starting time for this restriction.
time_zone [required]The time zone in which the support hours are expressed.
type [required]Indicates that the action pages an escalation policy. This action can be set once per routing rule item, and is mutually exclusive with the top-level policy_id field on the routing rule.
escalation_policyescalation_policyurgencySpecifies the level of urgency for a routing rule (low, high, or dynamic).
low, high, dynamic<type=reroute_to_team>Reroutes the page to another team, which then evaluates it against its own routing rules. Each routing rule can include this action only once. It can be combined only with send_slack_message and send_teams_message actions. It can't be used with escalation_policy or workflow actions, or when the routing rule sets policy_id.
destination_team_id [required]The ID of the team to reroute the page to.
type [required]Indicates that the action reroutes the page to another team's routing rules.
reroute_to_teamreroute_to_teamqueryDefines the query or condition that triggers this routing rule.
time_restrictionTime restrictions during which the routing rule is active. Outside of these hours, the rule does not match and routing continues to subsequent rules. This is mutually exclusive with the action-level support_hours field.
restrictions [required]Defines the list of time-based restrictions.
end_dayA day of the week.
monday, tuesday, wednesday, thursday, friday, saturday, sundayend_timeSpecifies the ending time for this restriction.
start_dayA day of the week.
monday, tuesday, wednesday, thursday, friday, saturday, sundaystart_timeSpecifies the starting time for this restriction.
time_zone [required]Specifies the time zone applicable to the restrictions.
urgencySpecifies the level of urgency for a routing rule (low, high, or dynamic).
low, high, dynamicidSpecifies the unique identifier of this routing rule.
relationshipsSpecifies relationships for a routing rule, linking to associated policy resources.
policyDefines the relationship that links a routing rule to a policy.
dataRepresents the policy data reference, containing the policy's ID and resource type.
id [required]Specifies the unique identifier of the policy.
type [required]Indicates that the resource is of type 'policies'.
policiespoliciestype [required]Team routing rules resource type.
team_routing_rulesteam_routing_rules{
"data": {
"id": "27590dae-47be-4a7d-9abf-8f4e45124020",
"relationships": {
"rules": {
"data": [
{
"id": "03aff2d6-6cbf-496c-997f-a857bbe9a94a",
"type": "team_routing_rules"
},
{
"id": "03aff2d6-6cbf-496c-997f-a857bbe9a94a",
"type": "team_routing_rules"
}
]
}
},
"type": "team_routing_rules"
},
"included": [
{
"attributes": {
"actions": null,
"query": "tags.service:test",
"time_restriction": {
"restrictions": [
{
"end_day": "monday",
"end_time": "17:00:00",
"start_day": "monday",
"start_time": "09:00:00"
},
{
"end_day": "tuesday",
"end_time": "17:00:00",
"start_day": "tuesday",
"start_time": "09:00:00"
}
],
"time_zone": ""
},
"urgency": "high"
},
"id": "03aff2d6-6cbf-496c-997f-a857bbe9a94a",
"relationships": {
"policy": {
"data": null
}
},
"type": "team_routing_rules"
}
]
}Too many requests
API error response.
errors [required]A list of errors.
{
"errors": [
"Bad Request"
]
}코드 예시
# Path parameters
export team_id="27590dae-47be-4a7d-9abf-8f4e45124020"
# 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 GET "https://api.${DD_SITE}/api/v2/on-call/teams/${team_id}/routing-rules" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}"# Path parameters
export team_id="27590dae-47be-4a7d-9abf-8f4e45124020"
# 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 GET "https://api.${DD_SITE}/api/v2/on-call/teams/${team_id}/routing-rules" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}"# Path parameters
export team_id="27590dae-47be-4a7d-9abf-8f4e45124020"
# 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 GET "https://api.${DD_SITE}/api/v2/on-call/teams/${team_id}/routing-rules" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}"# Path parameters
export team_id="27590dae-47be-4a7d-9abf-8f4e45124020"
# 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 GET "https://api.${DD_SITE}/api/v2/on-call/teams/${team_id}/routing-rules" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}"# Path parameters
export team_id="27590dae-47be-4a7d-9abf-8f4e45124020"
# 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 GET "https://api.${DD_SITE}/api/v2/on-call/teams/${team_id}/routing-rules" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}"# Path parameters
export team_id="27590dae-47be-4a7d-9abf-8f4e45124020"
# 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 GET "https://api.${DD_SITE}/api/v2/on-call/teams/${team_id}/routing-rules" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}"# Path parameters
export team_id="27590dae-47be-4a7d-9abf-8f4e45124020"
# 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 GET "https://api.${DD_SITE}/api/v2/on-call/teams/${team_id}/routing-rules" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}"# Path parameters
export team_id="27590dae-47be-4a7d-9abf-8f4e45124020"
# 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 GET "https://api.${DD_SITE}/api/v2/on-call/teams/${team_id}/routing-rules" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}"# Path parameters
export team_id="27590dae-47be-4a7d-9abf-8f4e45124020"
# 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 GET "https://api.${DD_SITE}/api/v2/on-call/teams/${team_id}/routing-rules" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}"// Get On-Call team routing rules returns "OK" response
package main
import (
"context"
"encoding/json"
"fmt"
"os"
"github.com/DataDog/datadog-api-client-go/v2/api/datadog"
"github.com/DataDog/datadog-api-client-go/v2/api/datadogV2"
)
func main() {
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.NewOnCallApi(apiClient)
resp, r, err := api.GetOnCallTeamRoutingRules(ctx, "27590dae-47be-4a7d-9abf-8f4e45124020", *datadogV2.NewGetOnCallTeamRoutingRulesOptionalParameters())
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `OnCallApi.GetOnCallTeamRoutingRules`: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
responseContent, _ := json.MarshalIndent(resp, "", " ")
fmt.Fprintf(os.Stdout, "Response from `OnCallApi.GetOnCallTeamRoutingRules`:\n%s\n", responseContent)
}
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"// Get On-Call team routing rules returns "OK" response
import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.OnCallApi;
import com.datadog.api.client.v2.model.TeamRoutingRules;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = ApiClient.getDefaultApiClient();
defaultClient.setAccessToken(System.getenv("DD_BEARER_TOKEN"));
OnCallApi apiInstance = new OnCallApi(defaultClient);
try {
TeamRoutingRules result =
apiInstance.getOnCallTeamRoutingRules("27590dae-47be-4a7d-9abf-8f4e45124020");
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling OnCallApi#getOnCallTeamRoutingRules");
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""""
Get On-Call team routing rules returns "OK" response
"""
from os import environ
from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.on_call_api import OnCallApi
configuration = Configuration()
configuration.access_token = environ["DD_BEARER_TOKEN"]
with ApiClient(configuration) as api_client:
api_instance = OnCallApi(api_client)
response = api_instance.get_on_call_team_routing_rules(
team_id="27590dae-47be-4a7d-9abf-8f4e45124020",
)
print(response)
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"# Get On-Call team routing rules returns "OK" response
require "datadog_api_client"
DatadogAPIClient.configure do |config|
config.access_token = ENV["DD_BEARER_TOKEN"]
end
api_instance = DatadogAPIClient::V2::OnCallAPI.new
p api_instance.get_on_call_team_routing_rules("27590dae-47be-4a7d-9abf-8f4e45124020")
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"// Get On-Call team routing rules returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_on_call::GetOnCallTeamRoutingRulesOptionalParams;
use datadog_api_client::datadogV2::api_on_call::OnCallAPI;
#[tokio::main]
async fn main() {
let configuration = datadog::Configuration::new();
let api = OnCallAPI::with_config(configuration);
let resp = api
.get_on_call_team_routing_rules(
"27590dae-47be-4a7d-9abf-8f4e45124020".to_string(),
GetOnCallTeamRoutingRulesOptionalParams::default(),
)
.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/**
* Get On-Call team routing rules 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.OnCallApi(configuration);
const params: v2.OnCallApiGetOnCallTeamRoutingRulesRequest = {
teamId: "27590dae-47be-4a7d-9abf-8f4e45124020",
};
apiInstance
.getOnCallTeamRoutingRules(params)
.then((data: v2.TeamRoutingRules) => {
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"