The Incident Teams endpoints are deprecated. See the Teams API endpoints to create, update, delete, and retrieve teams which can be associated with incidents.
Get details of an incident team. If the include[users] query parameter is provided,
the included attribute will contain the users related to these incident teams.
This endpoint requires the incident_read permission.
OAuth apps require the incident_read authorization scope to access this endpoint.
引数
パスパラメーター
名前
種類
説明
team_id [required]
string
The ID of the incident team.
クエリ文字列
名前
種類
説明
include
enum
Specifies which types of related objects should be included in the response. Allowed enum values: users, attachments
"""
Get details of an incident team returns "OK" response
"""fromosimportenvironfromdatadog_api_clientimportApiClient,Configurationfromdatadog_api_client.v2.api.incident_teams_apiimportIncidentTeamsApi# there is a valid "team" in the systemTEAM_DATA_ID=environ["TEAM_DATA_ID"]configuration=Configuration()configuration.unstable_operations["get_incident_team"]=TruewithApiClient(configuration)asapi_client:api_instance=IncidentTeamsApi(api_client)response=api_instance.get_incident_team(team_id=TEAM_DATA_ID,)print(response)
# Get details of an incident team returns "OK" responserequire"datadog_api_client"DatadogAPIClient.configuredo|config|config.unstable_operations["v2.get_incident_team".to_sym]=trueendapi_instance=DatadogAPIClient::V2::IncidentTeamsAPI.new# there is a valid "team" in the systemTEAM_DATA_ID=ENV["TEAM_DATA_ID"]papi_instance.get_incident_team(TEAM_DATA_ID)
// Get details of an incident team 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 "team" in the system
TeamDataID:=os.Getenv("TEAM_DATA_ID")ctx:=datadog.NewDefaultContext(context.Background())configuration:=datadog.NewConfiguration()configuration.SetUnstableOperationEnabled("v2.GetIncidentTeam",true)apiClient:=datadog.NewAPIClient(configuration)api:=datadogV2.NewIncidentTeamsApi(apiClient)resp,r,err:=api.GetIncidentTeam(ctx,TeamDataID,*datadogV2.NewGetIncidentTeamOptionalParameters())iferr!=nil{fmt.Fprintf(os.Stderr,"Error when calling `IncidentTeamsApi.GetIncidentTeam`: %v\n",err)fmt.Fprintf(os.Stderr,"Full HTTP response: %v\n",r)}responseContent,_:=json.MarshalIndent(resp,""," ")fmt.Fprintf(os.Stdout,"Response from `IncidentTeamsApi.GetIncidentTeam`:\n%s\n",responseContent)}
// Get details of an incident team returns "OK" responseimportcom.datadog.api.client.ApiClient;importcom.datadog.api.client.ApiException;importcom.datadog.api.client.v2.api.IncidentTeamsApi;importcom.datadog.api.client.v2.model.IncidentTeamResponse;publicclassExample{publicstaticvoidmain(String[]args){ApiClientdefaultClient=ApiClient.getDefaultApiClient();defaultClient.setUnstableOperationEnabled("v2.getIncidentTeam",true);IncidentTeamsApiapiInstance=newIncidentTeamsApi(defaultClient);// there is a valid "team" in the systemStringTEAM_DATA_ID=System.getenv("TEAM_DATA_ID");try{IncidentTeamResponseresult=apiInstance.getIncidentTeam(TEAM_DATA_ID);System.out.println(result);}catch(ApiExceptione){System.err.println("Exception when calling IncidentTeamsApi#getIncidentTeam");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 team returns "OK" response
usedatadog_api_client::datadog;usedatadog_api_client::datadogV2::api_incident_teams::GetIncidentTeamOptionalParams;usedatadog_api_client::datadogV2::api_incident_teams::IncidentTeamsAPI;#[tokio::main]asyncfnmain(){// there is a valid "team" in the system
letteam_data_id=std::env::var("TEAM_DATA_ID").unwrap();letmutconfiguration=datadog::Configuration::new();configuration.set_unstable_operation_enabled("v2.GetIncidentTeam",true);letapi=IncidentTeamsAPI::with_config(configuration);letresp=api.get_incident_team(team_data_id.clone(),GetIncidentTeamOptionalParams::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 team returns "OK" response
*/import{client,v2}from"@datadog/datadog-api-client";constconfiguration=client.createConfiguration();configuration.unstableOperations["v2.getIncidentTeam"]=true;constapiInstance=newv2.IncidentTeamsApi(configuration);// there is a valid "team" in the system
constTEAM_DATA_ID=process.env.TEAM_DATA_IDasstring;constparams: v2.IncidentTeamsApiGetIncidentTeamRequest={teamId: TEAM_DATA_ID,};apiInstance.getIncidentTeam(params).then((data: v2.IncidentTeamResponse)=>{console.log("API called successfully. Returned data: "+JSON.stringify(data));}).catch((error: any)=>console.error(error));
"""
Delete an existing incident team returns "OK" response
"""fromosimportenvironfromdatadog_api_clientimportApiClient,Configurationfromdatadog_api_client.v2.api.incident_teams_apiimportIncidentTeamsApi# there is a valid "team" in the systemTEAM_DATA_ID=environ["TEAM_DATA_ID"]configuration=Configuration()configuration.unstable_operations["delete_incident_team"]=TruewithApiClient(configuration)asapi_client:api_instance=IncidentTeamsApi(api_client)api_instance.delete_incident_team(team_id=TEAM_DATA_ID,)
# Delete an existing incident team returns "OK" responserequire"datadog_api_client"DatadogAPIClient.configuredo|config|config.unstable_operations["v2.delete_incident_team".to_sym]=trueendapi_instance=DatadogAPIClient::V2::IncidentTeamsAPI.new# there is a valid "team" in the systemTEAM_DATA_ID=ENV["TEAM_DATA_ID"]api_instance.delete_incident_team(TEAM_DATA_ID)
// Delete an existing incident team 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 "team" in the system
TeamDataID:=os.Getenv("TEAM_DATA_ID")ctx:=datadog.NewDefaultContext(context.Background())configuration:=datadog.NewConfiguration()configuration.SetUnstableOperationEnabled("v2.DeleteIncidentTeam",true)apiClient:=datadog.NewAPIClient(configuration)api:=datadogV2.NewIncidentTeamsApi(apiClient)r,err:=api.DeleteIncidentTeam(ctx,TeamDataID)iferr!=nil{fmt.Fprintf(os.Stderr,"Error when calling `IncidentTeamsApi.DeleteIncidentTeam`: %v\n",err)fmt.Fprintf(os.Stderr,"Full HTTP response: %v\n",r)}}
// Delete an existing incident team returns "OK" responseimportcom.datadog.api.client.ApiClient;importcom.datadog.api.client.ApiException;importcom.datadog.api.client.v2.api.IncidentTeamsApi;publicclassExample{publicstaticvoidmain(String[]args){ApiClientdefaultClient=ApiClient.getDefaultApiClient();defaultClient.setUnstableOperationEnabled("v2.deleteIncidentTeam",true);IncidentTeamsApiapiInstance=newIncidentTeamsApi(defaultClient);// there is a valid "team" in the systemStringTEAM_DATA_ID=System.getenv("TEAM_DATA_ID");try{apiInstance.deleteIncidentTeam(TEAM_DATA_ID);}catch(ApiExceptione){System.err.println("Exception when calling IncidentTeamsApi#deleteIncidentTeam");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 team returns "OK" response
usedatadog_api_client::datadog;usedatadog_api_client::datadogV2::api_incident_teams::IncidentTeamsAPI;#[tokio::main]asyncfnmain(){// there is a valid "team" in the system
letteam_data_id=std::env::var("TEAM_DATA_ID").unwrap();letmutconfiguration=datadog::Configuration::new();configuration.set_unstable_operation_enabled("v2.DeleteIncidentTeam",true);letapi=IncidentTeamsAPI::with_config(configuration);letresp=api.delete_incident_team(team_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 team returns "OK" response
*/import{client,v2}from"@datadog/datadog-api-client";constconfiguration=client.createConfiguration();configuration.unstableOperations["v2.deleteIncidentTeam"]=true;constapiInstance=newv2.IncidentTeamsApi(configuration);// there is a valid "team" in the system
constTEAM_DATA_ID=process.env.TEAM_DATA_IDasstring;constparams: v2.IncidentTeamsApiDeleteIncidentTeamRequest={teamId: TEAM_DATA_ID,};apiInstance.deleteIncidentTeam(params).then((data: any)=>{console.log("API called successfully. Returned data: "+JSON.stringify(data));}).catch((error: any)=>console.error(error));
Updates an existing incident team. 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 team 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 "team" in the system
TeamDataID:=os.Getenv("TEAM_DATA_ID")body:=datadogV2.IncidentTeamUpdateRequest{Data:datadogV2.IncidentTeamUpdateData{Type:datadogV2.INCIDENTTEAMTYPE_TEAMS,Attributes:&datadogV2.IncidentTeamUpdateAttributes{Name:"team name-updated",},},}ctx:=datadog.NewDefaultContext(context.Background())configuration:=datadog.NewConfiguration()configuration.SetUnstableOperationEnabled("v2.UpdateIncidentTeam",true)apiClient:=datadog.NewAPIClient(configuration)api:=datadogV2.NewIncidentTeamsApi(apiClient)resp,r,err:=api.UpdateIncidentTeam(ctx,TeamDataID,body)iferr!=nil{fmt.Fprintf(os.Stderr,"Error when calling `IncidentTeamsApi.UpdateIncidentTeam`: %v\n",err)fmt.Fprintf(os.Stderr,"Full HTTP response: %v\n",r)}responseContent,_:=json.MarshalIndent(resp,""," ")fmt.Fprintf(os.Stdout,"Response from `IncidentTeamsApi.UpdateIncidentTeam`:\n%s\n",responseContent)}
// Update an existing incident team returns "OK" responseimportcom.datadog.api.client.ApiClient;importcom.datadog.api.client.ApiException;importcom.datadog.api.client.v2.api.IncidentTeamsApi;importcom.datadog.api.client.v2.model.IncidentTeamResponse;importcom.datadog.api.client.v2.model.IncidentTeamType;importcom.datadog.api.client.v2.model.IncidentTeamUpdateAttributes;importcom.datadog.api.client.v2.model.IncidentTeamUpdateData;importcom.datadog.api.client.v2.model.IncidentTeamUpdateRequest;publicclassExample{publicstaticvoidmain(String[]args){ApiClientdefaultClient=ApiClient.getDefaultApiClient();defaultClient.setUnstableOperationEnabled("v2.updateIncidentTeam",true);IncidentTeamsApiapiInstance=newIncidentTeamsApi(defaultClient);// there is a valid "team" in the systemStringTEAM_DATA_ATTRIBUTES_NAME=System.getenv("TEAM_DATA_ATTRIBUTES_NAME");StringTEAM_DATA_ID=System.getenv("TEAM_DATA_ID");IncidentTeamUpdateRequestbody=newIncidentTeamUpdateRequest().data(newIncidentTeamUpdateData().type(IncidentTeamType.TEAMS).attributes(newIncidentTeamUpdateAttributes().name("team name-updated")));try{IncidentTeamResponseresult=apiInstance.updateIncidentTeam(TEAM_DATA_ID,body);System.out.println(result);}catch(ApiExceptione){System.err.println("Exception when calling IncidentTeamsApi#updateIncidentTeam");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 team returns "OK" response
"""fromosimportenvironfromdatadog_api_clientimportApiClient,Configurationfromdatadog_api_client.v2.api.incident_teams_apiimportIncidentTeamsApifromdatadog_api_client.v2.model.incident_team_typeimportIncidentTeamTypefromdatadog_api_client.v2.model.incident_team_update_attributesimportIncidentTeamUpdateAttributesfromdatadog_api_client.v2.model.incident_team_update_dataimportIncidentTeamUpdateDatafromdatadog_api_client.v2.model.incident_team_update_requestimportIncidentTeamUpdateRequest# there is a valid "team" in the systemTEAM_DATA_ATTRIBUTES_NAME=environ["TEAM_DATA_ATTRIBUTES_NAME"]TEAM_DATA_ID=environ["TEAM_DATA_ID"]body=IncidentTeamUpdateRequest(data=IncidentTeamUpdateData(type=IncidentTeamType.TEAMS,attributes=IncidentTeamUpdateAttributes(name="team name-updated",),),)configuration=Configuration()configuration.unstable_operations["update_incident_team"]=TruewithApiClient(configuration)asapi_client:api_instance=IncidentTeamsApi(api_client)response=api_instance.update_incident_team(team_id=TEAM_DATA_ID,body=body)print(response)
# Update an existing incident team returns "OK" responserequire"datadog_api_client"DatadogAPIClient.configuredo|config|config.unstable_operations["v2.update_incident_team".to_sym]=trueendapi_instance=DatadogAPIClient::V2::IncidentTeamsAPI.new# there is a valid "team" in the systemTEAM_DATA_ATTRIBUTES_NAME=ENV["TEAM_DATA_ATTRIBUTES_NAME"]TEAM_DATA_ID=ENV["TEAM_DATA_ID"]body=DatadogAPIClient::V2::IncidentTeamUpdateRequest.new({data:DatadogAPIClient::V2::IncidentTeamUpdateData.new({type:DatadogAPIClient::V2::IncidentTeamType::TEAMS,attributes:DatadogAPIClient::V2::IncidentTeamUpdateAttributes.new({name:"team name-updated",}),}),})papi_instance.update_incident_team(TEAM_DATA_ID,body)
// Update an existing incident team returns "OK" response
usedatadog_api_client::datadog;usedatadog_api_client::datadogV2::api_incident_teams::IncidentTeamsAPI;usedatadog_api_client::datadogV2::model::IncidentTeamType;usedatadog_api_client::datadogV2::model::IncidentTeamUpdateAttributes;usedatadog_api_client::datadogV2::model::IncidentTeamUpdateData;usedatadog_api_client::datadogV2::model::IncidentTeamUpdateRequest;#[tokio::main]asyncfnmain(){// there is a valid "team" in the system
letteam_data_id=std::env::var("TEAM_DATA_ID").unwrap();letbody=IncidentTeamUpdateRequest::new(IncidentTeamUpdateData::new(IncidentTeamType::TEAMS).attributes(IncidentTeamUpdateAttributes::new("team name-updated".to_string()),),);letmutconfiguration=datadog::Configuration::new();configuration.set_unstable_operation_enabled("v2.UpdateIncidentTeam",true);letapi=IncidentTeamsAPI::with_config(configuration);letresp=api.update_incident_team(team_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 team returns "OK" response
*/import{client,v2}from"@datadog/datadog-api-client";constconfiguration=client.createConfiguration();configuration.unstableOperations["v2.updateIncidentTeam"]=true;constapiInstance=newv2.IncidentTeamsApi(configuration);// there is a valid "team" in the system
constTEAM_DATA_ID=process.env.TEAM_DATA_IDasstring;constparams: v2.IncidentTeamsApiUpdateIncidentTeamRequest={body:{data:{type:"teams",attributes:{name:"team name-updated",},},},teamId: TEAM_DATA_ID,};apiInstance.updateIncidentTeam(params).then((data: v2.IncidentTeamResponse)=>{console.log("API called successfully. Returned data: "+JSON.stringify(data));}).catch((error: any)=>console.error(error));
Get all incident teams 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 teams.
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
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 teams returns "OK" response
"""fromosimportenvironfromdatadog_api_clientimportApiClient,Configurationfromdatadog_api_client.v2.api.incident_teams_apiimportIncidentTeamsApi# there is a valid "team" in the systemTEAM_DATA_ATTRIBUTES_NAME=environ["TEAM_DATA_ATTRIBUTES_NAME"]configuration=Configuration()configuration.unstable_operations["list_incident_teams"]=TruewithApiClient(configuration)asapi_client:api_instance=IncidentTeamsApi(api_client)response=api_instance.list_incident_teams(filter=TEAM_DATA_ATTRIBUTES_NAME,)print(response)
# Get a list of all incident teams returns "OK" responserequire"datadog_api_client"DatadogAPIClient.configuredo|config|config.unstable_operations["v2.list_incident_teams".to_sym]=trueendapi_instance=DatadogAPIClient::V2::IncidentTeamsAPI.new# there is a valid "team" in the systemTEAM_DATA_ATTRIBUTES_NAME=ENV["TEAM_DATA_ATTRIBUTES_NAME"]opts={filter:TEAM_DATA_ATTRIBUTES_NAME,}papi_instance.list_incident_teams(opts)
// Get a list of all incident teams 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 "team" in the system
TeamDataAttributesName:=os.Getenv("TEAM_DATA_ATTRIBUTES_NAME")ctx:=datadog.NewDefaultContext(context.Background())configuration:=datadog.NewConfiguration()configuration.SetUnstableOperationEnabled("v2.ListIncidentTeams",true)apiClient:=datadog.NewAPIClient(configuration)api:=datadogV2.NewIncidentTeamsApi(apiClient)resp,r,err:=api.ListIncidentTeams(ctx,*datadogV2.NewListIncidentTeamsOptionalParameters().WithFilter(TeamDataAttributesName))iferr!=nil{fmt.Fprintf(os.Stderr,"Error when calling `IncidentTeamsApi.ListIncidentTeams`: %v\n",err)fmt.Fprintf(os.Stderr,"Full HTTP response: %v\n",r)}responseContent,_:=json.MarshalIndent(resp,""," ")fmt.Fprintf(os.Stdout,"Response from `IncidentTeamsApi.ListIncidentTeams`:\n%s\n",responseContent)}
// Get a list of all incident teams returns "OK" responseimportcom.datadog.api.client.ApiClient;importcom.datadog.api.client.ApiException;importcom.datadog.api.client.v2.api.IncidentTeamsApi;importcom.datadog.api.client.v2.api.IncidentTeamsApi.ListIncidentTeamsOptionalParameters;importcom.datadog.api.client.v2.model.IncidentTeamsResponse;publicclassExample{publicstaticvoidmain(String[]args){ApiClientdefaultClient=ApiClient.getDefaultApiClient();defaultClient.setUnstableOperationEnabled("v2.listIncidentTeams",true);IncidentTeamsApiapiInstance=newIncidentTeamsApi(defaultClient);// there is a valid "team" in the systemStringTEAM_DATA_ATTRIBUTES_NAME=System.getenv("TEAM_DATA_ATTRIBUTES_NAME");try{IncidentTeamsResponseresult=apiInstance.listIncidentTeams(newListIncidentTeamsOptionalParameters().filter(TEAM_DATA_ATTRIBUTES_NAME));System.out.println(result);}catch(ApiExceptione){System.err.println("Exception when calling IncidentTeamsApi#listIncidentTeams");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 teams returns "OK" response
usedatadog_api_client::datadog;usedatadog_api_client::datadogV2::api_incident_teams::IncidentTeamsAPI;usedatadog_api_client::datadogV2::api_incident_teams::ListIncidentTeamsOptionalParams;#[tokio::main]asyncfnmain(){// there is a valid "team" in the system
letteam_data_attributes_name=std::env::var("TEAM_DATA_ATTRIBUTES_NAME").unwrap();letmutconfiguration=datadog::Configuration::new();configuration.set_unstable_operation_enabled("v2.ListIncidentTeams",true);letapi=IncidentTeamsAPI::with_config(configuration);letresp=api.list_incident_teams(ListIncidentTeamsOptionalParams::default().filter(team_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 teams returns "OK" response
*/import{client,v2}from"@datadog/datadog-api-client";constconfiguration=client.createConfiguration();configuration.unstableOperations["v2.listIncidentTeams"]=true;constapiInstance=newv2.IncidentTeamsApi(configuration);// there is a valid "team" in the system
constTEAM_DATA_ATTRIBUTES_NAME=process.env.TEAM_DATA_ATTRIBUTES_NAMEasstring;constparams: v2.IncidentTeamsApiListIncidentTeamsRequest={filter: TEAM_DATA_ATTRIBUTES_NAME,};apiInstance.listIncidentTeams(params).then((data: v2.IncidentTeamsResponse)=>{console.log("API called successfully. Returned data: "+JSON.stringify(data));}).catch((error: any)=>console.error(error));
// Create a new incident team 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.IncidentTeamCreateRequest{Data:datadogV2.IncidentTeamCreateData{Type:datadogV2.INCIDENTTEAMTYPE_TEAMS,Attributes:&datadogV2.IncidentTeamCreateAttributes{Name:"Example-Incident-Team",},},}ctx:=datadog.NewDefaultContext(context.Background())configuration:=datadog.NewConfiguration()configuration.SetUnstableOperationEnabled("v2.CreateIncidentTeam",true)apiClient:=datadog.NewAPIClient(configuration)api:=datadogV2.NewIncidentTeamsApi(apiClient)resp,r,err:=api.CreateIncidentTeam(ctx,body)iferr!=nil{fmt.Fprintf(os.Stderr,"Error when calling `IncidentTeamsApi.CreateIncidentTeam`: %v\n",err)fmt.Fprintf(os.Stderr,"Full HTTP response: %v\n",r)}responseContent,_:=json.MarshalIndent(resp,""," ")fmt.Fprintf(os.Stdout,"Response from `IncidentTeamsApi.CreateIncidentTeam`:\n%s\n",responseContent)}
// Create a new incident team returns "CREATED" responseimportcom.datadog.api.client.ApiClient;importcom.datadog.api.client.ApiException;importcom.datadog.api.client.v2.api.IncidentTeamsApi;importcom.datadog.api.client.v2.model.IncidentTeamCreateAttributes;importcom.datadog.api.client.v2.model.IncidentTeamCreateData;importcom.datadog.api.client.v2.model.IncidentTeamCreateRequest;importcom.datadog.api.client.v2.model.IncidentTeamResponse;importcom.datadog.api.client.v2.model.IncidentTeamType;publicclassExample{publicstaticvoidmain(String[]args){ApiClientdefaultClient=ApiClient.getDefaultApiClient();defaultClient.setUnstableOperationEnabled("v2.createIncidentTeam",true);IncidentTeamsApiapiInstance=newIncidentTeamsApi(defaultClient);IncidentTeamCreateRequestbody=newIncidentTeamCreateRequest().data(newIncidentTeamCreateData().type(IncidentTeamType.TEAMS).attributes(newIncidentTeamCreateAttributes().name("Example-Incident-Team")));try{IncidentTeamResponseresult=apiInstance.createIncidentTeam(body);System.out.println(result);}catch(ApiExceptione){System.err.println("Exception when calling IncidentTeamsApi#createIncidentTeam");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 team returns "CREATED" response
"""fromdatadog_api_clientimportApiClient,Configurationfromdatadog_api_client.v2.api.incident_teams_apiimportIncidentTeamsApifromdatadog_api_client.v2.model.incident_team_create_attributesimportIncidentTeamCreateAttributesfromdatadog_api_client.v2.model.incident_team_create_dataimportIncidentTeamCreateDatafromdatadog_api_client.v2.model.incident_team_create_requestimportIncidentTeamCreateRequestfromdatadog_api_client.v2.model.incident_team_typeimportIncidentTeamTypebody=IncidentTeamCreateRequest(data=IncidentTeamCreateData(type=IncidentTeamType.TEAMS,attributes=IncidentTeamCreateAttributes(name="Example-Incident-Team",),),)configuration=Configuration()configuration.unstable_operations["create_incident_team"]=TruewithApiClient(configuration)asapi_client:api_instance=IncidentTeamsApi(api_client)response=api_instance.create_incident_team(body=body)print(response)
# Create a new incident team returns "CREATED" responserequire"datadog_api_client"DatadogAPIClient.configuredo|config|config.unstable_operations["v2.create_incident_team".to_sym]=trueendapi_instance=DatadogAPIClient::V2::IncidentTeamsAPI.newbody=DatadogAPIClient::V2::IncidentTeamCreateRequest.new({data:DatadogAPIClient::V2::IncidentTeamCreateData.new({type:DatadogAPIClient::V2::IncidentTeamType::TEAMS,attributes:DatadogAPIClient::V2::IncidentTeamCreateAttributes.new({name:"Example-Incident-Team",}),}),})papi_instance.create_incident_team(body)
// Create a new incident team returns "CREATED" response
usedatadog_api_client::datadog;usedatadog_api_client::datadogV2::api_incident_teams::IncidentTeamsAPI;usedatadog_api_client::datadogV2::model::IncidentTeamCreateAttributes;usedatadog_api_client::datadogV2::model::IncidentTeamCreateData;usedatadog_api_client::datadogV2::model::IncidentTeamCreateRequest;usedatadog_api_client::datadogV2::model::IncidentTeamType;#[tokio::main]asyncfnmain(){letbody=IncidentTeamCreateRequest::new(IncidentTeamCreateData::new(IncidentTeamType::TEAMS).attributes(IncidentTeamCreateAttributes::new("Example-Incident-Team".to_string()),),);letmutconfiguration=datadog::Configuration::new();configuration.set_unstable_operation_enabled("v2.CreateIncidentTeam",true);letapi=IncidentTeamsAPI::with_config(configuration);letresp=api.create_incident_team(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 team returns "CREATED" response
*/import{client,v2}from"@datadog/datadog-api-client";constconfiguration=client.createConfiguration();configuration.unstableOperations["v2.createIncidentTeam"]=true;constapiInstance=newv2.IncidentTeamsApi(configuration);constparams: v2.IncidentTeamsApiCreateIncidentTeamRequest={body:{data:{type:"teams",attributes:{name:"Example-Incident-Team",},},},};apiInstance.createIncidentTeam(params).then((data: v2.IncidentTeamResponse)=>{console.log("API called successfully. Returned data: "+JSON.stringify(data));}).catch((error: any)=>console.error(error));