Update global incident handle
https://api.datadoghq.com/api/v2/incidents/config/global/incident-handleshttps://api.us3.datadoghq.com/api/v2/incidents/config/global/incident-handleshttps://api.us5.datadoghq.com/api/v2/incidents/config/global/incident-handleshttps://api.datadoghq.eu/api/v2/incidents/config/global/incident-handleshttps://api.ap1.datadoghq.com/api/v2/incidents/config/global/incident-handleshttps://api.ap2.datadoghq.com/api/v2/incidents/config/global/incident-handleshttps://api.uk1.datadoghq.com/api/v2/incidents/config/global/incident-handleshttps://api.ddog-gov.com/api/v2/incidents/config/global/incident-handleshttps://api.us2.ddog-gov.com/api/v2/incidents/config/global/incident-handles概要
Update an existing global incident handle.
引数
クエリ文字列
includeComma-separated list of related resources to include in the response
リクエスト
Body Data (required)
data [required]Data object representing an incident handle in a create or update request.
attributes [required]Incident handle attributes for requests
fieldsDynamic fields associated with the handle
severitySeverity levels associated with the handle
name [required]The handle name
idThe ID of the incident handle (required for PUT requests)
relationshipsRelationships to associate with an incident handle in a create or update request.
commander_userA single relationship object for an incident handle, wrapping the related resource data.
data [required]Relationship data for an incident handle, containing the ID and type of the related resource.
id [required]The ID of the related resource
type [required]The type of the related resource
incident_type [required]A single relationship object for an incident handle, wrapping the related resource data.
data [required]Relationship data for an incident handle, containing the ID and type of the related resource.
id [required]The ID of the related resource
type [required]The type of the related resource
type [required]Incident handle resource type
incidents_handles{
"data": {
"attributes": {
"fields": {
"severity": [
"SEV-1"
]
},
"name": "@incident-sev-1"
},
"id": "b2494081-cdf0-4205-b366-4e1dd4fdf0bf",
"relationships": {
"commander_user": {
"data": {
"id": "f7b538b1-ed7c-4e84-82de-fdf84a539d40",
"type": "incident_types"
}
},
"incident_type": {
"data": {
"id": "f7b538b1-ed7c-4e84-82de-fdf84a539d40",
"type": "incident_types"
}
}
},
"type": "incidents_handles"
}
}応答
OK
Response payload for a single incident handle, including the handle data and related resources.
data [required]Data object representing an incident handle in a response.
attributes [required]Incident handle attributes for responses
created_at [required]Timestamp when the handle was created
fields [required]Dynamic fields associated with the handle
severitySeverity levels associated with the handle
modified_at [required]Timestamp when the handle was last modified
name [required]The handle name
id [required]The ID of the incident handle
relationshipsRelationships associated with an incident handle response, including linked users and incident type.
commander_userA single relationship object for an incident handle, wrapping the related resource data.
data [required]Relationship data for an incident handle, containing the ID and type of the related resource.
id [required]The ID of the related resource
type [required]The type of the related resource
created_by_user [required]A single relationship object for an incident handle, wrapping the related resource data.
data [required]Relationship data for an incident handle, containing the ID and type of the related resource.
id [required]The ID of the related resource
type [required]The type of the related resource
incident_type [required]A single relationship object for an incident handle, wrapping the related resource data.
data [required]Relationship data for an incident handle, containing the ID and type of the related resource.
id [required]The ID of the related resource
type [required]The type of the related resource
last_modified_by_user [required]A single relationship object for an incident handle, wrapping the related resource data.
data [required]Relationship data for an incident handle, containing the ID and type of the related resource.
id [required]The ID of the related resource
type [required]The type of the related resource
type [required]Incident handle resource type
incidents_handlesincludedIncluded related resources
<type=users>User object returned by the API.
attributesAttributes of user object returned by the API.
emailEmail of the user.
handleHandle of the user.
iconURL of the user's icon.
nameName of the user.
uuidUUID of the user.
idID of the user.
typeUsers resource type.
usersusers<type=incident_types>Incident type response data.
attributesIncident type's attributes.
configurationThe incident-type-scoped behavior settings. All fields are optional on update. Any field omitted from a PATCH request keeps its current value. This object is read-only on the incident type resource itself and is only mutated through the update (PATCH) endpoint.
allow_incident_deletionWhether incidents of this type can be deleted.
falseallow_workflowsWhether automation workflows can be triggered for incidents of this type.
truecreate_messageAn optional message shown to users when they declare an incident of this type.
editable_timestampsWhether responders can edit incident timestamps for incidents of this type.
falseprivate_incidentsWhether responders can create private incidents of this type. This is an opt-in setting, distinct from private_incidents_by_default, which controls whether incidents are created private automatically.
falseprivate_incidents_by_defaultWhether incidents of this type are created as private by default.
falseslug_sourceWhen set to servicenow, incidents will display the ServiceNow record ID instead of the public ID. If no ServiceNow integration exists, the public ID will be displayed.
defaultdefault, servicenowtest_incidentsWhether incidents of this type are treated as test incidents.
truecreatedAtTimestamp when the incident type was created.
createdByA unique identifier that represents the user that created the incident type.
descriptionText that describes the incident type.
is_defaultIf true, this incident type will be used as the default incident type if a type is not specified during the creation of incident resources.
falselastModifiedByA unique identifier that represents the user that last modified the incident type.
modifiedAtTimestamp when the incident type was last modified.
name [required]The name of the incident type.
prefixThe string that will be prepended to the incident title across the Datadog app.
id [required]The incident type's ID.
relationshipsThe incident type's resource relationships.
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.
usersusersgoogle_meet_configurationA reference to a Google Meet Configuration resource.
data [required]The Google Meet configuration relationship data object.
id [required]The unique identifier of the Google Meet configuration.
type [required]The type of the Google Meet configuration.
last_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.
usersusersmicrosoft_teams_configurationA reference to a Microsoft Teams Configuration resource.
data [required]The Microsoft Teams configuration relationship data object.
id [required]The unique identifier of the Microsoft Teams configuration.
type [required]The type of the Microsoft Teams configuration.
zoom_configurationA reference to a Zoom configuration resource.
data [required]The Zoom configuration relationship data object.
id [required]The unique identifier of the Zoom configuration.
type [required]The type of the Zoom configuration.
type [required]Incident type resource type.
incident_typesincident_types{
"data": {
"attributes": {
"created_at": "2026-01-13T17:15:52.726905Z",
"fields": {
"severity": [
"SEV-1"
]
},
"modified_at": "2026-01-13T17:15:52.726905Z",
"name": "@incident-sev-1"
},
"id": "12ceee6d-a7c0-4407-bc54-30e54140d7f0",
"relationships": {
"commander_user": {
"data": {
"id": "f7b538b1-ed7c-4e84-82de-fdf84a539d40",
"type": "incident_types"
}
},
"created_by_user": {
"data": {
"id": "f7b538b1-ed7c-4e84-82de-fdf84a539d40",
"type": "incident_types"
}
},
"incident_type": {
"data": {
"id": "f7b538b1-ed7c-4e84-82de-fdf84a539d40",
"type": "incident_types"
}
},
"last_modified_by_user": {
"data": {
"id": "f7b538b1-ed7c-4e84-82de-fdf84a539d40",
"type": "incident_types"
}
}
},
"type": "incidents_handles"
},
"included": [
{
"attributes": {
"email": "string",
"handle": "string",
"icon": "string",
"name": "string",
"uuid": "string"
},
"id": "string",
"type": "users"
}
]
}Bad Request
API error response.
errors [required]A list of errors.
detailA human-readable explanation specific to this occurrence of the error.
metaNon-standard meta-information about the error
sourceReferences to the source of the error.
headerA string indicating the name of a single request header which caused the error.
parameterA string indicating which URI query parameter caused the error.
pointerA JSON pointer to the value in the request document that caused the error.
statusStatus code of the response.
titleShort human-readable summary of the error.
{
"errors": [
{
"detail": "Missing required attribute in body",
"meta": {},
"source": {
"header": "Authorization",
"parameter": "limit",
"pointer": "/data/attributes/title"
},
"status": "400",
"title": "Bad Request"
}
]
}Too many requests
API error response.
errors [required]A list of errors.
{
"errors": [
"Bad Request"
]
}コード例
# 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 PUT "https://api.${DD_SITE}/api/v2/incidents/config/global/incident-handles" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"data": {
"attributes": {
"fields": {
"severity": [
"SEV-1"
]
},
"name": "@incident-sev-1"
},
"id": "b2494081-cdf0-4205-b366-4e1dd4fdf0bf",
"relationships": {
"commander_user": {
"data": {
"id": "f7b538b1-ed7c-4e84-82de-fdf84a539d40",
"type": "incident_types"
}
},
"incident_type": {
"data": {
"id": "f7b538b1-ed7c-4e84-82de-fdf84a539d40",
"type": "incident_types"
}
}
},
"type": "incidents_handles"
}
}
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 PUT "https://api.${DD_SITE}/api/v2/incidents/config/global/incident-handles" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"data": {
"attributes": {
"fields": {
"severity": [
"SEV-1"
]
},
"name": "@incident-sev-1"
},
"id": "b2494081-cdf0-4205-b366-4e1dd4fdf0bf",
"relationships": {
"commander_user": {
"data": {
"id": "f7b538b1-ed7c-4e84-82de-fdf84a539d40",
"type": "incident_types"
}
},
"incident_type": {
"data": {
"id": "f7b538b1-ed7c-4e84-82de-fdf84a539d40",
"type": "incident_types"
}
}
},
"type": "incidents_handles"
}
}
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 PUT "https://api.${DD_SITE}/api/v2/incidents/config/global/incident-handles" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"data": {
"attributes": {
"fields": {
"severity": [
"SEV-1"
]
},
"name": "@incident-sev-1"
},
"id": "b2494081-cdf0-4205-b366-4e1dd4fdf0bf",
"relationships": {
"commander_user": {
"data": {
"id": "f7b538b1-ed7c-4e84-82de-fdf84a539d40",
"type": "incident_types"
}
},
"incident_type": {
"data": {
"id": "f7b538b1-ed7c-4e84-82de-fdf84a539d40",
"type": "incident_types"
}
}
},
"type": "incidents_handles"
}
}
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 PUT "https://api.${DD_SITE}/api/v2/incidents/config/global/incident-handles" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"data": {
"attributes": {
"fields": {
"severity": [
"SEV-1"
]
},
"name": "@incident-sev-1"
},
"id": "b2494081-cdf0-4205-b366-4e1dd4fdf0bf",
"relationships": {
"commander_user": {
"data": {
"id": "f7b538b1-ed7c-4e84-82de-fdf84a539d40",
"type": "incident_types"
}
},
"incident_type": {
"data": {
"id": "f7b538b1-ed7c-4e84-82de-fdf84a539d40",
"type": "incident_types"
}
}
},
"type": "incidents_handles"
}
}
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 PUT "https://api.${DD_SITE}/api/v2/incidents/config/global/incident-handles" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"data": {
"attributes": {
"fields": {
"severity": [
"SEV-1"
]
},
"name": "@incident-sev-1"
},
"id": "b2494081-cdf0-4205-b366-4e1dd4fdf0bf",
"relationships": {
"commander_user": {
"data": {
"id": "f7b538b1-ed7c-4e84-82de-fdf84a539d40",
"type": "incident_types"
}
},
"incident_type": {
"data": {
"id": "f7b538b1-ed7c-4e84-82de-fdf84a539d40",
"type": "incident_types"
}
}
},
"type": "incidents_handles"
}
}
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 PUT "https://api.${DD_SITE}/api/v2/incidents/config/global/incident-handles" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"data": {
"attributes": {
"fields": {
"severity": [
"SEV-1"
]
},
"name": "@incident-sev-1"
},
"id": "b2494081-cdf0-4205-b366-4e1dd4fdf0bf",
"relationships": {
"commander_user": {
"data": {
"id": "f7b538b1-ed7c-4e84-82de-fdf84a539d40",
"type": "incident_types"
}
},
"incident_type": {
"data": {
"id": "f7b538b1-ed7c-4e84-82de-fdf84a539d40",
"type": "incident_types"
}
}
},
"type": "incidents_handles"
}
}
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 PUT "https://api.${DD_SITE}/api/v2/incidents/config/global/incident-handles" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"data": {
"attributes": {
"fields": {
"severity": [
"SEV-1"
]
},
"name": "@incident-sev-1"
},
"id": "b2494081-cdf0-4205-b366-4e1dd4fdf0bf",
"relationships": {
"commander_user": {
"data": {
"id": "f7b538b1-ed7c-4e84-82de-fdf84a539d40",
"type": "incident_types"
}
},
"incident_type": {
"data": {
"id": "f7b538b1-ed7c-4e84-82de-fdf84a539d40",
"type": "incident_types"
}
}
},
"type": "incidents_handles"
}
}
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 PUT "https://api.${DD_SITE}/api/v2/incidents/config/global/incident-handles" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"data": {
"attributes": {
"fields": {
"severity": [
"SEV-1"
]
},
"name": "@incident-sev-1"
},
"id": "b2494081-cdf0-4205-b366-4e1dd4fdf0bf",
"relationships": {
"commander_user": {
"data": {
"id": "f7b538b1-ed7c-4e84-82de-fdf84a539d40",
"type": "incident_types"
}
},
"incident_type": {
"data": {
"id": "f7b538b1-ed7c-4e84-82de-fdf84a539d40",
"type": "incident_types"
}
}
},
"type": "incidents_handles"
}
}
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 PUT "https://api.${DD_SITE}/api/v2/incidents/config/global/incident-handles" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"data": {
"attributes": {
"fields": {
"severity": [
"SEV-1"
]
},
"name": "@incident-sev-1"
},
"id": "b2494081-cdf0-4205-b366-4e1dd4fdf0bf",
"relationships": {
"commander_user": {
"data": {
"id": "f7b538b1-ed7c-4e84-82de-fdf84a539d40",
"type": "incident_types"
}
},
"incident_type": {
"data": {
"id": "f7b538b1-ed7c-4e84-82de-fdf84a539d40",
"type": "incident_types"
}
}
},
"type": "incidents_handles"
}
}
EOF// Update global incident handle 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() {
body := datadogV2.IncidentHandleRequest{
Data: datadogV2.IncidentHandleDataRequest{
Attributes: datadogV2.IncidentHandleAttributesRequest{
Fields: &datadogV2.IncidentHandleAttributesFields{
Severity: []string{
"SEV-1",
},
},
Name: "@incident-sev-1",
},
Id: datadog.PtrString("b2494081-cdf0-4205-b366-4e1dd4fdf0bf"),
Relationships: *datadogV2.NewNullableIncidentHandleRelationshipsRequest(&datadogV2.IncidentHandleRelationshipsRequest{
CommanderUser: &datadogV2.IncidentHandleRelationship{
Data: datadogV2.IncidentHandleRelationshipData{
Id: "f7b538b1-ed7c-4e84-82de-fdf84a539d40",
Type: "incident_types",
},
},
IncidentType: datadogV2.IncidentHandleRelationship{
Data: datadogV2.IncidentHandleRelationshipData{
Id: "f7b538b1-ed7c-4e84-82de-fdf84a539d40",
Type: "incident_types",
},
},
}),
Type: datadogV2.INCIDENTHANDLETYPE_INCIDENTS_HANDLES,
},
}
ctx := datadog.NewDefaultContext(context.Background())
ctx = context.WithValue(ctx, datadog.ContextAccessToken, os.Getenv("DD_BEARER_TOKEN"))
configuration := datadog.NewConfiguration()
configuration.SetUnstableOperationEnabled("v2.UpdateGlobalIncidentHandle", true)
apiClient := datadog.NewAPIClient(configuration)
api := datadogV2.NewIncidentsApi(apiClient)
resp, r, err := api.UpdateGlobalIncidentHandle(ctx, body, *datadogV2.NewUpdateGlobalIncidentHandleOptionalParameters())
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `IncidentsApi.UpdateGlobalIncidentHandle`: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
responseContent, _ := json.MarshalIndent(resp, "", " ")
fmt.Fprintf(os.Stdout, "Response from `IncidentsApi.UpdateGlobalIncidentHandle`:\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"// Update global incident handle 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.IncidentHandleAttributesFields;
import com.datadog.api.client.v2.model.IncidentHandleAttributesRequest;
import com.datadog.api.client.v2.model.IncidentHandleDataRequest;
import com.datadog.api.client.v2.model.IncidentHandleRelationship;
import com.datadog.api.client.v2.model.IncidentHandleRelationshipData;
import com.datadog.api.client.v2.model.IncidentHandleRelationshipsRequest;
import com.datadog.api.client.v2.model.IncidentHandleRequest;
import com.datadog.api.client.v2.model.IncidentHandleResponse;
import com.datadog.api.client.v2.model.IncidentHandleType;
import java.util.Collections;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = ApiClient.getDefaultApiClient();
defaultClient.setAccessToken(System.getenv("DD_BEARER_TOKEN"));
defaultClient.setUnstableOperationEnabled("v2.updateGlobalIncidentHandle", true);
IncidentsApi apiInstance = new IncidentsApi(defaultClient);
IncidentHandleRequest body =
new IncidentHandleRequest()
.data(
new IncidentHandleDataRequest()
.attributes(
new IncidentHandleAttributesRequest()
.fields(
new IncidentHandleAttributesFields()
.severity(Collections.singletonList("SEV-1")))
.name("@incident-sev-1"))
.id("b2494081-cdf0-4205-b366-4e1dd4fdf0bf")
.relationships(
new IncidentHandleRelationshipsRequest()
.commanderUser(
new IncidentHandleRelationship()
.data(
new IncidentHandleRelationshipData()
.id("f7b538b1-ed7c-4e84-82de-fdf84a539d40")
.type("incident_types")))
.incidentType(
new IncidentHandleRelationship()
.data(
new IncidentHandleRelationshipData()
.id("f7b538b1-ed7c-4e84-82de-fdf84a539d40")
.type("incident_types"))))
.type(IncidentHandleType.INCIDENTS_HANDLES));
try {
IncidentHandleResponse result = apiInstance.updateGlobalIncidentHandle(body);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling IncidentsApi#updateGlobalIncidentHandle");
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""""
Update global incident handle returns "OK" response
"""
from os import environ
from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.incidents_api import IncidentsApi
from datadog_api_client.v2.model.incident_handle_attributes_fields import IncidentHandleAttributesFields
from datadog_api_client.v2.model.incident_handle_attributes_request import IncidentHandleAttributesRequest
from datadog_api_client.v2.model.incident_handle_data_request import IncidentHandleDataRequest
from datadog_api_client.v2.model.incident_handle_relationship import IncidentHandleRelationship
from datadog_api_client.v2.model.incident_handle_relationship_data import IncidentHandleRelationshipData
from datadog_api_client.v2.model.incident_handle_relationships_request import IncidentHandleRelationshipsRequest
from datadog_api_client.v2.model.incident_handle_request import IncidentHandleRequest
from datadog_api_client.v2.model.incident_handle_type import IncidentHandleType
body = IncidentHandleRequest(
data=IncidentHandleDataRequest(
attributes=IncidentHandleAttributesRequest(
fields=IncidentHandleAttributesFields(
severity=[
"SEV-1",
],
),
name="@incident-sev-1",
),
id="b2494081-cdf0-4205-b366-4e1dd4fdf0bf",
relationships=IncidentHandleRelationshipsRequest(
commander_user=IncidentHandleRelationship(
data=IncidentHandleRelationshipData(
id="f7b538b1-ed7c-4e84-82de-fdf84a539d40",
type="incident_types",
),
),
incident_type=IncidentHandleRelationship(
data=IncidentHandleRelationshipData(
id="f7b538b1-ed7c-4e84-82de-fdf84a539d40",
type="incident_types",
),
),
),
type=IncidentHandleType.INCIDENTS_HANDLES,
),
)
configuration = Configuration()
configuration.access_token = environ["DD_BEARER_TOKEN"]
configuration.unstable_operations["update_global_incident_handle"] = True
with ApiClient(configuration) as api_client:
api_instance = IncidentsApi(api_client)
response = api_instance.update_global_incident_handle(body=body)
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"# Update global incident handle returns "OK" response
require "datadog_api_client"
DatadogAPIClient.configure do |config|
config.access_token = ENV["DD_BEARER_TOKEN"]
config.unstable_operations["v2.update_global_incident_handle".to_sym] = true
end
api_instance = DatadogAPIClient::V2::IncidentsAPI.new
body = DatadogAPIClient::V2::IncidentHandleRequest.new({
data: DatadogAPIClient::V2::IncidentHandleDataRequest.new({
attributes: DatadogAPIClient::V2::IncidentHandleAttributesRequest.new({
fields: DatadogAPIClient::V2::IncidentHandleAttributesFields.new({
severity: [
"SEV-1",
],
}),
name: "@incident-sev-1",
}),
id: "b2494081-cdf0-4205-b366-4e1dd4fdf0bf",
relationships: DatadogAPIClient::V2::IncidentHandleRelationshipsRequest.new({
commander_user: DatadogAPIClient::V2::IncidentHandleRelationship.new({
data: DatadogAPIClient::V2::IncidentHandleRelationshipData.new({
id: "f7b538b1-ed7c-4e84-82de-fdf84a539d40",
type: "incident_types",
}),
}),
incident_type: DatadogAPIClient::V2::IncidentHandleRelationship.new({
data: DatadogAPIClient::V2::IncidentHandleRelationshipData.new({
id: "f7b538b1-ed7c-4e84-82de-fdf84a539d40",
type: "incident_types",
}),
}),
}),
type: DatadogAPIClient::V2::IncidentHandleType::INCIDENTS_HANDLES,
}),
})
p api_instance.update_global_incident_handle(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"// Update global incident handle returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_incidents::IncidentsAPI;
use datadog_api_client::datadogV2::api_incidents::UpdateGlobalIncidentHandleOptionalParams;
use datadog_api_client::datadogV2::model::IncidentHandleAttributesFields;
use datadog_api_client::datadogV2::model::IncidentHandleAttributesRequest;
use datadog_api_client::datadogV2::model::IncidentHandleDataRequest;
use datadog_api_client::datadogV2::model::IncidentHandleRelationship;
use datadog_api_client::datadogV2::model::IncidentHandleRelationshipData;
use datadog_api_client::datadogV2::model::IncidentHandleRelationshipsRequest;
use datadog_api_client::datadogV2::model::IncidentHandleRequest;
use datadog_api_client::datadogV2::model::IncidentHandleType;
#[tokio::main]
async fn main() {
let body = IncidentHandleRequest::new(
IncidentHandleDataRequest::new(
IncidentHandleAttributesRequest::new("@incident-sev-1".to_string())
.fields(IncidentHandleAttributesFields::new().severity(vec!["SEV-1".to_string()])),
IncidentHandleType::INCIDENTS_HANDLES,
)
.id("b2494081-cdf0-4205-b366-4e1dd4fdf0bf".to_string())
.relationships(Some(
IncidentHandleRelationshipsRequest::new(IncidentHandleRelationship::new(
IncidentHandleRelationshipData::new(
"f7b538b1-ed7c-4e84-82de-fdf84a539d40".to_string(),
"incident_types".to_string(),
),
))
.commander_user(IncidentHandleRelationship::new(
IncidentHandleRelationshipData::new(
"f7b538b1-ed7c-4e84-82de-fdf84a539d40".to_string(),
"incident_types".to_string(),
),
)),
)),
);
let mut configuration = datadog::Configuration::new();
configuration.set_unstable_operation_enabled("v2.update_global_incident_handle", true);
let api = IncidentsAPI::with_config(configuration);
let resp = api
.update_global_incident_handle(body, UpdateGlobalIncidentHandleOptionalParams::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="<API-KEY>" DD_APP_KEY="<APP-KEY>" cargo runDD_SITE="us3.datadoghq.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" cargo runDD_SITE="us5.datadoghq.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" cargo runDD_SITE="datadoghq.eu" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" cargo runDD_SITE="ap1.datadoghq.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" cargo runDD_SITE="ap2.datadoghq.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" cargo runDD_SITE="uk1.datadoghq.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" cargo runDD_SITE="ddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" cargo runDD_SITE="us2.ddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" cargo run/**
* Update global incident handle 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.updateGlobalIncidentHandle"] = true;
const apiInstance = new v2.IncidentsApi(configuration);
const params: v2.IncidentsApiUpdateGlobalIncidentHandleRequest = {
body: {
data: {
attributes: {
fields: {
severity: ["SEV-1"],
},
name: "@incident-sev-1",
},
id: "b2494081-cdf0-4205-b366-4e1dd4fdf0bf",
relationships: {
commanderUser: {
data: {
id: "f7b538b1-ed7c-4e84-82de-fdf84a539d40",
type: "incident_types",
},
},
incidentType: {
data: {
id: "f7b538b1-ed7c-4e84-82de-fdf84a539d40",
type: "incident_types",
},
},
},
type: "incidents_handles",
},
},
};
apiInstance
.updateGlobalIncidentHandle(params)
.then((data: v2.IncidentHandleResponse) => {
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"