Skip to content
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
184 changes: 184 additions & 0 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -105453,6 +105453,54 @@ components:
type: string
x-enum-varnames:
- SCHEDULE
RerouteOnCallPageRequest:
description: Full request to reroute an On-Call Page to a different team or user.
example:
data:
attributes:
comment: Rerouting to the database team.
target:
identifier: my-team
type: team_handle
type: reroute
properties:
data:
$ref: "#/components/schemas/RerouteOnCallPageRequestData"
required:
- data
type: object
RerouteOnCallPageRequestData:
description: The data for rerouting an On-Call Page, including attributes and resource type.
properties:
attributes:
$ref: "#/components/schemas/RerouteOnCallPageRequestDataAttributes"
type:
$ref: "#/components/schemas/RerouteOnCallPageRequestDataType"
required:
- attributes
- type
type: object
RerouteOnCallPageRequestDataAttributes:
description: Details about where to reroute the On-Call Page.
properties:
comment:
description: An optional comment explaining why the page is being rerouted.
example: Rerouting to the database team.
type: string
target:
$ref: "#/components/schemas/CreatePageRequestDataAttributesTarget"
required:
- target
type: object
RerouteOnCallPageRequestDataType:
default: reroute
description: The type of resource used when rerouting an On-Call Page.
enum:
- reroute
example: reroute
type: string
x-enum-varnames:
- REROUTE
ResolveVulnerableSymbolsRequest:
description: The top-level request object for resolving vulnerable symbols in a set of packages.
properties:
Expand Down Expand Up @@ -208728,6 +208776,142 @@ paths:
summary: Escalate On-Call Page
tags:
- On-Call Paging
/api/v2/on-call/pages/{page_id}/reroute:
post:
description: |-
Reroutes an On-Call Page.
operationId: RerouteOnCallPage
parameters:
- description: The page ID.
in: path
name: page_id
required: true
schema:
example: 15e74b8b-f865-48d0-bcc5-453323ed2c8f
format: uuid
type: string
requestBody:
content:
application/json:
examples:
default:
value:
data:
attributes:
comment: Rerouting to the database team.
target:
identifier: my-team
type: team_handle
type: reroute
schema:
$ref: "#/components/schemas/RerouteOnCallPageRequest"
required: true
responses:
"204":
description: No Content.
"400":
content:
application/json:
schema:
$ref: "#/components/schemas/JSONAPIErrorResponse"
description: Bad Request
"401":
content:
application/json:
schema:
$ref: "#/components/schemas/JSONAPIErrorResponse"
description: Unauthorized
"403":
content:
application/json:
schema:
$ref: "#/components/schemas/JSONAPIErrorResponse"
description: Forbidden
"429":
$ref: "#/components/responses/TooManyRequestsResponse"
security:
- apiKeyAuth: []
appKeyAuth: []
- AuthZ: []
servers:
- url: https://{site}
variables:
site:
default: navy.oncall.datadoghq.com
description: The globally available endpoint for On-Call.
enum:
- lava.oncall.datadoghq.com
- saffron.oncall.datadoghq.com
- navy.oncall.datadoghq.com
- coral.oncall.datadoghq.com
- teal.oncall.datadoghq.com
- beige.oncall.datadoghq.eu
- scarlet.oncall.datadoghq.com
x-enum-varnames:
- LAVA
- SAFFRON
- NAVY
- CORAL
- TEAL
- BEIGE
- SCARLET
- url: "{protocol}://{name}"
variables:
name:
default: navy.oncall.datadoghq.com
description: The full DNS name of the On-Call paging endpoint.
enum:
- lava.oncall.datadoghq.com
- saffron.oncall.datadoghq.com
- navy.oncall.datadoghq.com
- coral.oncall.datadoghq.com
- teal.oncall.datadoghq.com
- beige.oncall.datadoghq.eu
- scarlet.oncall.datadoghq.com
x-enum-varnames:
- LAVA
- SAFFRON
- NAVY
- CORAL
- TEAL
- BEIGE
- SCARLET
protocol:
default: https
description: The protocol for accessing the API.
- url: https://{subdomain}.{site}
variables:
site:
default: datadoghq.com
description: The Datadog site where the On-Call paging endpoint is deployed.
enum:
- datadoghq.com
- datadoghq.eu
x-enum-varnames:
- DATADOGHQ_COM
- DATADOGHQ_EU
subdomain:
default: navy.oncall
description: The On-Call paging subdomain.
enum:
- lava.oncall
- saffron.oncall
- navy.oncall
- coral.oncall
- teal.oncall
- beige.oncall
- scarlet.oncall
x-enum-varnames:
- LAVA
- SAFFRON
- NAVY
- CORAL
- TEAL
- BEIGE
- SCARLET
summary: Reroute On-Call Page
tags:
- On-Call Paging
/api/v2/on-call/pages/{page_id}/resolve:
post:
description: |-
Expand Down
35 changes: 35 additions & 0 deletions examples/v2/on-call-paging/RerouteOnCallPage.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
"""
Reroute On-Call Page returns "No Content." response
"""

