Included related resources that the user requested.
Option 1
object
User object returned by the API.
attributes
object
Attributes of user object returned by the API.
email
string
Email of the user.
handle
string
Handle of the user.
icon
string
URL of the user's icon.
name
string
Name of the user.
uuid
string
UUID of the user.
id
string
ID of the user.
type
enum
Users resource type.
Allowed enum values: users
default: users
Option 2
object
A single incident attachment.
attributes [required]
<oneOf>
The attributes object for an attachment.
Option 1
object
The attributes object for a postmortem attachment.
attachment [required]
object
The postmortem attachment.
documentUrl [required]
string
The URL of this notebook attachment.
title [required]
string
The title of this postmortem attachment.
attachment_type [required]
enum
The type of postmortem attachment attributes.
Allowed enum values: postmortem
default: postmortem
Option 2
object
The attributes object for a link attachment.
attachment [required]
object
The link attachment.
documentUrl [required]
string
The URL of this link attachment.
title [required]
string
The title of this link attachment.
attachment_type [required]
enum
The type of link attachment attributes.
Allowed enum values: link
default: link
modified
date-time
Timestamp when the incident attachment link was last modified.
id [required]
string
A unique identifier that represents the incident attachment.
relationships [required]
object
The incident attachment's relationships.
last_modified_by_user
object
Relationship to user.
data [required]
object
Relationship to user object.
id [required]
string
A unique identifier that represents the user.
type [required]
enum
Users resource type.
Allowed enum values: users
default: users
type [required]
enum
The incident attachment resource type.
Allowed enum values: incident_attachments
default: incident_attachments
{"data":{"attributes":{"archived":"2019-09-19T10:00:00.000Z","case_id":"integer","created":"2019-09-19T10:00:00.000Z","customer_impact_duration":"integer","customer_impact_end":"2019-09-19T10:00:00.000Z","customer_impact_scope":"An example customer impact scope","customer_impact_start":"2019-09-19T10:00:00.000Z","customer_impacted":false,"detected":"2019-09-19T10:00:00.000Z","fields":{"<any-key>":"undefined"},"incident_type_uuid":"00000000-0000-0000-0000-000000000000","modified":"2019-09-19T10:00:00.000Z","non_datadog_creator":{"image_48_px":"string","name":"string"},"notification_handles":[{"display_name":"Jane Doe","handle":"@test.user@test.com"}],"public_id":1,"resolved":"2019-09-19T10:00:00.000Z","severity":"UNKNOWN","state":"string","time_to_detect":"integer","time_to_internal_response":"integer","time_to_repair":"integer","time_to_resolve":"integer","title":"A test incident title","visibility":"string"},"id":"00000000-0000-0000-1234-000000000000","relationships":{"attachments":{"data":[{"id":"00000000-0000-abcd-1000-000000000000","type":"incident_attachments"}]},"commander_user":{"data":{"id":"00000000-0000-0000-0000-000000000000","type":"users"}},"created_by_user":{"data":{"id":"00000000-0000-0000-2345-000000000000","type":"users"}},"impacts":{"data":[{"id":"00000000-0000-0000-2345-000000000000","type":"incident_impacts"}]},"integrations":{"data":[{"id":"00000000-abcd-0001-0000-000000000000","type":"incident_integrations"}]},"last_modified_by_user":{"data":{"id":"00000000-0000-0000-2345-000000000000","type":"users"}},"responders":{"data":[{"id":"00000000-0000-0000-2345-000000000000","type":"incident_responders"}]},"user_defined_fields":{"data":[{"id":"00000000-0000-0000-2345-000000000000","type":"user_defined_field"}]}},"type":"incidents"},"included":[{"attributes":{"email":"string","handle":"string","icon":"string","name":"string","uuid":"string"},"id":"string","type":"users"}]}
// Create an incident returns "CREATED" response
packagemainimport("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")funcmain(){// there is a valid "user" in the system
UserDataID:=os.Getenv("USER_DATA_ID")body:=datadogV2.IncidentCreateRequest{Data:datadogV2.IncidentCreateData{Type:datadogV2.INCIDENTTYPE_INCIDENTS,Attributes:datadogV2.IncidentCreateAttributes{Title:"Example-Incident",CustomerImpacted:false,Fields:map[string]datadogV2.IncidentFieldAttributes{"state":datadogV2.IncidentFieldAttributes{IncidentFieldAttributesSingleValue:&datadogV2.IncidentFieldAttributesSingleValue{Type:datadogV2.INCIDENTFIELDATTRIBUTESSINGLEVALUETYPE_DROPDOWN.Ptr(),Value:*datadog.NewNullableString(datadog.PtrString("resolved")),}},},},Relationships:&datadogV2.IncidentCreateRelationships{CommanderUser:*datadogV2.NewNullableNullableRelationshipToUser(&datadogV2.NullableRelationshipToUser{Data:*datadogV2.NewNullableNullableRelationshipToUserData(&datadogV2.NullableRelationshipToUserData{Type:datadogV2.USERSTYPE_USERS,Id:UserDataID,}),}),},},}ctx:=datadog.NewDefaultContext(context.Background())configuration:=datadog.NewConfiguration()configuration.SetUnstableOperationEnabled("v2.CreateIncident",true)apiClient:=datadog.NewAPIClient(configuration)api:=datadogV2.NewIncidentsApi(apiClient)resp,r,err:=api.CreateIncident(ctx,body)iferr!=nil{fmt.Fprintf(os.Stderr,"Error when calling `IncidentsApi.CreateIncident`: %v\n",err)fmt.Fprintf(os.Stderr,"Full HTTP response: %v\n",r)}responseContent,_:=json.MarshalIndent(resp,""," ")fmt.Fprintf(os.Stdout,"Response from `IncidentsApi.CreateIncident`:\n%s\n",responseContent)}
// Create an incident returns "CREATED" responseimportcom.datadog.api.client.ApiClient;importcom.datadog.api.client.ApiException;importcom.datadog.api.client.v2.api.IncidentsApi;importcom.datadog.api.client.v2.model.IncidentCreateAttributes;importcom.datadog.api.client.v2.model.IncidentCreateData;importcom.datadog.api.client.v2.model.IncidentCreateRelationships;importcom.datadog.api.client.v2.model.IncidentCreateRequest;importcom.datadog.api.client.v2.model.IncidentFieldAttributes;importcom.datadog.api.client.v2.model.IncidentFieldAttributesSingleValue;importcom.datadog.api.client.v2.model.IncidentFieldAttributesSingleValueType;importcom.datadog.api.client.v2.model.IncidentResponse;importcom.datadog.api.client.v2.model.IncidentType;importcom.datadog.api.client.v2.model.NullableRelationshipToUser;importcom.datadog.api.client.v2.model.NullableRelationshipToUserData;importcom.datadog.api.client.v2.model.UsersType;importjava.util.Map;publicclassExample{publicstaticvoidmain(String[]args){ApiClientdefaultClient=ApiClient.getDefaultApiClient();defaultClient.setUnstableOperationEnabled("v2.createIncident",true);IncidentsApiapiInstance=newIncidentsApi(defaultClient);// there is a valid "user" in the systemStringUSER_DATA_ID=System.getenv("USER_DATA_ID");IncidentCreateRequestbody=newIncidentCreateRequest().data(newIncidentCreateData().type(IncidentType.INCIDENTS).attributes(newIncidentCreateAttributes().title("Example-Incident").customerImpacted(false).fields(Map.ofEntries(Map.entry("state",newIncidentFieldAttributes(newIncidentFieldAttributesSingleValue().type(IncidentFieldAttributesSingleValueType.DROPDOWN).value("resolved")))))).relationships(newIncidentCreateRelationships().commanderUser(newNullableRelationshipToUser().data(newNullableRelationshipToUserData().type(UsersType.USERS).id(USER_DATA_ID)))));try{IncidentResponseresult=apiInstance.createIncident(body);System.out.println(result);}catch(ApiExceptione){System.err.println("Exception when calling IncidentsApi#createIncident");System.err.println("Status code: "+e.getCode());System.err.println("Reason: "+e.getResponseBody());System.err.println("Response headers: "+e.getResponseHeaders());e.printStackTrace();}}}
"""
Create an incident returns "CREATED" response
"""fromosimportenvironfromdatadog_api_clientimportApiClient,Configurationfromdatadog_api_client.v2.api.incidents_apiimportIncidentsApifromdatadog_api_client.v2.model.incident_create_attributesimportIncidentCreateAttributesfromdatadog_api_client.v2.model.incident_create_dataimportIncidentCreateDatafromdatadog_api_client.v2.model.incident_create_relationshipsimportIncidentCreateRelationshipsfromdatadog_api_client.v2.model.incident_create_requestimportIncidentCreateRequestfromdatadog_api_client.v2.model.incident_field_attributes_single_valueimportIncidentFieldAttributesSingleValuefromdatadog_api_client.v2.model.incident_field_attributes_single_value_typeimport(IncidentFieldAttributesSingleValueType,)fromdatadog_api_client.v2.model.incident_typeimportIncidentTypefromdatadog_api_client.v2.model.nullable_relationship_to_userimportNullableRelationshipToUserfromdatadog_api_client.v2.model.nullable_relationship_to_user_dataimportNullableRelationshipToUserDatafromdatadog_api_client.v2.model.users_typeimportUsersType# there is a valid "user" in the systemUSER_DATA_ID=environ["USER_DATA_ID"]body=IncidentCreateRequest(data=IncidentCreateData(type=IncidentType.INCIDENTS,attributes=IncidentCreateAttributes(title="Example-Incident",customer_impacted=False,fields=dict(state=IncidentFieldAttributesSingleValue(type=IncidentFieldAttributesSingleValueType.DROPDOWN,value="resolved",),),),relationships=IncidentCreateRelationships(commander_user=NullableRelationshipToUser(data=NullableRelationshipToUserData(type=UsersType.USERS,id=USER_DATA_ID,),),),),)configuration=Configuration()configuration.unstable_operations["create_incident"]=TruewithApiClient(configuration)asapi_client:api_instance=IncidentsApi(api_client)response=api_instance.create_incident(body=body)print(response)
# Create an incident returns "CREATED" responserequire"datadog_api_client"DatadogAPIClient.configuredo|config|config.unstable_operations["v2.create_incident".to_sym]=trueendapi_instance=DatadogAPIClient::V2::IncidentsAPI.new# there is a valid "user" in the systemUSER_DATA_ID=ENV["USER_DATA_ID"]body=DatadogAPIClient::V2::IncidentCreateRequest.new({data:DatadogAPIClient::V2::IncidentCreateData.new({type:DatadogAPIClient::V2::IncidentType::INCIDENTS,attributes:DatadogAPIClient::V2::IncidentCreateAttributes.new({title:"Example-Incident",customer_impacted:false,fields:{state:DatadogAPIClient::V2::IncidentFieldAttributesSingleValue.new({type:DatadogAPIClient::V2::IncidentFieldAttributesSingleValueType::DROPDOWN,value:"resolved",}),},}),relationships:DatadogAPIClient::V2::IncidentCreateRelationships.new({commander_user:DatadogAPIClient::V2::NullableRelationshipToUser.new({data:DatadogAPIClient::V2::NullableRelationshipToUserData.new({type:DatadogAPIClient::V2::UsersType::USERS,id:USER_DATA_ID,}),}),}),}),})papi_instance.create_incident(body)
// Create an incident returns "CREATED" response
usedatadog_api_client::datadog;usedatadog_api_client::datadogV2::api_incidents::IncidentsAPI;usedatadog_api_client::datadogV2::model::IncidentCreateAttributes;usedatadog_api_client::datadogV2::model::IncidentCreateData;usedatadog_api_client::datadogV2::model::IncidentCreateRelationships;usedatadog_api_client::datadogV2::model::IncidentCreateRequest;usedatadog_api_client::datadogV2::model::IncidentFieldAttributes;usedatadog_api_client::datadogV2::model::IncidentFieldAttributesSingleValue;usedatadog_api_client::datadogV2::model::IncidentFieldAttributesSingleValueType;usedatadog_api_client::datadogV2::model::IncidentType;usedatadog_api_client::datadogV2::model::NullableRelationshipToUser;usedatadog_api_client::datadogV2::model::NullableRelationshipToUserData;usedatadog_api_client::datadogV2::model::UsersType;usestd::collections::BTreeMap;#[tokio::main]asyncfnmain(){// there is a valid "user" in the system
letuser_data_id=std::env::var("USER_DATA_ID").unwrap();letbody=IncidentCreateRequest::new(IncidentCreateData::new(IncidentCreateAttributes::new(false,"Example-Incident".to_string()).fields(BTreeMap::from([("state".to_string(),IncidentFieldAttributes::IncidentFieldAttributesSingleValue(Box::new(IncidentFieldAttributesSingleValue::new().type_(IncidentFieldAttributesSingleValueType::DROPDOWN).value(Some("resolved".to_string())),)),)]),),IncidentType::INCIDENTS,).relationships(IncidentCreateRelationships::new(Some(NullableRelationshipToUser::new(Some(NullableRelationshipToUserData::new(user_data_id.clone(),UsersType::USERS,))),))),);letmutconfiguration=datadog::Configuration::new();configuration.set_unstable_operation_enabled("v2.CreateIncident",true);letapi=IncidentsAPI::with_config(configuration);letresp=api.create_incident(body).await;ifletOk(value)=resp{println!("{:#?}",value);}else{println!("{:#?}",resp.unwrap_err());}}
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com"DD_API_KEY="<DD_API_KEY>"DD_APP_KEY="<DD_APP_KEY>"cargo run
/**
* Create an incident returns "CREATED" response
*/import{client,v2}from"@datadog/datadog-api-client";constconfiguration=client.createConfiguration();configuration.unstableOperations["v2.createIncident"]=true;constapiInstance=newv2.IncidentsApi(configuration);// there is a valid "user" in the system
constUSER_DATA_ID=process.env.USER_DATA_IDasstring;constparams: v2.IncidentsApiCreateIncidentRequest={body:{data:{type:"incidents",attributes:{title:"Example-Incident",customerImpacted: false,fields:{state:{type:"dropdown",value:"resolved",},},},relationships:{commanderUser:{data:{type:"users",id: USER_DATA_ID,},},},},},};apiInstance.createIncident(params).then((data: v2.IncidentResponse)=>{console.log("API called successfully. Returned data: "+JSON.stringify(data));}).catch((error: any)=>console.error(error));
Included related resources that the user requested.
Option 1
object
User object returned by the API.
attributes
object
Attributes of user object returned by the API.
email
string
Email of the user.
handle
string
Handle of the user.
icon
string
URL of the user's icon.
name
string
Name of the user.
uuid
string
UUID of the user.
id
string
ID of the user.
type
enum
Users resource type.
Allowed enum values: users
default: users
Option 2
object
A single incident attachment.
attributes [required]
<oneOf>
The attributes object for an attachment.
Option 1
object
The attributes object for a postmortem attachment.
attachment [required]
object
The postmortem attachment.
documentUrl [required]
string
The URL of this notebook attachment.
title [required]
string
The title of this postmortem attachment.
attachment_type [required]
enum
The type of postmortem attachment attributes.
Allowed enum values: postmortem
default: postmortem
Option 2
object
The attributes object for a link attachment.
attachment [required]
object
The link attachment.
documentUrl [required]
string
The URL of this link attachment.
title [required]
string
The title of this link attachment.
attachment_type [required]
enum
The type of link attachment attributes.
Allowed enum values: link
default: link
modified
date-time
Timestamp when the incident attachment link was last modified.
id [required]
string
A unique identifier that represents the incident attachment.
relationships [required]
object
The incident attachment's relationships.
last_modified_by_user
object
Relationship to user.
data [required]
object
Relationship to user object.
id [required]
string
A unique identifier that represents the user.
type [required]
enum
Users resource type.
Allowed enum values: users
default: users
type [required]
enum
The incident attachment resource type.
Allowed enum values: incident_attachments
default: incident_attachments
{"data":{"attributes":{"archived":"2019-09-19T10:00:00.000Z","case_id":"integer","created":"2019-09-19T10:00:00.000Z","customer_impact_duration":"integer","customer_impact_end":"2019-09-19T10:00:00.000Z","customer_impact_scope":"An example customer impact scope","customer_impact_start":"2019-09-19T10:00:00.000Z","customer_impacted":false,"detected":"2019-09-19T10:00:00.000Z","fields":{"<any-key>":"undefined"},"incident_type_uuid":"00000000-0000-0000-0000-000000000000","modified":"2019-09-19T10:00:00.000Z","non_datadog_creator":{"image_48_px":"string","name":"string"},"notification_handles":[{"display_name":"Jane Doe","handle":"@test.user@test.com"}],"public_id":1,"resolved":"2019-09-19T10:00:00.000Z","severity":"UNKNOWN","state":"string","time_to_detect":"integer","time_to_internal_response":"integer","time_to_repair":"integer","time_to_resolve":"integer","title":"A test incident title","visibility":"string"},"id":"00000000-0000-0000-1234-000000000000","relationships":{"attachments":{"data":[{"id":"00000000-0000-abcd-1000-000000000000","type":"incident_attachments"}]},"commander_user":{"data":{"id":"00000000-0000-0000-0000-000000000000","type":"users"}},"created_by_user":{"data":{"id":"00000000-0000-0000-2345-000000000000","type":"users"}},"impacts":{"data":[{"id":"00000000-0000-0000-2345-000000000000","type":"incident_impacts"}]},"integrations":{"data":[{"id":"00000000-abcd-0001-0000-000000000000","type":"incident_integrations"}]},"last_modified_by_user":{"data":{"id":"00000000-0000-0000-2345-000000000000","type":"users"}},"responders":{"data":[{"id":"00000000-0000-0000-2345-000000000000","type":"incident_responders"}]},"user_defined_fields":{"data":[{"id":"00000000-0000-0000-2345-000000000000","type":"user_defined_field"}]}},"type":"incidents"},"included":[{"attributes":{"email":"string","handle":"string","icon":"string","name":"string","uuid":"string"},"id":"string","type":"users"}]}
"""
Get the details of an incident returns "OK" response
"""fromosimportenvironfromdatadog_api_clientimportApiClient,Configurationfromdatadog_api_client.v2.api.incidents_apiimportIncidentsApi# there is a valid "incident" in the systemINCIDENT_DATA_ID=environ["INCIDENT_DATA_ID"]configuration=Configuration()configuration.unstable_operations["get_incident"]=TruewithApiClient(configuration)asapi_client:api_instance=IncidentsApi(api_client)response=api_instance.get_incident(incident_id=INCIDENT_DATA_ID,)print(response)
# Get the details of an incident returns "OK" responserequire"datadog_api_client"DatadogAPIClient.configuredo|config|config.unstable_operations["v2.get_incident".to_sym]=trueendapi_instance=DatadogAPIClient::V2::IncidentsAPI.new# there is a valid "incident" in the systemINCIDENT_DATA_ID=ENV["INCIDENT_DATA_ID"]papi_instance.get_incident(INCIDENT_DATA_ID)
// Get the details of an incident returns "OK" response
packagemainimport("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")funcmain(){// there is a valid "incident" in the system
IncidentDataID:=os.Getenv("INCIDENT_DATA_ID")ctx:=datadog.NewDefaultContext(context.Background())configuration:=datadog.NewConfiguration()configuration.SetUnstableOperationEnabled("v2.GetIncident",true)apiClient:=datadog.NewAPIClient(configuration)api:=datadogV2.NewIncidentsApi(apiClient)resp,r,err:=api.GetIncident(ctx,IncidentDataID,*datadogV2.NewGetIncidentOptionalParameters())iferr!=nil{fmt.Fprintf(os.Stderr,"Error when calling `IncidentsApi.GetIncident`: %v\n",err)fmt.Fprintf(os.Stderr,"Full HTTP response: %v\n",r)}responseContent,_:=json.MarshalIndent(resp,""," ")fmt.Fprintf(os.Stdout,"Response from `IncidentsApi.GetIncident`:\n%s\n",responseContent)}
// Get the details of an incident returns "OK" responseimportcom.datadog.api.client.ApiClient;importcom.datadog.api.client.ApiException;importcom.datadog.api.client.v2.api.IncidentsApi;importcom.datadog.api.client.v2.model.IncidentResponse;publicclassExample{publicstaticvoidmain(String[]args){ApiClientdefaultClient=ApiClient.getDefaultApiClient();defaultClient.setUnstableOperationEnabled("v2.getIncident",true);IncidentsApiapiInstance=newIncidentsApi(defaultClient);// there is a valid "incident" in the systemStringINCIDENT_DATA_ID=System.getenv("INCIDENT_DATA_ID");try{IncidentResponseresult=apiInstance.getIncident(INCIDENT_DATA_ID);System.out.println(result);}catch(ApiExceptione){System.err.println("Exception when calling IncidentsApi#getIncident");System.err.println("Status code: "+e.getCode());System.err.println("Reason: "+e.getResponseBody());System.err.println("Response headers: "+e.getResponseHeaders());e.printStackTrace();}}}
// Get the details of an incident returns "OK" response
usedatadog_api_client::datadog;usedatadog_api_client::datadogV2::api_incidents::GetIncidentOptionalParams;usedatadog_api_client::datadogV2::api_incidents::IncidentsAPI;#[tokio::main]asyncfnmain(){// there is a valid "incident" in the system
letincident_data_id=std::env::var("INCIDENT_DATA_ID").unwrap();letmutconfiguration=datadog::Configuration::new();configuration.set_unstable_operation_enabled("v2.GetIncident",true);letapi=IncidentsAPI::with_config(configuration);letresp=api.get_incident(incident_data_id.clone(),GetIncidentOptionalParams::default(),).await;ifletOk(value)=resp{println!("{:#?}",value);}else{println!("{:#?}",resp.unwrap_err());}}
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com"DD_API_KEY="<DD_API_KEY>"DD_APP_KEY="<DD_APP_KEY>"cargo run
/**
* Get the details of an incident returns "OK" response
*/import{client,v2}from"@datadog/datadog-api-client";constconfiguration=client.createConfiguration();configuration.unstableOperations["v2.getIncident"]=true;constapiInstance=newv2.IncidentsApi(configuration);// there is a valid "incident" in the system
constINCIDENT_DATA_ID=process.env.INCIDENT_DATA_IDasstring;constparams: v2.IncidentsApiGetIncidentRequest={incidentId: INCIDENT_DATA_ID,};apiInstance.getIncident(params).then((data: v2.IncidentResponse)=>{console.log("API called successfully. Returned data: "+JSON.stringify(data));}).catch((error: any)=>console.error(error));
Updates an incident. Provide only the attributes that should be updated as this request is a partial update.
This endpoint requires the incident_write permission.
OAuth apps require the incident_write authorization scope to access this endpoint.
引数
パスパラメーター
名前
種類
説明
incident_id [required]
string
The UUID of the incident.
クエリ文字列
名前
種類
説明
include
array
Specifies which types of related objects should be included in the response.
{"data":{"id":"00000000-0000-0000-1234-000000000000","type":"incidents","attributes":{"fields":{"state":{"type":"dropdown","value":"resolved"}},"title":"A test incident title-updated"}}}
Included related resources that the user requested.
Option 1
object
User object returned by the API.
attributes
object
Attributes of user object returned by the API.
email
string
Email of the user.
handle
string
Handle of the user.
icon
string
URL of the user's icon.
name
string
Name of the user.
uuid
string
UUID of the user.
id
string
ID of the user.
type
enum
Users resource type.
Allowed enum values: users
default: users
Option 2
object
A single incident attachment.
attributes [required]
<oneOf>
The attributes object for an attachment.
Option 1
object
The attributes object for a postmortem attachment.
attachment [required]
object
The postmortem attachment.
documentUrl [required]
string
The URL of this notebook attachment.
title [required]
string
The title of this postmortem attachment.
attachment_type [required]
enum
The type of postmortem attachment attributes.
Allowed enum values: postmortem
default: postmortem
Option 2
object
The attributes object for a link attachment.
attachment [required]
object
The link attachment.
documentUrl [required]
string
The URL of this link attachment.
title [required]
string
The title of this link attachment.
attachment_type [required]
enum
The type of link attachment attributes.
Allowed enum values: link
default: link
modified
date-time
Timestamp when the incident attachment link was last modified.
id [required]
string
A unique identifier that represents the incident attachment.
relationships [required]
object
The incident attachment's relationships.
last_modified_by_user
object
Relationship to user.
data [required]
object
Relationship to user object.
id [required]
string
A unique identifier that represents the user.
type [required]
enum
Users resource type.
Allowed enum values: users
default: users
type [required]
enum
The incident attachment resource type.
Allowed enum values: incident_attachments
default: incident_attachments
{"data":{"attributes":{"archived":"2019-09-19T10:00:00.000Z","case_id":"integer","created":"2019-09-19T10:00:00.000Z","customer_impact_duration":"integer","customer_impact_end":"2019-09-19T10:00:00.000Z","customer_impact_scope":"An example customer impact scope","customer_impact_start":"2019-09-19T10:00:00.000Z","customer_impacted":false,"detected":"2019-09-19T10:00:00.000Z","fields":{"<any-key>":"undefined"},"incident_type_uuid":"00000000-0000-0000-0000-000000000000","modified":"2019-09-19T10:00:00.000Z","non_datadog_creator":{"image_48_px":"string","name":"string"},"notification_handles":[{"display_name":"Jane Doe","handle":"@test.user@test.com"}],"public_id":1,"resolved":"2019-09-19T10:00:00.000Z","severity":"UNKNOWN","state":"string","time_to_detect":"integer","time_to_internal_response":"integer","time_to_repair":"integer","time_to_resolve":"integer","title":"A test incident title","visibility":"string"},"id":"00000000-0000-0000-1234-000000000000","relationships":{"attachments":{"data":[{"id":"00000000-0000-abcd-1000-000000000000","type":"incident_attachments"}]},"commander_user":{"data":{"id":"00000000-0000-0000-0000-000000000000","type":"users"}},"created_by_user":{"data":{"id":"00000000-0000-0000-2345-000000000000","type":"users"}},"impacts":{"data":[{"id":"00000000-0000-0000-2345-000000000000","type":"incident_impacts"}]},"integrations":{"data":[{"id":"00000000-abcd-0001-0000-000000000000","type":"incident_integrations"}]},"last_modified_by_user":{"data":{"id":"00000000-0000-0000-2345-000000000000","type":"users"}},"responders":{"data":[{"id":"00000000-0000-0000-2345-000000000000","type":"incident_responders"}]},"user_defined_fields":{"data":[{"id":"00000000-0000-0000-2345-000000000000","type":"user_defined_field"}]}},"type":"incidents"},"included":[{"attributes":{"email":"string","handle":"string","icon":"string","name":"string","uuid":"string"},"id":"string","type":"users"}]}
// Add commander to an incident returns "OK" response
packagemainimport("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")funcmain(){// there is a valid "incident" in the system
IncidentDataID:=os.Getenv("INCIDENT_DATA_ID")// there is a valid "user" in the system
UserDataID:=os.Getenv("USER_DATA_ID")body:=datadogV2.IncidentUpdateRequest{Data:datadogV2.IncidentUpdateData{Id:IncidentDataID,Type:datadogV2.INCIDENTTYPE_INCIDENTS,Relationships:&datadogV2.IncidentUpdateRelationships{CommanderUser:*datadogV2.NewNullableNullableRelationshipToUser(&datadogV2.NullableRelationshipToUser{Data:*datadogV2.NewNullableNullableRelationshipToUserData(&datadogV2.NullableRelationshipToUserData{Id:UserDataID,Type:datadogV2.USERSTYPE_USERS,}),}),},},}ctx:=datadog.NewDefaultContext(context.Background())configuration:=datadog.NewConfiguration()configuration.SetUnstableOperationEnabled("v2.UpdateIncident",true)apiClient:=datadog.NewAPIClient(configuration)api:=datadogV2.NewIncidentsApi(apiClient)resp,r,err:=api.UpdateIncident(ctx,IncidentDataID,body,*datadogV2.NewUpdateIncidentOptionalParameters())iferr!=nil{fmt.Fprintf(os.Stderr,"Error when calling `IncidentsApi.UpdateIncident`: %v\n",err)fmt.Fprintf(os.Stderr,"Full HTTP response: %v\n",r)}responseContent,_:=json.MarshalIndent(resp,""," ")fmt.Fprintf(os.Stdout,"Response from `IncidentsApi.UpdateIncident`:\n%s\n",responseContent)}
// Remove commander from an incident returns "OK" response
packagemainimport("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")funcmain(){// there is a valid "incident" in the system
IncidentDataID:=os.Getenv("INCIDENT_DATA_ID")body:=datadogV2.IncidentUpdateRequest{Data:datadogV2.IncidentUpdateData{Id:IncidentDataID,Type:datadogV2.INCIDENTTYPE_INCIDENTS,Relationships:&datadogV2.IncidentUpdateRelationships{CommanderUser:*datadogV2.NewNullableNullableRelationshipToUser(&datadogV2.NullableRelationshipToUser{Data:*datadogV2.NewNullableNullableRelationshipToUserData(nil),}),},},}ctx:=datadog.NewDefaultContext(context.Background())configuration:=datadog.NewConfiguration()configuration.SetUnstableOperationEnabled("v2.UpdateIncident",true)apiClient:=datadog.NewAPIClient(configuration)api:=datadogV2.NewIncidentsApi(apiClient)resp,r,err:=api.UpdateIncident(ctx,IncidentDataID,body,*datadogV2.NewUpdateIncidentOptionalParameters())iferr!=nil{fmt.Fprintf(os.Stderr,"Error when calling `IncidentsApi.UpdateIncident`: %v\n",err)fmt.Fprintf(os.Stderr,"Full HTTP response: %v\n",r)}responseContent,_:=json.MarshalIndent(resp,""," ")fmt.Fprintf(os.Stdout,"Response from `IncidentsApi.UpdateIncident`:\n%s\n",responseContent)}
// Update an existing incident returns "OK" response
packagemainimport("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")funcmain(){// there is a valid "incident" in the system
IncidentDataID:=os.Getenv("INCIDENT_DATA_ID")body:=datadogV2.IncidentUpdateRequest{Data:datadogV2.IncidentUpdateData{Id:IncidentDataID,Type:datadogV2.INCIDENTTYPE_INCIDENTS,Attributes:&datadogV2.IncidentUpdateAttributes{Fields:map[string]datadogV2.IncidentFieldAttributes{"state":datadogV2.IncidentFieldAttributes{IncidentFieldAttributesSingleValue:&datadogV2.IncidentFieldAttributesSingleValue{Type:datadogV2.INCIDENTFIELDATTRIBUTESSINGLEVALUETYPE_DROPDOWN.Ptr(),Value:*datadog.NewNullableString(datadog.PtrString("resolved")),}},},Title:datadog.PtrString("A test incident title-updated"),},},}ctx:=datadog.NewDefaultContext(context.Background())configuration:=datadog.NewConfiguration()configuration.SetUnstableOperationEnabled("v2.UpdateIncident",true)apiClient:=datadog.NewAPIClient(configuration)api:=datadogV2.NewIncidentsApi(apiClient)resp,r,err:=api.UpdateIncident(ctx,IncidentDataID,body,*datadogV2.NewUpdateIncidentOptionalParameters())iferr!=nil{fmt.Fprintf(os.Stderr,"Error when calling `IncidentsApi.UpdateIncident`: %v\n",err)fmt.Fprintf(os.Stderr,"Full HTTP response: %v\n",r)}responseContent,_:=json.MarshalIndent(resp,""," ")fmt.Fprintf(os.Stdout,"Response from `IncidentsApi.UpdateIncident`:\n%s\n",responseContent)}
// Add commander to an incident returns "OK" responseimportcom.datadog.api.client.ApiClient;importcom.datadog.api.client.ApiException;importcom.datadog.api.client.v2.api.IncidentsApi;importcom.datadog.api.client.v2.model.IncidentResponse;importcom.datadog.api.client.v2.model.IncidentType;importcom.datadog.api.client.v2.model.IncidentUpdateData;importcom.datadog.api.client.v2.model.IncidentUpdateRelationships;importcom.datadog.api.client.v2.model.IncidentUpdateRequest;importcom.datadog.api.client.v2.model.NullableRelationshipToUser;importcom.datadog.api.client.v2.model.NullableRelationshipToUserData;importcom.datadog.api.client.v2.model.UsersType;publicclassExample{publicstaticvoidmain(String[]args){ApiClientdefaultClient=ApiClient.getDefaultApiClient();defaultClient.setUnstableOperationEnabled("v2.updateIncident",true);IncidentsApiapiInstance=newIncidentsApi(defaultClient);// there is a valid "incident" in the systemStringINCIDENT_DATA_ID=System.getenv("INCIDENT_DATA_ID");// there is a valid "user" in the systemStringUSER_DATA_ID=System.getenv("USER_DATA_ID");IncidentUpdateRequestbody=newIncidentUpdateRequest().data(newIncidentUpdateData().id(INCIDENT_DATA_ID).type(IncidentType.INCIDENTS).relationships(newIncidentUpdateRelationships().commanderUser(newNullableRelationshipToUser().data(newNullableRelationshipToUserData().id(USER_DATA_ID).type(UsersType.USERS)))));try{IncidentResponseresult=apiInstance.updateIncident(INCIDENT_DATA_ID,body);System.out.println(result);}catch(ApiExceptione){System.err.println("Exception when calling IncidentsApi#updateIncident");System.err.println("Status code: "+e.getCode());System.err.println("Reason: "+e.getResponseBody());System.err.println("Response headers: "+e.getResponseHeaders());e.printStackTrace();}}}
// Remove commander from an incident returns "OK" responseimportcom.datadog.api.client.ApiClient;importcom.datadog.api.client.ApiException;importcom.datadog.api.client.v2.api.IncidentsApi;importcom.datadog.api.client.v2.model.IncidentResponse;importcom.datadog.api.client.v2.model.IncidentType;importcom.datadog.api.client.v2.model.IncidentUpdateData;importcom.datadog.api.client.v2.model.IncidentUpdateRelationships;importcom.datadog.api.client.v2.model.IncidentUpdateRequest;importcom.datadog.api.client.v2.model.NullableRelationshipToUser;publicclassExample{publicstaticvoidmain(String[]args){ApiClientdefaultClient=ApiClient.getDefaultApiClient();defaultClient.setUnstableOperationEnabled("v2.updateIncident",true);IncidentsApiapiInstance=newIncidentsApi(defaultClient);// there is a valid "incident" in the systemStringINCIDENT_DATA_ID=System.getenv("INCIDENT_DATA_ID");IncidentUpdateRequestbody=newIncidentUpdateRequest().data(newIncidentUpdateData().id(INCIDENT_DATA_ID).type(IncidentType.INCIDENTS).relationships(newIncidentUpdateRelationships().commanderUser(newNullableRelationshipToUser().data(null))));try{IncidentResponseresult=apiInstance.updateIncident(INCIDENT_DATA_ID,body);System.out.println(result);}catch(ApiExceptione){System.err.println("Exception when calling IncidentsApi#updateIncident");System.err.println("Status code: "+e.getCode());System.err.println("Reason: "+e.getResponseBody());System.err.println("Response headers: "+e.getResponseHeaders());e.printStackTrace();}}}
// Update an existing incident returns "OK" responseimportcom.datadog.api.client.ApiClient;importcom.datadog.api.client.ApiException;importcom.datadog.api.client.v2.api.IncidentsApi;importcom.datadog.api.client.v2.model.IncidentFieldAttributes;importcom.datadog.api.client.v2.model.IncidentFieldAttributesSingleValue;importcom.datadog.api.client.v2.model.IncidentFieldAttributesSingleValueType;importcom.datadog.api.client.v2.model.IncidentResponse;importcom.datadog.api.client.v2.model.IncidentType;importcom.datadog.api.client.v2.model.IncidentUpdateAttributes;importcom.datadog.api.client.v2.model.IncidentUpdateData;importcom.datadog.api.client.v2.model.IncidentUpdateRequest;importjava.util.Map;publicclassExample{publicstaticvoidmain(String[]args){ApiClientdefaultClient=ApiClient.getDefaultApiClient();defaultClient.setUnstableOperationEnabled("v2.updateIncident",true);IncidentsApiapiInstance=newIncidentsApi(defaultClient);// there is a valid "incident" in the systemStringINCIDENT_DATA_ATTRIBUTES_TITLE=System.getenv("INCIDENT_DATA_ATTRIBUTES_TITLE");StringINCIDENT_DATA_ID=System.getenv("INCIDENT_DATA_ID");IncidentUpdateRequestbody=newIncidentUpdateRequest().data(newIncidentUpdateData().id(INCIDENT_DATA_ID).type(IncidentType.INCIDENTS).attributes(newIncidentUpdateAttributes().fields(Map.ofEntries(Map.entry("state",newIncidentFieldAttributes(newIncidentFieldAttributesSingleValue().type(IncidentFieldAttributesSingleValueType.DROPDOWN).value("resolved"))))).title("A test incident title-updated")));try{IncidentResponseresult=apiInstance.updateIncident(INCIDENT_DATA_ID,body);System.out.println(result);}catch(ApiExceptione){System.err.println("Exception when calling IncidentsApi#updateIncident");System.err.println("Status code: "+e.getCode());System.err.println("Reason: "+e.getResponseBody());System.err.println("Response headers: "+e.getResponseHeaders());e.printStackTrace();}}}
"""
Add commander to an incident returns "OK" response
"""fromosimportenvironfromdatadog_api_clientimportApiClient,Configurationfromdatadog_api_client.v2.api.incidents_apiimportIncidentsApifromdatadog_api_client.v2.model.incident_typeimportIncidentTypefromdatadog_api_client.v2.model.incident_update_dataimportIncidentUpdateDatafromdatadog_api_client.v2.model.incident_update_relationshipsimportIncidentUpdateRelationshipsfromdatadog_api_client.v2.model.incident_update_requestimportIncidentUpdateRequestfromdatadog_api_client.v2.model.nullable_relationship_to_userimportNullableRelationshipToUserfromdatadog_api_client.v2.model.nullable_relationship_to_user_dataimportNullableRelationshipToUserDatafromdatadog_api_client.v2.model.users_typeimportUsersType# there is a valid "incident" in the systemINCIDENT_DATA_ID=environ["INCIDENT_DATA_ID"]# there is a valid "user" in the systemUSER_DATA_ID=environ["USER_DATA_ID"]body=IncidentUpdateRequest(data=IncidentUpdateData(id=INCIDENT_DATA_ID,type=IncidentType.INCIDENTS,relationships=IncidentUpdateRelationships(commander_user=NullableRelationshipToUser(data=NullableRelationshipToUserData(id=USER_DATA_ID,type=UsersType.USERS,),),),),)configuration=Configuration()configuration.unstable_operations["update_incident"]=TruewithApiClient(configuration)asapi_client:api_instance=IncidentsApi(api_client)response=api_instance.update_incident(incident_id=INCIDENT_DATA_ID,body=body)print(response)
"""
Remove commander from an incident returns "OK" response
"""fromosimportenvironfromdatadog_api_clientimportApiClient,Configurationfromdatadog_api_client.v2.api.incidents_apiimportIncidentsApifromdatadog_api_client.v2.model.incident_typeimportIncidentTypefromdatadog_api_client.v2.model.incident_update_dataimportIncidentUpdateDatafromdatadog_api_client.v2.model.incident_update_relationshipsimportIncidentUpdateRelationshipsfromdatadog_api_client.v2.model.incident_update_requestimportIncidentUpdateRequestfromdatadog_api_client.v2.model.nullable_relationship_to_userimportNullableRelationshipToUser# there is a valid "incident" in the systemINCIDENT_DATA_ID=environ["INCIDENT_DATA_ID"]body=IncidentUpdateRequest(data=IncidentUpdateData(id=INCIDENT_DATA_ID,type=IncidentType.INCIDENTS,relationships=IncidentUpdateRelationships(commander_user=NullableRelationshipToUser(data=None,),),),)configuration=Configuration()configuration.unstable_operations["update_incident"]=TruewithApiClient(configuration)asapi_client:api_instance=IncidentsApi(api_client)response=api_instance.update_incident(incident_id=INCIDENT_DATA_ID,body=body)print(response)
"""
Update an existing incident returns "OK" response
"""fromosimportenvironfromdatadog_api_clientimportApiClient,Configurationfromdatadog_api_client.v2.api.incidents_apiimportIncidentsApifromdatadog_api_client.v2.model.incident_field_attributes_single_valueimportIncidentFieldAttributesSingleValuefromdatadog_api_client.v2.model.incident_field_attributes_single_value_typeimport(IncidentFieldAttributesSingleValueType,)fromdatadog_api_client.v2.model.incident_typeimportIncidentTypefromdatadog_api_client.v2.model.incident_update_attributesimportIncidentUpdateAttributesfromdatadog_api_client.v2.model.incident_update_dataimportIncidentUpdateDatafromdatadog_api_client.v2.model.incident_update_requestimportIncidentUpdateRequest# there is a valid "incident" in the systemINCIDENT_DATA_ATTRIBUTES_TITLE=environ["INCIDENT_DATA_ATTRIBUTES_TITLE"]INCIDENT_DATA_ID=environ["INCIDENT_DATA_ID"]body=IncidentUpdateRequest(data=IncidentUpdateData(id=INCIDENT_DATA_ID,type=IncidentType.INCIDENTS,attributes=IncidentUpdateAttributes(fields=dict(state=IncidentFieldAttributesSingleValue(type=IncidentFieldAttributesSingleValueType.DROPDOWN,value="resolved",),),title="A test incident title-updated",),),)configuration=Configuration()configuration.unstable_operations["update_incident"]=TruewithApiClient(configuration)asapi_client:api_instance=IncidentsApi(api_client)response=api_instance.update_incident(incident_id=INCIDENT_DATA_ID,body=body)print(response)
# Add commander to an incident returns "OK" responserequire"datadog_api_client"DatadogAPIClient.configuredo|config|config.unstable_operations["v2.update_incident".to_sym]=trueendapi_instance=DatadogAPIClient::V2::IncidentsAPI.new# there is a valid "incident" in the systemINCIDENT_DATA_ID=ENV["INCIDENT_DATA_ID"]# there is a valid "user" in the systemUSER_DATA_ID=ENV["USER_DATA_ID"]body=DatadogAPIClient::V2::IncidentUpdateRequest.new({data:DatadogAPIClient::V2::IncidentUpdateData.new({id:INCIDENT_DATA_ID,type:DatadogAPIClient::V2::IncidentType::INCIDENTS,relationships:DatadogAPIClient::V2::IncidentUpdateRelationships.new({commander_user:DatadogAPIClient::V2::NullableRelationshipToUser.new({data:DatadogAPIClient::V2::NullableRelationshipToUserData.new({id:USER_DATA_ID,type:DatadogAPIClient::V2::UsersType::USERS,}),}),}),}),})papi_instance.update_incident(INCIDENT_DATA_ID,body)
# Remove commander from an incident returns "OK" responserequire"datadog_api_client"DatadogAPIClient.configuredo|config|config.unstable_operations["v2.update_incident".to_sym]=trueendapi_instance=DatadogAPIClient::V2::IncidentsAPI.new# there is a valid "incident" in the systemINCIDENT_DATA_ID=ENV["INCIDENT_DATA_ID"]body=DatadogAPIClient::V2::IncidentUpdateRequest.new({data:DatadogAPIClient::V2::IncidentUpdateData.new({id:INCIDENT_DATA_ID,type:DatadogAPIClient::V2::IncidentType::INCIDENTS,relationships:DatadogAPIClient::V2::IncidentUpdateRelationships.new({commander_user:DatadogAPIClient::V2::NullableRelationshipToUser.new({data:nil,}),}),}),})papi_instance.update_incident(INCIDENT_DATA_ID,body)
# Update an existing incident returns "OK" responserequire"datadog_api_client"DatadogAPIClient.configuredo|config|config.unstable_operations["v2.update_incident".to_sym]=trueendapi_instance=DatadogAPIClient::V2::IncidentsAPI.new# there is a valid "incident" in the systemINCIDENT_DATA_ATTRIBUTES_TITLE=ENV["INCIDENT_DATA_ATTRIBUTES_TITLE"]INCIDENT_DATA_ID=ENV["INCIDENT_DATA_ID"]body=DatadogAPIClient::V2::IncidentUpdateRequest.new({data:DatadogAPIClient::V2::IncidentUpdateData.new({id:INCIDENT_DATA_ID,type:DatadogAPIClient::V2::IncidentType::INCIDENTS,attributes:DatadogAPIClient::V2::IncidentUpdateAttributes.new({fields:{state:DatadogAPIClient::V2::IncidentFieldAttributesSingleValue.new({type:DatadogAPIClient::V2::IncidentFieldAttributesSingleValueType::DROPDOWN,value:"resolved",}),},title:"A test incident title-updated",}),}),})papi_instance.update_incident(INCIDENT_DATA_ID,body)
// Add commander to an incident returns "OK" response
usedatadog_api_client::datadog;usedatadog_api_client::datadogV2::api_incidents::IncidentsAPI;usedatadog_api_client::datadogV2::api_incidents::UpdateIncidentOptionalParams;usedatadog_api_client::datadogV2::model::IncidentType;usedatadog_api_client::datadogV2::model::IncidentUpdateData;usedatadog_api_client::datadogV2::model::IncidentUpdateRelationships;usedatadog_api_client::datadogV2::model::IncidentUpdateRequest;usedatadog_api_client::datadogV2::model::NullableRelationshipToUser;usedatadog_api_client::datadogV2::model::NullableRelationshipToUserData;usedatadog_api_client::datadogV2::model::UsersType;#[tokio::main]asyncfnmain(){// there is a valid "incident" in the system
letincident_data_id=std::env::var("INCIDENT_DATA_ID").unwrap();// there is a valid "user" in the system
letuser_data_id=std::env::var("USER_DATA_ID").unwrap();letbody=IncidentUpdateRequest::new(IncidentUpdateData::new(incident_data_id.clone(),IncidentType::INCIDENTS).relationships(IncidentUpdateRelationships::new().commander_user(Some(NullableRelationshipToUser::new(Some(NullableRelationshipToUserData::new(user_data_id.clone(),UsersType::USERS,))),)),),);letmutconfiguration=datadog::Configuration::new();configuration.set_unstable_operation_enabled("v2.UpdateIncident",true);letapi=IncidentsAPI::with_config(configuration);letresp=api.update_incident(incident_data_id.clone(),body,UpdateIncidentOptionalParams::default(),).await;ifletOk(value)=resp{println!("{:#?}",value);}else{println!("{:#?}",resp.unwrap_err());}}
// Remove commander from an incident returns "OK" response
usedatadog_api_client::datadog;usedatadog_api_client::datadogV2::api_incidents::IncidentsAPI;usedatadog_api_client::datadogV2::api_incidents::UpdateIncidentOptionalParams;usedatadog_api_client::datadogV2::model::IncidentType;usedatadog_api_client::datadogV2::model::IncidentUpdateData;usedatadog_api_client::datadogV2::model::IncidentUpdateRelationships;usedatadog_api_client::datadogV2::model::IncidentUpdateRequest;usedatadog_api_client::datadogV2::model::NullableRelationshipToUser;#[tokio::main]asyncfnmain(){// there is a valid "incident" in the system
letincident_data_id=std::env::var("INCIDENT_DATA_ID").unwrap();letbody=IncidentUpdateRequest::new(IncidentUpdateData::new(incident_data_id.clone(),IncidentType::INCIDENTS).relationships(IncidentUpdateRelationships::new().commander_user(Some(NullableRelationshipToUser::new(None))),),);letmutconfiguration=datadog::Configuration::new();configuration.set_unstable_operation_enabled("v2.UpdateIncident",true);letapi=IncidentsAPI::with_config(configuration);letresp=api.update_incident(incident_data_id.clone(),body,UpdateIncidentOptionalParams::default(),).await;ifletOk(value)=resp{println!("{:#?}",value);}else{println!("{:#?}",resp.unwrap_err());}}
// Update an existing incident returns "OK" response
usedatadog_api_client::datadog;usedatadog_api_client::datadogV2::api_incidents::IncidentsAPI;usedatadog_api_client::datadogV2::api_incidents::UpdateIncidentOptionalParams;usedatadog_api_client::datadogV2::model::IncidentFieldAttributes;usedatadog_api_client::datadogV2::model::IncidentFieldAttributesSingleValue;usedatadog_api_client::datadogV2::model::IncidentFieldAttributesSingleValueType;usedatadog_api_client::datadogV2::model::IncidentType;usedatadog_api_client::datadogV2::model::IncidentUpdateAttributes;usedatadog_api_client::datadogV2::model::IncidentUpdateData;usedatadog_api_client::datadogV2::model::IncidentUpdateRequest;usestd::collections::BTreeMap;#[tokio::main]asyncfnmain(){// there is a valid "incident" in the system
letincident_data_id=std::env::var("INCIDENT_DATA_ID").unwrap();letbody=IncidentUpdateRequest::new(IncidentUpdateData::new(incident_data_id.clone(),IncidentType::INCIDENTS).attributes(IncidentUpdateAttributes::new().fields(BTreeMap::from([("state".to_string(),IncidentFieldAttributes::IncidentFieldAttributesSingleValue(Box::new(IncidentFieldAttributesSingleValue::new().type_(IncidentFieldAttributesSingleValueType::DROPDOWN).value(Some("resolved".to_string())),)),)])).title("A test incident title-updated".to_string()),),);letmutconfiguration=datadog::Configuration::new();configuration.set_unstable_operation_enabled("v2.UpdateIncident",true);letapi=IncidentsAPI::with_config(configuration);letresp=api.update_incident(incident_data_id.clone(),body,UpdateIncidentOptionalParams::default(),).await;ifletOk(value)=resp{println!("{:#?}",value);}else{println!("{:#?}",resp.unwrap_err());}}
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com"DD_API_KEY="<DD_API_KEY>"DD_APP_KEY="<DD_APP_KEY>"cargo run
/**
* Add commander to an incident returns "OK" response
*/import{client,v2}from"@datadog/datadog-api-client";constconfiguration=client.createConfiguration();configuration.unstableOperations["v2.updateIncident"]=true;constapiInstance=newv2.IncidentsApi(configuration);// there is a valid "incident" in the system
constINCIDENT_DATA_ID=process.env.INCIDENT_DATA_IDasstring;// there is a valid "user" in the system
constUSER_DATA_ID=process.env.USER_DATA_IDasstring;constparams: v2.IncidentsApiUpdateIncidentRequest={body:{data:{id: INCIDENT_DATA_ID,type:"incidents",relationships:{commanderUser:{data:{id: USER_DATA_ID,type:"users",},},},},},incidentId: INCIDENT_DATA_ID,};apiInstance.updateIncident(params).then((data: v2.IncidentResponse)=>{console.log("API called successfully. Returned data: "+JSON.stringify(data));}).catch((error: any)=>console.error(error));
/**
* Remove commander from an incident returns "OK" response
*/import{client,v2}from"@datadog/datadog-api-client";constconfiguration=client.createConfiguration();configuration.unstableOperations["v2.updateIncident"]=true;constapiInstance=newv2.IncidentsApi(configuration);// there is a valid "incident" in the system
constINCIDENT_DATA_ID=process.env.INCIDENT_DATA_IDasstring;constparams: v2.IncidentsApiUpdateIncidentRequest={body:{data:{id: INCIDENT_DATA_ID,type:"incidents",relationships:{commanderUser:{data: null,},},},},incidentId: INCIDENT_DATA_ID,};apiInstance.updateIncident(params).then((data: v2.IncidentResponse)=>{console.log("API called successfully. Returned data: "+JSON.stringify(data));}).catch((error: any)=>console.error(error));
/**
* Update an existing incident returns "OK" response
*/import{client,v2}from"@datadog/datadog-api-client";constconfiguration=client.createConfiguration();configuration.unstableOperations["v2.updateIncident"]=true;constapiInstance=newv2.IncidentsApi(configuration);// there is a valid "incident" in the system
constINCIDENT_DATA_ID=process.env.INCIDENT_DATA_IDasstring;constparams: v2.IncidentsApiUpdateIncidentRequest={body:{data:{id: INCIDENT_DATA_ID,type:"incidents",attributes:{fields:{state:{type:"dropdown",value:"resolved",},},title:"A test incident title-updated",},},},incidentId: INCIDENT_DATA_ID,};apiInstance.updateIncident(params).then((data: v2.IncidentResponse)=>{console.log("API called successfully. Returned data: "+JSON.stringify(data));}).catch((error: any)=>console.error(error));
"""
Delete an existing incident returns "OK" response
"""fromosimportenvironfromdatadog_api_clientimportApiClient,Configurationfromdatadog_api_client.v2.api.incidents_apiimportIncidentsApi# there is a valid "incident" in the systemINCIDENT_DATA_ID=environ["INCIDENT_DATA_ID"]configuration=Configuration()configuration.unstable_operations["delete_incident"]=TruewithApiClient(configuration)asapi_client:api_instance=IncidentsApi(api_client)api_instance.delete_incident(incident_id=INCIDENT_DATA_ID,)
# Delete an existing incident returns "OK" responserequire"datadog_api_client"DatadogAPIClient.configuredo|config|config.unstable_operations["v2.delete_incident".to_sym]=trueendapi_instance=DatadogAPIClient::V2::IncidentsAPI.new# there is a valid "incident" in the systemINCIDENT_DATA_ID=ENV["INCIDENT_DATA_ID"]api_instance.delete_incident(INCIDENT_DATA_ID)
// Delete an existing incident returns "OK" response
packagemainimport("context""fmt""os""github.com/DataDog/datadog-api-client-go/v2/api/datadog""github.com/DataDog/datadog-api-client-go/v2/api/datadogV2")funcmain(){// there is a valid "incident" in the system
IncidentDataID:=os.Getenv("INCIDENT_DATA_ID")ctx:=datadog.NewDefaultContext(context.Background())configuration:=datadog.NewConfiguration()configuration.SetUnstableOperationEnabled("v2.DeleteIncident",true)apiClient:=datadog.NewAPIClient(configuration)api:=datadogV2.NewIncidentsApi(apiClient)r,err:=api.DeleteIncident(ctx,IncidentDataID)iferr!=nil{fmt.Fprintf(os.Stderr,"Error when calling `IncidentsApi.DeleteIncident`: %v\n",err)fmt.Fprintf(os.Stderr,"Full HTTP response: %v\n",r)}}
// Delete an existing incident returns "OK" responseimportcom.datadog.api.client.ApiClient;importcom.datadog.api.client.ApiException;importcom.datadog.api.client.v2.api.IncidentsApi;publicclassExample{publicstaticvoidmain(String[]args){ApiClientdefaultClient=ApiClient.getDefaultApiClient();defaultClient.setUnstableOperationEnabled("v2.deleteIncident",true);IncidentsApiapiInstance=newIncidentsApi(defaultClient);// there is a valid "incident" in the systemStringINCIDENT_DATA_ID=System.getenv("INCIDENT_DATA_ID");try{apiInstance.deleteIncident(INCIDENT_DATA_ID);}catch(ApiExceptione){System.err.println("Exception when calling IncidentsApi#deleteIncident");System.err.println("Status code: "+e.getCode());System.err.println("Reason: "+e.getResponseBody());System.err.println("Response headers: "+e.getResponseHeaders());e.printStackTrace();}}}
// Delete an existing incident returns "OK" response
usedatadog_api_client::datadog;usedatadog_api_client::datadogV2::api_incidents::IncidentsAPI;#[tokio::main]asyncfnmain(){// there is a valid "incident" in the system
letincident_data_id=std::env::var("INCIDENT_DATA_ID").unwrap();letmutconfiguration=datadog::Configuration::new();configuration.set_unstable_operation_enabled("v2.DeleteIncident",true);letapi=IncidentsAPI::with_config(configuration);letresp=api.delete_incident(incident_data_id.clone()).await;ifletOk(value)=resp{println!("{:#?}",value);}else{println!("{:#?}",resp.unwrap_err());}}
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com"DD_API_KEY="<DD_API_KEY>"DD_APP_KEY="<DD_APP_KEY>"cargo run
/**
* Delete an existing incident returns "OK" response
*/import{client,v2}from"@datadog/datadog-api-client";constconfiguration=client.createConfiguration();configuration.unstableOperations["v2.deleteIncident"]=true;constapiInstance=newv2.IncidentsApi(configuration);// there is a valid "incident" in the system
constINCIDENT_DATA_ID=process.env.INCIDENT_DATA_IDasstring;constparams: v2.IncidentsApiDeleteIncidentRequest={incidentId: INCIDENT_DATA_ID,};apiInstance.deleteIncident(params).then((data: any)=>{console.log("API called successfully. Returned data: "+JSON.stringify(data));}).catch((error: any)=>console.error(error));
Included related resources that the user requested.
Option 1
object
User object returned by the API.
attributes
object
Attributes of user object returned by the API.
email
string
Email of the user.
handle
string
Handle of the user.
icon
string
URL of the user's icon.
name
string
Name of the user.
uuid
string
UUID of the user.
id
string
ID of the user.
type
enum
Users resource type.
Allowed enum values: users
default: users
Option 2
object
A single incident attachment.
attributes [required]
<oneOf>
The attributes object for an attachment.
Option 1
object
The attributes object for a postmortem attachment.
attachment [required]
object
The postmortem attachment.
documentUrl [required]
string
The URL of this notebook attachment.
title [required]
string
The title of this postmortem attachment.
attachment_type [required]
enum
The type of postmortem attachment attributes.
Allowed enum values: postmortem
default: postmortem
Option 2
object
The attributes object for a link attachment.
attachment [required]
object
The link attachment.
documentUrl [required]
string
The URL of this link attachment.
title [required]
string
The title of this link attachment.
attachment_type [required]
enum
The type of link attachment attributes.
Allowed enum values: link
default: link
modified
date-time
Timestamp when the incident attachment link was last modified.
id [required]
string
A unique identifier that represents the incident attachment.
relationships [required]
object
The incident attachment's relationships.
last_modified_by_user
object
Relationship to user.
data [required]
object
Relationship to user object.
id [required]
string
A unique identifier that represents the user.
type [required]
enum
Users resource type.
Allowed enum values: users
default: users
type [required]
enum
The incident attachment resource type.
Allowed enum values: incident_attachments
default: incident_attachments
meta
object
The metadata object containing pagination metadata.
pagination
object
Pagination properties.
next_offset
int64
The index of the first element in the next page of results. Equal to page size added to the current offset.
offset
int64
The index of the first element in the results.
size
int64
Maximum size of pages to return.
{"data":[{"attributes":{"archived":"2019-09-19T10:00:00.000Z","case_id":"integer","created":"2019-09-19T10:00:00.000Z","customer_impact_duration":"integer","customer_impact_end":"2019-09-19T10:00:00.000Z","customer_impact_scope":"An example customer impact scope","customer_impact_start":"2019-09-19T10:00:00.000Z","customer_impacted":false,"detected":"2019-09-19T10:00:00.000Z","fields":{"<any-key>":"undefined"},"incident_type_uuid":"00000000-0000-0000-0000-000000000000","modified":"2019-09-19T10:00:00.000Z","non_datadog_creator":{"image_48_px":"string","name":"string"},"notification_handles":[{"display_name":"Jane Doe","handle":"@test.user@test.com"}],"public_id":1,"resolved":"2019-09-19T10:00:00.000Z","severity":"UNKNOWN","state":"string","time_to_detect":"integer","time_to_internal_response":"integer","time_to_repair":"integer","time_to_resolve":"integer","title":"A test incident title","visibility":"string"},"id":"00000000-0000-0000-1234-000000000000","relationships":{"attachments":{"data":[{"id":"00000000-0000-abcd-1000-000000000000","type":"incident_attachments"}]},"commander_user":{"data":{"id":"00000000-0000-0000-0000-000000000000","type":"users"}},"created_by_user":{"data":{"id":"00000000-0000-0000-2345-000000000000","type":"users"}},"impacts":{"data":[{"id":"00000000-0000-0000-2345-000000000000","type":"incident_impacts"}]},"integrations":{"data":[{"id":"00000000-abcd-0001-0000-000000000000","type":"incident_integrations"}]},"last_modified_by_user":{"data":{"id":"00000000-0000-0000-2345-000000000000","type":"users"}},"responders":{"data":[{"id":"00000000-0000-0000-2345-000000000000","type":"incident_responders"}]},"user_defined_fields":{"data":[{"id":"00000000-0000-0000-2345-000000000000","type":"user_defined_field"}]}},"type":"incidents"}],"included":[{"attributes":{"email":"string","handle":"string","icon":"string","name":"string","uuid":"string"},"id":"string","type":"users"}],"meta":{"pagination":{"next_offset":1000,"offset":10,"size":1000}}}
"""
Get a list of incidents returns "OK" response
"""fromdatadog_api_clientimportApiClient,Configurationfromdatadog_api_client.v2.api.incidents_apiimportIncidentsApiconfiguration=Configuration()configuration.unstable_operations["list_incidents"]=TruewithApiClient(configuration)asapi_client:api_instance=IncidentsApi(api_client)response=api_instance.list_incidents()print(response)
# Get a list of incidents returns "OK" responserequire"datadog_api_client"DatadogAPIClient.configuredo|config|config.unstable_operations["v2.list_incidents".to_sym]=trueendapi_instance=DatadogAPIClient::V2::IncidentsAPI.newpapi_instance.list_incidents()
// Get a list of incidents returns "OK" response
packagemainimport("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")funcmain(){ctx:=datadog.NewDefaultContext(context.Background())configuration:=datadog.NewConfiguration()configuration.SetUnstableOperationEnabled("v2.ListIncidents",true)apiClient:=datadog.NewAPIClient(configuration)api:=datadogV2.NewIncidentsApi(apiClient)resp,r,err:=api.ListIncidents(ctx,*datadogV2.NewListIncidentsOptionalParameters())iferr!=nil{fmt.Fprintf(os.Stderr,"Error when calling `IncidentsApi.ListIncidents`: %v\n",err)fmt.Fprintf(os.Stderr,"Full HTTP response: %v\n",r)}responseContent,_:=json.MarshalIndent(resp,""," ")fmt.Fprintf(os.Stdout,"Response from `IncidentsApi.ListIncidents`:\n%s\n",responseContent)}
// Get a list of incidents returns "OK" responseimportcom.datadog.api.client.ApiClient;importcom.datadog.api.client.ApiException;importcom.datadog.api.client.v2.api.IncidentsApi;importcom.datadog.api.client.v2.model.IncidentsResponse;publicclassExample{publicstaticvoidmain(String[]args){ApiClientdefaultClient=ApiClient.getDefaultApiClient();defaultClient.setUnstableOperationEnabled("v2.listIncidents",true);IncidentsApiapiInstance=newIncidentsApi(defaultClient);try{IncidentsResponseresult=apiInstance.listIncidents();System.out.println(result);}catch(ApiExceptione){System.err.println("Exception when calling IncidentsApi#listIncidents");System.err.println("Status code: "+e.getCode());System.err.println("Reason: "+e.getResponseBody());System.err.println("Response headers: "+e.getResponseHeaders());e.printStackTrace();}}}
// Get a list of incidents returns "OK" response
usedatadog_api_client::datadog;usedatadog_api_client::datadogV2::api_incidents::IncidentsAPI;usedatadog_api_client::datadogV2::api_incidents::ListIncidentsOptionalParams;#[tokio::main]asyncfnmain(){letmutconfiguration=datadog::Configuration::new();configuration.set_unstable_operation_enabled("v2.ListIncidents",true);letapi=IncidentsAPI::with_config(configuration);letresp=api.list_incidents(ListIncidentsOptionalParams::default()).await;ifletOk(value)=resp{println!("{:#?}",value);}else{println!("{:#?}",resp.unwrap_err());}}
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com"DD_API_KEY="<DD_API_KEY>"DD_APP_KEY="<DD_APP_KEY>"cargo run
/**
* Get a list of incidents returns "OK" response
*/import{client,v2}from"@datadog/datadog-api-client";constconfiguration=client.createConfiguration();configuration.unstableOperations["v2.listIncidents"]=true;constapiInstance=newv2.IncidentsApi(configuration);apiInstance.listIncidents().then((data: v2.IncidentsResponse)=>{console.log("API called successfully. Returned data: "+JSON.stringify(data));}).catch((error: any)=>console.error(error));
Search for incidents matching a certain query.
This endpoint requires the incident_read permission.
OAuth apps require the incident_read authorization scope to access this endpoint.
引数
クエリ文字列
名前
種類
説明
include
enum
Specifies which types of related objects should be included in the response. Allowed enum values: users, attachments
query [required]
string
Specifies which incidents should be returned. The query can contain any number of incident facets
joined by ANDs, along with multiple values for each of those facets joined by ORs. For
example: state:active AND severity:(SEV-2 OR SEV-1).
sort
enum
Specifies the order of returned incidents. Allowed enum values: created, -created
page[size]
integer
Size for a given page. The maximum allowed value is 100.
page[offset]
integer
Specific offset to use as the beginning of the returned page.
"""
Search for incidents returns "OK" response
"""fromdatadog_api_clientimportApiClient,Configurationfromdatadog_api_client.v2.api.incidents_apiimportIncidentsApiconfiguration=Configuration()configuration.unstable_operations["search_incidents"]=TruewithApiClient(configuration)asapi_client:api_instance=IncidentsApi(api_client)response=api_instance.search_incidents(query="state:(active OR stable OR resolved)",)print(response)
# Search for incidents returns "OK" responserequire"datadog_api_client"DatadogAPIClient.configuredo|config|config.unstable_operations["v2.search_incidents".to_sym]=trueendapi_instance=DatadogAPIClient::V2::IncidentsAPI.newpapi_instance.search_incidents("state:(active OR stable OR resolved)")
// Search for incidents returns "OK" response
packagemainimport("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")funcmain(){ctx:=datadog.NewDefaultContext(context.Background())configuration:=datadog.NewConfiguration()configuration.SetUnstableOperationEnabled("v2.SearchIncidents",true)apiClient:=datadog.NewAPIClient(configuration)api:=datadogV2.NewIncidentsApi(apiClient)resp,r,err:=api.SearchIncidents(ctx,"state:(active OR stable OR resolved)",*datadogV2.NewSearchIncidentsOptionalParameters())iferr!=nil{fmt.Fprintf(os.Stderr,"Error when calling `IncidentsApi.SearchIncidents`: %v\n",err)fmt.Fprintf(os.Stderr,"Full HTTP response: %v\n",r)}responseContent,_:=json.MarshalIndent(resp,""," ")fmt.Fprintf(os.Stdout,"Response from `IncidentsApi.SearchIncidents`:\n%s\n",responseContent)}
// Search for incidents returns "OK" responseimportcom.datadog.api.client.ApiClient;importcom.datadog.api.client.ApiException;importcom.datadog.api.client.v2.api.IncidentsApi;importcom.datadog.api.client.v2.model.IncidentSearchResponse;publicclassExample{publicstaticvoidmain(String[]args){ApiClientdefaultClient=ApiClient.getDefaultApiClient();defaultClient.setUnstableOperationEnabled("v2.searchIncidents",true);IncidentsApiapiInstance=newIncidentsApi(defaultClient);try{IncidentSearchResponseresult=apiInstance.searchIncidents("state:(active OR stable OR resolved)");System.out.println(result);}catch(ApiExceptione){System.err.println("Exception when calling IncidentsApi#searchIncidents");System.err.println("Status code: "+e.getCode());System.err.println("Reason: "+e.getResponseBody());System.err.println("Response headers: "+e.getResponseHeaders());e.printStackTrace();}}}
// Search for incidents returns "OK" response
usedatadog_api_client::datadog;usedatadog_api_client::datadogV2::api_incidents::IncidentsAPI;usedatadog_api_client::datadogV2::api_incidents::SearchIncidentsOptionalParams;#[tokio::main]asyncfnmain(){letmutconfiguration=datadog::Configuration::new();configuration.set_unstable_operation_enabled("v2.SearchIncidents",true);letapi=IncidentsAPI::with_config(configuration);letresp=api.search_incidents("state:(active OR stable OR resolved)".to_string(),SearchIncidentsOptionalParams::default(),).await;ifletOk(value)=resp{println!("{:#?}",value);}else{println!("{:#?}",resp.unwrap_err());}}
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com"DD_API_KEY="<DD_API_KEY>"DD_APP_KEY="<DD_APP_KEY>"cargo run
/**
* Search for incidents returns "OK" response
*/import{client,v2}from"@datadog/datadog-api-client";constconfiguration=client.createConfiguration();configuration.unstableOperations["v2.searchIncidents"]=true;constapiInstance=newv2.IncidentsApi(configuration);constparams: v2.IncidentsApiSearchIncidentsRequest={query:"state:(active OR stable OR resolved)",};apiInstance.searchIncidents(params).then((data: v2.IncidentSearchResponse)=>{console.log("API called successfully. Returned data: "+JSON.stringify(data));}).catch((error: any)=>console.error(error));
"""
Get a list of attachments returns "OK" response
"""fromdatadog_api_clientimportApiClient,Configurationfromdatadog_api_client.v2.api.incidents_apiimportIncidentsApiconfiguration=Configuration()configuration.unstable_operations["list_incident_attachments"]=TruewithApiClient(configuration)asapi_client:api_instance=IncidentsApi(api_client)response=api_instance.list_incident_attachments(incident_id="incident_id",)print(response)
# Get a list of attachments returns "OK" responserequire"datadog_api_client"DatadogAPIClient.configuredo|config|config.unstable_operations["v2.list_incident_attachments".to_sym]=trueendapi_instance=DatadogAPIClient::V2::IncidentsAPI.newpapi_instance.list_incident_attachments("incident_id")
// Get a list of attachments returns "OK" response
packagemainimport("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")funcmain(){ctx:=datadog.NewDefaultContext(context.Background())configuration:=datadog.NewConfiguration()configuration.SetUnstableOperationEnabled("v2.ListIncidentAttachments",true)apiClient:=datadog.NewAPIClient(configuration)api:=datadogV2.NewIncidentsApi(apiClient)resp,r,err:=api.ListIncidentAttachments(ctx,"incident_id",*datadogV2.NewListIncidentAttachmentsOptionalParameters())iferr!=nil{fmt.Fprintf(os.Stderr,"Error when calling `IncidentsApi.ListIncidentAttachments`: %v\n",err)fmt.Fprintf(os.Stderr,"Full HTTP response: %v\n",r)}responseContent,_:=json.MarshalIndent(resp,""," ")fmt.Fprintf(os.Stdout,"Response from `IncidentsApi.ListIncidentAttachments`:\n%s\n",responseContent)}
// Get a list of attachments returns "OK" responseimportcom.datadog.api.client.ApiClient;importcom.datadog.api.client.ApiException;importcom.datadog.api.client.v2.api.IncidentsApi;importcom.datadog.api.client.v2.model.IncidentAttachmentsResponse;publicclassExample{publicstaticvoidmain(String[]args){ApiClientdefaultClient=ApiClient.getDefaultApiClient();defaultClient.setUnstableOperationEnabled("v2.listIncidentAttachments",true);IncidentsApiapiInstance=newIncidentsApi(defaultClient);try{IncidentAttachmentsResponseresult=apiInstance.listIncidentAttachments("incident_id");System.out.println(result);}catch(ApiExceptione){System.err.println("Exception when calling IncidentsApi#listIncidentAttachments");System.err.println("Status code: "+e.getCode());System.err.println("Reason: "+e.getResponseBody());System.err.println("Response headers: "+e.getResponseHeaders());e.printStackTrace();}}}
// Get a list of attachments returns "OK" response
usedatadog_api_client::datadog;usedatadog_api_client::datadogV2::api_incidents::IncidentsAPI;usedatadog_api_client::datadogV2::api_incidents::ListIncidentAttachmentsOptionalParams;#[tokio::main]asyncfnmain(){letmutconfiguration=datadog::Configuration::new();configuration.set_unstable_operation_enabled("v2.ListIncidentAttachments",true);letapi=IncidentsAPI::with_config(configuration);letresp=api.list_incident_attachments("incident_id".to_string(),ListIncidentAttachmentsOptionalParams::default(),).await;ifletOk(value)=resp{println!("{:#?}",value);}else{println!("{:#?}",resp.unwrap_err());}}
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com"DD_API_KEY="<API-KEY>"DD_APP_KEY="<APP-KEY>"cargo run
/**
* Get a list of attachments returns "OK" response
*/import{client,v2}from"@datadog/datadog-api-client";constconfiguration=client.createConfiguration();configuration.unstableOperations["v2.listIncidentAttachments"]=true;constapiInstance=newv2.IncidentsApi(configuration);constparams: v2.IncidentsApiListIncidentAttachmentsRequest={incidentId:"incident_id",};apiInstance.listIncidentAttachments(params).then((data: v2.IncidentAttachmentsResponse)=>{console.log("API called successfully. Returned data: "+JSON.stringify(data));}).catch((error: any)=>console.error(error));
An array of incident attachments. An attachment object without an "id" key indicates that you want to
create that attachment. An attachment object without an "attributes" key indicates that you want to
delete that attachment. An attachment object with both the "id" key and a populated "attributes" object
indicates that you want to update that attachment.
attributes
<oneOf>
Incident attachment attributes.
Option 1
object
The attributes object for a postmortem attachment.
attachment [required]
object
The postmortem attachment.
documentUrl [required]
string
The URL of this notebook attachment.
title [required]
string
The title of this postmortem attachment.
attachment_type [required]
enum
The type of postmortem attachment attributes.
Allowed enum values: postmortem
default: postmortem
Option 2
object
The attributes object for a link attachment.
attachment [required]
object
The link attachment.
documentUrl [required]
string
The URL of this link attachment.
title [required]
string
The title of this link attachment.
attachment_type [required]
enum
The type of link attachment attributes.
Allowed enum values: link
default: link
modified
date-time
Timestamp when the incident attachment link was last modified.
id
string
A unique identifier that represents the incident attachment.
type [required]
enum
The incident attachment resource type.
Allowed enum values: incident_attachments
// Create an incident attachment returns "OK" response
packagemainimport("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")funcmain(){// there is a valid "incident" in the system
IncidentDataID:=os.Getenv("INCIDENT_DATA_ID")body:=datadogV2.IncidentAttachmentUpdateRequest{Data:[]datadogV2.IncidentAttachmentUpdateData{{Type:datadogV2.INCIDENTATTACHMENTTYPE_INCIDENT_ATTACHMENTS,Attributes:&datadogV2.IncidentAttachmentUpdateAttributes{IncidentAttachmentLinkAttributes:&datadogV2.IncidentAttachmentLinkAttributes{AttachmentType:datadogV2.INCIDENTATTACHMENTLINKATTACHMENTTYPE_LINK,Attachment:datadogV2.IncidentAttachmentLinkAttributesAttachmentObject{DocumentUrl:"https://www.example.com/doc",Title:"Example-Incident",},}},},},}ctx:=datadog.NewDefaultContext(context.Background())configuration:=datadog.NewConfiguration()configuration.SetUnstableOperationEnabled("v2.UpdateIncidentAttachments",true)apiClient:=datadog.NewAPIClient(configuration)api:=datadogV2.NewIncidentsApi(apiClient)resp,r,err:=api.UpdateIncidentAttachments(ctx,IncidentDataID,body,*datadogV2.NewUpdateIncidentAttachmentsOptionalParameters())iferr!=nil{fmt.Fprintf(os.Stderr,"Error when calling `IncidentsApi.UpdateIncidentAttachments`: %v\n",err)fmt.Fprintf(os.Stderr,"Full HTTP response: %v\n",r)}responseContent,_:=json.MarshalIndent(resp,""," ")fmt.Fprintf(os.Stdout,"Response from `IncidentsApi.UpdateIncidentAttachments`:\n%s\n",responseContent)}
// Create an incident attachment returns "OK" responseimportcom.datadog.api.client.ApiClient;importcom.datadog.api.client.ApiException;importcom.datadog.api.client.v2.api.IncidentsApi;importcom.datadog.api.client.v2.model.IncidentAttachmentLinkAttachmentType;importcom.datadog.api.client.v2.model.IncidentAttachmentLinkAttributes;importcom.datadog.api.client.v2.model.IncidentAttachmentLinkAttributesAttachmentObject;importcom.datadog.api.client.v2.model.IncidentAttachmentType;importcom.datadog.api.client.v2.model.IncidentAttachmentUpdateAttributes;importcom.datadog.api.client.v2.model.IncidentAttachmentUpdateData;importcom.datadog.api.client.v2.model.IncidentAttachmentUpdateRequest;importcom.datadog.api.client.v2.model.IncidentAttachmentUpdateResponse;importjava.util.Collections;publicclassExample{publicstaticvoidmain(String[]args){ApiClientdefaultClient=ApiClient.getDefaultApiClient();defaultClient.setUnstableOperationEnabled("v2.updateIncidentAttachments",true);IncidentsApiapiInstance=newIncidentsApi(defaultClient);// there is a valid "incident" in the systemStringINCIDENT_DATA_ID=System.getenv("INCIDENT_DATA_ID");IncidentAttachmentUpdateRequestbody=newIncidentAttachmentUpdateRequest().data(Collections.singletonList(newIncidentAttachmentUpdateData().type(IncidentAttachmentType.INCIDENT_ATTACHMENTS).attributes(newIncidentAttachmentUpdateAttributes(newIncidentAttachmentLinkAttributes().attachmentType(IncidentAttachmentLinkAttachmentType.LINK).attachment(newIncidentAttachmentLinkAttributesAttachmentObject().documentUrl("https://www.example.com/doc").title("Example-Incident"))))));try{IncidentAttachmentUpdateResponseresult=apiInstance.updateIncidentAttachments(INCIDENT_DATA_ID,body);System.out.println(result);}catch(ApiExceptione){System.err.println("Exception when calling IncidentsApi#updateIncidentAttachments");System.err.println("Status code: "+e.getCode());System.err.println("Reason: "+e.getResponseBody());System.err.println("Response headers: "+e.getResponseHeaders());e.printStackTrace();}}}
"""
Create an incident attachment returns "OK" response
"""fromosimportenvironfromdatadog_api_clientimportApiClient,Configurationfromdatadog_api_client.v2.api.incidents_apiimportIncidentsApifromdatadog_api_client.v2.model.incident_attachment_link_attachment_typeimportIncidentAttachmentLinkAttachmentTypefromdatadog_api_client.v2.model.incident_attachment_link_attributesimportIncidentAttachmentLinkAttributesfromdatadog_api_client.v2.model.incident_attachment_link_attributes_attachment_objectimport(IncidentAttachmentLinkAttributesAttachmentObject,)fromdatadog_api_client.v2.model.incident_attachment_typeimportIncidentAttachmentTypefromdatadog_api_client.v2.model.incident_attachment_update_dataimportIncidentAttachmentUpdateDatafromdatadog_api_client.v2.model.incident_attachment_update_requestimportIncidentAttachmentUpdateRequest# there is a valid "incident" in the systemINCIDENT_DATA_ID=environ["INCIDENT_DATA_ID"]body=IncidentAttachmentUpdateRequest(data=[IncidentAttachmentUpdateData(type=IncidentAttachmentType.INCIDENT_ATTACHMENTS,attributes=IncidentAttachmentLinkAttributes(attachment_type=IncidentAttachmentLinkAttachmentType.LINK,attachment=IncidentAttachmentLinkAttributesAttachmentObject(document_url="https://www.example.com/doc",title="Example-Incident",),),),],)configuration=Configuration()configuration.unstable_operations["update_incident_attachments"]=TruewithApiClient(configuration)asapi_client:api_instance=IncidentsApi(api_client)response=api_instance.update_incident_attachments(incident_id=INCIDENT_DATA_ID,body=body)print(response)
# Create an incident attachment returns "OK" responserequire"datadog_api_client"DatadogAPIClient.configuredo|config|config.unstable_operations["v2.update_incident_attachments".to_sym]=trueendapi_instance=DatadogAPIClient::V2::IncidentsAPI.new# there is a valid "incident" in the systemINCIDENT_DATA_ID=ENV["INCIDENT_DATA_ID"]body=DatadogAPIClient::V2::IncidentAttachmentUpdateRequest.new({data:[DatadogAPIClient::V2::IncidentAttachmentUpdateData.new({type:DatadogAPIClient::V2::IncidentAttachmentType::INCIDENT_ATTACHMENTS,attributes:DatadogAPIClient::V2::IncidentAttachmentLinkAttributes.new({attachment_type:DatadogAPIClient::V2::IncidentAttachmentLinkAttachmentType::LINK,attachment:DatadogAPIClient::V2::IncidentAttachmentLinkAttributesAttachmentObject.new({document_url:"https://www.example.com/doc",title:"Example-Incident",}),}),}),],})papi_instance.update_incident_attachments(INCIDENT_DATA_ID,body)
// Create an incident attachment returns "OK" response
usedatadog_api_client::datadog;usedatadog_api_client::datadogV2::api_incidents::IncidentsAPI;usedatadog_api_client::datadogV2::api_incidents::UpdateIncidentAttachmentsOptionalParams;usedatadog_api_client::datadogV2::model::IncidentAttachmentLinkAttachmentType;usedatadog_api_client::datadogV2::model::IncidentAttachmentLinkAttributes;usedatadog_api_client::datadogV2::model::IncidentAttachmentLinkAttributesAttachmentObject;usedatadog_api_client::datadogV2::model::IncidentAttachmentType;usedatadog_api_client::datadogV2::model::IncidentAttachmentUpdateAttributes;usedatadog_api_client::datadogV2::model::IncidentAttachmentUpdateData;usedatadog_api_client::datadogV2::model::IncidentAttachmentUpdateRequest;#[tokio::main]asyncfnmain(){// there is a valid "incident" in the system
letincident_data_id=std::env::var("INCIDENT_DATA_ID").unwrap();letbody=IncidentAttachmentUpdateRequest::new(vec![IncidentAttachmentUpdateData::new(IncidentAttachmentType::INCIDENT_ATTACHMENTS,).attributes(IncidentAttachmentUpdateAttributes::IncidentAttachmentLinkAttributes(Box::new(IncidentAttachmentLinkAttributes::new(IncidentAttachmentLinkAttributesAttachmentObject::new("https://www.example.com/doc".to_string(),"Example-Incident".to_string(),),IncidentAttachmentLinkAttachmentType::LINK,),)),)]);letmutconfiguration=datadog::Configuration::new();configuration.set_unstable_operation_enabled("v2.UpdateIncidentAttachments",true);letapi=IncidentsAPI::with_config(configuration);letresp=api.update_incident_attachments(incident_data_id.clone(),body,UpdateIncidentAttachmentsOptionalParams::default(),).await;ifletOk(value)=resp{println!("{:#?}",value);}else{println!("{:#?}",resp.unwrap_err());}}
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com"DD_API_KEY="<API-KEY>"DD_APP_KEY="<APP-KEY>"cargo run
/**
* Create an incident attachment returns "OK" response
*/import{client,v2}from"@datadog/datadog-api-client";constconfiguration=client.createConfiguration();configuration.unstableOperations["v2.updateIncidentAttachments"]=true;constapiInstance=newv2.IncidentsApi(configuration);// there is a valid "incident" in the system
constINCIDENT_DATA_ID=process.env.INCIDENT_DATA_IDasstring;constparams: v2.IncidentsApiUpdateIncidentAttachmentsRequest={body:{data:[{type:"incident_attachments",attributes:{attachmentType:"link",attachment:{documentUrl:"https://www.example.com/doc",title:"Example-Incident",},},},],},incidentId: INCIDENT_DATA_ID,};apiInstance.updateIncidentAttachments(params).then((data: v2.IncidentAttachmentUpdateResponse)=>{console.log("API called successfully. Returned data: "+JSON.stringify(data));}).catch((error: any)=>console.error(error));
Incident integration metadata for the Slack integration.
channels [required]
[object]
Array of Slack channels in this integration metadata.
channel_id [required]
string
Slack channel ID.
channel_name [required]
string
Name of the Slack channel.
redirect_url [required]
string
URL redirecting to the Slack channel.
team_id
string
Slack team ID.
Option 2
object
Incident integration metadata for the Jira integration.
issues [required]
[object]
Array of Jira issues in this integration metadata.
account [required]
string
URL of issue's Jira account.
issue_key
string
Jira issue's issue key.
issuetype_id
string
Jira issue's issue type.
project_key [required]
string
Jira issue's project keys.
redirect_url
string
URL redirecting to the Jira issue.
Option 3
object
Incident integration metadata for the Microsoft Teams integration.
teams [required]
[object]
Array of Microsoft Teams in this integration metadata.
ms_channel_id [required]
string
Microsoft Teams channel ID.
ms_channel_name [required]
string
Microsoft Teams channel name.
ms_tenant_id [required]
string
Microsoft Teams tenant ID.
redirect_url [required]
string
URL redirecting to the Microsoft Teams channel.
modified
date-time
Timestamp when the incident todo was last modified.
status
int32
A number indicating the status of this integration metadata. 0 indicates unknown;
1 indicates pending; 2 indicates complete; 3 indicates manually created;
4 indicates manually updated; 5 indicates failed.
id [required]
string
The incident integration metadata's ID.
relationships
object
The incident's integration relationships from a response.
"""
Get a list of an incident's integration metadata returns "OK" response
"""fromosimportenvironfromdatadog_api_clientimportApiClient,Configurationfromdatadog_api_client.v2.api.incidents_apiimportIncidentsApi# there is a valid "incident" in the systemINCIDENT_DATA_ID=environ["INCIDENT_DATA_ID"]configuration=Configuration()configuration.unstable_operations["list_incident_integrations"]=TruewithApiClient(configuration)asapi_client:api_instance=IncidentsApi(api_client)response=api_instance.list_incident_integrations(incident_id=INCIDENT_DATA_ID,)print(response)
# Get a list of an incident's integration metadata returns "OK" responserequire"datadog_api_client"DatadogAPIClient.configuredo|config|config.unstable_operations["v2.list_incident_integrations".to_sym]=trueendapi_instance=DatadogAPIClient::V2::IncidentsAPI.new# there is a valid "incident" in the systemINCIDENT_DATA_ID=ENV["INCIDENT_DATA_ID"]papi_instance.list_incident_integrations(INCIDENT_DATA_ID)
// Get a list of an incident's integration metadata returns "OK" response
packagemainimport("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")funcmain(){// there is a valid "incident" in the system
IncidentDataID:=os.Getenv("INCIDENT_DATA_ID")ctx:=datadog.NewDefaultContext(context.Background())configuration:=datadog.NewConfiguration()configuration.SetUnstableOperationEnabled("v2.ListIncidentIntegrations",true)apiClient:=datadog.NewAPIClient(configuration)api:=datadogV2.NewIncidentsApi(apiClient)resp,r,err:=api.ListIncidentIntegrations(ctx,IncidentDataID)iferr!=nil{fmt.Fprintf(os.Stderr,"Error when calling `IncidentsApi.ListIncidentIntegrations`: %v\n",err)fmt.Fprintf(os.Stderr,"Full HTTP response: %v\n",r)}responseContent,_:=json.MarshalIndent(resp,""," ")fmt.Fprintf(os.Stdout,"Response from `IncidentsApi.ListIncidentIntegrations`:\n%s\n",responseContent)}
// Get a list of an incident's integration metadata returns "OK" responseimportcom.datadog.api.client.ApiClient;importcom.datadog.api.client.ApiException;importcom.datadog.api.client.v2.api.IncidentsApi;importcom.datadog.api.client.v2.model.IncidentIntegrationMetadataListResponse;publicclassExample{publicstaticvoidmain(String[]args){ApiClientdefaultClient=ApiClient.getDefaultApiClient();defaultClient.setUnstableOperationEnabled("v2.listIncidentIntegrations",true);IncidentsApiapiInstance=newIncidentsApi(defaultClient);// there is a valid "incident" in the systemStringINCIDENT_DATA_ID=System.getenv("INCIDENT_DATA_ID");try{IncidentIntegrationMetadataListResponseresult=apiInstance.listIncidentIntegrations(INCIDENT_DATA_ID);System.out.println(result);}catch(ApiExceptione){System.err.println("Exception when calling IncidentsApi#listIncidentIntegrations");System.err.println("Status code: "+e.getCode());System.err.println("Reason: "+e.getResponseBody());System.err.println("Response headers: "+e.getResponseHeaders());e.printStackTrace();}}}
// Get a list of an incident's integration metadata returns "OK" response
usedatadog_api_client::datadog;usedatadog_api_client::datadogV2::api_incidents::IncidentsAPI;#[tokio::main]asyncfnmain(){// there is a valid "incident" in the system
letincident_data_id=std::env::var("INCIDENT_DATA_ID").unwrap();letmutconfiguration=datadog::Configuration::new();configuration.set_unstable_operation_enabled("v2.ListIncidentIntegrations",true);letapi=IncidentsAPI::with_config(configuration);letresp=api.list_incident_integrations(incident_data_id.clone()).await;ifletOk(value)=resp{println!("{:#?}",value);}else{println!("{:#?}",resp.unwrap_err());}}
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com"DD_API_KEY="<DD_API_KEY>"DD_APP_KEY="<DD_APP_KEY>"cargo run
/**
* Get a list of an incident's integration metadata returns "OK" response
*/import{client,v2}from"@datadog/datadog-api-client";constconfiguration=client.createConfiguration();configuration.unstableOperations["v2.listIncidentIntegrations"]=true;constapiInstance=newv2.IncidentsApi(configuration);// there is a valid "incident" in the system
constINCIDENT_DATA_ID=process.env.INCIDENT_DATA_IDasstring;constparams: v2.IncidentsApiListIncidentIntegrationsRequest={incidentId: INCIDENT_DATA_ID,};apiInstance.listIncidentIntegrations(params).then((data: v2.IncidentIntegrationMetadataListResponse)=>{console.log("API called successfully. Returned data: "+JSON.stringify(data));}).catch((error: any)=>console.error(error));
Incident integration metadata for the Slack integration.
channels [required]
[object]
Array of Slack channels in this integration metadata.
channel_id [required]
string
Slack channel ID.
channel_name [required]
string
Name of the Slack channel.
redirect_url [required]
string
URL redirecting to the Slack channel.
team_id
string
Slack team ID.
Option 2
object
Incident integration metadata for the Jira integration.
issues [required]
[object]
Array of Jira issues in this integration metadata.
account [required]
string
URL of issue's Jira account.
issue_key
string
Jira issue's issue key.
issuetype_id
string
Jira issue's issue type.
project_key [required]
string
Jira issue's project keys.
redirect_url
string
URL redirecting to the Jira issue.
Option 3
object
Incident integration metadata for the Microsoft Teams integration.
teams [required]
[object]
Array of Microsoft Teams in this integration metadata.
ms_channel_id [required]
string
Microsoft Teams channel ID.
ms_channel_name [required]
string
Microsoft Teams channel name.
ms_tenant_id [required]
string
Microsoft Teams tenant ID.
redirect_url [required]
string
URL redirecting to the Microsoft Teams channel.
modified
date-time
Timestamp when the incident todo was last modified.
status
int32
A number indicating the status of this integration metadata. 0 indicates unknown;
1 indicates pending; 2 indicates complete; 3 indicates manually created;
4 indicates manually updated; 5 indicates failed.
Incident integration metadata for the Slack integration.
channels [required]
[object]
Array of Slack channels in this integration metadata.
channel_id [required]
string
Slack channel ID.
channel_name [required]
string
Name of the Slack channel.
redirect_url [required]
string
URL redirecting to the Slack channel.
team_id
string
Slack team ID.
Option 2
object
Incident integration metadata for the Jira integration.
issues [required]
[object]
Array of Jira issues in this integration metadata.
account [required]
string
URL of issue's Jira account.
issue_key
string
Jira issue's issue key.
issuetype_id
string
Jira issue's issue type.
project_key [required]
string
Jira issue's project keys.
redirect_url
string
URL redirecting to the Jira issue.
Option 3
object
Incident integration metadata for the Microsoft Teams integration.
teams [required]
[object]
Array of Microsoft Teams in this integration metadata.
ms_channel_id [required]
string
Microsoft Teams channel ID.
ms_channel_name [required]
string
Microsoft Teams channel name.
ms_tenant_id [required]
string
Microsoft Teams tenant ID.
redirect_url [required]
string
URL redirecting to the Microsoft Teams channel.
modified
date-time
Timestamp when the incident todo was last modified.
status
int32
A number indicating the status of this integration metadata. 0 indicates unknown;
1 indicates pending; 2 indicates complete; 3 indicates manually created;
4 indicates manually updated; 5 indicates failed.
id [required]
string
The incident integration metadata's ID.
relationships
object
The incident's integration relationships from a response.
// Create an incident integration metadata returns "CREATED" response
packagemainimport("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")funcmain(){// there is a valid "incident" in the system
IncidentDataID:=os.Getenv("INCIDENT_DATA_ID")body:=datadogV2.IncidentIntegrationMetadataCreateRequest{Data:datadogV2.IncidentIntegrationMetadataCreateData{Attributes:datadogV2.IncidentIntegrationMetadataAttributes{IncidentId:datadog.PtrString(IncidentDataID),IntegrationType:1,Metadata:datadogV2.IncidentIntegrationMetadataMetadata{SlackIntegrationMetadata:&datadogV2.SlackIntegrationMetadata{Channels:[]datadogV2.SlackIntegrationMetadataChannelItem{{ChannelId:"C0123456789",ChannelName:"#new-channel",TeamId:datadog.PtrString("T01234567"),RedirectUrl:"https://slack.com/app_redirect?channel=C0123456789&team=T01234567",},},}},},Type:datadogV2.INCIDENTINTEGRATIONMETADATATYPE_INCIDENT_INTEGRATIONS,},}ctx:=datadog.NewDefaultContext(context.Background())configuration:=datadog.NewConfiguration()configuration.SetUnstableOperationEnabled("v2.CreateIncidentIntegration",true)apiClient:=datadog.NewAPIClient(configuration)api:=datadogV2.NewIncidentsApi(apiClient)resp,r,err:=api.CreateIncidentIntegration(ctx,IncidentDataID,body)iferr!=nil{fmt.Fprintf(os.Stderr,"Error when calling `IncidentsApi.CreateIncidentIntegration`: %v\n",err)fmt.Fprintf(os.Stderr,"Full HTTP response: %v\n",r)}responseContent,_:=json.MarshalIndent(resp,""," ")fmt.Fprintf(os.Stdout,"Response from `IncidentsApi.CreateIncidentIntegration`:\n%s\n",responseContent)}
// Create an incident integration metadata returns "CREATED" responseimportcom.datadog.api.client.ApiClient;importcom.datadog.api.client.ApiException;importcom.datadog.api.client.v2.api.IncidentsApi;importcom.datadog.api.client.v2.model.IncidentIntegrationMetadataAttributes;importcom.datadog.api.client.v2.model.IncidentIntegrationMetadataCreateData;importcom.datadog.api.client.v2.model.IncidentIntegrationMetadataCreateRequest;importcom.datadog.api.client.v2.model.IncidentIntegrationMetadataMetadata;importcom.datadog.api.client.v2.model.IncidentIntegrationMetadataResponse;importcom.datadog.api.client.v2.model.IncidentIntegrationMetadataType;importcom.datadog.api.client.v2.model.SlackIntegrationMetadata;importcom.datadog.api.client.v2.model.SlackIntegrationMetadataChannelItem;importjava.util.Collections;publicclassExample{publicstaticvoidmain(String[]args){ApiClientdefaultClient=ApiClient.getDefaultApiClient();defaultClient.setUnstableOperationEnabled("v2.createIncidentIntegration",true);IncidentsApiapiInstance=newIncidentsApi(defaultClient);// there is a valid "incident" in the systemStringINCIDENT_DATA_ID=System.getenv("INCIDENT_DATA_ID");IncidentIntegrationMetadataCreateRequestbody=newIncidentIntegrationMetadataCreateRequest().data(newIncidentIntegrationMetadataCreateData().attributes(newIncidentIntegrationMetadataAttributes().incidentId(INCIDENT_DATA_ID).integrationType(1).metadata(newIncidentIntegrationMetadataMetadata(newSlackIntegrationMetadata().channels(Collections.singletonList(newSlackIntegrationMetadataChannelItem().channelId("C0123456789").channelName("#new-channel").teamId("T01234567").redirectUrl("https://slack.com/app_redirect?channel=C0123456789&team=T01234567")))))).type(IncidentIntegrationMetadataType.INCIDENT_INTEGRATIONS));try{IncidentIntegrationMetadataResponseresult=apiInstance.createIncidentIntegration(INCIDENT_DATA_ID,body);System.out.println(result);}catch(ApiExceptione){System.err.println("Exception when calling IncidentsApi#createIncidentIntegration");System.err.println("Status code: "+e.getCode());System.err.println("Reason: "+e.getResponseBody());System.err.println("Response headers: "+e.getResponseHeaders());e.printStackTrace();}}}
"""
Create an incident integration metadata returns "CREATED" response
"""fromosimportenvironfromdatadog_api_clientimportApiClient,Configurationfromdatadog_api_client.v2.api.incidents_apiimportIncidentsApifromdatadog_api_client.v2.model.incident_integration_metadata_attributesimportIncidentIntegrationMetadataAttributesfromdatadog_api_client.v2.model.incident_integration_metadata_create_dataimportIncidentIntegrationMetadataCreateDatafromdatadog_api_client.v2.model.incident_integration_metadata_create_requestimport(IncidentIntegrationMetadataCreateRequest,)fromdatadog_api_client.v2.model.incident_integration_metadata_typeimportIncidentIntegrationMetadataTypefromdatadog_api_client.v2.model.slack_integration_metadataimportSlackIntegrationMetadatafromdatadog_api_client.v2.model.slack_integration_metadata_channel_itemimportSlackIntegrationMetadataChannelItem# there is a valid "incident" in the systemINCIDENT_DATA_ID=environ["INCIDENT_DATA_ID"]body=IncidentIntegrationMetadataCreateRequest(data=IncidentIntegrationMetadataCreateData(attributes=IncidentIntegrationMetadataAttributes(incident_id=INCIDENT_DATA_ID,integration_type=1,metadata=SlackIntegrationMetadata(channels=[SlackIntegrationMetadataChannelItem(channel_id="C0123456789",channel_name="#new-channel",team_id="T01234567",redirect_url="https://slack.com/app_redirect?channel=C0123456789&team=T01234567",),],),),type=IncidentIntegrationMetadataType.INCIDENT_INTEGRATIONS,),)configuration=Configuration()configuration.unstable_operations["create_incident_integration"]=TruewithApiClient(configuration)asapi_client:api_instance=IncidentsApi(api_client)response=api_instance.create_incident_integration(incident_id=INCIDENT_DATA_ID,body=body)print(response)
# Create an incident integration metadata returns "CREATED" responserequire"datadog_api_client"DatadogAPIClient.configuredo|config|config.unstable_operations["v2.create_incident_integration".to_sym]=trueendapi_instance=DatadogAPIClient::V2::IncidentsAPI.new# there is a valid "incident" in the systemINCIDENT_DATA_ID=ENV["INCIDENT_DATA_ID"]body=DatadogAPIClient::V2::IncidentIntegrationMetadataCreateRequest.new({data:DatadogAPIClient::V2::IncidentIntegrationMetadataCreateData.new({attributes:DatadogAPIClient::V2::IncidentIntegrationMetadataAttributes.new({incident_id:INCIDENT_DATA_ID,integration_type:1,metadata:DatadogAPIClient::V2::SlackIntegrationMetadata.new({channels:[DatadogAPIClient::V2::SlackIntegrationMetadataChannelItem.new({channel_id:"C0123456789",channel_name:"#new-channel",team_id:"T01234567",redirect_url:"https://slack.com/app_redirect?channel=C0123456789&team=T01234567",}),],}),}),type:DatadogAPIClient::V2::IncidentIntegrationMetadataType::INCIDENT_INTEGRATIONS,}),})papi_instance.create_incident_integration(INCIDENT_DATA_ID,body)
// Create an incident integration metadata returns "CREATED" response
usedatadog_api_client::datadog;usedatadog_api_client::datadogV2::api_incidents::IncidentsAPI;usedatadog_api_client::datadogV2::model::IncidentIntegrationMetadataAttributes;usedatadog_api_client::datadogV2::model::IncidentIntegrationMetadataCreateData;usedatadog_api_client::datadogV2::model::IncidentIntegrationMetadataCreateRequest;usedatadog_api_client::datadogV2::model::IncidentIntegrationMetadataMetadata;usedatadog_api_client::datadogV2::model::IncidentIntegrationMetadataType;usedatadog_api_client::datadogV2::model::SlackIntegrationMetadata;usedatadog_api_client::datadogV2::model::SlackIntegrationMetadataChannelItem;#[tokio::main]asyncfnmain(){// there is a valid "incident" in the system
letincident_data_id=std::env::var("INCIDENT_DATA_ID").unwrap();letbody=IncidentIntegrationMetadataCreateRequest::new(IncidentIntegrationMetadataCreateData::new(IncidentIntegrationMetadataAttributes::new(1,IncidentIntegrationMetadataMetadata::SlackIntegrationMetadata(Box::new(SlackIntegrationMetadata::new(vec![SlackIntegrationMetadataChannelItem::new("C0123456789".to_string(),"#new-channel".to_string(),"https://slack.com/app_redirect?channel=C0123456789&team=T01234567".to_string(),).team_id("T01234567".to_string())]),)),).incident_id(incident_data_id.clone()),IncidentIntegrationMetadataType::INCIDENT_INTEGRATIONS,));letmutconfiguration=datadog::Configuration::new();configuration.set_unstable_operation_enabled("v2.CreateIncidentIntegration",true);letapi=IncidentsAPI::with_config(configuration);letresp=api.create_incident_integration(incident_data_id.clone(),body).await;ifletOk(value)=resp{println!("{:#?}",value);}else{println!("{:#?}",resp.unwrap_err());}}
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com"DD_API_KEY="<DD_API_KEY>"DD_APP_KEY="<DD_APP_KEY>"cargo run
/**
* Create an incident integration metadata returns "CREATED" response
*/import{client,v2}from"@datadog/datadog-api-client";constconfiguration=client.createConfiguration();configuration.unstableOperations["v2.createIncidentIntegration"]=true;constapiInstance=newv2.IncidentsApi(configuration);// there is a valid "incident" in the system
constINCIDENT_DATA_ID=process.env.INCIDENT_DATA_IDasstring;constparams: v2.IncidentsApiCreateIncidentIntegrationRequest={body:{data:{attributes:{incidentId: INCIDENT_DATA_ID,integrationType: 1,metadata:{channels:[{channelId:"C0123456789",channelName:"#new-channel",teamId:"T01234567",redirectUrl:"https://slack.com/app_redirect?channel=C0123456789&team=T01234567",},],},},type:"incident_integrations",},},incidentId: INCIDENT_DATA_ID,};apiInstance.createIncidentIntegration(params).then((data: v2.IncidentIntegrationMetadataResponse)=>{console.log("API called successfully. Returned data: "+JSON.stringify(data));}).catch((error: any)=>console.error(error));
Incident integration metadata for the Slack integration.
channels [required]
[object]
Array of Slack channels in this integration metadata.
channel_id [required]
string
Slack channel ID.
channel_name [required]
string
Name of the Slack channel.
redirect_url [required]
string
URL redirecting to the Slack channel.
team_id
string
Slack team ID.
Option 2
object
Incident integration metadata for the Jira integration.
issues [required]
[object]
Array of Jira issues in this integration metadata.
account [required]
string
URL of issue's Jira account.
issue_key
string
Jira issue's issue key.
issuetype_id
string
Jira issue's issue type.
project_key [required]
string
Jira issue's project keys.
redirect_url
string
URL redirecting to the Jira issue.
Option 3
object
Incident integration metadata for the Microsoft Teams integration.
teams [required]
[object]
Array of Microsoft Teams in this integration metadata.
ms_channel_id [required]
string
Microsoft Teams channel ID.
ms_channel_name [required]
string
Microsoft Teams channel name.
ms_tenant_id [required]
string
Microsoft Teams tenant ID.
redirect_url [required]
string
URL redirecting to the Microsoft Teams channel.
modified
date-time
Timestamp when the incident todo was last modified.
status
int32
A number indicating the status of this integration metadata. 0 indicates unknown;
1 indicates pending; 2 indicates complete; 3 indicates manually created;
4 indicates manually updated; 5 indicates failed.
id [required]
string
The incident integration metadata's ID.
relationships
object
The incident's integration relationships from a response.
"""
Get incident integration metadata details returns "OK" response
"""fromosimportenvironfromdatadog_api_clientimportApiClient,Configurationfromdatadog_api_client.v2.api.incidents_apiimportIncidentsApi# there is a valid "incident" in the systemINCIDENT_DATA_ID=environ["INCIDENT_DATA_ID"]# the "incident" has an "incident_integration_metadata"INCIDENT_INTEGRATION_METADATA_DATA_ID=environ["INCIDENT_INTEGRATION_METADATA_DATA_ID"]configuration=Configuration()configuration.unstable_operations["get_incident_integration"]=TruewithApiClient(configuration)asapi_client:api_instance=IncidentsApi(api_client)response=api_instance.get_incident_integration(incident_id=INCIDENT_DATA_ID,integration_metadata_id=INCIDENT_INTEGRATION_METADATA_DATA_ID,)print(response)
# Get incident integration metadata details returns "OK" responserequire"datadog_api_client"DatadogAPIClient.configuredo|config|config.unstable_operations["v2.get_incident_integration".to_sym]=trueendapi_instance=DatadogAPIClient::V2::IncidentsAPI.new# there is a valid "incident" in the systemINCIDENT_DATA_ID=ENV["INCIDENT_DATA_ID"]# the "incident" has an "incident_integration_metadata"INCIDENT_INTEGRATION_METADATA_DATA_ID=ENV["INCIDENT_INTEGRATION_METADATA_DATA_ID"]papi_instance.get_incident_integration(INCIDENT_DATA_ID,INCIDENT_INTEGRATION_METADATA_DATA_ID)
// Get incident integration metadata details returns "OK" response
packagemainimport("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")funcmain(){// there is a valid "incident" in the system
IncidentDataID:=os.Getenv("INCIDENT_DATA_ID")// the "incident" has an "incident_integration_metadata"
IncidentIntegrationMetadataDataID:=os.Getenv("INCIDENT_INTEGRATION_METADATA_DATA_ID")ctx:=datadog.NewDefaultContext(context.Background())configuration:=datadog.NewConfiguration()configuration.SetUnstableOperationEnabled("v2.GetIncidentIntegration",true)apiClient:=datadog.NewAPIClient(configuration)api:=datadogV2.NewIncidentsApi(apiClient)resp,r,err:=api.GetIncidentIntegration(ctx,IncidentDataID,IncidentIntegrationMetadataDataID)iferr!=nil{fmt.Fprintf(os.Stderr,"Error when calling `IncidentsApi.GetIncidentIntegration`: %v\n",err)fmt.Fprintf(os.Stderr,"Full HTTP response: %v\n",r)}responseContent,_:=json.MarshalIndent(resp,""," ")fmt.Fprintf(os.Stdout,"Response from `IncidentsApi.GetIncidentIntegration`:\n%s\n",responseContent)}
// Get incident integration metadata details returns "OK" responseimportcom.datadog.api.client.ApiClient;importcom.datadog.api.client.ApiException;importcom.datadog.api.client.v2.api.IncidentsApi;importcom.datadog.api.client.v2.model.IncidentIntegrationMetadataResponse;publicclassExample{publicstaticvoidmain(String[]args){ApiClientdefaultClient=ApiClient.getDefaultApiClient();defaultClient.setUnstableOperationEnabled("v2.getIncidentIntegration",true);IncidentsApiapiInstance=newIncidentsApi(defaultClient);// there is a valid "incident" in the systemStringINCIDENT_DATA_ID=System.getenv("INCIDENT_DATA_ID");// the "incident" has an "incident_integration_metadata"StringINCIDENT_INTEGRATION_METADATA_DATA_ID=System.getenv("INCIDENT_INTEGRATION_METADATA_DATA_ID");try{IncidentIntegrationMetadataResponseresult=apiInstance.getIncidentIntegration(INCIDENT_DATA_ID,INCIDENT_INTEGRATION_METADATA_DATA_ID);System.out.println(result);}catch(ApiExceptione){System.err.println("Exception when calling IncidentsApi#getIncidentIntegration");System.err.println("Status code: "+e.getCode());System.err.println("Reason: "+e.getResponseBody());System.err.println("Response headers: "+e.getResponseHeaders());e.printStackTrace();}}}
// Get incident integration metadata details returns "OK" response
usedatadog_api_client::datadog;usedatadog_api_client::datadogV2::api_incidents::IncidentsAPI;#[tokio::main]asyncfnmain(){// there is a valid "incident" in the system
letincident_data_id=std::env::var("INCIDENT_DATA_ID").unwrap();// the "incident" has an "incident_integration_metadata"
letincident_integration_metadata_data_id=std::env::var("INCIDENT_INTEGRATION_METADATA_DATA_ID").unwrap();letmutconfiguration=datadog::Configuration::new();configuration.set_unstable_operation_enabled("v2.GetIncidentIntegration",true);letapi=IncidentsAPI::with_config(configuration);letresp=api.get_incident_integration(incident_data_id.clone(),incident_integration_metadata_data_id.clone(),).await;ifletOk(value)=resp{println!("{:#?}",value);}else{println!("{:#?}",resp.unwrap_err());}}
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com"DD_API_KEY="<DD_API_KEY>"DD_APP_KEY="<DD_APP_KEY>"cargo run
/**
* Get incident integration metadata details returns "OK" response
*/import{client,v2}from"@datadog/datadog-api-client";constconfiguration=client.createConfiguration();configuration.unstableOperations["v2.getIncidentIntegration"]=true;constapiInstance=newv2.IncidentsApi(configuration);// there is a valid "incident" in the system
constINCIDENT_DATA_ID=process.env.INCIDENT_DATA_IDasstring;// the "incident" has an "incident_integration_metadata"
constINCIDENT_INTEGRATION_METADATA_DATA_ID=process.env.INCIDENT_INTEGRATION_METADATA_DATA_IDasstring;constparams: v2.IncidentsApiGetIncidentIntegrationRequest={incidentId: INCIDENT_DATA_ID,integrationMetadataId: INCIDENT_INTEGRATION_METADATA_DATA_ID,};apiInstance.getIncidentIntegration(params).then((data: v2.IncidentIntegrationMetadataResponse)=>{console.log("API called successfully. Returned data: "+JSON.stringify(data));}).catch((error: any)=>console.error(error));
Incident integration metadata for the Slack integration.
channels [required]
[object]
Array of Slack channels in this integration metadata.
channel_id [required]
string
Slack channel ID.
channel_name [required]
string
Name of the Slack channel.
redirect_url [required]
string
URL redirecting to the Slack channel.
team_id
string
Slack team ID.
Option 2
object
Incident integration metadata for the Jira integration.
issues [required]
[object]
Array of Jira issues in this integration metadata.
account [required]
string
URL of issue's Jira account.
issue_key
string
Jira issue's issue key.
issuetype_id
string
Jira issue's issue type.
project_key [required]
string
Jira issue's project keys.
redirect_url
string
URL redirecting to the Jira issue.
Option 3
object
Incident integration metadata for the Microsoft Teams integration.
teams [required]
[object]
Array of Microsoft Teams in this integration metadata.
ms_channel_id [required]
string
Microsoft Teams channel ID.
ms_channel_name [required]
string
Microsoft Teams channel name.
ms_tenant_id [required]
string
Microsoft Teams tenant ID.
redirect_url [required]
string
URL redirecting to the Microsoft Teams channel.
modified
date-time
Timestamp when the incident todo was last modified.
status
int32
A number indicating the status of this integration metadata. 0 indicates unknown;
1 indicates pending; 2 indicates complete; 3 indicates manually created;
4 indicates manually updated; 5 indicates failed.
Incident integration metadata for the Slack integration.
channels [required]
[object]
Array of Slack channels in this integration metadata.
channel_id [required]
string
Slack channel ID.
channel_name [required]
string
Name of the Slack channel.
redirect_url [required]
string
URL redirecting to the Slack channel.
team_id
string
Slack team ID.
Option 2
object
Incident integration metadata for the Jira integration.
issues [required]
[object]
Array of Jira issues in this integration metadata.
account [required]
string
URL of issue's Jira account.
issue_key
string
Jira issue's issue key.
issuetype_id
string
Jira issue's issue type.
project_key [required]
string
Jira issue's project keys.
redirect_url
string
URL redirecting to the Jira issue.
Option 3
object
Incident integration metadata for the Microsoft Teams integration.
teams [required]
[object]
Array of Microsoft Teams in this integration metadata.
ms_channel_id [required]
string
Microsoft Teams channel ID.
ms_channel_name [required]
string
Microsoft Teams channel name.
ms_tenant_id [required]
string
Microsoft Teams tenant ID.
redirect_url [required]
string
URL redirecting to the Microsoft Teams channel.
modified
date-time
Timestamp when the incident todo was last modified.
status
int32
A number indicating the status of this integration metadata. 0 indicates unknown;
1 indicates pending; 2 indicates complete; 3 indicates manually created;
4 indicates manually updated; 5 indicates failed.
id [required]
string
The incident integration metadata's ID.
relationships
object
The incident's integration relationships from a response.
// Update an existing incident integration metadata returns "OK" response
packagemainimport("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")funcmain(){// there is a valid "incident" in the system
IncidentDataID:=os.Getenv("INCIDENT_DATA_ID")// the "incident" has an "incident_integration_metadata"
IncidentIntegrationMetadataDataID:=os.Getenv("INCIDENT_INTEGRATION_METADATA_DATA_ID")body:=datadogV2.IncidentIntegrationMetadataPatchRequest{Data:datadogV2.IncidentIntegrationMetadataPatchData{Attributes:datadogV2.IncidentIntegrationMetadataAttributes{IncidentId:datadog.PtrString(IncidentDataID),IntegrationType:1,Metadata:datadogV2.IncidentIntegrationMetadataMetadata{SlackIntegrationMetadata:&datadogV2.SlackIntegrationMetadata{Channels:[]datadogV2.SlackIntegrationMetadataChannelItem{{ChannelId:"C0123456789",ChannelName:"#updated-channel-name",TeamId:datadog.PtrString("T01234567"),RedirectUrl:"https://slack.com/app_redirect?channel=C0123456789&team=T01234567",},},}},},Type:datadogV2.INCIDENTINTEGRATIONMETADATATYPE_INCIDENT_INTEGRATIONS,},}ctx:=datadog.NewDefaultContext(context.Background())configuration:=datadog.NewConfiguration()configuration.SetUnstableOperationEnabled("v2.UpdateIncidentIntegration",true)apiClient:=datadog.NewAPIClient(configuration)api:=datadogV2.NewIncidentsApi(apiClient)resp,r,err:=api.UpdateIncidentIntegration(ctx,IncidentDataID,IncidentIntegrationMetadataDataID,body)iferr!=nil{fmt.Fprintf(os.Stderr,"Error when calling `IncidentsApi.UpdateIncidentIntegration`: %v\n",err)fmt.Fprintf(os.Stderr,"Full HTTP response: %v\n",r)}responseContent,_:=json.MarshalIndent(resp,""," ")fmt.Fprintf(os.Stdout,"Response from `IncidentsApi.UpdateIncidentIntegration`:\n%s\n",responseContent)}
// Update an existing incident integration metadata returns "OK" responseimportcom.datadog.api.client.ApiClient;importcom.datadog.api.client.ApiException;importcom.datadog.api.client.v2.api.IncidentsApi;importcom.datadog.api.client.v2.model.IncidentIntegrationMetadataAttributes;importcom.datadog.api.client.v2.model.IncidentIntegrationMetadataMetadata;importcom.datadog.api.client.v2.model.IncidentIntegrationMetadataPatchData;importcom.datadog.api.client.v2.model.IncidentIntegrationMetadataPatchRequest;importcom.datadog.api.client.v2.model.IncidentIntegrationMetadataResponse;importcom.datadog.api.client.v2.model.IncidentIntegrationMetadataType;importcom.datadog.api.client.v2.model.SlackIntegrationMetadata;importcom.datadog.api.client.v2.model.SlackIntegrationMetadataChannelItem;importjava.util.Collections;publicclassExample{publicstaticvoidmain(String[]args){ApiClientdefaultClient=ApiClient.getDefaultApiClient();defaultClient.setUnstableOperationEnabled("v2.updateIncidentIntegration",true);IncidentsApiapiInstance=newIncidentsApi(defaultClient);// there is a valid "incident" in the systemStringINCIDENT_DATA_ID=System.getenv("INCIDENT_DATA_ID");// the "incident" has an "incident_integration_metadata"StringINCIDENT_INTEGRATION_METADATA_DATA_ID=System.getenv("INCIDENT_INTEGRATION_METADATA_DATA_ID");IncidentIntegrationMetadataPatchRequestbody=newIncidentIntegrationMetadataPatchRequest().data(newIncidentIntegrationMetadataPatchData().attributes(newIncidentIntegrationMetadataAttributes().incidentId(INCIDENT_DATA_ID).integrationType(1).metadata(newIncidentIntegrationMetadataMetadata(newSlackIntegrationMetadata().channels(Collections.singletonList(newSlackIntegrationMetadataChannelItem().channelId("C0123456789").channelName("#updated-channel-name").teamId("T01234567").redirectUrl("https://slack.com/app_redirect?channel=C0123456789&team=T01234567")))))).type(IncidentIntegrationMetadataType.INCIDENT_INTEGRATIONS));try{IncidentIntegrationMetadataResponseresult=apiInstance.updateIncidentIntegration(INCIDENT_DATA_ID,INCIDENT_INTEGRATION_METADATA_DATA_ID,body);System.out.println(result);}catch(ApiExceptione){System.err.println("Exception when calling IncidentsApi#updateIncidentIntegration");System.err.println("Status code: "+e.getCode());System.err.println("Reason: "+e.getResponseBody());System.err.println("Response headers: "+e.getResponseHeaders());e.printStackTrace();}}}
"""
Update an existing incident integration metadata returns "OK" response
"""fromosimportenvironfromdatadog_api_clientimportApiClient,Configurationfromdatadog_api_client.v2.api.incidents_apiimportIncidentsApifromdatadog_api_client.v2.model.incident_integration_metadata_attributesimportIncidentIntegrationMetadataAttributesfromdatadog_api_client.v2.model.incident_integration_metadata_patch_dataimportIncidentIntegrationMetadataPatchDatafromdatadog_api_client.v2.model.incident_integration_metadata_patch_requestimport(IncidentIntegrationMetadataPatchRequest,)fromdatadog_api_client.v2.model.incident_integration_metadata_typeimportIncidentIntegrationMetadataTypefromdatadog_api_client.v2.model.slack_integration_metadataimportSlackIntegrationMetadatafromdatadog_api_client.v2.model.slack_integration_metadata_channel_itemimportSlackIntegrationMetadataChannelItem# there is a valid "incident" in the systemINCIDENT_DATA_ID=environ["INCIDENT_DATA_ID"]# the "incident" has an "incident_integration_metadata"INCIDENT_INTEGRATION_METADATA_DATA_ID=environ["INCIDENT_INTEGRATION_METADATA_DATA_ID"]body=IncidentIntegrationMetadataPatchRequest(data=IncidentIntegrationMetadataPatchData(attributes=IncidentIntegrationMetadataAttributes(incident_id=INCIDENT_DATA_ID,integration_type=1,metadata=SlackIntegrationMetadata(channels=[SlackIntegrationMetadataChannelItem(channel_id="C0123456789",channel_name="#updated-channel-name",team_id="T01234567",redirect_url="https://slack.com/app_redirect?channel=C0123456789&team=T01234567",),],),),type=IncidentIntegrationMetadataType.INCIDENT_INTEGRATIONS,),)configuration=Configuration()configuration.unstable_operations["update_incident_integration"]=TruewithApiClient(configuration)asapi_client:api_instance=IncidentsApi(api_client)response=api_instance.update_incident_integration(incident_id=INCIDENT_DATA_ID,integration_metadata_id=INCIDENT_INTEGRATION_METADATA_DATA_ID,body=body)print(response)
# Update an existing incident integration metadata returns "OK" responserequire"datadog_api_client"DatadogAPIClient.configuredo|config|config.unstable_operations["v2.update_incident_integration".to_sym]=trueendapi_instance=DatadogAPIClient::V2::IncidentsAPI.new# there is a valid "incident" in the systemINCIDENT_DATA_ID=ENV["INCIDENT_DATA_ID"]# the "incident" has an "incident_integration_metadata"INCIDENT_INTEGRATION_METADATA_DATA_ID=ENV["INCIDENT_INTEGRATION_METADATA_DATA_ID"]body=DatadogAPIClient::V2::IncidentIntegrationMetadataPatchRequest.new({data:DatadogAPIClient::V2::IncidentIntegrationMetadataPatchData.new({attributes:DatadogAPIClient::V2::IncidentIntegrationMetadataAttributes.new({incident_id:INCIDENT_DATA_ID,integration_type:1,metadata:DatadogAPIClient::V2::SlackIntegrationMetadata.new({channels:[DatadogAPIClient::V2::SlackIntegrationMetadataChannelItem.new({channel_id:"C0123456789",channel_name:"#updated-channel-name",team_id:"T01234567",redirect_url:"https://slack.com/app_redirect?channel=C0123456789&team=T01234567",}),],}),}),type:DatadogAPIClient::V2::IncidentIntegrationMetadataType::INCIDENT_INTEGRATIONS,}),})papi_instance.update_incident_integration(INCIDENT_DATA_ID,INCIDENT_INTEGRATION_METADATA_DATA_ID,body)
// Update an existing incident integration metadata returns "OK" response
usedatadog_api_client::datadog;usedatadog_api_client::datadogV2::api_incidents::IncidentsAPI;usedatadog_api_client::datadogV2::model::IncidentIntegrationMetadataAttributes;usedatadog_api_client::datadogV2::model::IncidentIntegrationMetadataMetadata;usedatadog_api_client::datadogV2::model::IncidentIntegrationMetadataPatchData;usedatadog_api_client::datadogV2::model::IncidentIntegrationMetadataPatchRequest;usedatadog_api_client::datadogV2::model::IncidentIntegrationMetadataType;usedatadog_api_client::datadogV2::model::SlackIntegrationMetadata;usedatadog_api_client::datadogV2::model::SlackIntegrationMetadataChannelItem;#[tokio::main]asyncfnmain(){// there is a valid "incident" in the system
letincident_data_id=std::env::var("INCIDENT_DATA_ID").unwrap();// the "incident" has an "incident_integration_metadata"
letincident_integration_metadata_data_id=std::env::var("INCIDENT_INTEGRATION_METADATA_DATA_ID").unwrap();letbody=IncidentIntegrationMetadataPatchRequest::new(IncidentIntegrationMetadataPatchData::new(IncidentIntegrationMetadataAttributes::new(1,IncidentIntegrationMetadataMetadata::SlackIntegrationMetadata(Box::new(SlackIntegrationMetadata::new(vec![SlackIntegrationMetadataChannelItem::new("C0123456789".to_string(),"#updated-channel-name".to_string(),"https://slack.com/app_redirect?channel=C0123456789&team=T01234567".to_string(),).team_id("T01234567".to_string())]),)),).incident_id(incident_data_id.clone()),IncidentIntegrationMetadataType::INCIDENT_INTEGRATIONS,));letmutconfiguration=datadog::Configuration::new();configuration.set_unstable_operation_enabled("v2.UpdateIncidentIntegration",true);letapi=IncidentsAPI::with_config(configuration);letresp=api.update_incident_integration(incident_data_id.clone(),incident_integration_metadata_data_id.clone(),body,).await;ifletOk(value)=resp{println!("{:#?}",value);}else{println!("{:#?}",resp.unwrap_err());}}
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com"DD_API_KEY="<DD_API_KEY>"DD_APP_KEY="<DD_APP_KEY>"cargo run
/**
* Update an existing incident integration metadata returns "OK" response
*/import{client,v2}from"@datadog/datadog-api-client";constconfiguration=client.createConfiguration();configuration.unstableOperations["v2.updateIncidentIntegration"]=true;constapiInstance=newv2.IncidentsApi(configuration);// there is a valid "incident" in the system
constINCIDENT_DATA_ID=process.env.INCIDENT_DATA_IDasstring;// the "incident" has an "incident_integration_metadata"
constINCIDENT_INTEGRATION_METADATA_DATA_ID=process.env.INCIDENT_INTEGRATION_METADATA_DATA_IDasstring;constparams: v2.IncidentsApiUpdateIncidentIntegrationRequest={body:{data:{attributes:{incidentId: INCIDENT_DATA_ID,integrationType: 1,metadata:{channels:[{channelId:"C0123456789",channelName:"#updated-channel-name",teamId:"T01234567",redirectUrl:"https://slack.com/app_redirect?channel=C0123456789&team=T01234567",},],},},type:"incident_integrations",},},incidentId: INCIDENT_DATA_ID,integrationMetadataId: INCIDENT_INTEGRATION_METADATA_DATA_ID,};apiInstance.updateIncidentIntegration(params).then((data: v2.IncidentIntegrationMetadataResponse)=>{console.log("API called successfully. Returned data: "+JSON.stringify(data));}).catch((error: any)=>console.error(error));
"""
Delete an incident integration metadata returns "OK" response
"""fromosimportenvironfromdatadog_api_clientimportApiClient,Configurationfromdatadog_api_client.v2.api.incidents_apiimportIncidentsApi# there is a valid "incident" in the systemINCIDENT_DATA_ID=environ["INCIDENT_DATA_ID"]# the "incident" has an "incident_integration_metadata"INCIDENT_INTEGRATION_METADATA_DATA_ID=environ["INCIDENT_INTEGRATION_METADATA_DATA_ID"]configuration=Configuration()configuration.unstable_operations["delete_incident_integration"]=TruewithApiClient(configuration)asapi_client:api_instance=IncidentsApi(api_client)api_instance.delete_incident_integration(incident_id=INCIDENT_DATA_ID,integration_metadata_id=INCIDENT_INTEGRATION_METADATA_DATA_ID,)
# Delete an incident integration metadata returns "OK" responserequire"datadog_api_client"DatadogAPIClient.configuredo|config|config.unstable_operations["v2.delete_incident_integration".to_sym]=trueendapi_instance=DatadogAPIClient::V2::IncidentsAPI.new# there is a valid "incident" in the systemINCIDENT_DATA_ID=ENV["INCIDENT_DATA_ID"]# the "incident" has an "incident_integration_metadata"INCIDENT_INTEGRATION_METADATA_DATA_ID=ENV["INCIDENT_INTEGRATION_METADATA_DATA_ID"]api_instance.delete_incident_integration(INCIDENT_DATA_ID,INCIDENT_INTEGRATION_METADATA_DATA_ID)
// Delete an incident integration metadata returns "OK" response
packagemainimport("context""fmt""os""github.com/DataDog/datadog-api-client-go/v2/api/datadog""github.com/DataDog/datadog-api-client-go/v2/api/datadogV2")funcmain(){// there is a valid "incident" in the system
IncidentDataID:=os.Getenv("INCIDENT_DATA_ID")// the "incident" has an "incident_integration_metadata"
IncidentIntegrationMetadataDataID:=os.Getenv("INCIDENT_INTEGRATION_METADATA_DATA_ID")ctx:=datadog.NewDefaultContext(context.Background())configuration:=datadog.NewConfiguration()configuration.SetUnstableOperationEnabled("v2.DeleteIncidentIntegration",true)apiClient:=datadog.NewAPIClient(configuration)api:=datadogV2.NewIncidentsApi(apiClient)r,err:=api.DeleteIncidentIntegration(ctx,IncidentDataID,IncidentIntegrationMetadataDataID)iferr!=nil{fmt.Fprintf(os.Stderr,"Error when calling `IncidentsApi.DeleteIncidentIntegration`: %v\n",err)fmt.Fprintf(os.Stderr,"Full HTTP response: %v\n",r)}}
// Delete an incident integration metadata returns "OK" responseimportcom.datadog.api.client.ApiClient;importcom.datadog.api.client.ApiException;importcom.datadog.api.client.v2.api.IncidentsApi;publicclassExample{publicstaticvoidmain(String[]args){ApiClientdefaultClient=ApiClient.getDefaultApiClient();defaultClient.setUnstableOperationEnabled("v2.deleteIncidentIntegration",true);IncidentsApiapiInstance=newIncidentsApi(defaultClient);// there is a valid "incident" in the systemStringINCIDENT_DATA_ID=System.getenv("INCIDENT_DATA_ID");// the "incident" has an "incident_integration_metadata"StringINCIDENT_INTEGRATION_METADATA_DATA_ID=System.getenv("INCIDENT_INTEGRATION_METADATA_DATA_ID");try{apiInstance.deleteIncidentIntegration(INCIDENT_DATA_ID,INCIDENT_INTEGRATION_METADATA_DATA_ID);}catch(ApiExceptione){System.err.println("Exception when calling IncidentsApi#deleteIncidentIntegration");System.err.println("Status code: "+e.getCode());System.err.println("Reason: "+e.getResponseBody());System.err.println("Response headers: "+e.getResponseHeaders());e.printStackTrace();}}}
// Delete an incident integration metadata returns "OK" response
usedatadog_api_client::datadog;usedatadog_api_client::datadogV2::api_incidents::IncidentsAPI;#[tokio::main]asyncfnmain(){// there is a valid "incident" in the system
letincident_data_id=std::env::var("INCIDENT_DATA_ID").unwrap();// the "incident" has an "incident_integration_metadata"
letincident_integration_metadata_data_id=std::env::var("INCIDENT_INTEGRATION_METADATA_DATA_ID").unwrap();letmutconfiguration=datadog::Configuration::new();configuration.set_unstable_operation_enabled("v2.DeleteIncidentIntegration",true);letapi=IncidentsAPI::with_config(configuration);letresp=api.delete_incident_integration(incident_data_id.clone(),incident_integration_metadata_data_id.clone(),).await;ifletOk(value)=resp{println!("{:#?}",value);}else{println!("{:#?}",resp.unwrap_err());}}
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com"DD_API_KEY="<DD_API_KEY>"DD_APP_KEY="<DD_APP_KEY>"cargo run
/**
* Delete an incident integration metadata returns "OK" response
*/import{client,v2}from"@datadog/datadog-api-client";constconfiguration=client.createConfiguration();configuration.unstableOperations["v2.deleteIncidentIntegration"]=true;constapiInstance=newv2.IncidentsApi(configuration);// there is a valid "incident" in the system
constINCIDENT_DATA_ID=process.env.INCIDENT_DATA_IDasstring;// the "incident" has an "incident_integration_metadata"
constINCIDENT_INTEGRATION_METADATA_DATA_ID=process.env.INCIDENT_INTEGRATION_METADATA_DATA_IDasstring;constparams: v2.IncidentsApiDeleteIncidentIntegrationRequest={incidentId: INCIDENT_DATA_ID,integrationMetadataId: INCIDENT_INTEGRATION_METADATA_DATA_ID,};apiInstance.deleteIncidentIntegration(params).then((data: any)=>{console.log("API called successfully. Returned data: "+JSON.stringify(data));}).catch((error: any)=>console.error(error));
An array containing type and the unique identifier of a role.
id
string
The unique identifier of the role.
type
enum
Roles type.
Allowed enum values: roles
default: roles
type
enum
Users resource type.
Allowed enum values: users
default: users
meta
object
The metadata object containing pagination metadata.
pagination
object
Pagination properties.
next_offset
int64
The index of the first element in the next page of results. Equal to page size added to the current offset.
offset
int64
The index of the first element in the results.
size
int64
Maximum size of pages to return.
{"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","mfa_enabled":false,"modified_at":"2019-09-19T10:00:00.000Z","name":"string","service_account":false,"status":"string","title":"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"}],"meta":{"pagination":{"next_offset":1000,"offset":10,"size":1000}}}
"""
Get a list of an incident's todos returns "OK" response
"""fromosimportenvironfromdatadog_api_clientimportApiClient,Configurationfromdatadog_api_client.v2.api.incidents_apiimportIncidentsApi# there is a valid "incident" in the systemINCIDENT_DATA_ID=environ["INCIDENT_DATA_ID"]configuration=Configuration()configuration.unstable_operations["list_incident_todos"]=TruewithApiClient(configuration)asapi_client:api_instance=IncidentsApi(api_client)response=api_instance.list_incident_todos(incident_id=INCIDENT_DATA_ID,)print(response)
# Get a list of an incident's todos returns "OK" responserequire"datadog_api_client"DatadogAPIClient.configuredo|config|config.unstable_operations["v2.list_incident_todos".to_sym]=trueendapi_instance=DatadogAPIClient::V2::IncidentsAPI.new# there is a valid "incident" in the systemINCIDENT_DATA_ID=ENV["INCIDENT_DATA_ID"]papi_instance.list_incident_todos(INCIDENT_DATA_ID)
// Get a list of an incident's todos returns "OK" response
packagemainimport("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")funcmain(){// there is a valid "incident" in the system
IncidentDataID:=os.Getenv("INCIDENT_DATA_ID")ctx:=datadog.NewDefaultContext(context.Background())configuration:=datadog.NewConfiguration()configuration.SetUnstableOperationEnabled("v2.ListIncidentTodos",true)apiClient:=datadog.NewAPIClient(configuration)api:=datadogV2.NewIncidentsApi(apiClient)resp,r,err:=api.ListIncidentTodos(ctx,IncidentDataID)iferr!=nil{fmt.Fprintf(os.Stderr,"Error when calling `IncidentsApi.ListIncidentTodos`: %v\n",err)fmt.Fprintf(os.Stderr,"Full HTTP response: %v\n",r)}responseContent,_:=json.MarshalIndent(resp,""," ")fmt.Fprintf(os.Stdout,"Response from `IncidentsApi.ListIncidentTodos`:\n%s\n",responseContent)}
// Get a list of an incident's todos returns "OK" responseimportcom.datadog.api.client.ApiClient;importcom.datadog.api.client.ApiException;importcom.datadog.api.client.v2.api.IncidentsApi;importcom.datadog.api.client.v2.model.IncidentTodoListResponse;publicclassExample{publicstaticvoidmain(String[]args){ApiClientdefaultClient=ApiClient.getDefaultApiClient();defaultClient.setUnstableOperationEnabled("v2.listIncidentTodos",true);IncidentsApiapiInstance=newIncidentsApi(defaultClient);// there is a valid "incident" in the systemStringINCIDENT_DATA_ID=System.getenv("INCIDENT_DATA_ID");try{IncidentTodoListResponseresult=apiInstance.listIncidentTodos(INCIDENT_DATA_ID);System.out.println(result);}catch(ApiExceptione){System.err.println("Exception when calling IncidentsApi#listIncidentTodos");System.err.println("Status code: "+e.getCode());System.err.println("Reason: "+e.getResponseBody());System.err.println("Response headers: "+e.getResponseHeaders());e.printStackTrace();}}}
// Get a list of an incident's todos returns "OK" response
usedatadog_api_client::datadog;usedatadog_api_client::datadogV2::api_incidents::IncidentsAPI;#[tokio::main]asyncfnmain(){// there is a valid "incident" in the system
letincident_data_id=std::env::var("INCIDENT_DATA_ID").unwrap();letmutconfiguration=datadog::Configuration::new();configuration.set_unstable_operation_enabled("v2.ListIncidentTodos",true);letapi=IncidentsAPI::with_config(configuration);letresp=api.list_incident_todos(incident_data_id.clone()).await;ifletOk(value)=resp{println!("{:#?}",value);}else{println!("{:#?}",resp.unwrap_err());}}
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com"DD_API_KEY="<DD_API_KEY>"DD_APP_KEY="<DD_APP_KEY>"cargo run
/**
* Get a list of an incident's todos returns "OK" response
*/import{client,v2}from"@datadog/datadog-api-client";constconfiguration=client.createConfiguration();configuration.unstableOperations["v2.listIncidentTodos"]=true;constapiInstance=newv2.IncidentsApi(configuration);// there is a valid "incident" in the system
constINCIDENT_DATA_ID=process.env.INCIDENT_DATA_IDasstring;constparams: v2.IncidentsApiListIncidentTodosRequest={incidentId: INCIDENT_DATA_ID,};apiInstance.listIncidentTodos(params).then((data: v2.IncidentTodoListResponse)=>{console.log("API called successfully. Returned data: "+JSON.stringify(data));}).catch((error: any)=>console.error(error));
An array containing type and the unique identifier of a role.
id
string
The unique identifier of the role.
type
enum
Roles type.
Allowed enum values: roles
default: roles
type
enum
Users resource type.
Allowed enum values: users
default: users
{"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","mfa_enabled":false,"modified_at":"2019-09-19T10:00:00.000Z","name":"string","service_account":false,"status":"string","title":"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"}]}
// Create an incident todo returns "CREATED" response
packagemainimport("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")funcmain(){// there is a valid "incident" in the system
IncidentDataID:=os.Getenv("INCIDENT_DATA_ID")body:=datadogV2.IncidentTodoCreateRequest{Data:datadogV2.IncidentTodoCreateData{Attributes:datadogV2.IncidentTodoAttributes{Assignees:[]datadogV2.IncidentTodoAssignee{datadogV2.IncidentTodoAssignee{IncidentTodoAssigneeHandle:datadog.PtrString("@test.user@test.com")},},Content:"Restore lost data.",},Type:datadogV2.INCIDENTTODOTYPE_INCIDENT_TODOS,},}ctx:=datadog.NewDefaultContext(context.Background())configuration:=datadog.NewConfiguration()configuration.SetUnstableOperationEnabled("v2.CreateIncidentTodo",true)apiClient:=datadog.NewAPIClient(configuration)api:=datadogV2.NewIncidentsApi(apiClient)resp,r,err:=api.CreateIncidentTodo(ctx,IncidentDataID,body)iferr!=nil{fmt.Fprintf(os.Stderr,"Error when calling `IncidentsApi.CreateIncidentTodo`: %v\n",err)fmt.Fprintf(os.Stderr,"Full HTTP response: %v\n",r)}responseContent,_:=json.MarshalIndent(resp,""," ")fmt.Fprintf(os.Stdout,"Response from `IncidentsApi.CreateIncidentTodo`:\n%s\n",responseContent)}
// Create an incident todo returns "CREATED" responseimportcom.datadog.api.client.ApiClient;importcom.datadog.api.client.ApiException;importcom.datadog.api.client.v2.api.IncidentsApi;importcom.datadog.api.client.v2.model.IncidentTodoAssignee;importcom.datadog.api.client.v2.model.IncidentTodoAttributes;importcom.datadog.api.client.v2.model.IncidentTodoCreateData;importcom.datadog.api.client.v2.model.IncidentTodoCreateRequest;importcom.datadog.api.client.v2.model.IncidentTodoResponse;importcom.datadog.api.client.v2.model.IncidentTodoType;importjava.util.Collections;publicclassExample{publicstaticvoidmain(String[]args){ApiClientdefaultClient=ApiClient.getDefaultApiClient();defaultClient.setUnstableOperationEnabled("v2.createIncidentTodo",true);IncidentsApiapiInstance=newIncidentsApi(defaultClient);// there is a valid "incident" in the systemStringINCIDENT_DATA_ID=System.getenv("INCIDENT_DATA_ID");IncidentTodoCreateRequestbody=newIncidentTodoCreateRequest().data(newIncidentTodoCreateData().attributes(newIncidentTodoAttributes().assignees(Collections.singletonList(newIncidentTodoAssignee("@test.user@test.com"))).content("Restore lost data.")).type(IncidentTodoType.INCIDENT_TODOS));try{IncidentTodoResponseresult=apiInstance.createIncidentTodo(INCIDENT_DATA_ID,body);System.out.println(result);}catch(ApiExceptione){System.err.println("Exception when calling IncidentsApi#createIncidentTodo");System.err.println("Status code: "+e.getCode());System.err.println("Reason: "+e.getResponseBody());System.err.println("Response headers: "+e.getResponseHeaders());e.printStackTrace();}}}
"""
Create an incident todo returns "CREATED" response
"""fromosimportenvironfromdatadog_api_clientimportApiClient,Configurationfromdatadog_api_client.v2.api.incidents_apiimportIncidentsApifromdatadog_api_client.v2.model.incident_todo_assignee_arrayimportIncidentTodoAssigneeArrayfromdatadog_api_client.v2.model.incident_todo_attributesimportIncidentTodoAttributesfromdatadog_api_client.v2.model.incident_todo_create_dataimportIncidentTodoCreateDatafromdatadog_api_client.v2.model.incident_todo_create_requestimportIncidentTodoCreateRequestfromdatadog_api_client.v2.model.incident_todo_typeimportIncidentTodoType# there is a valid "incident" in the systemINCIDENT_DATA_ID=environ["INCIDENT_DATA_ID"]body=IncidentTodoCreateRequest(data=IncidentTodoCreateData(attributes=IncidentTodoAttributes(assignees=IncidentTodoAssigneeArray(["@test.user@test.com",]),content="Restore lost data.",),type=IncidentTodoType.INCIDENT_TODOS,),)configuration=Configuration()configuration.unstable_operations["create_incident_todo"]=TruewithApiClient(configuration)asapi_client:api_instance=IncidentsApi(api_client)response=api_instance.create_incident_todo(incident_id=INCIDENT_DATA_ID,body=body)print(response)
# Create an incident todo returns "CREATED" responserequire"datadog_api_client"DatadogAPIClient.configuredo|config|config.unstable_operations["v2.create_incident_todo".to_sym]=trueendapi_instance=DatadogAPIClient::V2::IncidentsAPI.new# there is a valid "incident" in the systemINCIDENT_DATA_ID=ENV["INCIDENT_DATA_ID"]body=DatadogAPIClient::V2::IncidentTodoCreateRequest.new({data:DatadogAPIClient::V2::IncidentTodoCreateData.new({attributes:DatadogAPIClient::V2::IncidentTodoAttributes.new({assignees:["@test.user@test.com",],content:"Restore lost data.",}),type:DatadogAPIClient::V2::IncidentTodoType::INCIDENT_TODOS,}),})papi_instance.create_incident_todo(INCIDENT_DATA_ID,body)
// Create an incident todo returns "CREATED" response
usedatadog_api_client::datadog;usedatadog_api_client::datadogV2::api_incidents::IncidentsAPI;usedatadog_api_client::datadogV2::model::IncidentTodoAssignee;usedatadog_api_client::datadogV2::model::IncidentTodoAttributes;usedatadog_api_client::datadogV2::model::IncidentTodoCreateData;usedatadog_api_client::datadogV2::model::IncidentTodoCreateRequest;usedatadog_api_client::datadogV2::model::IncidentTodoType;#[tokio::main]asyncfnmain(){// there is a valid "incident" in the system
letincident_data_id=std::env::var("INCIDENT_DATA_ID").unwrap();letbody=IncidentTodoCreateRequest::new(IncidentTodoCreateData::new(IncidentTodoAttributes::new(vec![IncidentTodoAssignee::IncidentTodoAssigneeHandle("@test.user@test.com".to_string(),)],"Restore lost data.".to_string(),),IncidentTodoType::INCIDENT_TODOS,));letmutconfiguration=datadog::Configuration::new();configuration.set_unstable_operation_enabled("v2.CreateIncidentTodo",true);letapi=IncidentsAPI::with_config(configuration);letresp=api.create_incident_todo(incident_data_id.clone(),body).await;ifletOk(value)=resp{println!("{:#?}",value);}else{println!("{:#?}",resp.unwrap_err());}}
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com"DD_API_KEY="<DD_API_KEY>"DD_APP_KEY="<DD_APP_KEY>"cargo run
/**
* Create an incident todo returns "CREATED" response
*/import{client,v2}from"@datadog/datadog-api-client";constconfiguration=client.createConfiguration();configuration.unstableOperations["v2.createIncidentTodo"]=true;constapiInstance=newv2.IncidentsApi(configuration);// there is a valid "incident" in the system
constINCIDENT_DATA_ID=process.env.INCIDENT_DATA_IDasstring;constparams: v2.IncidentsApiCreateIncidentTodoRequest={body:{data:{attributes:{assignees:["@test.user@test.com"],content:"Restore lost data.",},type:"incident_todos",},},incidentId: INCIDENT_DATA_ID,};apiInstance.createIncidentTodo(params).then((data: v2.IncidentTodoResponse)=>{console.log("API called successfully. Returned data: "+JSON.stringify(data));}).catch((error: any)=>console.error(error));
An array containing type and the unique identifier of a role.
id
string
The unique identifier of the role.
type
enum
Roles type.
Allowed enum values: roles
default: roles
type
enum
Users resource type.
Allowed enum values: users
default: users
{"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","mfa_enabled":false,"modified_at":"2019-09-19T10:00:00.000Z","name":"string","service_account":false,"status":"string","title":"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"}]}
"""
Get incident todo details returns "OK" response
"""fromosimportenvironfromdatadog_api_clientimportApiClient,Configurationfromdatadog_api_client.v2.api.incidents_apiimportIncidentsApi# there is a valid "incident" in the systemINCIDENT_DATA_ID=environ["INCIDENT_DATA_ID"]# the "incident" has an "incident_todo"INCIDENT_TODO_DATA_ID=environ["INCIDENT_TODO_DATA_ID"]configuration=Configuration()configuration.unstable_operations["get_incident_todo"]=TruewithApiClient(configuration)asapi_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)
# Get incident todo details returns "OK" responserequire"datadog_api_client"DatadogAPIClient.configuredo|config|config.unstable_operations["v2.get_incident_todo".to_sym]=trueendapi_instance=DatadogAPIClient::V2::IncidentsAPI.new# there is a valid "incident" in the systemINCIDENT_DATA_ID=ENV["INCIDENT_DATA_ID"]# the "incident" has an "incident_todo"INCIDENT_TODO_DATA_ID=ENV["INCIDENT_TODO_DATA_ID"]papi_instance.get_incident_todo(INCIDENT_DATA_ID,INCIDENT_TODO_DATA_ID)
// Get incident todo details returns "OK" response
packagemainimport("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")funcmain(){// 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())configuration:=datadog.NewConfiguration()configuration.SetUnstableOperationEnabled("v2.GetIncidentTodo",true)apiClient:=datadog.NewAPIClient(configuration)api:=datadogV2.NewIncidentsApi(apiClient)resp,r,err:=api.GetIncidentTodo(ctx,IncidentDataID,IncidentTodoDataID)iferr!=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)}
// Get incident todo details returns "OK" responseimportcom.datadog.api.client.ApiClient;importcom.datadog.api.client.ApiException;importcom.datadog.api.client.v2.api.IncidentsApi;importcom.datadog.api.client.v2.model.IncidentTodoResponse;publicclassExample{publicstaticvoidmain(String[]args){ApiClientdefaultClient=ApiClient.getDefaultApiClient();defaultClient.setUnstableOperationEnabled("v2.getIncidentTodo",true);IncidentsApiapiInstance=newIncidentsApi(defaultClient);// there is a valid "incident" in the systemStringINCIDENT_DATA_ID=System.getenv("INCIDENT_DATA_ID");// the "incident" has an "incident_todo"StringINCIDENT_TODO_DATA_ID=System.getenv("INCIDENT_TODO_DATA_ID");try{IncidentTodoResponseresult=apiInstance.getIncidentTodo(INCIDENT_DATA_ID,INCIDENT_TODO_DATA_ID);System.out.println(result);}catch(ApiExceptione){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();}}}
// Get incident todo details returns "OK" response
usedatadog_api_client::datadog;usedatadog_api_client::datadogV2::api_incidents::IncidentsAPI;#[tokio::main]asyncfnmain(){// there is a valid "incident" in the system
letincident_data_id=std::env::var("INCIDENT_DATA_ID").unwrap();// the "incident" has an "incident_todo"
letincident_todo_data_id=std::env::var("INCIDENT_TODO_DATA_ID").unwrap();letmutconfiguration=datadog::Configuration::new();configuration.set_unstable_operation_enabled("v2.GetIncidentTodo",true);letapi=IncidentsAPI::with_config(configuration);letresp=api.get_incident_todo(incident_data_id.clone(),incident_todo_data_id.clone()).await;ifletOk(value)=resp{println!("{:#?}",value);}else{println!("{:#?}",resp.unwrap_err());}}
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-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";constconfiguration=client.createConfiguration();configuration.unstableOperations["v2.getIncidentTodo"]=true;constapiInstance=newv2.IncidentsApi(configuration);// there is a valid "incident" in the system
constINCIDENT_DATA_ID=process.env.INCIDENT_DATA_IDasstring;// the "incident" has an "incident_todo"
constINCIDENT_TODO_DATA_ID=process.env.INCIDENT_TODO_DATA_IDasstring;constparams: 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));
The source of the anonymous assignee.
Allowed enum values: slack,microsoft_teams
default: slack
completed
string
Timestamp when the todo was completed.
content [required]
string
The follow-up task's content.
created
date-time
Timestamp when the incident todo was created.
due_date
string
Timestamp when the todo should be completed by.
incident_id
string
UUID of the incident this todo is connected to.
modified
date-time
Timestamp when the incident todo was last modified.
type [required]
enum
Todo resource type.
Allowed enum values: incident_todos
default: incident_todos
{"data":{"attributes":{"assignees":["@test.user@test.com"],"content":"Restore lost data.","completed":"2023-03-06T22:00:00.000000+00:00","due_date":"2023-07-10T05:00:00.000000+00:00"},"type":"incident_todos"}}
An array containing type and the unique identifier of a role.
id
string
The unique identifier of the role.
type
enum
Roles type.
Allowed enum values: roles
default: roles
type
enum
Users resource type.
Allowed enum values: users
default: users
{"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","mfa_enabled":false,"modified_at":"2019-09-19T10:00:00.000Z","name":"string","service_account":false,"status":"string","title":"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"}]}
// Update an incident todo returns "OK" response
packagemainimport("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")funcmain(){// 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")body:=datadogV2.IncidentTodoPatchRequest{Data:datadogV2.IncidentTodoPatchData{Attributes:datadogV2.IncidentTodoAttributes{Assignees:[]datadogV2.IncidentTodoAssignee{datadogV2.IncidentTodoAssignee{IncidentTodoAssigneeHandle:datadog.PtrString("@test.user@test.com")},},Content:"Restore lost data.",Completed:*datadog.NewNullableString(datadog.PtrString("2023-03-06T22:00:00.000000+00:00")),DueDate:*datadog.NewNullableString(datadog.PtrString("2023-07-10T05:00:00.000000+00:00")),},Type:datadogV2.INCIDENTTODOTYPE_INCIDENT_TODOS,},}ctx:=datadog.NewDefaultContext(context.Background())configuration:=datadog.NewConfiguration()configuration.SetUnstableOperationEnabled("v2.UpdateIncidentTodo",true)apiClient:=datadog.NewAPIClient(configuration)api:=datadogV2.NewIncidentsApi(apiClient)resp,r,err:=api.UpdateIncidentTodo(ctx,IncidentDataID,IncidentTodoDataID,body)iferr!=nil{fmt.Fprintf(os.Stderr,"Error when calling `IncidentsApi.UpdateIncidentTodo`: %v\n",err)fmt.Fprintf(os.Stderr,"Full HTTP response: %v\n",r)}responseContent,_:=json.MarshalIndent(resp,""," ")fmt.Fprintf(os.Stdout,"Response from `IncidentsApi.UpdateIncidentTodo`:\n%s\n",responseContent)}
// Update an incident todo returns "OK" responseimportcom.datadog.api.client.ApiClient;importcom.datadog.api.client.ApiException;importcom.datadog.api.client.v2.api.IncidentsApi;importcom.datadog.api.client.v2.model.IncidentTodoAssignee;importcom.datadog.api.client.v2.model.IncidentTodoAttributes;importcom.datadog.api.client.v2.model.IncidentTodoPatchData;importcom.datadog.api.client.v2.model.IncidentTodoPatchRequest;importcom.datadog.api.client.v2.model.IncidentTodoResponse;importcom.datadog.api.client.v2.model.IncidentTodoType;importjava.util.Collections;publicclassExample{publicstaticvoidmain(String[]args){ApiClientdefaultClient=ApiClient.getDefaultApiClient();defaultClient.setUnstableOperationEnabled("v2.updateIncidentTodo",true);IncidentsApiapiInstance=newIncidentsApi(defaultClient);// there is a valid "incident" in the systemStringINCIDENT_DATA_ID=System.getenv("INCIDENT_DATA_ID");// the "incident" has an "incident_todo"StringINCIDENT_TODO_DATA_ID=System.getenv("INCIDENT_TODO_DATA_ID");IncidentTodoPatchRequestbody=newIncidentTodoPatchRequest().data(newIncidentTodoPatchData().attributes(newIncidentTodoAttributes().assignees(Collections.singletonList(newIncidentTodoAssignee("@test.user@test.com"))).content("Restore lost data.").completed("2023-03-06T22:00:00.000000+00:00").dueDate("2023-07-10T05:00:00.000000+00:00")).type(IncidentTodoType.INCIDENT_TODOS));try{IncidentTodoResponseresult=apiInstance.updateIncidentTodo(INCIDENT_DATA_ID,INCIDENT_TODO_DATA_ID,body);System.out.println(result);}catch(ApiExceptione){System.err.println("Exception when calling IncidentsApi#updateIncidentTodo");System.err.println("Status code: "+e.getCode());System.err.println("Reason: "+e.getResponseBody());System.err.println("Response headers: "+e.getResponseHeaders());e.printStackTrace();}}}
"""
Update an incident todo returns "OK" response
"""fromosimportenvironfromdatadog_api_clientimportApiClient,Configurationfromdatadog_api_client.v2.api.incidents_apiimportIncidentsApifromdatadog_api_client.v2.model.incident_todo_assignee_arrayimportIncidentTodoAssigneeArrayfromdatadog_api_client.v2.model.incident_todo_attributesimportIncidentTodoAttributesfromdatadog_api_client.v2.model.incident_todo_patch_dataimportIncidentTodoPatchDatafromdatadog_api_client.v2.model.incident_todo_patch_requestimportIncidentTodoPatchRequestfromdatadog_api_client.v2.model.incident_todo_typeimportIncidentTodoType# there is a valid "incident" in the systemINCIDENT_DATA_ID=environ["INCIDENT_DATA_ID"]# the "incident" has an "incident_todo"INCIDENT_TODO_DATA_ID=environ["INCIDENT_TODO_DATA_ID"]body=IncidentTodoPatchRequest(data=IncidentTodoPatchData(attributes=IncidentTodoAttributes(assignees=IncidentTodoAssigneeArray(["@test.user@test.com",]),content="Restore lost data.",completed="2023-03-06T22:00:00.000000+00:00",due_date="2023-07-10T05:00:00.000000+00:00",),type=IncidentTodoType.INCIDENT_TODOS,),)configuration=Configuration()configuration.unstable_operations["update_incident_todo"]=TruewithApiClient(configuration)asapi_client:api_instance=IncidentsApi(api_client)response=api_instance.update_incident_todo(incident_id=INCIDENT_DATA_ID,todo_id=INCIDENT_TODO_DATA_ID,body=body)print(response)
# Update an incident todo returns "OK" responserequire"datadog_api_client"DatadogAPIClient.configuredo|config|config.unstable_operations["v2.update_incident_todo".to_sym]=trueendapi_instance=DatadogAPIClient::V2::IncidentsAPI.new# there is a valid "incident" in the systemINCIDENT_DATA_ID=ENV["INCIDENT_DATA_ID"]# the "incident" has an "incident_todo"INCIDENT_TODO_DATA_ID=ENV["INCIDENT_TODO_DATA_ID"]body=DatadogAPIClient::V2::IncidentTodoPatchRequest.new({data:DatadogAPIClient::V2::IncidentTodoPatchData.new({attributes:DatadogAPIClient::V2::IncidentTodoAttributes.new({assignees:["@test.user@test.com",],content:"Restore lost data.",completed:"2023-03-06T22:00:00.000000+00:00",due_date:"2023-07-10T05:00:00.000000+00:00",}),type:DatadogAPIClient::V2::IncidentTodoType::INCIDENT_TODOS,}),})papi_instance.update_incident_todo(INCIDENT_DATA_ID,INCIDENT_TODO_DATA_ID,body)
// Update an incident todo returns "OK" response
usedatadog_api_client::datadog;usedatadog_api_client::datadogV2::api_incidents::IncidentsAPI;usedatadog_api_client::datadogV2::model::IncidentTodoAssignee;usedatadog_api_client::datadogV2::model::IncidentTodoAttributes;usedatadog_api_client::datadogV2::model::IncidentTodoPatchData;usedatadog_api_client::datadogV2::model::IncidentTodoPatchRequest;usedatadog_api_client::datadogV2::model::IncidentTodoType;#[tokio::main]asyncfnmain(){// there is a valid "incident" in the system
letincident_data_id=std::env::var("INCIDENT_DATA_ID").unwrap();// the "incident" has an "incident_todo"
letincident_todo_data_id=std::env::var("INCIDENT_TODO_DATA_ID").unwrap();letbody=IncidentTodoPatchRequest::new(IncidentTodoPatchData::new(IncidentTodoAttributes::new(vec![IncidentTodoAssignee::IncidentTodoAssigneeHandle("@test.user@test.com".to_string(),)],"Restore lost data.".to_string(),).completed(Some("2023-03-06T22:00:00.000000+00:00".to_string())).due_date(Some("2023-07-10T05:00:00.000000+00:00".to_string())),IncidentTodoType::INCIDENT_TODOS,));letmutconfiguration=datadog::Configuration::new();configuration.set_unstable_operation_enabled("v2.UpdateIncidentTodo",true);letapi=IncidentsAPI::with_config(configuration);letresp=api.update_incident_todo(incident_data_id.clone(),incident_todo_data_id.clone(),body,).await;ifletOk(value)=resp{println!("{:#?}",value);}else{println!("{:#?}",resp.unwrap_err());}}
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com"DD_API_KEY="<DD_API_KEY>"DD_APP_KEY="<DD_APP_KEY>"cargo run
/**
* Update an incident todo returns "OK" response
*/import{client,v2}from"@datadog/datadog-api-client";constconfiguration=client.createConfiguration();configuration.unstableOperations["v2.updateIncidentTodo"]=true;constapiInstance=newv2.IncidentsApi(configuration);// there is a valid "incident" in the system
constINCIDENT_DATA_ID=process.env.INCIDENT_DATA_IDasstring;// the "incident" has an "incident_todo"
constINCIDENT_TODO_DATA_ID=process.env.INCIDENT_TODO_DATA_IDasstring;constparams: v2.IncidentsApiUpdateIncidentTodoRequest={body:{data:{attributes:{assignees:["@test.user@test.com"],content:"Restore lost data.",completed:"2023-03-06T22:00:00.000000+00:00",dueDate:"2023-07-10T05:00:00.000000+00:00",},type:"incident_todos",},},incidentId: INCIDENT_DATA_ID,todoId: INCIDENT_TODO_DATA_ID,};apiInstance.updateIncidentTodo(params).then((data: v2.IncidentTodoResponse)=>{console.log("API called successfully. Returned data: "+JSON.stringify(data));}).catch((error: any)=>console.error(error));
"""
Delete an incident todo returns "OK" response
"""fromosimportenvironfromdatadog_api_clientimportApiClient,Configurationfromdatadog_api_client.v2.api.incidents_apiimportIncidentsApi# there is a valid "incident" in the systemINCIDENT_DATA_ID=environ["INCIDENT_DATA_ID"]# the "incident" has an "incident_todo"INCIDENT_TODO_DATA_ID=environ["INCIDENT_TODO_DATA_ID"]configuration=Configuration()configuration.unstable_operations["delete_incident_todo"]=TruewithApiClient(configuration)asapi_client:api_instance=IncidentsApi(api_client)api_instance.delete_incident_todo(incident_id=INCIDENT_DATA_ID,todo_id=INCIDENT_TODO_DATA_ID,)
# Delete an incident todo returns "OK" responserequire"datadog_api_client"DatadogAPIClient.configuredo|config|config.unstable_operations["v2.delete_incident_todo".to_sym]=trueendapi_instance=DatadogAPIClient::V2::IncidentsAPI.new# there is a valid "incident" in the systemINCIDENT_DATA_ID=ENV["INCIDENT_DATA_ID"]# the "incident" has an "incident_todo"INCIDENT_TODO_DATA_ID=ENV["INCIDENT_TODO_DATA_ID"]api_instance.delete_incident_todo(INCIDENT_DATA_ID,INCIDENT_TODO_DATA_ID)
// Delete an incident todo returns "OK" response
packagemainimport("context""fmt""os""github.com/DataDog/datadog-api-client-go/v2/api/datadog""github.com/DataDog/datadog-api-client-go/v2/api/datadogV2")funcmain(){// 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())configuration:=datadog.NewConfiguration()configuration.SetUnstableOperationEnabled("v2.DeleteIncidentTodo",true)apiClient:=datadog.NewAPIClient(configuration)api:=datadogV2.NewIncidentsApi(apiClient)r,err:=api.DeleteIncidentTodo(ctx,IncidentDataID,IncidentTodoDataID)iferr!=nil{fmt.Fprintf(os.Stderr,"Error when calling `IncidentsApi.DeleteIncidentTodo`: %v\n",err)fmt.Fprintf(os.Stderr,"Full HTTP response: %v\n",r)}}
// Delete an incident todo returns "OK" responseimportcom.datadog.api.client.ApiClient;importcom.datadog.api.client.ApiException;importcom.datadog.api.client.v2.api.IncidentsApi;publicclassExample{publicstaticvoidmain(String[]args){ApiClientdefaultClient=ApiClient.getDefaultApiClient();defaultClient.setUnstableOperationEnabled("v2.deleteIncidentTodo",true);IncidentsApiapiInstance=newIncidentsApi(defaultClient);// there is a valid "incident" in the systemStringINCIDENT_DATA_ID=System.getenv("INCIDENT_DATA_ID");// the "incident" has an "incident_todo"StringINCIDENT_TODO_DATA_ID=System.getenv("INCIDENT_TODO_DATA_ID");try{apiInstance.deleteIncidentTodo(INCIDENT_DATA_ID,INCIDENT_TODO_DATA_ID);}catch(ApiExceptione){System.err.println("Exception when calling IncidentsApi#deleteIncidentTodo");System.err.println("Status code: "+e.getCode());System.err.println("Reason: "+e.getResponseBody());System.err.println("Response headers: "+e.getResponseHeaders());e.printStackTrace();}}}
// Delete an incident todo returns "OK" response
usedatadog_api_client::datadog;usedatadog_api_client::datadogV2::api_incidents::IncidentsAPI;#[tokio::main]asyncfnmain(){// there is a valid "incident" in the system
letincident_data_id=std::env::var("INCIDENT_DATA_ID").unwrap();// the "incident" has an "incident_todo"
letincident_todo_data_id=std::env::var("INCIDENT_TODO_DATA_ID").unwrap();letmutconfiguration=datadog::Configuration::new();configuration.set_unstable_operation_enabled("v2.DeleteIncidentTodo",true);letapi=IncidentsAPI::with_config(configuration);letresp=api.delete_incident_todo(incident_data_id.clone(),incident_todo_data_id.clone()).await;ifletOk(value)=resp{println!("{:#?}",value);}else{println!("{:#?}",resp.unwrap_err());}}
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com"DD_API_KEY="<DD_API_KEY>"DD_APP_KEY="<DD_APP_KEY>"cargo run
/**
* Delete an incident todo returns "OK" response
*/import{client,v2}from"@datadog/datadog-api-client";constconfiguration=client.createConfiguration();configuration.unstableOperations["v2.deleteIncidentTodo"]=true;constapiInstance=newv2.IncidentsApi(configuration);// there is a valid "incident" in the system
constINCIDENT_DATA_ID=process.env.INCIDENT_DATA_IDasstring;// the "incident" has an "incident_todo"
constINCIDENT_TODO_DATA_ID=process.env.INCIDENT_TODO_DATA_IDasstring;constparams: v2.IncidentsApiDeleteIncidentTodoRequest={incidentId: INCIDENT_DATA_ID,todoId: INCIDENT_TODO_DATA_ID,};apiInstance.deleteIncidentTodo(params).then((data: any)=>{console.log("API called successfully. Returned data: "+JSON.stringify(data));}).catch((error: any)=>console.error(error));
A unique identifier that represents the user that created the incident type.
description
string
Text that describes the incident type.
is_default
boolean
If true, this incident type will be used as the default incident type if a type is not specified during the creation of incident resources.
lastModifiedBy
string
A unique identifier that represents the user that last modified the incident type.
modifiedAt
date-time
Timestamp when the incident type was last modified.
name [required]
string
The name of the incident type.
prefix
string
The string that will be prepended to the incident title across the Datadog app.
type [required]
enum
Incident type resource type.
Allowed enum values: incident_types
default: incident_types
{"data":{"attributes":{"description":"Any incidents that harm (or have the potential to) the confidentiality, integrity, or availability of our data.","is_default":false,"name":"Security Incident"},"type":"incident_types"}}
A unique identifier that represents the user that created the incident type.
description
string
Text that describes the incident type.
is_default
boolean
If true, this incident type will be used as the default incident type if a type is not specified during the creation of incident resources.
lastModifiedBy
string
A unique identifier that represents the user that last modified the incident type.
modifiedAt
date-time
Timestamp when the incident type was last modified.
name [required]
string
The name of the incident type.
prefix
string
The string that will be prepended to the incident title across the Datadog app.
id [required]
string
The incident type's ID.
type [required]
enum
Incident type resource type.
Allowed enum values: incident_types
default: incident_types
{"data":{"attributes":{"createdAt":"2019-09-19T10:00:00.000Z","createdBy":"00000000-0000-0000-0000-000000000000","description":"Any incidents that harm (or have the potential to) the confidentiality, integrity, or availability of our data.","is_default":false,"lastModifiedBy":"00000000-0000-0000-0000-000000000000","modifiedAt":"2019-09-19T10:00:00.000Z","name":"Security Incident","prefix":"IR"},"id":"00000000-0000-0000-0000-000000000000","type":"incident_types"}}
# Curl command curl-XPOST"https://api.ap1.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/incidents/config/types" \
-H"Accept: application/json" \
-H"Content-Type: application/json" \
-H"DD-API-KEY: ${DD_API_KEY}" \
-H"DD-APPLICATION-KEY: ${DD_APP_KEY}" \
-d@-<<EOF{
"data": {
"attributes": {
"description": "Any incidents that harm (or have the potential to) the confidentiality, integrity, or availability of our data.",
"is_default": false,
"name": "Security Incident"
},
"type": "incident_types"
}
}EOF
// Create an incident type returns "CREATED" response
packagemainimport("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")funcmain(){body:=datadogV2.IncidentTypeCreateRequest{Data:datadogV2.IncidentTypeCreateData{Attributes:datadogV2.IncidentTypeAttributes{Description:datadog.PtrString("Any incidents that harm (or have the potential to) the confidentiality, integrity, or availability of our data."),IsDefault:datadog.PtrBool(false),Name:"Security Incident",},Type:datadogV2.INCIDENTTYPETYPE_INCIDENT_TYPES,},}ctx:=datadog.NewDefaultContext(context.Background())configuration:=datadog.NewConfiguration()configuration.SetUnstableOperationEnabled("v2.CreateIncidentType",true)apiClient:=datadog.NewAPIClient(configuration)api:=datadogV2.NewIncidentsApi(apiClient)resp,r,err:=api.CreateIncidentType(ctx,body)iferr!=nil{fmt.Fprintf(os.Stderr,"Error when calling `IncidentsApi.CreateIncidentType`: %v\n",err)fmt.Fprintf(os.Stderr,"Full HTTP response: %v\n",r)}responseContent,_:=json.MarshalIndent(resp,""," ")fmt.Fprintf(os.Stdout,"Response from `IncidentsApi.CreateIncidentType`:\n%s\n",responseContent)}
// Create an incident type returns "CREATED" responseimportcom.datadog.api.client.ApiClient;importcom.datadog.api.client.ApiException;importcom.datadog.api.client.v2.api.IncidentsApi;importcom.datadog.api.client.v2.model.IncidentTypeAttributes;importcom.datadog.api.client.v2.model.IncidentTypeCreateData;importcom.datadog.api.client.v2.model.IncidentTypeCreateRequest;importcom.datadog.api.client.v2.model.IncidentTypeResponse;importcom.datadog.api.client.v2.model.IncidentTypeType;publicclassExample{publicstaticvoidmain(String[]args){ApiClientdefaultClient=ApiClient.getDefaultApiClient();defaultClient.setUnstableOperationEnabled("v2.createIncidentType",true);IncidentsApiapiInstance=newIncidentsApi(defaultClient);IncidentTypeCreateRequestbody=newIncidentTypeCreateRequest().data(newIncidentTypeCreateData().attributes(newIncidentTypeAttributes().description("Any incidents that harm (or have the potential to) the"+" confidentiality, integrity, or availability of our data.").isDefault(false).name("Security Incident")).type(IncidentTypeType.INCIDENT_TYPES));try{IncidentTypeResponseresult=apiInstance.createIncidentType(body);System.out.println(result);}catch(ApiExceptione){System.err.println("Exception when calling IncidentsApi#createIncidentType");System.err.println("Status code: "+e.getCode());System.err.println("Reason: "+e.getResponseBody());System.err.println("Response headers: "+e.getResponseHeaders());e.printStackTrace();}}}
"""
Create an incident type returns "CREATED" response
"""fromdatadog_api_clientimportApiClient,Configurationfromdatadog_api_client.v2.api.incidents_apiimportIncidentsApifromdatadog_api_client.v2.model.incident_type_attributesimportIncidentTypeAttributesfromdatadog_api_client.v2.model.incident_type_create_dataimportIncidentTypeCreateDatafromdatadog_api_client.v2.model.incident_type_create_requestimportIncidentTypeCreateRequestfromdatadog_api_client.v2.model.incident_type_typeimportIncidentTypeTypebody=IncidentTypeCreateRequest(data=IncidentTypeCreateData(attributes=IncidentTypeAttributes(description="Any incidents that harm (or have the potential to) the confidentiality, integrity, or availability of our data.",is_default=False,name="Security Incident",),type=IncidentTypeType.INCIDENT_TYPES,),)configuration=Configuration()configuration.unstable_operations["create_incident_type"]=TruewithApiClient(configuration)asapi_client:api_instance=IncidentsApi(api_client)response=api_instance.create_incident_type(body=body)print(response)
# Create an incident type returns "CREATED" responserequire"datadog_api_client"DatadogAPIClient.configuredo|config|config.unstable_operations["v2.create_incident_type".to_sym]=trueendapi_instance=DatadogAPIClient::V2::IncidentsAPI.newbody=DatadogAPIClient::V2::IncidentTypeCreateRequest.new({data:DatadogAPIClient::V2::IncidentTypeCreateData.new({attributes:DatadogAPIClient::V2::IncidentTypeAttributes.new({description:"Any incidents that harm (or have the potential to) the confidentiality, integrity, or availability of our data.",is_default:false,name:"Security Incident",}),type:DatadogAPIClient::V2::IncidentTypeType::INCIDENT_TYPES,}),})papi_instance.create_incident_type(body)
// Create an incident type returns "CREATED" response
usedatadog_api_client::datadog;usedatadog_api_client::datadogV2::api_incidents::IncidentsAPI;usedatadog_api_client::datadogV2::model::IncidentTypeAttributes;usedatadog_api_client::datadogV2::model::IncidentTypeCreateData;usedatadog_api_client::datadogV2::model::IncidentTypeCreateRequest;usedatadog_api_client::datadogV2::model::IncidentTypeType;#[tokio::main]asyncfnmain(){letbody=IncidentTypeCreateRequest::new(IncidentTypeCreateData::new(IncidentTypeAttributes::new("Security Incident".to_string()).description("Any incidents that harm (or have the potential to) the confidentiality, integrity, or availability of our data.".to_string(),).is_default(false),IncidentTypeType::INCIDENT_TYPES,),);letmutconfiguration=datadog::Configuration::new();configuration.set_unstable_operation_enabled("v2.CreateIncidentType",true);letapi=IncidentsAPI::with_config(configuration);letresp=api.create_incident_type(body).await;ifletOk(value)=resp{println!("{:#?}",value);}else{println!("{:#?}",resp.unwrap_err());}}
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com"DD_API_KEY="<DD_API_KEY>"DD_APP_KEY="<DD_APP_KEY>"cargo run
/**
* Create an incident type returns "CREATED" response
*/import{client,v2}from"@datadog/datadog-api-client";constconfiguration=client.createConfiguration();configuration.unstableOperations["v2.createIncidentType"]=true;constapiInstance=newv2.IncidentsApi(configuration);constparams: v2.IncidentsApiCreateIncidentTypeRequest={body:{data:{attributes:{description:"Any incidents that harm (or have the potential to) the confidentiality, integrity, or availability of our data.",isDefault: false,name:"Security Incident",},type:"incident_types",},},};apiInstance.createIncidentType(params).then((data: v2.IncidentTypeResponse)=>{console.log("API called successfully. Returned data: "+JSON.stringify(data));}).catch((error: any)=>console.error(error));
A unique identifier that represents the user that created the incident type.
description
string
Text that describes the incident type.
is_default
boolean
If true, this incident type will be used as the default incident type if a type is not specified during the creation of incident resources.
lastModifiedBy
string
A unique identifier that represents the user that last modified the incident type.
modifiedAt
date-time
Timestamp when the incident type was last modified.
name [required]
string
The name of the incident type.
prefix
string
The string that will be prepended to the incident title across the Datadog app.
id [required]
string
The incident type's ID.
type [required]
enum
Incident type resource type.
Allowed enum values: incident_types
default: incident_types
{"data":[{"attributes":{"createdAt":"2019-09-19T10:00:00.000Z","createdBy":"00000000-0000-0000-0000-000000000000","description":"Any incidents that harm (or have the potential to) the confidentiality, integrity, or availability of our data.","is_default":false,"lastModifiedBy":"00000000-0000-0000-0000-000000000000","modifiedAt":"2019-09-19T10:00:00.000Z","name":"Security Incident","prefix":"IR"},"id":"00000000-0000-0000-0000-000000000000","type":"incident_types"}]}
"""
Get a list of incident types returns "OK" response
"""fromdatadog_api_clientimportApiClient,Configurationfromdatadog_api_client.v2.api.incidents_apiimportIncidentsApiconfiguration=Configuration()configuration.unstable_operations["list_incident_types"]=TruewithApiClient(configuration)asapi_client:api_instance=IncidentsApi(api_client)response=api_instance.list_incident_types()print(response)
# Get a list of incident types returns "OK" responserequire"datadog_api_client"DatadogAPIClient.configuredo|config|config.unstable_operations["v2.list_incident_types".to_sym]=trueendapi_instance=DatadogAPIClient::V2::IncidentsAPI.newpapi_instance.list_incident_types()
// Get a list of incident types returns "OK" response
packagemainimport("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")funcmain(){ctx:=datadog.NewDefaultContext(context.Background())configuration:=datadog.NewConfiguration()configuration.SetUnstableOperationEnabled("v2.ListIncidentTypes",true)apiClient:=datadog.NewAPIClient(configuration)api:=datadogV2.NewIncidentsApi(apiClient)resp,r,err:=api.ListIncidentTypes(ctx,*datadogV2.NewListIncidentTypesOptionalParameters())iferr!=nil{fmt.Fprintf(os.Stderr,"Error when calling `IncidentsApi.ListIncidentTypes`: %v\n",err)fmt.Fprintf(os.Stderr,"Full HTTP response: %v\n",r)}responseContent,_:=json.MarshalIndent(resp,""," ")fmt.Fprintf(os.Stdout,"Response from `IncidentsApi.ListIncidentTypes`:\n%s\n",responseContent)}
// Get a list of incident types returns "OK" responseimportcom.datadog.api.client.ApiClient;importcom.datadog.api.client.ApiException;importcom.datadog.api.client.v2.api.IncidentsApi;importcom.datadog.api.client.v2.model.IncidentTypeListResponse;publicclassExample{publicstaticvoidmain(String[]args){ApiClientdefaultClient=ApiClient.getDefaultApiClient();defaultClient.setUnstableOperationEnabled("v2.listIncidentTypes",true);IncidentsApiapiInstance=newIncidentsApi(defaultClient);try{IncidentTypeListResponseresult=apiInstance.listIncidentTypes();System.out.println(result);}catch(ApiExceptione){System.err.println("Exception when calling IncidentsApi#listIncidentTypes");System.err.println("Status code: "+e.getCode());System.err.println("Reason: "+e.getResponseBody());System.err.println("Response headers: "+e.getResponseHeaders());e.printStackTrace();}}}
// Get a list of incident types returns "OK" response
usedatadog_api_client::datadog;usedatadog_api_client::datadogV2::api_incidents::IncidentsAPI;usedatadog_api_client::datadogV2::api_incidents::ListIncidentTypesOptionalParams;#[tokio::main]asyncfnmain(){letmutconfiguration=datadog::Configuration::new();configuration.set_unstable_operation_enabled("v2.ListIncidentTypes",true);letapi=IncidentsAPI::with_config(configuration);letresp=api.list_incident_types(ListIncidentTypesOptionalParams::default()).await;ifletOk(value)=resp{println!("{:#?}",value);}else{println!("{:#?}",resp.unwrap_err());}}
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com"DD_API_KEY="<DD_API_KEY>"DD_APP_KEY="<DD_APP_KEY>"cargo run
/**
* Get a list of incident types returns "OK" response
*/import{client,v2}from"@datadog/datadog-api-client";constconfiguration=client.createConfiguration();configuration.unstableOperations["v2.listIncidentTypes"]=true;constapiInstance=newv2.IncidentsApi(configuration);apiInstance.listIncidentTypes().then((data: v2.IncidentTypeListResponse)=>{console.log("API called successfully. Returned data: "+JSON.stringify(data));}).catch((error: any)=>console.error(error));
A unique identifier that represents the user that created the incident type.
description
string
Text that describes the incident type.
is_default
boolean
If true, this incident type will be used as the default incident type if a type is not specified during the creation of incident resources.
lastModifiedBy
string
A unique identifier that represents the user that last modified the incident type.
modifiedAt
date-time
Timestamp when the incident type was last modified.
name [required]
string
The name of the incident type.
prefix
string
The string that will be prepended to the incident title across the Datadog app.
id [required]
string
The incident type's ID.
type [required]
enum
Incident type resource type.
Allowed enum values: incident_types
default: incident_types
{"data":{"attributes":{"createdAt":"2019-09-19T10:00:00.000Z","createdBy":"00000000-0000-0000-0000-000000000000","description":"Any incidents that harm (or have the potential to) the confidentiality, integrity, or availability of our data.","is_default":false,"lastModifiedBy":"00000000-0000-0000-0000-000000000000","modifiedAt":"2019-09-19T10:00:00.000Z","name":"Security Incident","prefix":"IR"},"id":"00000000-0000-0000-0000-000000000000","type":"incident_types"}}
"""
Get incident type details returns "OK" response
"""fromdatadog_api_clientimportApiClient,Configurationfromdatadog_api_client.v2.api.incidents_apiimportIncidentsApiconfiguration=Configuration()configuration.unstable_operations["get_incident_type"]=TruewithApiClient(configuration)asapi_client:api_instance=IncidentsApi(api_client)response=api_instance.get_incident_type(incident_type_id="incident_type_id",)print(response)
# Get incident type details returns "OK" responserequire"datadog_api_client"DatadogAPIClient.configuredo|config|config.unstable_operations["v2.get_incident_type".to_sym]=trueendapi_instance=DatadogAPIClient::V2::IncidentsAPI.newpapi_instance.get_incident_type("incident_type_id")
// Get incident type details returns "OK" response
packagemainimport("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")funcmain(){ctx:=datadog.NewDefaultContext(context.Background())configuration:=datadog.NewConfiguration()configuration.SetUnstableOperationEnabled("v2.GetIncidentType",true)apiClient:=datadog.NewAPIClient(configuration)api:=datadogV2.NewIncidentsApi(apiClient)resp,r,err:=api.GetIncidentType(ctx,"incident_type_id")iferr!=nil{fmt.Fprintf(os.Stderr,"Error when calling `IncidentsApi.GetIncidentType`: %v\n",err)fmt.Fprintf(os.Stderr,"Full HTTP response: %v\n",r)}responseContent,_:=json.MarshalIndent(resp,""," ")fmt.Fprintf(os.Stdout,"Response from `IncidentsApi.GetIncidentType`:\n%s\n",responseContent)}
// Get incident type details returns "OK" response
usedatadog_api_client::datadog;usedatadog_api_client::datadogV2::api_incidents::IncidentsAPI;#[tokio::main]asyncfnmain(){letmutconfiguration=datadog::Configuration::new();configuration.set_unstable_operation_enabled("v2.GetIncidentType",true);letapi=IncidentsAPI::with_config(configuration);letresp=api.get_incident_type("incident_type_id".to_string()).await;ifletOk(value)=resp{println!("{:#?}",value);}else{println!("{:#?}",resp.unwrap_err());}}
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com"DD_API_KEY="<DD_API_KEY>"DD_APP_KEY="<DD_APP_KEY>"cargo run
/**
* Get incident type details returns "OK" response
*/import{client,v2}from"@datadog/datadog-api-client";constconfiguration=client.createConfiguration();configuration.unstableOperations["v2.getIncidentType"]=true;constapiInstance=newv2.IncidentsApi(configuration);constparams: v2.IncidentsApiGetIncidentTypeRequest={incidentTypeId:"incident_type_id",};apiInstance.getIncidentType(params).then((data: v2.IncidentTypeResponse)=>{console.log("API called successfully. Returned data: "+JSON.stringify(data));}).catch((error: any)=>console.error(error));
A unique identifier that represents the user that created the incident type.
description
string
Text that describes the incident type.
is_default
boolean
If true, this incident type will be used as the default incident type if a type is not specified during the creation of incident resources.
lastModifiedBy
string
A unique identifier that represents the user that last modified the incident type.
modifiedAt
date-time
Timestamp when the incident type was last modified.
name [required]
string
The name of the incident type.
prefix
string
The string that will be prepended to the incident title across the Datadog app.
id [required]
string
The incident type's ID.
type [required]
enum
Incident type resource type.
Allowed enum values: incident_types
default: incident_types
{"data":{"attributes":{"createdAt":"2019-09-19T10:00:00.000Z","createdBy":"00000000-0000-0000-0000-000000000000","description":"Any incidents that harm (or have the potential to) the confidentiality, integrity, or availability of our data.","is_default":false,"lastModifiedBy":"00000000-0000-0000-0000-000000000000","modifiedAt":"2019-09-19T10:00:00.000Z","name":"Security Incident","prefix":"IR"},"id":"00000000-0000-0000-0000-000000000000","type":"incident_types"}}
// Update an incident type returns "OK" response
packagemainimport("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")funcmain(){// there is a valid "incident_type" in the system
IncidentTypeDataID:=os.Getenv("INCIDENT_TYPE_DATA_ID")body:=datadogV2.IncidentTypePatchRequest{Data:datadogV2.IncidentTypePatchData{Id:IncidentTypeDataID,Attributes:datadogV2.IncidentTypeUpdateAttributes{Name:datadog.PtrString("Security Incident-updated"),},Type:datadogV2.INCIDENTTYPETYPE_INCIDENT_TYPES,},}ctx:=datadog.NewDefaultContext(context.Background())configuration:=datadog.NewConfiguration()configuration.SetUnstableOperationEnabled("v2.UpdateIncidentType",true)apiClient:=datadog.NewAPIClient(configuration)api:=datadogV2.NewIncidentsApi(apiClient)resp,r,err:=api.UpdateIncidentType(ctx,IncidentTypeDataID,body)iferr!=nil{fmt.Fprintf(os.Stderr,"Error when calling `IncidentsApi.UpdateIncidentType`: %v\n",err)fmt.Fprintf(os.Stderr,"Full HTTP response: %v\n",r)}responseContent,_:=json.MarshalIndent(resp,""," ")fmt.Fprintf(os.Stdout,"Response from `IncidentsApi.UpdateIncidentType`:\n%s\n",responseContent)}
// Update an incident type returns "OK" responseimportcom.datadog.api.client.ApiClient;importcom.datadog.api.client.ApiException;importcom.datadog.api.client.v2.api.IncidentsApi;importcom.datadog.api.client.v2.model.IncidentTypePatchData;importcom.datadog.api.client.v2.model.IncidentTypePatchRequest;importcom.datadog.api.client.v2.model.IncidentTypeResponse;importcom.datadog.api.client.v2.model.IncidentTypeType;importcom.datadog.api.client.v2.model.IncidentTypeUpdateAttributes;publicclassExample{publicstaticvoidmain(String[]args){ApiClientdefaultClient=ApiClient.getDefaultApiClient();defaultClient.setUnstableOperationEnabled("v2.updateIncidentType",true);IncidentsApiapiInstance=newIncidentsApi(defaultClient);// there is a valid "incident_type" in the systemStringINCIDENT_TYPE_DATA_ATTRIBUTES_NAME=System.getenv("INCIDENT_TYPE_DATA_ATTRIBUTES_NAME");StringINCIDENT_TYPE_DATA_ID=System.getenv("INCIDENT_TYPE_DATA_ID");IncidentTypePatchRequestbody=newIncidentTypePatchRequest().data(newIncidentTypePatchData().id(INCIDENT_TYPE_DATA_ID).attributes(newIncidentTypeUpdateAttributes().name("Security Incident-updated")).type(IncidentTypeType.INCIDENT_TYPES));try{IncidentTypeResponseresult=apiInstance.updateIncidentType(INCIDENT_TYPE_DATA_ID,body);System.out.println(result);}catch(ApiExceptione){System.err.println("Exception when calling IncidentsApi#updateIncidentType");System.err.println("Status code: "+e.getCode());System.err.println("Reason: "+e.getResponseBody());System.err.println("Response headers: "+e.getResponseHeaders());e.printStackTrace();}}}
"""
Update an incident type returns "OK" response
"""fromosimportenvironfromdatadog_api_clientimportApiClient,Configurationfromdatadog_api_client.v2.api.incidents_apiimportIncidentsApifromdatadog_api_client.v2.model.incident_type_patch_dataimportIncidentTypePatchDatafromdatadog_api_client.v2.model.incident_type_patch_requestimportIncidentTypePatchRequestfromdatadog_api_client.v2.model.incident_type_typeimportIncidentTypeTypefromdatadog_api_client.v2.model.incident_type_update_attributesimportIncidentTypeUpdateAttributes# there is a valid "incident_type" in the systemINCIDENT_TYPE_DATA_ATTRIBUTES_NAME=environ["INCIDENT_TYPE_DATA_ATTRIBUTES_NAME"]INCIDENT_TYPE_DATA_ID=environ["INCIDENT_TYPE_DATA_ID"]body=IncidentTypePatchRequest(data=IncidentTypePatchData(id=INCIDENT_TYPE_DATA_ID,attributes=IncidentTypeUpdateAttributes(name="Security Incident-updated",),type=IncidentTypeType.INCIDENT_TYPES,),)configuration=Configuration()configuration.unstable_operations["update_incident_type"]=TruewithApiClient(configuration)asapi_client:api_instance=IncidentsApi(api_client)response=api_instance.update_incident_type(incident_type_id=INCIDENT_TYPE_DATA_ID,body=body)print(response)
# Update an incident type returns "OK" responserequire"datadog_api_client"DatadogAPIClient.configuredo|config|config.unstable_operations["v2.update_incident_type".to_sym]=trueendapi_instance=DatadogAPIClient::V2::IncidentsAPI.new# there is a valid "incident_type" in the systemINCIDENT_TYPE_DATA_ATTRIBUTES_NAME=ENV["INCIDENT_TYPE_DATA_ATTRIBUTES_NAME"]INCIDENT_TYPE_DATA_ID=ENV["INCIDENT_TYPE_DATA_ID"]body=DatadogAPIClient::V2::IncidentTypePatchRequest.new({data:DatadogAPIClient::V2::IncidentTypePatchData.new({id:INCIDENT_TYPE_DATA_ID,attributes:DatadogAPIClient::V2::IncidentTypeUpdateAttributes.new({name:"Security Incident-updated",}),type:DatadogAPIClient::V2::IncidentTypeType::INCIDENT_TYPES,}),})papi_instance.update_incident_type(INCIDENT_TYPE_DATA_ID,body)
// Update an incident type returns "OK" response
usedatadog_api_client::datadog;usedatadog_api_client::datadogV2::api_incidents::IncidentsAPI;usedatadog_api_client::datadogV2::model::IncidentTypePatchData;usedatadog_api_client::datadogV2::model::IncidentTypePatchRequest;usedatadog_api_client::datadogV2::model::IncidentTypeType;usedatadog_api_client::datadogV2::model::IncidentTypeUpdateAttributes;#[tokio::main]asyncfnmain(){// there is a valid "incident_type" in the system
letincident_type_data_id=std::env::var("INCIDENT_TYPE_DATA_ID").unwrap();letbody=IncidentTypePatchRequest::new(IncidentTypePatchData::new(IncidentTypeUpdateAttributes::new().name("Security Incident-updated".to_string()),incident_type_data_id.clone(),IncidentTypeType::INCIDENT_TYPES,));letmutconfiguration=datadog::Configuration::new();configuration.set_unstable_operation_enabled("v2.UpdateIncidentType",true);letapi=IncidentsAPI::with_config(configuration);letresp=api.update_incident_type(incident_type_data_id.clone(),body).await;ifletOk(value)=resp{println!("{:#?}",value);}else{println!("{:#?}",resp.unwrap_err());}}
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com"DD_API_KEY="<DD_API_KEY>"DD_APP_KEY="<DD_APP_KEY>"cargo run
/**
* Update an incident type returns "OK" response
*/import{client,v2}from"@datadog/datadog-api-client";constconfiguration=client.createConfiguration();configuration.unstableOperations["v2.updateIncidentType"]=true;constapiInstance=newv2.IncidentsApi(configuration);// there is a valid "incident_type" in the system
constINCIDENT_TYPE_DATA_ID=process.env.INCIDENT_TYPE_DATA_IDasstring;constparams: v2.IncidentsApiUpdateIncidentTypeRequest={body:{data:{id: INCIDENT_TYPE_DATA_ID,attributes:{name:"Security Incident-updated",},type:"incident_types",},},incidentTypeId: INCIDENT_TYPE_DATA_ID,};apiInstance.updateIncidentType(params).then((data: v2.IncidentTypeResponse)=>{console.log("API called successfully. Returned data: "+JSON.stringify(data));}).catch((error: any)=>console.error(error));
"""
Delete an incident type returns "OK" response
"""fromosimportenvironfromdatadog_api_clientimportApiClient,Configurationfromdatadog_api_client.v2.api.incidents_apiimportIncidentsApi# there is a valid "incident_type" in the systemINCIDENT_TYPE_DATA_ID=environ["INCIDENT_TYPE_DATA_ID"]configuration=Configuration()configuration.unstable_operations["delete_incident_type"]=TruewithApiClient(configuration)asapi_client:api_instance=IncidentsApi(api_client)api_instance.delete_incident_type(incident_type_id=INCIDENT_TYPE_DATA_ID,)
# Delete an incident type returns "OK" responserequire"datadog_api_client"DatadogAPIClient.configuredo|config|config.unstable_operations["v2.delete_incident_type".to_sym]=trueendapi_instance=DatadogAPIClient::V2::IncidentsAPI.new# there is a valid "incident_type" in the systemINCIDENT_TYPE_DATA_ID=ENV["INCIDENT_TYPE_DATA_ID"]api_instance.delete_incident_type(INCIDENT_TYPE_DATA_ID)
// Delete an incident type returns "OK" response
packagemainimport("context""fmt""os""github.com/DataDog/datadog-api-client-go/v2/api/datadog""github.com/DataDog/datadog-api-client-go/v2/api/datadogV2")funcmain(){// there is a valid "incident_type" in the system
IncidentTypeDataID:=os.Getenv("INCIDENT_TYPE_DATA_ID")ctx:=datadog.NewDefaultContext(context.Background())configuration:=datadog.NewConfiguration()configuration.SetUnstableOperationEnabled("v2.DeleteIncidentType",true)apiClient:=datadog.NewAPIClient(configuration)api:=datadogV2.NewIncidentsApi(apiClient)r,err:=api.DeleteIncidentType(ctx,IncidentTypeDataID)iferr!=nil{fmt.Fprintf(os.Stderr,"Error when calling `IncidentsApi.DeleteIncidentType`: %v\n",err)fmt.Fprintf(os.Stderr,"Full HTTP response: %v\n",r)}}
// Delete an incident type returns "OK" responseimportcom.datadog.api.client.ApiClient;importcom.datadog.api.client.ApiException;importcom.datadog.api.client.v2.api.IncidentsApi;publicclassExample{publicstaticvoidmain(String[]args){ApiClientdefaultClient=ApiClient.getDefaultApiClient();defaultClient.setUnstableOperationEnabled("v2.deleteIncidentType",true);IncidentsApiapiInstance=newIncidentsApi(defaultClient);// there is a valid "incident_type" in the systemStringINCIDENT_TYPE_DATA_ID=System.getenv("INCIDENT_TYPE_DATA_ID");try{apiInstance.deleteIncidentType(INCIDENT_TYPE_DATA_ID);}catch(ApiExceptione){System.err.println("Exception when calling IncidentsApi#deleteIncidentType");System.err.println("Status code: "+e.getCode());System.err.println("Reason: "+e.getResponseBody());System.err.println("Response headers: "+e.getResponseHeaders());e.printStackTrace();}}}
// Delete an incident type returns "OK" response
usedatadog_api_client::datadog;usedatadog_api_client::datadogV2::api_incidents::IncidentsAPI;#[tokio::main]asyncfnmain(){// there is a valid "incident_type" in the system
letincident_type_data_id=std::env::var("INCIDENT_TYPE_DATA_ID").unwrap();letmutconfiguration=datadog::Configuration::new();configuration.set_unstable_operation_enabled("v2.DeleteIncidentType",true);letapi=IncidentsAPI::with_config(configuration);letresp=api.delete_incident_type(incident_type_data_id.clone()).await;ifletOk(value)=resp{println!("{:#?}",value);}else{println!("{:#?}",resp.unwrap_err());}}
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com"DD_API_KEY="<DD_API_KEY>"DD_APP_KEY="<DD_APP_KEY>"cargo run
/**
* Delete an incident type returns "OK" response
*/import{client,v2}from"@datadog/datadog-api-client";constconfiguration=client.createConfiguration();configuration.unstableOperations["v2.deleteIncidentType"]=true;constapiInstance=newv2.IncidentsApi(configuration);// there is a valid "incident_type" in the system
constINCIDENT_TYPE_DATA_ID=process.env.INCIDENT_TYPE_DATA_IDasstring;constparams: v2.IncidentsApiDeleteIncidentTypeRequest={incidentTypeId: INCIDENT_TYPE_DATA_ID,};apiInstance.deleteIncidentType(params).then((data: any)=>{console.log("API called successfully. Returned data: "+JSON.stringify(data));}).catch((error: any)=>console.error(error));