Represents a complete escalation policy response, including policy data and optionally included related resources.
Expand All
항목
유형
설명
data
object
Represents the data for a single escalation policy, including its attributes, ID, relationships, and resource type.
attributes
object
Defines the main attributes of an escalation policy, such as its name and behavior on policy end.
name [required]
string
Specifies the name of the escalation policy.
resolve_page_on_policy_end
boolean
Indicates whether the page is automatically resolved when the policy ends.
retries
int64
Specifies how many times the escalation sequence is retried if there is no response.
id
string
Specifies the unique identifier of the escalation policy.
relationships
object
Represents the relationships for an escalation policy, including references to steps and teams.
steps [required]
object
Defines the relationship to a collection of steps within an escalation policy. Contains an array of step data references.
data
[object]
An array of references to the steps defined in this escalation policy.
id [required]
string
Specifies the unique identifier for the step resource.
type [required]
enum
Indicates that the resource is of type steps.
Allowed enum values: steps
default: steps
teams
object
Associates teams with this schedule in a data structure.
data
[object]
An array of team references for this schedule.
id [required]
string
The unique identifier of the team in this relationship.
type [required]
enum
Teams resource type.
Allowed enum values: teams
default: teams
type [required]
enum
Indicates that the resource is of type policies.
Allowed enum values: policies
default: policies
included
[ <oneOf>]
Provides any included related resources, such as steps or targets, returned with the policy.
<type=steps>
object
Represents a single step in an escalation policy, including its attributes, relationships, and resource type.
attributes
object
Defines attributes for an escalation policy step, such as assignment strategy and escalation timeout.
assignment
enum
Specifies how this escalation step will assign targets (example default or round-robin).
Allowed enum values: default,round-robin
escalate_after_seconds
int64
Specifies how many seconds to wait before escalating to the next step.
id
string
Specifies the unique identifier of this escalation policy step.
relationships
object
Represents the relationship of an escalation policy step to its targets.
targets
object
A list of escalation targets for a step
data
[ <oneOf>]
The EscalationTargetsdata.
<type=teams>
object
Represents a team target for an escalation policy step, including the team's ID and resource type.
id [required]
string
Specifies the unique identifier of the team resource.
type [required]
enum
Indicates that the resource is of type teams.
Allowed enum values: teams
default: teams
<type=users>
object
Represents a user target for an escalation policy step, including the user's ID and resource type.
id [required]
string
Specifies the unique identifier of the user resource.
type [required]
enum
Indicates that the resource is of type users.
Allowed enum values: users
default: users
<type=schedules>
object
Represents a schedule target for an escalation policy step, including its ID and resource type. This is a shortcut for a configured schedule target with position set to 'current'.
id [required]
string
Specifies the unique identifier of the schedule resource.
type [required]
enum
Indicates that the resource is of type schedules.
Allowed enum values: schedules
default: schedules
<type=schedule_target>
object
Relationship reference to a configured schedule target.
id [required]
string
Specifies the unique identifier of the configured schedule target.
type [required]
enum
Indicates that the resource is of type schedule_target.
Allowed enum values: schedule_target
default: schedule_target
type [required]
enum
Indicates that the resource is of type steps.
Allowed enum values: steps
default: steps
<type=users>
object
Represents a user object in the context of an escalation policy, including their id, type, and basic attributes.
attributes
object
Provides basic user information for an escalation policy, including a name and email address.
email
string
The user's email address.
name
string
The user's name.
status
enum
The user's status.
Allowed enum values: active,deactivated,pending
id
string
The unique user identifier.
type [required]
enum
Users resource type.
Allowed enum values: users
default: users
<type=schedules>
object
Represents the primary data object for a schedule, linking attributes and relationships.
attributes
object
Provides core properties of a schedule object such as its name and time zone.
name
string
A short name for the schedule.
tags
[string]
A list of tags associated with the schedule.
time_zone
string
The time zone in which this schedule operates.
id
string
The schedule's unique identifier.
relationships
object
Groups the relationships for a schedule object, referencing layers and teams.
layers
object
Associates layers with this schedule in a data structure.
data
[object]
An array of layer references for this schedule.
id [required]
string
The unique identifier of the layer in this relationship.
type [required]
enum
Layers resource type.
Allowed enum values: layers
default: layers
teams
object
Associates teams with this schedule in a data structure.
data
[object]
An array of team references for this schedule.
id [required]
string
The unique identifier of the team in this relationship.
Full resource representation of a configured schedule target with position (previous, current, or next).
attributes [required]
object
Attributes for a configured schedule target, including position.
position [required]
enum
Specifies the position of a schedule target (example previous, current, or next).
Allowed enum values: previous,current,next
id [required]
string
Specifies the unique identifier of the configured schedule target.
relationships [required]
object
Represents the relationships of a configured schedule target.
schedule [required]
object
Holds the schedule reference for a configured schedule target.
data [required]
object
Represents a schedule target for an escalation policy step, including its ID and resource type. This is a shortcut for a configured schedule target with position set to 'current'.
id [required]
string
Specifies the unique identifier of the schedule resource.
type [required]
enum
Indicates that the resource is of type schedules.
Allowed enum values: schedules
default: schedules
type [required]
enum
Indicates that the resource is of type schedule_target.
Allowed enum values: schedule_target
default: schedule_target
<type=teams>
object
Provides a reference to a team, including ID, type, and basic attributes/relationships.
attributes
object
Encapsulates the basic attributes of a Team reference, such as name, handle, and an optional avatar or description.
avatar
string
URL or reference for the team's avatar (if available).
// Update On-Call escalation policy returns "OK" responsepackagemainimport("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 "escalation_policy" in the systemEscalationPolicyDataID:=os.Getenv("ESCALATION_POLICY_DATA_ID")EscalationPolicyDataRelationshipsStepsData0ID:=os.Getenv("ESCALATION_POLICY_DATA_RELATIONSHIPS_STEPS_DATA_0_ID")// there is a valid "user" in the systemUserDataID:=os.Getenv("USER_DATA_ID")// there is a valid "dd_team" in the systemDdTeamDataID:=os.Getenv("DD_TEAM_DATA_ID")body:=datadogV2.EscalationPolicyUpdateRequest{Data:datadogV2.EscalationPolicyUpdateRequestData{Attributes:datadogV2.EscalationPolicyUpdateRequestDataAttributes{Name:"Example-On-Call-updated",ResolvePageOnPolicyEnd:datadog.PtrBool(false),Retries:datadog.PtrInt64(0),Steps:[]datadogV2.EscalationPolicyUpdateRequestDataAttributesStepsItems{{Assignment:datadogV2.ESCALATIONPOLICYSTEPATTRIBUTESASSIGNMENT_DEFAULT.Ptr(),EscalateAfterSeconds:datadog.PtrInt64(3600),Id:datadog.PtrString(EscalationPolicyDataRelationshipsStepsData0ID),Targets:[]datadogV2.EscalationPolicyStepTarget{{Id:datadog.PtrString(UserDataID),Type:datadogV2.ESCALATIONPOLICYSTEPTARGETTYPE_USERS.Ptr(),},},},},},Id:EscalationPolicyDataID,Relationships:&datadogV2.EscalationPolicyUpdateRequestDataRelationships{Teams:&datadogV2.DataRelationshipsTeams{Data:[]datadogV2.DataRelationshipsTeamsDataItems{{Id:DdTeamDataID,Type:datadogV2.DATARELATIONSHIPSTEAMSDATAITEMSTYPE_TEAMS,},},},},Type:datadogV2.ESCALATIONPOLICYUPDATEREQUESTDATATYPE_POLICIES,},}ctx:=datadog.NewDefaultContext(context.Background())configuration:=datadog.NewConfiguration()apiClient:=datadog.NewAPIClient(configuration)api:=datadogV2.NewOnCallApi(apiClient)resp,r,err:=api.UpdateOnCallEscalationPolicy(ctx,EscalationPolicyDataID,body,*datadogV2.NewUpdateOnCallEscalationPolicyOptionalParameters())iferr!=nil{fmt.Fprintf(os.Stderr,"Error when calling `OnCallApi.UpdateOnCallEscalationPolicy`: %v\n",err)fmt.Fprintf(os.Stderr,"Full HTTP response: %v\n",r)}responseContent,_:=json.MarshalIndent(resp,""," ")fmt.Fprintf(os.Stdout,"Response from `OnCallApi.UpdateOnCallEscalationPolicy`:\n%s\n",responseContent)}
// Update On-Call escalation policy returns "OK" responseimportcom.datadog.api.client.ApiClient;importcom.datadog.api.client.ApiException;importcom.datadog.api.client.v2.api.OnCallApi;importcom.datadog.api.client.v2.model.DataRelationshipsTeams;importcom.datadog.api.client.v2.model.DataRelationshipsTeamsDataItems;importcom.datadog.api.client.v2.model.DataRelationshipsTeamsDataItemsType;importcom.datadog.api.client.v2.model.EscalationPolicy;importcom.datadog.api.client.v2.model.EscalationPolicyStepAttributesAssignment;importcom.datadog.api.client.v2.model.EscalationPolicyStepTarget;importcom.datadog.api.client.v2.model.EscalationPolicyStepTargetType;importcom.datadog.api.client.v2.model.EscalationPolicyUpdateRequest;importcom.datadog.api.client.v2.model.EscalationPolicyUpdateRequestData;importcom.datadog.api.client.v2.model.EscalationPolicyUpdateRequestDataAttributes;importcom.datadog.api.client.v2.model.EscalationPolicyUpdateRequestDataAttributesStepsItems;importcom.datadog.api.client.v2.model.EscalationPolicyUpdateRequestDataRelationships;importcom.datadog.api.client.v2.model.EscalationPolicyUpdateRequestDataType;importjava.util.Collections;publicclassExample{publicstaticvoidmain(String[]args){ApiClientdefaultClient=ApiClient.getDefaultApiClient();OnCallApiapiInstance=newOnCallApi(defaultClient);// there is a valid "escalation_policy" in the systemStringESCALATION_POLICY_DATA_ID=System.getenv("ESCALATION_POLICY_DATA_ID");StringESCALATION_POLICY_DATA_RELATIONSHIPS_STEPS_DATA_0_ID=System.getenv("ESCALATION_POLICY_DATA_RELATIONSHIPS_STEPS_DATA_0_ID");// there is a valid "user" in the systemStringUSER_DATA_ID=System.getenv("USER_DATA_ID");// there is a valid "dd_team" in the systemStringDD_TEAM_DATA_ID=System.getenv("DD_TEAM_DATA_ID");EscalationPolicyUpdateRequestbody=newEscalationPolicyUpdateRequest().data(newEscalationPolicyUpdateRequestData().attributes(newEscalationPolicyUpdateRequestDataAttributes().name("Example-On-Call-updated").resolvePageOnPolicyEnd(false).retries(0L).steps(Collections.singletonList(newEscalationPolicyUpdateRequestDataAttributesStepsItems().assignment(EscalationPolicyStepAttributesAssignment.DEFAULT).escalateAfterSeconds(3600L).id(ESCALATION_POLICY_DATA_RELATIONSHIPS_STEPS_DATA_0_ID).targets(Collections.singletonList(newEscalationPolicyStepTarget().id(USER_DATA_ID).type(EscalationPolicyStepTargetType.USERS)))))).id(ESCALATION_POLICY_DATA_ID).relationships(newEscalationPolicyUpdateRequestDataRelationships().teams(newDataRelationshipsTeams().data(Collections.singletonList(newDataRelationshipsTeamsDataItems().id(DD_TEAM_DATA_ID).type(DataRelationshipsTeamsDataItemsType.TEAMS))))).type(EscalationPolicyUpdateRequestDataType.POLICIES));try{EscalationPolicyresult=apiInstance.updateOnCallEscalationPolicy(ESCALATION_POLICY_DATA_ID,body);System.out.println(result);}catch(ApiExceptione){System.err.println("Exception when calling OnCallApi#updateOnCallEscalationPolicy");System.err.println("Status code: "+e.getCode());System.err.println("Reason: "+e.getResponseBody());System.err.println("Response headers: "+e.getResponseHeaders());e.printStackTrace();}}}
"""
Update On-Call escalation policy returns "OK" response
"""fromosimportenvironfromdatadog_api_clientimportApiClient,Configurationfromdatadog_api_client.v2.api.on_call_apiimportOnCallApifromdatadog_api_client.v2.model.data_relationships_teamsimportDataRelationshipsTeamsfromdatadog_api_client.v2.model.data_relationships_teams_data_itemsimportDataRelationshipsTeamsDataItemsfromdatadog_api_client.v2.model.data_relationships_teams_data_items_typeimportDataRelationshipsTeamsDataItemsTypefromdatadog_api_client.v2.model.escalation_policy_step_attributes_assignmentimport(EscalationPolicyStepAttributesAssignment,)fromdatadog_api_client.v2.model.escalation_policy_step_targetimportEscalationPolicyStepTargetfromdatadog_api_client.v2.model.escalation_policy_step_target_typeimportEscalationPolicyStepTargetTypefromdatadog_api_client.v2.model.escalation_policy_update_requestimportEscalationPolicyUpdateRequestfromdatadog_api_client.v2.model.escalation_policy_update_request_dataimportEscalationPolicyUpdateRequestDatafromdatadog_api_client.v2.model.escalation_policy_update_request_data_attributesimport(EscalationPolicyUpdateRequestDataAttributes,)fromdatadog_api_client.v2.model.escalation_policy_update_request_data_attributes_steps_itemsimport(EscalationPolicyUpdateRequestDataAttributesStepsItems,)fromdatadog_api_client.v2.model.escalation_policy_update_request_data_relationshipsimport(EscalationPolicyUpdateRequestDataRelationships,)fromdatadog_api_client.v2.model.escalation_policy_update_request_data_typeimportEscalationPolicyUpdateRequestDataType# there is a valid "escalation_policy" in the systemESCALATION_POLICY_DATA_ID=environ["ESCALATION_POLICY_DATA_ID"]ESCALATION_POLICY_DATA_RELATIONSHIPS_STEPS_DATA_0_ID=environ["ESCALATION_POLICY_DATA_RELATIONSHIPS_STEPS_DATA_0_ID"]# there is a valid "user" in the systemUSER_DATA_ID=environ["USER_DATA_ID"]# there is a valid "dd_team" in the systemDD_TEAM_DATA_ID=environ["DD_TEAM_DATA_ID"]body=EscalationPolicyUpdateRequest(data=EscalationPolicyUpdateRequestData(attributes=EscalationPolicyUpdateRequestDataAttributes(name="Example-On-Call-updated",resolve_page_on_policy_end=False,retries=0,steps=[EscalationPolicyUpdateRequestDataAttributesStepsItems(assignment=EscalationPolicyStepAttributesAssignment.DEFAULT,escalate_after_seconds=3600,id=ESCALATION_POLICY_DATA_RELATIONSHIPS_STEPS_DATA_0_ID,targets=[EscalationPolicyStepTarget(id=USER_DATA_ID,type=EscalationPolicyStepTargetType.USERS,),],),],),id=ESCALATION_POLICY_DATA_ID,relationships=EscalationPolicyUpdateRequestDataRelationships(teams=DataRelationshipsTeams(data=[DataRelationshipsTeamsDataItems(id=DD_TEAM_DATA_ID,type=DataRelationshipsTeamsDataItemsType.TEAMS,),],),),type=EscalationPolicyUpdateRequestDataType.POLICIES,),)configuration=Configuration()withApiClient(configuration)asapi_client:api_instance=OnCallApi(api_client)response=api_instance.update_on_call_escalation_policy(policy_id=ESCALATION_POLICY_DATA_ID,body=body)print(response)
# Update On-Call escalation policy returns "OK" responserequire"datadog_api_client"api_instance=DatadogAPIClient::V2::OnCallAPI.new# there is a valid "escalation_policy" in the systemESCALATION_POLICY_DATA_ID=ENV["ESCALATION_POLICY_DATA_ID"]ESCALATION_POLICY_DATA_RELATIONSHIPS_STEPS_DATA_0_ID=ENV["ESCALATION_POLICY_DATA_RELATIONSHIPS_STEPS_DATA_0_ID"]# there is a valid "user" in the systemUSER_DATA_ID=ENV["USER_DATA_ID"]# there is a valid "dd_team" in the systemDD_TEAM_DATA_ID=ENV["DD_TEAM_DATA_ID"]body=DatadogAPIClient::V2::EscalationPolicyUpdateRequest.new({data:DatadogAPIClient::V2::EscalationPolicyUpdateRequestData.new({attributes:DatadogAPIClient::V2::EscalationPolicyUpdateRequestDataAttributes.new({name:"Example-On-Call-updated",resolve_page_on_policy_end:false,retries:0,steps:[DatadogAPIClient::V2::EscalationPolicyUpdateRequestDataAttributesStepsItems.new({assignment:DatadogAPIClient::V2::EscalationPolicyStepAttributesAssignment::DEFAULT,escalate_after_seconds:3600,id:ESCALATION_POLICY_DATA_RELATIONSHIPS_STEPS_DATA_0_ID,targets:[DatadogAPIClient::V2::EscalationPolicyStepTarget.new({id:USER_DATA_ID,type:DatadogAPIClient::V2::EscalationPolicyStepTargetType::USERS,}),],}),],}),id:ESCALATION_POLICY_DATA_ID,relationships:DatadogAPIClient::V2::EscalationPolicyUpdateRequestDataRelationships.new({teams:DatadogAPIClient::V2::DataRelationshipsTeams.new({data:[DatadogAPIClient::V2::DataRelationshipsTeamsDataItems.new({id:DD_TEAM_DATA_ID,type:DatadogAPIClient::V2::DataRelationshipsTeamsDataItemsType::TEAMS,}),],}),}),type:DatadogAPIClient::V2::EscalationPolicyUpdateRequestDataType::POLICIES,}),})papi_instance.update_on_call_escalation_policy(ESCALATION_POLICY_DATA_ID,body)
// Update On-Call escalation policy returns "OK" response
usedatadog_api_client::datadog;usedatadog_api_client::datadogV2::api_on_call::OnCallAPI;usedatadog_api_client::datadogV2::api_on_call::UpdateOnCallEscalationPolicyOptionalParams;usedatadog_api_client::datadogV2::model::DataRelationshipsTeams;usedatadog_api_client::datadogV2::model::DataRelationshipsTeamsDataItems;usedatadog_api_client::datadogV2::model::DataRelationshipsTeamsDataItemsType;usedatadog_api_client::datadogV2::model::EscalationPolicyStepAttributesAssignment;usedatadog_api_client::datadogV2::model::EscalationPolicyStepTarget;usedatadog_api_client::datadogV2::model::EscalationPolicyStepTargetType;usedatadog_api_client::datadogV2::model::EscalationPolicyUpdateRequest;usedatadog_api_client::datadogV2::model::EscalationPolicyUpdateRequestData;usedatadog_api_client::datadogV2::model::EscalationPolicyUpdateRequestDataAttributes;usedatadog_api_client::datadogV2::model::EscalationPolicyUpdateRequestDataAttributesStepsItems;usedatadog_api_client::datadogV2::model::EscalationPolicyUpdateRequestDataRelationships;usedatadog_api_client::datadogV2::model::EscalationPolicyUpdateRequestDataType;#[tokio::main]asyncfnmain(){// there is a valid "escalation_policy" in the system
letescalation_policy_data_id=std::env::var("ESCALATION_POLICY_DATA_ID").unwrap();letescalation_policy_data_relationships_steps_data_0_id=std::env::var("ESCALATION_POLICY_DATA_RELATIONSHIPS_STEPS_DATA_0_ID").unwrap();// there is a valid "user" in the system
letuser_data_id=std::env::var("USER_DATA_ID").unwrap();// there is a valid "dd_team" in the system
letdd_team_data_id=std::env::var("DD_TEAM_DATA_ID").unwrap();letbody=EscalationPolicyUpdateRequest::new(EscalationPolicyUpdateRequestData::new(EscalationPolicyUpdateRequestDataAttributes::new("Example-On-Call-updated".to_string(),vec![EscalationPolicyUpdateRequestDataAttributesStepsItems::new(vec![EscalationPolicyStepTarget::new().id(user_data_id.clone()).type_(EscalationPolicyStepTargetType::USERS),]).assignment(EscalationPolicyStepAttributesAssignment::DEFAULT).escalate_after_seconds(3600).id(escalation_policy_data_relationships_steps_data_0_id.clone()),],).resolve_page_on_policy_end(false).retries(0),escalation_policy_data_id.clone(),EscalationPolicyUpdateRequestDataType::POLICIES,).relationships(EscalationPolicyUpdateRequestDataRelationships::new().teams(DataRelationshipsTeams::new().data(vec![DataRelationshipsTeamsDataItems::new(dd_team_data_id.clone(),DataRelationshipsTeamsDataItemsType::TEAMS,)]),)),);letconfiguration=datadog::Configuration::new();letapi=OnCallAPI::with_config(configuration);letresp=api.update_on_call_escalation_policy(escalation_policy_data_id.clone(),body,UpdateOnCallEscalationPolicyOptionalParams::default(),).await;ifletOk(value)=resp{println!("{:#?}",value);}else{println!("{:#?}",resp.unwrap_err());}}
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comuk1.datadoghq.comddog-gov.comus2.ddog-gov.com"DD_API_KEY="<DD_API_KEY>"DD_APP_KEY="<DD_APP_KEY>"cargo run
/**
* Update On-Call escalation policy returns "OK" response
*/import{client,v2}from"@datadog/datadog-api-client";constconfiguration=client.createConfiguration();constapiInstance=newv2.OnCallApi(configuration);// there is a valid "escalation_policy" in the system
constESCALATION_POLICY_DATA_ID=process.env.ESCALATION_POLICY_DATA_IDasstring;constESCALATION_POLICY_DATA_RELATIONSHIPS_STEPS_DATA_0_ID=process.env.ESCALATION_POLICY_DATA_RELATIONSHIPS_STEPS_DATA_0_IDasstring;// there is a valid "user" in the system
constUSER_DATA_ID=process.env.USER_DATA_IDasstring;// there is a valid "dd_team" in the system
constDD_TEAM_DATA_ID=process.env.DD_TEAM_DATA_IDasstring;constparams: v2.OnCallApiUpdateOnCallEscalationPolicyRequest={body:{data:{attributes:{name:"Example-On-Call-updated",resolvePageOnPolicyEnd: false,retries: 0,steps:[{assignment:"default",escalateAfterSeconds: 3600,id: ESCALATION_POLICY_DATA_RELATIONSHIPS_STEPS_DATA_0_ID,targets:[{id: USER_DATA_ID,type:"users",},],},],},id: ESCALATION_POLICY_DATA_ID,relationships:{teams:{data:[{id: DD_TEAM_DATA_ID,type:"teams",},],},},type:"policies",},},policyId: ESCALATION_POLICY_DATA_ID,};apiInstance.updateOnCallEscalationPolicy(params).then((data: v2.EscalationPolicy)=>{console.log("API called successfully. Returned data: "+JSON.stringify(data));}).catch((error: any)=>console.error(error));