from os import environ
from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.on_call_paging_api import OnCallPagingApi
from datadog_api_client.v2.model.create_page_request_data_attributes_target import CreatePageRequestDataAttributesTarget
from datadog_api_client.v2.model.on_call_page_target_type import OnCallPageTargetType
from datadog_api_client.v2.model.reroute_on_call_page_request import RerouteOnCallPageRequest
from datadog_api_client.v2.model.reroute_on_call_page_request_data import RerouteOnCallPageRequestData
from datadog_api_client.v2.model.reroute_on_call_page_request_data_attributes import (
RerouteOnCallPageRequestDataAttributes,
)
from datadog_api_client.v2.model.reroute_on_call_page_request_data_type import RerouteOnCallPageRequestDataType
from uuid import UUID

body = RerouteOnCallPageRequest(
data=RerouteOnCallPageRequestData(
attributes=RerouteOnCallPageRequestDataAttributes(
comment="Rerouting to the database team.",
target=CreatePageRequestDataAttributesTarget(
identifier="my-team",
type=OnCallPageTargetType.TEAM_HANDLE,
),
),
type=RerouteOnCallPageRequestDataType.REROUTE,
),
)

configuration = Configuration()
configuration.access_token = environ["DD_BEARER_TOKEN"]
with ApiClient(configuration) as api_client:
api_instance = OnCallPagingApi(api_client)
api_instance.reroute_on_call_page(page_id=UUID("15e74b8b-f865-48d0-bcc5-453323ed2c8f"), body=body)
116 changes: 116 additions & 0 deletions src/datadog_api_client/v2/api/on_call_paging_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
)
from datadog_api_client.v2.model.create_page_response import CreatePageResponse
from datadog_api_client.v2.model.create_page_request import CreatePageRequest
from datadog_api_client.v2.model.reroute_on_call_page_request import RerouteOnCallPageRequest


class OnCallPagingApi:
Expand Down Expand Up @@ -295,6 +296,100 @@ def __init__(self, api_client=None):
api_client=api_client,
)

self._reroute_on_call_page_endpoint = _Endpoint(
settings={
"response_type": None,
"auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"],
"endpoint_path": "/api/v2/on-call/pages/{page_id}/reroute",
"operation_id": "reroute_on_call_page",
"http_method": "POST",
"version": "v2",
"servers": [
{
"url": "https://{site}",
"variables": {
"site": {
"description": "The globally available endpoint for On-Call.",
"default_value": "navy.oncall.datadoghq.com",
"enum_values": [
"lava.oncall.datadoghq.com",
"saffron.oncall.datadoghq.com",
"navy.oncall.datadoghq.com",
"coral.oncall.datadoghq.com",
"teal.oncall.datadoghq.com",
"beige.oncall.datadoghq.eu",
"scarlet.oncall.datadoghq.com",
],
},
},
},
{
"url": "{protocol}://{name}",
"variables": {
"name": {
"description": "The full DNS name of the On-Call paging endpoint.",
"default_value": "navy.oncall.datadoghq.com",
"enum_values": [
"lava.oncall.datadoghq.com",
"saffron.oncall.datadoghq.com",
"navy.oncall.datadoghq.com",
"coral.oncall.datadoghq.com",
"teal.oncall.datadoghq.com",
"beige.oncall.datadoghq.eu",
"scarlet.oncall.datadoghq.com",
],
},
"protocol": {
"description": "The protocol for accessing the API.",
"default_value": "https",
},
},
},
{
"url": "https://{subdomain}.{site}",
"variables": {
"site": {
"description": "The Datadog site where the On-Call paging endpoint is deployed.",
"default_value": "datadoghq.com",
"enum_values": [
"datadoghq.com",
"datadoghq.eu",
],
},
"subdomain": {
"description": "The On-Call paging subdomain.",
"default_value": "navy.oncall",
"enum_values": [
"lava.oncall",
"saffron.oncall",
"navy.oncall",
"coral.oncall",
"teal.oncall",
"beige.oncall",
"scarlet.oncall",
],
},
},
},
],
},
params_map={
"page_id": {
"required": True,
"openapi_types": (UUID,),
"attribute": "page_id",
"location": "path",
},
"body": {
"required": True,
"openapi_types": (RerouteOnCallPageRequest,),
"location": "body",
},
},
headers_map={"accept": ["*/*"], "content_type": ["application/json"]},
api_client=api_client,
)

self._resolve_on_call_page_endpoint = _Endpoint(
settings={
"response_type": None,
Expand Down Expand Up @@ -436,6 +531,27 @@ def escalate_on_call_page(

return self._escalate_on_call_page_endpoint.call_with_http_info(**kwargs)

def reroute_on_call_page(
self,
page_id: UUID,
body: RerouteOnCallPageRequest,
) -> None:
"""Reroute On-Call Page.

Reroutes an On-Call Page.

:param page_id: The page ID.
:type page_id: UUID
:type body: RerouteOnCallPageRequest
:rtype: None
"""
kwargs: Dict[str, Any] = {}
kwargs["page_id"] = page_id

kwargs["body"] = body

return self._reroute_on_call_page_endpoint.call_with_http_info(**kwargs)

def resolve_on_call_page(
self,
page_id: UUID,
Expand Down
Loading
Loading