Get details of an incident service. If the include[users] query parameter is provided,
the included attribute will contain the users related to these incident services.
This endpoint requires the incident_read permission.
OAuth apps require the incident_read authorization scope to access this endpoint.
Arguments
Paramètres du chemin
Nom
Type
Description
service_id [required]
string
The ID of the incident service.
Chaînes de requête
Nom
Type
Description
include
enum
Specifies which types of related objects should be included in the response. Allowed enum values: users, attachments
"""
Get details of an incident service returns "OK" response
"""fromosimportenvironfromdatadog_api_clientimportApiClient,Configurationfromdatadog_api_client.v2.api.incident_services_apiimportIncidentServicesApi# there is a valid "service" in the systemSERVICE_DATA_ID=environ["SERVICE_DATA_ID"]configuration=Configuration()configuration.unstable_operations["get_incident_service"]=TruewithApiClient(configuration)asapi_client:api_instance=IncidentServicesApi(api_client)response=api_instance.get_incident_service(service_id=SERVICE_DATA_ID,)print(response)
# Get details of an incident service returns "OK" responserequire"datadog_api_client"DatadogAPIClient.configuredo|config|config.unstable_operations["v2.get_incident_service".to_sym]=trueendapi_instance=DatadogAPIClient::V2::IncidentServicesAPI.new# there is a valid "service" in the systemSERVICE_DATA_ID=ENV["SERVICE_DATA_ID"]papi_instance.get_incident_service(SERVICE_DATA_ID)
// Get details of an incident service 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 "service" in the system
ServiceDataID:=os.Getenv("SERVICE_DATA_ID")ctx:=datadog.NewDefaultContext(context.Background())configuration:=datadog.NewConfiguration()configuration.SetUnstableOperationEnabled("v2.GetIncidentService",true)apiClient:=datadog.NewAPIClient(configuration)api:=datadogV2.NewIncidentServicesApi(apiClient)resp,r,err:=api.GetIncidentService(ctx,ServiceDataID,*datadogV2.NewGetIncidentServiceOptionalParameters())iferr!=nil{fmt.Fprintf(os.Stderr,"Error when calling `IncidentServicesApi.GetIncidentService`: %v\n",err)fmt.Fprintf(os.Stderr,"Full HTTP response: %v\n",r)}responseContent,_:=json.MarshalIndent(resp,""," ")fmt.Fprintf(os.Stdout,"Response from `IncidentServicesApi.GetIncidentService`:\n%s\n",responseContent)}
// Get details of an incident service returns "OK" responseimportcom.datadog.api.client.ApiClient;importcom.datadog.api.client.ApiException;importcom.datadog.api.client.v2.api.IncidentServicesApi;importcom.datadog.api.client.v2.model.IncidentServiceResponse;publicclassExample{publicstaticvoidmain(String[]args){ApiClientdefaultClient=ApiClient.getDefaultApiClient();defaultClient.setUnstableOperationEnabled("v2.getIncidentService",true);IncidentServicesApiapiInstance=newIncidentServicesApi(defaultClient);// there is a valid "service" in the systemStringSERVICE_DATA_ID=System.getenv("SERVICE_DATA_ID");try{IncidentServiceResponseresult=apiInstance.getIncidentService(SERVICE_DATA_ID);System.out.println(result);}catch(ApiExceptione){System.err.println("Exception when calling IncidentServicesApi#getIncidentService");System.err.println("Status code: "+e.getCode());System.err.println("Reason: "+e.getResponseBody());System.err.println("Response headers: "+e.getResponseHeaders());e.printStackTrace();}}}
// Get details of an incident service returns "OK" response
usedatadog_api_client::datadog;usedatadog_api_client::datadogV2::api_incident_services::GetIncidentServiceOptionalParams;usedatadog_api_client::datadogV2::api_incident_services::IncidentServicesAPI;#[tokio::main]asyncfnmain(){// there is a valid "service" in the system
letservice_data_id=std::env::var("SERVICE_DATA_ID").unwrap();letmutconfiguration=datadog::Configuration::new();configuration.set_unstable_operation_enabled("v2.GetIncidentService",true);letapi=IncidentServicesAPI::with_config(configuration);letresp=api.get_incident_service(service_data_id.clone(),GetIncidentServiceOptionalParams::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 details of an incident service returns "OK" response
*/import{client,v2}from"@datadog/datadog-api-client";constconfiguration=client.createConfiguration();configuration.unstableOperations["v2.getIncidentService"]=true;constapiInstance=newv2.IncidentServicesApi(configuration);// there is a valid "service" in the system
constSERVICE_DATA_ID=process.env.SERVICE_DATA_IDasstring;constparams: v2.IncidentServicesApiGetIncidentServiceRequest={serviceId: SERVICE_DATA_ID,};apiInstance.getIncidentService(params).then((data: v2.IncidentServiceResponse)=>{console.log("API called successfully. Returned data: "+JSON.stringify(data));}).catch((error: any)=>console.error(error));
"""
Delete an existing incident service returns "OK" response
"""fromosimportenvironfromdatadog_api_clientimportApiClient,Configurationfromdatadog_api_client.v2.api.incident_services_apiimportIncidentServicesApi# there is a valid "service" in the systemSERVICE_DATA_ID=environ["SERVICE_DATA_ID"]configuration=Configuration()configuration.unstable_operations["delete_incident_service"]=TruewithApiClient(configuration)asapi_client:api_instance=IncidentServicesApi(api_client)api_instance.delete_incident_service(service_id=SERVICE_DATA_ID,)
# Delete an existing incident service returns "OK" responserequire"datadog_api_client"DatadogAPIClient.configuredo|config|config.unstable_operations["v2.delete_incident_service".to_sym]=trueendapi_instance=DatadogAPIClient::V2::IncidentServicesAPI.new# there is a valid "service" in the systemSERVICE_DATA_ID=ENV["SERVICE_DATA_ID"]api_instance.delete_incident_service(SERVICE_DATA_ID)
// Delete an existing incident service 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 "service" in the system
ServiceDataID:=os.Getenv("SERVICE_DATA_ID")ctx:=datadog.NewDefaultContext(context.Background())configuration:=datadog.NewConfiguration()configuration.SetUnstableOperationEnabled("v2.DeleteIncidentService",true)apiClient:=datadog.NewAPIClient(configuration)api:=datadogV2.NewIncidentServicesApi(apiClient)r,err:=api.DeleteIncidentService(ctx,ServiceDataID)iferr!=nil{fmt.Fprintf(os.Stderr,"Error when calling `IncidentServicesApi.DeleteIncidentService`: %v\n",err)fmt.Fprintf(os.Stderr,"Full HTTP response: %v\n",r)}}
// Delete an existing incident service returns "OK" responseimportcom.datadog.api.client.ApiClient;importcom.datadog.api.client.ApiException;importcom.datadog.api.client.v2.api.IncidentServicesApi;publicclassExample{publicstaticvoidmain(String[]args){ApiClientdefaultClient=ApiClient.getDefaultApiClient();defaultClient.setUnstableOperationEnabled("v2.deleteIncidentService",true);IncidentServicesApiapiInstance=newIncidentServicesApi(defaultClient);// there is a valid "service" in the systemStringSERVICE_DATA_ID=System.getenv("SERVICE_DATA_ID");try{apiInstance.deleteIncidentService(SERVICE_DATA_ID);}catch(ApiExceptione){System.err.println("Exception when calling IncidentServicesApi#deleteIncidentService");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 service returns "OK" response
usedatadog_api_client::datadog;usedatadog_api_client::datadogV2::api_incident_services::IncidentServicesAPI;#[tokio::main]asyncfnmain(){// there is a valid "service" in the system
letservice_data_id=std::env::var("SERVICE_DATA_ID").unwrap();letmutconfiguration=datadog::Configuration::new();configuration.set_unstable_operation_enabled("v2.DeleteIncidentService",true);letapi=IncidentServicesAPI::with_config(configuration);letresp=api.delete_incident_service(service_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 service returns "OK" response
*/import{client,v2}from"@datadog/datadog-api-client";constconfiguration=client.createConfiguration();configuration.unstableOperations["v2.deleteIncidentService"]=true;constapiInstance=newv2.IncidentServicesApi(configuration);// there is a valid "service" in the system
constSERVICE_DATA_ID=process.env.SERVICE_DATA_IDasstring;constparams: v2.IncidentServicesApiDeleteIncidentServiceRequest={serviceId: SERVICE_DATA_ID,};apiInstance.deleteIncidentService(params).then((data: any)=>{console.log("API called successfully. Returned data: "+JSON.stringify(data));}).catch((error: any)=>console.error(error));
Updates an existing incident service. Only provide the attributes which should be updated as this request is a partial update.
This endpoint requires the incident_settings_write permission.
OAuth apps require the incident_settings_write authorization scope to access this endpoint.
// Update an existing incident service 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 "service" in the system
ServiceDataID:=os.Getenv("SERVICE_DATA_ID")body:=datadogV2.IncidentServiceUpdateRequest{Data:datadogV2.IncidentServiceUpdateData{Type:datadogV2.INCIDENTSERVICETYPE_SERVICES,Attributes:&datadogV2.IncidentServiceUpdateAttributes{Name:"service name-updated",},},}ctx:=datadog.NewDefaultContext(context.Background())configuration:=datadog.NewConfiguration()configuration.SetUnstableOperationEnabled("v2.UpdateIncidentService",true)apiClient:=datadog.NewAPIClient(configuration)api:=datadogV2.NewIncidentServicesApi(apiClient)resp,r,err:=api.UpdateIncidentService(ctx,ServiceDataID,body)iferr!=nil{fmt.Fprintf(os.Stderr,"Error when calling `IncidentServicesApi.UpdateIncidentService`: %v\n",err)fmt.Fprintf(os.Stderr,"Full HTTP response: %v\n",r)}responseContent,_:=json.MarshalIndent(resp,""," ")fmt.Fprintf(os.Stdout,"Response from `IncidentServicesApi.UpdateIncidentService`:\n%s\n",responseContent)}
// Update an existing incident service returns "OK" responseimportcom.datadog.api.client.ApiClient;importcom.datadog.api.client.ApiException;importcom.datadog.api.client.v2.api.IncidentServicesApi;importcom.datadog.api.client.v2.model.IncidentServiceResponse;importcom.datadog.api.client.v2.model.IncidentServiceType;importcom.datadog.api.client.v2.model.IncidentServiceUpdateAttributes;importcom.datadog.api.client.v2.model.IncidentServiceUpdateData;importcom.datadog.api.client.v2.model.IncidentServiceUpdateRequest;publicclassExample{publicstaticvoidmain(String[]args){ApiClientdefaultClient=ApiClient.getDefaultApiClient();defaultClient.setUnstableOperationEnabled("v2.updateIncidentService",true);IncidentServicesApiapiInstance=newIncidentServicesApi(defaultClient);// there is a valid "service" in the systemStringSERVICE_DATA_ATTRIBUTES_NAME=System.getenv("SERVICE_DATA_ATTRIBUTES_NAME");StringSERVICE_DATA_ID=System.getenv("SERVICE_DATA_ID");IncidentServiceUpdateRequestbody=newIncidentServiceUpdateRequest().data(newIncidentServiceUpdateData().type(IncidentServiceType.SERVICES).attributes(newIncidentServiceUpdateAttributes().name("service name-updated")));try{IncidentServiceResponseresult=apiInstance.updateIncidentService(SERVICE_DATA_ID,body);System.out.println(result);}catch(ApiExceptione){System.err.println("Exception when calling IncidentServicesApi#updateIncidentService");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 service returns "OK" response
"""fromosimportenvironfromdatadog_api_clientimportApiClient,Configurationfromdatadog_api_client.v2.api.incident_services_apiimportIncidentServicesApifromdatadog_api_client.v2.model.incident_service_typeimportIncidentServiceTypefromdatadog_api_client.v2.model.incident_service_update_attributesimportIncidentServiceUpdateAttributesfromdatadog_api_client.v2.model.incident_service_update_dataimportIncidentServiceUpdateDatafromdatadog_api_client.v2.model.incident_service_update_requestimportIncidentServiceUpdateRequest# there is a valid "service" in the systemSERVICE_DATA_ATTRIBUTES_NAME=environ["SERVICE_DATA_ATTRIBUTES_NAME"]SERVICE_DATA_ID=environ["SERVICE_DATA_ID"]body=IncidentServiceUpdateRequest(data=IncidentServiceUpdateData(type=IncidentServiceType.SERVICES,attributes=IncidentServiceUpdateAttributes(name="service name-updated",),),)configuration=Configuration()configuration.unstable_operations["update_incident_service"]=TruewithApiClient(configuration)asapi_client:api_instance=IncidentServicesApi(api_client)response=api_instance.update_incident_service(service_id=SERVICE_DATA_ID,body=body)print(response)
# Update an existing incident service returns "OK" responserequire"datadog_api_client"DatadogAPIClient.configuredo|config|config.unstable_operations["v2.update_incident_service".to_sym]=trueendapi_instance=DatadogAPIClient::V2::IncidentServicesAPI.new# there is a valid "service" in the systemSERVICE_DATA_ATTRIBUTES_NAME=ENV["SERVICE_DATA_ATTRIBUTES_NAME"]SERVICE_DATA_ID=ENV["SERVICE_DATA_ID"]body=DatadogAPIClient::V2::IncidentServiceUpdateRequest.new({data:DatadogAPIClient::V2::IncidentServiceUpdateData.new({type:DatadogAPIClient::V2::IncidentServiceType::SERVICES,attributes:DatadogAPIClient::V2::IncidentServiceUpdateAttributes.new({name:"service name-updated",}),}),})papi_instance.update_incident_service(SERVICE_DATA_ID,body)
// Update an existing incident service returns "OK" response
usedatadog_api_client::datadog;usedatadog_api_client::datadogV2::api_incident_services::IncidentServicesAPI;usedatadog_api_client::datadogV2::model::IncidentServiceType;usedatadog_api_client::datadogV2::model::IncidentServiceUpdateAttributes;usedatadog_api_client::datadogV2::model::IncidentServiceUpdateData;usedatadog_api_client::datadogV2::model::IncidentServiceUpdateRequest;#[tokio::main]asyncfnmain(){// there is a valid "service" in the system
letservice_data_id=std::env::var("SERVICE_DATA_ID").unwrap();letbody=IncidentServiceUpdateRequest::new(IncidentServiceUpdateData::new(IncidentServiceType::SERVICES).attributes(IncidentServiceUpdateAttributes::new("service name-updated".to_string()),),);letmutconfiguration=datadog::Configuration::new();configuration.set_unstable_operation_enabled("v2.UpdateIncidentService",true);letapi=IncidentServicesAPI::with_config(configuration);letresp=api.update_incident_service(service_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 service returns "OK" response
*/import{client,v2}from"@datadog/datadog-api-client";constconfiguration=client.createConfiguration();configuration.unstableOperations["v2.updateIncidentService"]=true;constapiInstance=newv2.IncidentServicesApi(configuration);// there is a valid "service" in the system
constSERVICE_DATA_ID=process.env.SERVICE_DATA_IDasstring;constparams: v2.IncidentServicesApiUpdateIncidentServiceRequest={body:{data:{type:"services",attributes:{name:"service name-updated",},},},serviceId: SERVICE_DATA_ID,};apiInstance.updateIncidentService(params).then((data: v2.IncidentServiceResponse)=>{console.log("API called successfully. Returned data: "+JSON.stringify(data));}).catch((error: any)=>console.error(error));
Get all incident services uploaded for the requesting user’s organization. If the include[users] query parameter is provided, the included attribute will contain the users related to these incident services.
This endpoint requires the incident_read permission.
OAuth apps require the incident_read authorization scope to access this endpoint.
Arguments
Chaînes de requête
Nom
Type
Description
include
enum
Specifies which types of related objects should be included in the response. Allowed enum values: users, attachments
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.
"""
Get a list of all incident services returns "OK" response
"""fromosimportenvironfromdatadog_api_clientimportApiClient,Configurationfromdatadog_api_client.v2.api.incident_services_apiimportIncidentServicesApi# there is a valid "service" in the systemSERVICE_DATA_ATTRIBUTES_NAME=environ["SERVICE_DATA_ATTRIBUTES_NAME"]configuration=Configuration()configuration.unstable_operations["list_incident_services"]=TruewithApiClient(configuration)asapi_client:api_instance=IncidentServicesApi(api_client)response=api_instance.list_incident_services(filter=SERVICE_DATA_ATTRIBUTES_NAME,)print(response)
# Get a list of all incident services returns "OK" responserequire"datadog_api_client"DatadogAPIClient.configuredo|config|config.unstable_operations["v2.list_incident_services".to_sym]=trueendapi_instance=DatadogAPIClient::V2::IncidentServicesAPI.new# there is a valid "service" in the systemSERVICE_DATA_ATTRIBUTES_NAME=ENV["SERVICE_DATA_ATTRIBUTES_NAME"]opts={filter:SERVICE_DATA_ATTRIBUTES_NAME,}papi_instance.list_incident_services(opts)
// Get a list of all incident services 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 "service" in the system
ServiceDataAttributesName:=os.Getenv("SERVICE_DATA_ATTRIBUTES_NAME")ctx:=datadog.NewDefaultContext(context.Background())configuration:=datadog.NewConfiguration()configuration.SetUnstableOperationEnabled("v2.ListIncidentServices",true)apiClient:=datadog.NewAPIClient(configuration)api:=datadogV2.NewIncidentServicesApi(apiClient)resp,r,err:=api.ListIncidentServices(ctx,*datadogV2.NewListIncidentServicesOptionalParameters().WithFilter(ServiceDataAttributesName))iferr!=nil{fmt.Fprintf(os.Stderr,"Error when calling `IncidentServicesApi.ListIncidentServices`: %v\n",err)fmt.Fprintf(os.Stderr,"Full HTTP response: %v\n",r)}responseContent,_:=json.MarshalIndent(resp,""," ")fmt.Fprintf(os.Stdout,"Response from `IncidentServicesApi.ListIncidentServices`:\n%s\n",responseContent)}
// Get a list of all incident services returns "OK" responseimportcom.datadog.api.client.ApiClient;importcom.datadog.api.client.ApiException;importcom.datadog.api.client.v2.api.IncidentServicesApi;importcom.datadog.api.client.v2.api.IncidentServicesApi.ListIncidentServicesOptionalParameters;importcom.datadog.api.client.v2.model.IncidentServicesResponse;publicclassExample{publicstaticvoidmain(String[]args){ApiClientdefaultClient=ApiClient.getDefaultApiClient();defaultClient.setUnstableOperationEnabled("v2.listIncidentServices",true);IncidentServicesApiapiInstance=newIncidentServicesApi(defaultClient);// there is a valid "service" in the systemStringSERVICE_DATA_ATTRIBUTES_NAME=System.getenv("SERVICE_DATA_ATTRIBUTES_NAME");try{IncidentServicesResponseresult=apiInstance.listIncidentServices(newListIncidentServicesOptionalParameters().filter(SERVICE_DATA_ATTRIBUTES_NAME));System.out.println(result);}catch(ApiExceptione){System.err.println("Exception when calling IncidentServicesApi#listIncidentServices");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 all incident services returns "OK" response
usedatadog_api_client::datadog;usedatadog_api_client::datadogV2::api_incident_services::IncidentServicesAPI;usedatadog_api_client::datadogV2::api_incident_services::ListIncidentServicesOptionalParams;#[tokio::main]asyncfnmain(){// there is a valid "service" in the system
letservice_data_attributes_name=std::env::var("SERVICE_DATA_ATTRIBUTES_NAME").unwrap();letmutconfiguration=datadog::Configuration::new();configuration.set_unstable_operation_enabled("v2.ListIncidentServices",true);letapi=IncidentServicesAPI::with_config(configuration);letresp=api.list_incident_services(ListIncidentServicesOptionalParams::default().filter(service_data_attributes_name.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 all incident services returns "OK" response
*/import{client,v2}from"@datadog/datadog-api-client";constconfiguration=client.createConfiguration();configuration.unstableOperations["v2.listIncidentServices"]=true;constapiInstance=newv2.IncidentServicesApi(configuration);// there is a valid "service" in the system
constSERVICE_DATA_ATTRIBUTES_NAME=process.env.SERVICE_DATA_ATTRIBUTES_NAMEasstring;constparams: v2.IncidentServicesApiListIncidentServicesRequest={filter: SERVICE_DATA_ATTRIBUTES_NAME,};apiInstance.listIncidentServices(params).then((data: v2.IncidentServicesResponse)=>{console.log("API called successfully. Returned data: "+JSON.stringify(data));}).catch((error: any)=>console.error(error));
// Create a new incident service 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.IncidentServiceCreateRequest{Data:datadogV2.IncidentServiceCreateData{Type:datadogV2.INCIDENTSERVICETYPE_SERVICES,Attributes:&datadogV2.IncidentServiceCreateAttributes{Name:"Example-Incident-Service",},},}ctx:=datadog.NewDefaultContext(context.Background())configuration:=datadog.NewConfiguration()configuration.SetUnstableOperationEnabled("v2.CreateIncidentService",true)apiClient:=datadog.NewAPIClient(configuration)api:=datadogV2.NewIncidentServicesApi(apiClient)resp,r,err:=api.CreateIncidentService(ctx,body)iferr!=nil{fmt.Fprintf(os.Stderr,"Error when calling `IncidentServicesApi.CreateIncidentService`: %v\n",err)fmt.Fprintf(os.Stderr,"Full HTTP response: %v\n",r)}responseContent,_:=json.MarshalIndent(resp,""," ")fmt.Fprintf(os.Stdout,"Response from `IncidentServicesApi.CreateIncidentService`:\n%s\n",responseContent)}
// Create a new incident service returns "CREATED" responseimportcom.datadog.api.client.ApiClient;importcom.datadog.api.client.ApiException;importcom.datadog.api.client.v2.api.IncidentServicesApi;importcom.datadog.api.client.v2.model.IncidentServiceCreateAttributes;importcom.datadog.api.client.v2.model.IncidentServiceCreateData;importcom.datadog.api.client.v2.model.IncidentServiceCreateRequest;importcom.datadog.api.client.v2.model.IncidentServiceResponse;importcom.datadog.api.client.v2.model.IncidentServiceType;publicclassExample{publicstaticvoidmain(String[]args){ApiClientdefaultClient=ApiClient.getDefaultApiClient();defaultClient.setUnstableOperationEnabled("v2.createIncidentService",true);IncidentServicesApiapiInstance=newIncidentServicesApi(defaultClient);IncidentServiceCreateRequestbody=newIncidentServiceCreateRequest().data(newIncidentServiceCreateData().type(IncidentServiceType.SERVICES).attributes(newIncidentServiceCreateAttributes().name("Example-Incident-Service")));try{IncidentServiceResponseresult=apiInstance.createIncidentService(body);System.out.println(result);}catch(ApiExceptione){System.err.println("Exception when calling IncidentServicesApi#createIncidentService");System.err.println("Status code: "+e.getCode());System.err.println("Reason: "+e.getResponseBody());System.err.println("Response headers: "+e.getResponseHeaders());e.printStackTrace();}}}
"""
Create a new incident service returns "CREATED" response
"""fromdatadog_api_clientimportApiClient,Configurationfromdatadog_api_client.v2.api.incident_services_apiimportIncidentServicesApifromdatadog_api_client.v2.model.incident_service_create_attributesimportIncidentServiceCreateAttributesfromdatadog_api_client.v2.model.incident_service_create_dataimportIncidentServiceCreateDatafromdatadog_api_client.v2.model.incident_service_create_requestimportIncidentServiceCreateRequestfromdatadog_api_client.v2.model.incident_service_typeimportIncidentServiceTypebody=IncidentServiceCreateRequest(data=IncidentServiceCreateData(type=IncidentServiceType.SERVICES,attributes=IncidentServiceCreateAttributes(name="Example-Incident-Service",),),)configuration=Configuration()configuration.unstable_operations["create_incident_service"]=TruewithApiClient(configuration)asapi_client:api_instance=IncidentServicesApi(api_client)response=api_instance.create_incident_service(body=body)print(response)
# Create a new incident service returns "CREATED" responserequire"datadog_api_client"DatadogAPIClient.configuredo|config|config.unstable_operations["v2.create_incident_service".to_sym]=trueendapi_instance=DatadogAPIClient::V2::IncidentServicesAPI.newbody=DatadogAPIClient::V2::IncidentServiceCreateRequest.new({data:DatadogAPIClient::V2::IncidentServiceCreateData.new({type:DatadogAPIClient::V2::IncidentServiceType::SERVICES,attributes:DatadogAPIClient::V2::IncidentServiceCreateAttributes.new({name:"Example-Incident-Service",}),}),})papi_instance.create_incident_service(body)
// Create a new incident service returns "CREATED" response
usedatadog_api_client::datadog;usedatadog_api_client::datadogV2::api_incident_services::IncidentServicesAPI;usedatadog_api_client::datadogV2::model::IncidentServiceCreateAttributes;usedatadog_api_client::datadogV2::model::IncidentServiceCreateData;usedatadog_api_client::datadogV2::model::IncidentServiceCreateRequest;usedatadog_api_client::datadogV2::model::IncidentServiceType;#[tokio::main]asyncfnmain(){letbody=IncidentServiceCreateRequest::new(IncidentServiceCreateData::new(IncidentServiceType::SERVICES).attributes(IncidentServiceCreateAttributes::new("Example-Incident-Service".to_string()),),);letmutconfiguration=datadog::Configuration::new();configuration.set_unstable_operation_enabled("v2.CreateIncidentService",true);letapi=IncidentServicesAPI::with_config(configuration);letresp=api.create_incident_service(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 a new incident service returns "CREATED" response
*/import{client,v2}from"@datadog/datadog-api-client";constconfiguration=client.createConfiguration();configuration.unstableOperations["v2.createIncidentService"]=true;constapiInstance=newv2.IncidentServicesApi(configuration);constparams: v2.IncidentServicesApiCreateIncidentServiceRequest={body:{data:{type:"services",attributes:{name:"Example-Incident-Service",},},},};apiInstance.createIncidentService(params).then((data: v2.IncidentServiceResponse)=>{console.log("API called successfully. Returned data: "+JSON.stringify(data));}).catch((error: any)=>console.error(error));