Skip to content

Add spec for team on-call endpoint #690

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .apigentools-info
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
"spec_versions": {
"v1": {
"apigentools_version": "1.6.6",
"regenerated": "2025-06-04 10:47:54.214856",
"spec_repo_commit": "1f58e760"
"regenerated": "2025-06-04 12:51:39.592781",
"spec_repo_commit": "35a63137"
},
"v2": {
"apigentools_version": "1.6.6",
"regenerated": "2025-06-04 10:47:54.231413",
"spec_repo_commit": "1f58e760"
"regenerated": "2025-06-04 12:51:39.609704",
"spec_repo_commit": "35a63137"
}
}
}
249 changes: 249 additions & 0 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13844,6 +13844,19 @@ components:
- retryStrategy
- fallbackStepName
type: object
Escalation:
description: Represents an escalation policy step.
properties:
id:
description: Unique identifier of the escalation step.
type: string
relationships:
$ref: '#/components/schemas/EscalationRelationships'
type:
$ref: '#/components/schemas/EscalationType'
required:
- type
type: object
EscalationPolicy:
description: Represents a complete escalation policy response, including policy
data and optionally included related resources.
Expand Down Expand Up @@ -14353,6 +14366,46 @@ components:
type: string
x-enum-varnames:
- USERS
EscalationRelationships:
description: Contains the relationships of an escalation object, including its
responders.
properties:
responders:
$ref: '#/components/schemas/EscalationRelationshipsResponders'
type: object
EscalationRelationshipsResponders:
description: Lists the users involved in a specific step of the escalation policy.
properties:
data:
description: Array of user references assigned as responders for this escalation
step.
items:
$ref: '#/components/schemas/EscalationRelationshipsRespondersDataItems'
type: array
type: object
EscalationRelationshipsRespondersDataItems:
description: Represents a user assigned to an escalation step.
properties:
id:
description: Unique identifier of the user assigned to the escalation step.
example: ''
type: string
type:
$ref: '#/components/schemas/EscalationRelationshipsRespondersDataItemsType'
required:
- type
- id
type: object
EscalationRelationshipsRespondersDataItemsType:
default: users
description: Represents the resource type for users assigned as responders in
an escalation step.
enum:
- users
example: users
type: string
x-enum-varnames:
- USERS
EscalationTarget:
description: Represents an escalation target, which can be a team, user, or
schedule.
Expand All @@ -14369,6 +14422,16 @@ components:
$ref: '#/components/schemas/EscalationTarget'
type: array
type: object
EscalationType:
default: escalation_policy_steps
description: Represents the resource type for individual steps in an escalation
policy used during incident response.
enum:
- escalation_policy_steps
example: escalation_policy_steps
type: string
x-enum-varnames:
- ESCALATION_POLICY_STEPS
Event:
description: The metadata associated with a request.
properties:
Expand Down Expand Up @@ -37980,6 +38043,150 @@ components:
$ref: '#/components/schemas/TeamLink'
type: array
type: object
TeamOnCallResponders:
description: Root object representing a team's on-call responder configuration.
example:
data:
id: 111ee23r-aaaaa-aaaa-aaww-1234wertsd23
relationships:
escalations:
data:
- id: 111ee23r-aaaaa-aaaa-aaww-1234wertsd23
type: escalation_policy_steps
responders:
data:
- id: 111ee23r-aaaaa-aaaa-aaww-1234wertsd23
type: users
type: team_oncall_responders
included:
- attributes:
email: [email protected]
name: Test User
status: active
id: 111ee23r-aaaaa-aaaa-aaww-1234wertsd23
type: users
- id: 111ee23r-aaaaa-aaaa-aaww-1234wertsd23
relationships:
responders:
data:
- id: 111ee23r-aaaaa-aaaa-aaww-1234wertsd23
type: users
type: escalation_policy_steps
properties:
data:
$ref: '#/components/schemas/TeamOnCallRespondersData'
included:
description: The `TeamOnCallResponders` `included`.
items:
$ref: '#/components/schemas/TeamOnCallRespondersIncluded'
type: array
type: object
TeamOnCallRespondersData:
description: Defines the main on-call responder object for a team, including
relationships and metadata.
properties:
id:
description: Unique identifier of the on-call responder configuration.
type: string
relationships:
$ref: '#/components/schemas/TeamOnCallRespondersDataRelationships'
type:
$ref: '#/components/schemas/TeamOnCallRespondersDataType'
required:
- type
type: object
TeamOnCallRespondersDataRelationships:
description: Relationship objects linked to a team's on-call responder configuration,
including escalations and responders.
properties:
escalations:
$ref: '#/components/schemas/TeamOnCallRespondersDataRelationshipsEscalations'
responders:
$ref: '#/components/schemas/TeamOnCallRespondersDataRelationshipsResponders'
type: object
TeamOnCallRespondersDataRelationshipsEscalations:
description: Defines the escalation policy steps linked to the team's on-call
configuration.
properties:
data:
description: Array of escalation step references.
items:
$ref: '#/components/schemas/TeamOnCallRespondersDataRelationshipsEscalationsDataItems'
type: array
type: object
TeamOnCallRespondersDataRelationshipsEscalationsDataItems:
description: Represents a link to a specific escalation policy step associated
with the on-call team.
properties:
id:
description: Unique identifier of the escalation step.
example: ''
type: string
type:
$ref: '#/components/schemas/TeamOnCallRespondersDataRelationshipsEscalationsDataItemsType'
required:
- type
- id
type: object
TeamOnCallRespondersDataRelationshipsEscalationsDataItemsType:
default: escalation_policy_steps
description: Identifies the resource type for escalation policy steps linked
to a team's on-call configuration.
enum:
- escalation_policy_steps
example: escalation_policy_steps
type: string
x-enum-varnames:
- ESCALATION_POLICY_STEPS
TeamOnCallRespondersDataRelationshipsResponders:
description: Defines the list of users assigned as on-call responders for the
team.
properties:
data:
description: Array of user references associated as responders.
items:
$ref: '#/components/schemas/TeamOnCallRespondersDataRelationshipsRespondersDataItems'
type: array
type: object
TeamOnCallRespondersDataRelationshipsRespondersDataItems:
description: Represents a user responder associated with the on-call team.
properties:
id:
description: Unique identifier of the responder.
example: ''
type: string
type:
$ref: '#/components/schemas/TeamOnCallRespondersDataRelationshipsRespondersDataItemsType'
required:
- type
- id
type: object
TeamOnCallRespondersDataRelationshipsRespondersDataItemsType:
default: users
description: Identifies the resource type for individual user entities associated
with on-call response.
enum:
- users
example: users
type: string
x-enum-varnames:
- USERS
TeamOnCallRespondersDataType:
default: team_oncall_responders
description: Represents the resource type for a group of users assigned to handle
on-call duties within a team.
enum:
- team_oncall_responders
example: team_oncall_responders
type: string
x-enum-varnames:
- TEAM_ONCALL_RESPONDERS
TeamOnCallRespondersIncluded:
description: Represents an union of related resources included in the response,
such as users and escalation steps.
oneOf:
- $ref: '#/components/schemas/User'
- $ref: '#/components/schemas/Escalation'
TeamPermissionSetting:
description: Team permission setting
properties:
Expand Down Expand Up @@ -52562,6 +52769,48 @@ paths:
summary: Get the schedule on-call user
tags:
- On-Call
/api/v2/on-call/teams/{team_id}/on-call:
get:
description: Get a team's on-call users at a given time
operationId: GetTeamOnCallUsers
parameters:
- description: 'Comma-separated list of included relationships to be returned.
Allowed values: `responders`, `escalations`, `escalations.responders`.'
in: query
name: include
schema:
type: string
- description: The team ID
in: path
name: team_id
required: true
schema:
example: 27590dae-47be-4a7d-9abf-8f4e45124020
type: string
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/TeamOnCallResponders'
description: OK
'400':
$ref: '#/components/responses/BadRequestResponse'
'401':
$ref: '#/components/responses/UnauthorizedResponse'
'403':
$ref: '#/components/responses/ForbiddenResponse'
'404':
$ref: '#/components/responses/NotFoundResponse'
'429':
$ref: '#/components/responses/TooManyRequestsResponse'
security:
- apiKeyAuth: []
appKeyAuth: []
- AuthZ: []
summary: Get team on-call users
tags:
- On-Call
/api/v2/on-call/teams/{team_id}/routing-rules:
get:
description: Get a team's On-Call routing rules
Expand Down
24 changes: 24 additions & 0 deletions examples/v2_on-call_GetTeamOnCallUsers.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
// Get team on-call users returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_on_call::GetTeamOnCallUsersOptionalParams;
use datadog_api_client::datadogV2::api_on_call::OnCallAPI;

#[tokio::main]
async fn main() {
// there are valid "routing_rules" in the system
let routing_rules_data_id = std::env::var("ROUTING_RULES_DATA_ID").unwrap();
let configuration = datadog::Configuration::new();
let api = OnCallAPI::with_config(configuration);
let resp = api
.get_team_on_call_users(
routing_rules_data_id.clone(),
GetTeamOnCallUsersOptionalParams::default()
.include("responders,escalations.responders".to_string()),
)
.await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}
Loading
Loading