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
21 changes: 21 additions & 0 deletions examples/v2/on-call-paging/RerouteOnCallPage.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Reroute On-Call Page returns "No Content." response

require "datadog_api_client"
DatadogAPIClient.configure do |config|
config.access_token = ENV["DD_BEARER_TOKEN"]
end
api_instance = DatadogAPIClient::V2::OnCallPagingAPI.new

body = DatadogAPIClient::V2::RerouteOnCallPageRequest.new({
data: DatadogAPIClient::V2::RerouteOnCallPageRequestData.new({
attributes: DatadogAPIClient::V2::RerouteOnCallPageRequestDataAttributes.new({
comment: "Rerouting to the database team.",
target: DatadogAPIClient::V2::CreatePageRequestDataAttributesTarget.new({
identifier: "my-team",
type: DatadogAPIClient::V2::OnCallPageTargetType::TEAM_HANDLE,
}),
}),
type: DatadogAPIClient::V2::RerouteOnCallPageRequestDataType::REROUTE,
}),
})
api_instance.reroute_on_call_page("15e74b8b-f865-48d0-bcc5-453323ed2c8f", body)
4 changes: 4 additions & 0 deletions features/scenarios_model_mapping.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5495,6 +5495,10 @@
"v2.EscalateOnCallPage" => {
"page_id" => "UUID",
},
"v2.RerouteOnCallPage" => {
"page_id" => "UUID",
"body" => "RerouteOnCallPageRequest",
},
"v2.ResolveOnCallPage" => {
"page_id" => "UUID",
},
Expand Down
16 changes: 16 additions & 0 deletions features/v2/on-call_paging.feature
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,22 @@ Feature: On-Call Paging
When the request is sent
Then the response status is 202 Accepted.

@generated @skip @team:ddoghq/on-call
Scenario: Reroute On-Call Page returns "Bad Request" response
Given new "RerouteOnCallPage" request
And request contains "page_id" parameter from "REPLACE.ME"
And body with value {"data": {"attributes": {"comment": "Rerouting to the database team.", "target": {"identifier": "my-team", "type": "team_handle"}}, "type": "reroute"}}
When the request is sent
Then the response status is 400 Bad Request

@generated @skip @team:ddoghq/on-call
Scenario: Reroute On-Call Page returns "No Content." response
Given new "RerouteOnCallPage" request
And request contains "page_id" parameter from "REPLACE.ME"
And body with value {"data": {"attributes": {"comment": "Rerouting to the database team.", "target": {"identifier": "my-team", "type": "team_handle"}}, "type": "reroute"}}
When the request is sent
Then the response status is 204 No Content.

@generated @skip @team:ddoghq/on-call
Scenario: Resolve On-Call Page returns "Accepted." response
Given new "ResolveOnCallPage" request
Expand Down
6 changes: 6 additions & 0 deletions features/v2/undo.json
Original file line number Diff line number Diff line change
Expand Up @@ -6801,6 +6801,12 @@
"type": "unsafe"
}
},
"RerouteOnCallPage": {
"tag": "On-Call Paging",
"undo": {
"type": "idempotent"
}
},
"ResolveOnCallPage": {
"tag": "On-Call Paging",
"undo": {
Expand Down
71 changes: 71 additions & 0 deletions lib/datadog_api_client/configuration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1533,6 +1533,77 @@ def operation_server_settings
}
}
],
"v2.reroute_on_call_page": [
{
url: +"https://{site}",
description: "No description provided",
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}",
description: "No description provided",
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}",
description: "No description provided",
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"
]
}
}
}
],
"v2.resolve_on_call_page": [
{
url: +"https://{site}",
Expand Down
4 changes: 4 additions & 0 deletions lib/datadog_api_client/inflector.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7254,6 +7254,10 @@ def overrides
"v2.report_schedule_toggle_request_attributes" => "ReportScheduleToggleRequestAttributes",
"v2.report_schedule_toggle_request_data" => "ReportScheduleToggleRequestData",
"v2.report_schedule_type" => "ReportScheduleType",
"v2.reroute_on_call_page_request" => "RerouteOnCallPageRequest",
"v2.reroute_on_call_page_request_data" => "RerouteOnCallPageRequestData",
"v2.reroute_on_call_page_request_data_attributes" => "RerouteOnCallPageRequestDataAttributes",
"v2.reroute_on_call_page_request_data_type" => "RerouteOnCallPageRequestDataType",
"v2.resolve_vulnerable_symbols_request" => "ResolveVulnerableSymbolsRequest",
"v2.resolve_vulnerable_symbols_request_data" => "ResolveVulnerableSymbolsRequestData",
"v2.resolve_vulnerable_symbols_request_data_attributes" => "ResolveVulnerableSymbolsRequestDataAttributes",
Expand Down
Loading
Loading