Skip to content
Open
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
10 changes: 9 additions & 1 deletion .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -72918,9 +72918,13 @@ paths:
- apiKeyAuth: []
appKeyAuth: []
- AuthZ: []
summary: Get the schedule on-call user
summary: Get the scheduled on-call user
tags:
- On-Call
x-permission:
operator: AND
permissions:
- on_call_read
/api/v2/on-call/teams/{team_id}/on-call:
get:
description: Get a team's on-call users at a given time
Expand Down Expand Up @@ -72963,6 +72967,10 @@ paths:
summary: Get team on-call users
tags:
- On-Call
x-permission:
operator: AND
permissions:
- on_call_read
/api/v2/on-call/teams/{team_id}/routing-rules:
get:
description: Get a team's On-Call routing rules
Expand Down
8 changes: 2 additions & 6 deletions examples/v2/on-call/GetScheduleOnCallUser.py
Original file line number Diff line number Diff line change
@@ -1,19 +1,15 @@
"""
Get the schedule on-call user returns "OK" response
Get the scheduled on-call user returns "OK" response
"""

from os import environ
from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.on_call_api import OnCallApi

# there is a valid "schedule" in the system
SCHEDULE_DATA_ID = environ["SCHEDULE_DATA_ID"]

configuration = Configuration()
with ApiClient(configuration) as api_client:
api_instance = OnCallApi(api_client)
response = api_instance.get_schedule_on_call_user(
schedule_id=SCHEDULE_DATA_ID,
schedule_id="3653d3c6-0c75-11ea-ad28-fb5701eabc7d",
)

print(response)
19 changes: 19 additions & 0 deletions examples/v2/on-call/GetScheduleOnCallUser_3672445524.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
"""
Get the schedule on-call user returns "OK" response
"""

from os import environ
from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.on_call_api import OnCallApi

# there is a valid "schedule" in the system
SCHEDULE_DATA_ID = environ["SCHEDULE_DATA_ID"]

configuration = Configuration()
with ApiClient(configuration) as api_client:
api_instance = OnCallApi(api_client)
response = api_instance.get_schedule_on_call_user(
schedule_id=SCHEDULE_DATA_ID,
)

print(response)
2 changes: 1 addition & 1 deletion src/datadog_api_client/v2/api/on_call_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -527,7 +527,7 @@ def get_schedule_on_call_user(
include: Union[str, UnsetType] = unset,
filter_at_ts: Union[str, UnsetType] = unset,
) -> Shift:
"""Get the schedule on-call user.
"""Get the scheduled on-call user.

Retrieves the user who is on-call for the specified schedule at a given time.

Expand Down
21 changes: 14 additions & 7 deletions tests/v2/features/on-call.feature
Original file line number Diff line number Diff line change
Expand Up @@ -153,26 +153,33 @@ Feature: On-Call
When the request is sent
Then the response status is 200 OK

@team:DataDog/on-call
Scenario: Get the schedule on-call user returns "OK" response
Given new "GetScheduleOnCallUser" request
And there is a valid "user" in the system
And there is a valid "schedule" in the system
And request contains "schedule_id" parameter from "schedule.data.id"
When the request is sent
Then the response status is 200 OK

@generated @skip @team:DataDog/on-call
Scenario: Get the schedule on-call user returns "Bad Request" response
Scenario: Get the scheduled on-call user returns "Bad Request" response
Given new "GetScheduleOnCallUser" request
And request contains "schedule_id" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 400 Bad Request

@generated @skip @team:DataDog/on-call
Scenario: Get the schedule on-call user returns "Not Found" response
Scenario: Get the scheduled on-call user returns "Not Found" response
Given new "GetScheduleOnCallUser" request
And request contains "schedule_id" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 404 Not Found

@team:DataDog/on-call
Scenario: Get the schedule on-call user returns "OK" response
@generated @skip @team:DataDog/on-call
Scenario: Get the scheduled on-call user returns "OK" response
Given new "GetScheduleOnCallUser" request
And there is a valid "user" in the system
And there is a valid "schedule" in the system
And request contains "schedule_id" parameter from "schedule.data.id"
And request contains "schedule_id" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 200 OK

Expand Down
Loading