Get incident todo details
https://api.datadoghq.com/api/v2/incidents/{incident_id}/relationships/todos/{todo_id}https://api.us3.datadoghq.com/api/v2/incidents/{incident_id}/relationships/todos/{todo_id}https://api.us5.datadoghq.com/api/v2/incidents/{incident_id}/relationships/todos/{todo_id}https://api.datadoghq.eu/api/v2/incidents/{incident_id}/relationships/todos/{todo_id}https://api.ap1.datadoghq.com/api/v2/incidents/{incident_id}/relationships/todos/{todo_id}https://api.ap2.datadoghq.com/api/v2/incidents/{incident_id}/relationships/todos/{todo_id}https://api.uk1.datadoghq.com/api/v2/incidents/{incident_id}/relationships/todos/{todo_id}https://api.ddog-gov.com/api/v2/incidents/{incident_id}/relationships/todos/{todo_id}https://api.us2.ddog-gov.com/api/v2/incidents/{incident_id}/relationships/todos/{todo_id}概要
インシデント Todo の詳細を取得します。
OAuth apps require the incident_read authorization scope to access this endpoint.
引数
パスパラメーター
incident_id [required]The UUID of the incident.
todo_id [required]The UUID of the incident todo.
応答
OK
Response with an incident todo.
data [required]Incident todo response data.
attributesIncident todo's attributes.
assignees [required]Array of todo assignees.
Object 1Assignee's @-handle.
Object 2Anonymous assignee entity.
icon [required]URL for assignee's icon.
id [required]Anonymous assignee's ID.
name [required]Assignee's name.
source [required]The source of the anonymous assignee.
slackslack, microsoft_teamscompletedTimestamp when the todo was completed.
content [required]The follow-up task's content.
createdTimestamp when the incident todo was created.
due_dateTimestamp when the todo should be completed by.
incident_idUUID of the incident this todo is connected to.
modifiedTimestamp when the incident todo was last modified.
id [required]The incident todo's ID.
relationshipsThe incident's relationships from a response.
created_by_userRelationship to user.
data [required]Relationship to user object.
id [required]A unique identifier that represents the user.
type [required]Users resource type.
usersuserslast_modified_by_userRelationship to user.
data [required]Relationship to user object.
id [required]A unique identifier that represents the user.
type [required]Users resource type.
usersuserstype [required]Todo resource type.
incident_todosincident_todosincludedIncluded related resources that the user requested.
<type=users>User object returned by the API.
attributesAttributes of user object returned by the API.
created_atThe ISO 8601 timestamp of when the user account was created.
disabledWhether the user account is deactivated. Disabled users cannot log in.
emailThe email address of the user, used for login and notifications.
handleThe unique handle (username) of the user, typically matching their email prefix.
iconURL of the user's profile icon, typically a Gravatar URL derived from the email address.
last_login_timeThe ISO 8601 timestamp of the user's most recent login, or null if the user has never logged in.
mfa_enabledWhether multi-factor authentication (MFA) is enabled for the user's account.
modified_atThe ISO 8601 timestamp of when the user account was last modified.
nameThe full display name of the user as shown in the Datadog UI.
service_accountWhether this is a service account rather than a human user. Service accounts are used for programmatic API access.
statusThe current status of the user account (for example, Active, Pending, or Disabled).
titleThe job title of the user (for example, "Senior Engineer" or "Product Manager").
uuidThe globally unique identifier (UUID) of the user.
verifiedWhether the user's email address has been verified.
idID of the user.
relationshipsRelationships of the user object returned by the API.
orgRelationship to an organization.
data [required]Relationship to organization object.
id [required]ID of the organization.
type [required]Organizations resource type.
orgsorgsother_orgsRelationship to organizations.
data [required]Relationships to organization objects.
id [required]ID of the organization.
type [required]Organizations resource type.
orgsorgsother_usersRelationship to users.
data [required]Relationships to user objects.
id [required]A unique identifier that represents the user.
type [required]Users resource type.
usersusersrolesRelationship to roles.
dataAn array containing type and the unique identifier of a role.
idThe unique identifier of the role.
typeRoles type.
rolesrolestypeUsers resource type.
usersusers{
"data": {
"attributes": {
"assignees": [
{
"description": "@test.user@test.com",
"example": "@test.user@test.com",
"type": "@test.user@test.com"
}
],
"completed": "2023-03-06T22:00:00.000000+00:00",
"content": "Restore lost data.",
"created": "2019-09-19T10:00:00.000Z",
"due_date": "2023-07-10T05:00:00.000000+00:00",
"incident_id": "00000000-aaaa-0000-0000-000000000000",
"modified": "2019-09-19T10:00:00.000Z"
},
"id": "00000000-0000-0000-1234-000000000000",
"relationships": {
"created_by_user": {
"data": {
"id": "00000000-0000-0000-2345-000000000000",
"type": "users"
}
},
"last_modified_by_user": {
"data": {
"id": "00000000-0000-0000-2345-000000000000",
"type": "users"
}
}
},
"type": "incident_todos"
},
"included": [
{
"attributes": {
"created_at": "2019-09-19T10:00:00.000Z",
"disabled": false,
"email": "string",
"handle": "string",
"icon": "string",
"last_login_time": "2019-09-19T10:00:00.000Z",
"mfa_enabled": false,
"modified_at": "2019-09-19T10:00:00.000Z",
"name": "string",
"service_account": false,
"status": "string",
"title": "string",
"uuid": "string",
"verified": false
},
"id": "string",
"relationships": {
"org": {
"data": {
"id": "00000000-0000-beef-0000-000000000000",
"type": "orgs"
}
},
"other_orgs": {
"data": [
{
"id": "00000000-0000-beef-0000-000000000000",
"type": "orgs"
}
]
},
"other_users": {
"data": [
{
"id": "00000000-0000-0000-2345-000000000000",
"type": "users"
}
]
},
"roles": {
"data": [
{
"id": "3653d3c6-0c75-11ea-ad28-fb5701eabc7d",
"type": "roles"
}
]
}
},
"type": "users"
}
]
}Bad Request
API error response.
errors [required]A list of errors.
{
"errors": [
"Bad Request"
]
}Unauthorized
API error response.
errors [required]A list of errors.
{
"errors": [
"Bad Request"
]
}Forbidden
API error response.
errors [required]A list of errors.
{
"errors": [
"Bad Request"
]
}Not Found
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"
]
}コード例
# Path parameters
export incident_id="CHANGE_ME"
export todo_id="CHANGE_ME"
# 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/incidents/${incident_id}/relationships/todos/${todo_id}" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}"# Path parameters
export incident_id="CHANGE_ME"
export todo_id="CHANGE_ME"
# 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/incidents/${incident_id}/relationships/todos/${todo_id}" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}"# Path parameters
export incident_id="CHANGE_ME"
export todo_id="CHANGE_ME"
# 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/incidents/${incident_id}/relationships/todos/${todo_id}" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}"# Path parameters
export incident_id="CHANGE_ME"
export todo_id="CHANGE_ME"
# 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/incidents/${incident_id}/relationships/todos/${todo_id}" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}"# Path parameters
export incident_id="CHANGE_ME"
export todo_id="CHANGE_ME"
# 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/incidents/${incident_id}/relationships/todos/${todo_id}" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}"# Path parameters
export incident_id="CHANGE_ME"
export todo_id="CHANGE_ME"
# 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/incidents/${incident_id}/relationships/todos/${todo_id}" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}"# Path parameters
export incident_id="CHANGE_ME"
export todo_id="CHANGE_ME"
# 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/incidents/${incident_id}/relationships/todos/${todo_id}" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}"# Path parameters
export incident_id="CHANGE_ME"
export todo_id="CHANGE_ME"
# 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/incidents/${incident_id}/relationships/todos/${todo_id}" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}"# Path parameters
export incident_id="CHANGE_ME"
export todo_id="CHANGE_ME"
# 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/incidents/${incident_id}/relationships/todos/${todo_id}" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}"// Get incident todo details 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() {
// there is a valid "incident" in the system
IncidentDataID := os.Getenv("INCIDENT_DATA_ID")
// the "incident" has an "incident_todo"
IncidentTodoDataID := os.Getenv("INCIDENT_TODO_DATA_ID")
ctx := datadog.NewDefaultContext(context.Background())
ctx = context.WithValue(ctx, datadog.ContextAccessToken, os.Getenv("DD_BEARER_TOKEN"))
configuration := datadog.NewConfiguration()
configuration.SetUnstableOperationEnabled("v2.GetIncidentTodo", true)
apiClient := datadog.NewAPIClient(configuration)
api := datadogV2.NewIncidentsApi(apiClient)
resp, r, err := api.GetIncidentTodo(ctx, IncidentDataID, IncidentTodoDataID)
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `IncidentsApi.GetIncidentTodo`: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
responseContent, _ := json.MarshalIndent(resp, "", " ")
fmt.Fprintf(os.Stdout, "Response from `IncidentsApi.GetIncidentTodo`:\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 incident todo details returns "OK" response
import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.IncidentsApi;
import com.datadog.api.client.v2.model.IncidentTodoResponse;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = ApiClient.getDefaultApiClient();
defaultClient.setAccessToken(System.getenv("DD_BEARER_TOKEN"));
defaultClient.setUnstableOperationEnabled("v2.getIncidentTodo", true);
IncidentsApi apiInstance = new IncidentsApi(defaultClient);
// there is a valid "incident" in the system
String INCIDENT_DATA_ID = System.getenv("INCIDENT_DATA_ID");
// the "incident" has an "incident_todo"
String INCIDENT_TODO_DATA_ID = System.getenv("INCIDENT_TODO_DATA_ID");
try {
IncidentTodoResponse result =
apiInstance.getIncidentTodo(INCIDENT_DATA_ID, INCIDENT_TODO_DATA_ID);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling IncidentsApi#getIncidentTodo");
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 incident todo details returns "OK" response
"""
from os import environ
from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.incidents_api import IncidentsApi
# there is a valid "incident" in the system
INCIDENT_DATA_ID = environ["INCIDENT_DATA_ID"]
# the "incident" has an "incident_todo"
INCIDENT_TODO_DATA_ID = environ["INCIDENT_TODO_DATA_ID"]
configuration = Configuration()
configuration.access_token = environ["DD_BEARER_TOKEN"]
configuration.unstable_operations["get_incident_todo"] = True
with ApiClient(configuration) as api_client:
api_instance = IncidentsApi(api_client)
response = api_instance.get_incident_todo(
incident_id=INCIDENT_DATA_ID,
todo_id=INCIDENT_TODO_DATA_ID,
)
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 incident todo details returns "OK" response
require "datadog_api_client"
DatadogAPIClient.configure do |config|
config.access_token = ENV["DD_BEARER_TOKEN"]
config.unstable_operations["v2.get_incident_todo".to_sym] = true
end
api_instance = DatadogAPIClient::V2::IncidentsAPI.new
# there is a valid "incident" in the system
INCIDENT_DATA_ID = ENV["INCIDENT_DATA_ID"]
# the "incident" has an "incident_todo"
INCIDENT_TODO_DATA_ID = ENV["INCIDENT_TODO_DATA_ID"]
p api_instance.get_incident_todo(INCIDENT_DATA_ID, INCIDENT_TODO_DATA_ID)
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 incident todo details returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_incidents::IncidentsAPI;
#[tokio::main]
async fn main() {
// there is a valid "incident" in the system
let incident_data_id = std::env::var("INCIDENT_DATA_ID").unwrap();
// the "incident" has an "incident_todo"
let incident_todo_data_id = std::env::var("INCIDENT_TODO_DATA_ID").unwrap();
let mut configuration = datadog::Configuration::new();
configuration.set_unstable_operation_enabled("v2.get_incident_todo", true);
let api = IncidentsAPI::with_config(configuration);
let resp = api
.get_incident_todo(incident_data_id.clone(), incident_todo_data_id.clone())
.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 incident todo details 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,
},
},
});
configuration.unstableOperations["v2.getIncidentTodo"] = true;
const apiInstance = new v2.IncidentsApi(configuration);
// there is a valid "incident" in the system
const INCIDENT_DATA_ID = process.env.INCIDENT_DATA_ID as string;
// the "incident" has an "incident_todo"
const INCIDENT_TODO_DATA_ID = process.env.INCIDENT_TODO_DATA_ID as string;
const params: v2.IncidentsApiGetIncidentTodoRequest = {
incidentId: INCIDENT_DATA_ID,
todoId: INCIDENT_TODO_DATA_ID,
};
apiInstance
.getIncidentTodo(params)
.then((data: v2.IncidentTodoResponse) => {
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"