Skip to content

Commit 99d6eda

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Add Publish and Unpublish API documentation for Status Pages (DataDog#3902)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
1 parent 8ce2654 commit 99d6eda

50 files changed

Lines changed: 668 additions & 264 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.generator/schemas/v2/openapi.yaml

Lines changed: 62 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107213,7 +107213,7 @@ paths:
107213107213
permissions:
107214107214
- status_pages_settings_read
107215107215
post:
107216-
description: Creates a new status page.
107216+
description: "Creates a new status page. **Note**: Publishing a status page on creation via the `enabled` property will be deprecated. Use the dedicated [publish](#publish-status-page) status page endpoint after creation instead."
107217107217
operationId: CreateStatusPage
107218107218
parameters:
107219107219
- description: "Comma-separated list of resources to include. Supported values: created_by_user, last_modified_by_user."
@@ -107428,7 +107428,7 @@ paths:
107428107428
permissions:
107429107429
- status_pages_settings_read
107430107430
patch:
107431-
description: Updates an existing status page's attributes.
107431+
description: "Updates an existing status page's attributes. **Note**: Publishing and unpublishing via the `enabled` property will be deprecated on this endpoint. Use the dedicated [publish](#publish-status-page) and [unpublish](#unpublish-status-page) status page endpoints instead."
107432107432
operationId: UpdateStatusPage
107433107433
parameters:
107434107434
- description: Whether to delete existing subscribers when updating a status page's type.
@@ -108027,6 +108027,66 @@ paths:
108027108027
operator: AND
108028108028
permissions:
108029108029
- status_pages_incident_write
108030+
/api/v2/statuspages/{page_id}/publish:
108031+
post:
108032+
description: Publishes a status page. For pages of type `public`, makes the status page available on the public internet and requires the `status_pages_public_page_publish` permission. For pages of type `internal`, makes the status page available under the `status-pages/$domain_prefix/view` route within the Datadog organization and requires the `status_pages_internal_page_publish` permission. The `status_pages_settings_write` permission is temporarily honored as we migrate publishing functionality from the update status page endpoint to the publish status page endpoint.
108033+
operationId: PublishStatusPage
108034+
parameters:
108035+
- description: The ID of the status page.
108036+
in: path
108037+
name: page_id
108038+
required: true
108039+
schema:
108040+
format: uuid
108041+
type: string
108042+
responses:
108043+
"204":
108044+
description: No Content
108045+
"429":
108046+
$ref: "#/components/responses/TooManyRequestsResponse"
108047+
security:
108048+
- apiKeyAuth: []
108049+
appKeyAuth: []
108050+
- AuthZ: []
108051+
summary: Publish status page
108052+
tags:
108053+
- Status Pages
108054+
x-permission:
108055+
operator: OR
108056+
permissions:
108057+
- status_pages_settings_write
108058+
- status_pages_public_page_publish
108059+
- status_pages_internal_page_publish
108060+
/api/v2/statuspages/{page_id}/unpublish:
108061+
post:
108062+
description: Unpublishes a status page. For pages of type `public`, removes the status page from the public internet and requires the `status_pages_public_page_publish` permission. For pages of type `internal`, removes the `status-pages/$domain_prefix/view` route from the Datadog organization and requires the `status_pages_internal_page_publish` permission. The `status_pages_settings_write` permission is temporarily honored as we migrate unpublishing functionality from the update status page endpoint to the unpublish status page endpoint.
108063+
operationId: UnpublishStatusPage
108064+
parameters:
108065+
- description: The ID of the status page.
108066+
in: path
108067+
name: page_id
108068+
required: true
108069+
schema:
108070+
format: uuid
108071+
type: string
108072+
responses:
108073+
"204":
108074+
description: No Content
108075+
"429":
108076+
$ref: "#/components/responses/TooManyRequestsResponse"
108077+
security:
108078+
- apiKeyAuth: []
108079+
appKeyAuth: []
108080+
- AuthZ: []
108081+
summary: Unpublish status page
108082+
tags:
108083+
- Status Pages
108084+
x-permission:
108085+
operator: OR
108086+
permissions:
108087+
- status_pages_settings_write
108088+
- status_pages_public_page_publish
108089+
- status_pages_internal_page_publish
108030108090
/api/v2/synthetics/api-multistep/subtests/{public_id}:
108031108091
get:
108032108092
description: |-

api/datadogV2/api_status_pages.go

Lines changed: 138 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,7 @@ func (r *CreateStatusPageOptionalParameters) WithInclude(include string) *Create
381381
}
382382

383383
// CreateStatusPage Create status page.
384-
// Creates a new status page.
384+
// Creates a new status page. **Note**: Publishing a status page on creation via the `enabled` property will be deprecated. Use the dedicated [publish](#publish-status-page) status page endpoint after creation instead.
385385
func (a *StatusPagesApi) CreateStatusPage(ctx _context.Context, body CreateStatusPageRequest, o ...CreateStatusPageOptionalParameters) (StatusPage, *_nethttp.Response, error) {
386386
var (
387387
localVarHTTPMethod = _nethttp.MethodPost
@@ -1645,6 +1645,142 @@ func (a *StatusPagesApi) ListStatusPages(ctx _context.Context, o ...ListStatusPa
16451645
return localVarReturnValue, localVarHTTPResponse, nil
16461646
}
16471647

1648+
// PublishStatusPage Publish status page.
1649+
// Publishes a status page. For pages of type `public`, makes the status page available on the public internet and requires the `status_pages_public_page_publish` permission. For pages of type `internal`, makes the status page available under the `status-pages/$domain_prefix/view` route within the Datadog organization and requires the `status_pages_internal_page_publish` permission. The `status_pages_settings_write` permission is temporarily honored as we migrate publishing functionality from the update status page endpoint to the publish status page endpoint.
1650+
func (a *StatusPagesApi) PublishStatusPage(ctx _context.Context, pageId uuid.UUID) (*_nethttp.Response, error) {
1651+
var (
1652+
localVarHTTPMethod = _nethttp.MethodPost
1653+
localVarPostBody interface{}
1654+
)
1655+
1656+
localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.StatusPagesApi.PublishStatusPage")
1657+
if err != nil {
1658+
return nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()}
1659+
}
1660+
1661+
localVarPath := localBasePath + "/api/v2/statuspages/{page_id}/publish"
1662+
localVarPath = datadog.ReplacePathParameter(localVarPath, "{page_id}", _neturl.PathEscape(datadog.ParameterToString(pageId, "")))
1663+
1664+
localVarHeaderParams := make(map[string]string)
1665+
localVarQueryParams := _neturl.Values{}
1666+
localVarFormParams := _neturl.Values{}
1667+
localVarHeaderParams["Accept"] = "*/*"
1668+
1669+
if a.Client.Cfg.DelegatedTokenConfig != nil {
1670+
err = datadog.UseDelegatedTokenAuth(ctx, &localVarHeaderParams, a.Client.Cfg.DelegatedTokenConfig)
1671+
if err != nil {
1672+
return nil, err
1673+
}
1674+
} else {
1675+
datadog.SetAuthKeys(
1676+
ctx,
1677+
&localVarHeaderParams,
1678+
[2]string{"apiKeyAuth", "DD-API-KEY"},
1679+
[2]string{"appKeyAuth", "DD-APPLICATION-KEY"},
1680+
)
1681+
}
1682+
req, err := a.Client.PrepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, nil)
1683+
if err != nil {
1684+
return nil, err
1685+
}
1686+
1687+
localVarHTTPResponse, err := a.Client.CallAPI(req)
1688+
if err != nil || localVarHTTPResponse == nil {
1689+
return localVarHTTPResponse, err
1690+
}
1691+
1692+
localVarBody, err := datadog.ReadBody(localVarHTTPResponse)
1693+
if err != nil {
1694+
return localVarHTTPResponse, err
1695+
}
1696+
1697+
if localVarHTTPResponse.StatusCode >= 300 {
1698+
newErr := datadog.GenericOpenAPIError{
1699+
ErrorBody: localVarBody,
1700+
ErrorMessage: localVarHTTPResponse.Status,
1701+
}
1702+
if localVarHTTPResponse.StatusCode == 429 {
1703+
var v APIErrorResponse
1704+
err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
1705+
if err != nil {
1706+
return localVarHTTPResponse, newErr
1707+
}
1708+
newErr.ErrorModel = v
1709+
}
1710+
return localVarHTTPResponse, newErr
1711+
}
1712+
1713+
return localVarHTTPResponse, nil
1714+
}
1715+
1716+
// UnpublishStatusPage Unpublish status page.
1717+
// Unpublishes a status page. For pages of type `public`, removes the status page from the public internet and requires the `status_pages_public_page_publish` permission. For pages of type `internal`, removes the `status-pages/$domain_prefix/view` route from the Datadog organization and requires the `status_pages_internal_page_publish` permission. The `status_pages_settings_write` permission is temporarily honored as we migrate unpublishing functionality from the update status page endpoint to the unpublish status page endpoint.
1718+
func (a *StatusPagesApi) UnpublishStatusPage(ctx _context.Context, pageId uuid.UUID) (*_nethttp.Response, error) {
1719+
var (
1720+
localVarHTTPMethod = _nethttp.MethodPost
1721+
localVarPostBody interface{}
1722+
)
1723+
1724+
localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.StatusPagesApi.UnpublishStatusPage")
1725+
if err != nil {
1726+
return nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()}
1727+
}
1728+
1729+
localVarPath := localBasePath + "/api/v2/statuspages/{page_id}/unpublish"
1730+
localVarPath = datadog.ReplacePathParameter(localVarPath, "{page_id}", _neturl.PathEscape(datadog.ParameterToString(pageId, "")))
1731+
1732+
localVarHeaderParams := make(map[string]string)
1733+
localVarQueryParams := _neturl.Values{}
1734+
localVarFormParams := _neturl.Values{}
1735+
localVarHeaderParams["Accept"] = "*/*"
1736+
1737+
if a.Client.Cfg.DelegatedTokenConfig != nil {
1738+
err = datadog.UseDelegatedTokenAuth(ctx, &localVarHeaderParams, a.Client.Cfg.DelegatedTokenConfig)
1739+
if err != nil {
1740+
return nil, err
1741+
}
1742+
} else {
1743+
datadog.SetAuthKeys(
1744+
ctx,
1745+
&localVarHeaderParams,
1746+
[2]string{"apiKeyAuth", "DD-API-KEY"},
1747+
[2]string{"appKeyAuth", "DD-APPLICATION-KEY"},
1748+
)
1749+
}
1750+
req, err := a.Client.PrepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, nil)
1751+
if err != nil {
1752+
return nil, err
1753+
}
1754+
1755+
localVarHTTPResponse, err := a.Client.CallAPI(req)
1756+
if err != nil || localVarHTTPResponse == nil {
1757+
return localVarHTTPResponse, err
1758+
}
1759+
1760+
localVarBody, err := datadog.ReadBody(localVarHTTPResponse)
1761+
if err != nil {
1762+
return localVarHTTPResponse, err
1763+
}
1764+
1765+
if localVarHTTPResponse.StatusCode >= 300 {
1766+
newErr := datadog.GenericOpenAPIError{
1767+
ErrorBody: localVarBody,
1768+
ErrorMessage: localVarHTTPResponse.Status,
1769+
}
1770+
if localVarHTTPResponse.StatusCode == 429 {
1771+
var v APIErrorResponse
1772+
err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
1773+
if err != nil {
1774+
return localVarHTTPResponse, newErr
1775+
}
1776+
newErr.ErrorModel = v
1777+
}
1778+
return localVarHTTPResponse, newErr
1779+
}
1780+
1781+
return localVarHTTPResponse, nil
1782+
}
1783+
16481784
// UpdateComponentOptionalParameters holds optional parameters for UpdateComponent.
16491785
type UpdateComponentOptionalParameters struct {
16501786
Include *string
@@ -2020,7 +2156,7 @@ func (r *UpdateStatusPageOptionalParameters) WithInclude(include string) *Update
20202156
}
20212157

20222158
// UpdateStatusPage Update status page.
2023-
// Updates an existing status page's attributes.
2159+
// Updates an existing status page's attributes. **Note**: Publishing and unpublishing via the `enabled` property will be deprecated on this endpoint. Use the dedicated [publish](#publish-status-page) and [unpublish](#unpublish-status-page) status page endpoints instead.
20242160
func (a *StatusPagesApi) UpdateStatusPage(ctx _context.Context, pageId uuid.UUID, body PatchStatusPageRequest, o ...UpdateStatusPageOptionalParameters) (StatusPage, *_nethttp.Response, error) {
20252161
var (
20262162
localVarHTTPMethod = _nethttp.MethodPatch

api/datadogV2/doc.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -838,6 +838,8 @@
838838
// - [StatusPagesApi.ListDegradations]
839839
// - [StatusPagesApi.ListMaintenances]
840840
// - [StatusPagesApi.ListStatusPages]
841+
// - [StatusPagesApi.PublishStatusPage]
842+
// - [StatusPagesApi.UnpublishStatusPage]
841843
// - [StatusPagesApi.UpdateComponent]
842844
// - [StatusPagesApi.UpdateDegradation]
843845
// - [StatusPagesApi.UpdateMaintenance]
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
// Publish status page returns "No Content" response
2+
3+
package main
4+
5+
import (
6+
"context"
7+
"fmt"
8+
"os"
9+
10+
"github.com/DataDog/datadog-api-client-go/v2/api/datadog"
11+
"github.com/DataDog/datadog-api-client-go/v2/api/datadogV2"
12+
"github.com/google/uuid"
13+
)
14+
15+
func main() {
16+
// there is a valid "unpublished_status_page" in the system
17+
UnpublishedStatusPageDataID := uuid.MustParse(os.Getenv("UNPUBLISHED_STATUS_PAGE_DATA_ID"))
18+
19+
ctx := datadog.NewDefaultContext(context.Background())
20+
configuration := datadog.NewConfiguration()
21+
apiClient := datadog.NewAPIClient(configuration)
22+
api := datadogV2.NewStatusPagesApi(apiClient)
23+
r, err := api.PublishStatusPage(ctx, UnpublishedStatusPageDataID)
24+
25+
if err != nil {
26+
fmt.Fprintf(os.Stderr, "Error when calling `StatusPagesApi.PublishStatusPage`: %v\n", err)
27+
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
28+
}
29+
}
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
// Unpublish status page returns "No Content" response
2+
3+
package main
4+
5+
import (
6+
"context"
7+
"fmt"
8+
"os"
9+
10+
"github.com/DataDog/datadog-api-client-go/v2/api/datadog"
11+
"github.com/DataDog/datadog-api-client-go/v2/api/datadogV2"
12+
"github.com/google/uuid"
13+
)
14+
15+
func main() {
16+
// there is a valid "status_page" in the system
17+
StatusPageDataID := uuid.MustParse(os.Getenv("STATUS_PAGE_DATA_ID"))
18+
19+
ctx := datadog.NewDefaultContext(context.Background())
20+
configuration := datadog.NewConfiguration()
21+
apiClient := datadog.NewAPIClient(configuration)
22+
api := datadogV2.NewStatusPagesApi(apiClient)
23+
r, err := api.UnpublishStatusPage(ctx, StatusPageDataID)
24+
25+
if err != nil {
26+
fmt.Fprintf(os.Stderr, "Error when calling `StatusPagesApi.UnpublishStatusPage`: %v\n", err)
27+
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
28+
}
29+
}
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2026-02-24T17:00:35.997Z
1+
2026-03-31T18:43:45.443Z

tests/scenarios/cassettes/TestScenarios/v2/Feature_Status_Pages/Scenario_Create_component_returns_Created_response.yaml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
interactions:
22
- request:
33
body: |
4-
{"data":{"attributes":{"components":[{"components":[{"name":"Login","position":0,"type":"component"},{"name":"Settings","position":1,"type":"component"}],"name":"Application","type":"group"}],"domain_prefix":"df531f11f71a2e23","enabled":true,"name":"A Status Page","type":"internal","visualization_type":"bars_and_uptime_percentage"},"type":"status_pages"}}
4+
{"data":{"attributes":{"components":[{"components":[{"name":"Login","position":0,"type":"component"},{"name":"Settings","position":1,"type":"component"}],"name":"Application","type":"group"}],"domain_prefix":"9dbd15ff66733c82","enabled":true,"name":"A Status Page","type":"internal","visualization_type":"bars_and_uptime_percentage"},"type":"status_pages"}}
55
form: {}
66
headers:
77
Accept:
@@ -12,8 +12,8 @@ interactions:
1212
method: POST
1313
url: https://api.datadoghq.com/api/v2/statuspages
1414
response:
15-
body: '{"data":{"id":"3483924e-54de-4b7f-9177-56f224f8c6e6","type":"status_pages","attributes":{"company_logo":null,"components":[{"id":"d03bffa2-720c-4f82-871e-3f1599d38089","name":"Application","type":"group","position":0,"components":[{"id":"6fe382cb-5309-49bf-b56b-c9921a7d8153","name":"Login","type":"component","status":"operational","position":0},{"id":"b8a9ac5d-2470-4c43-b90d-817ba996822c","name":"Settings","type":"component","status":"operational","position":1}]}],"created_at":"2026-02-24T17:00:36.165599Z","custom_domain":null,"custom_domain_enabled":false,"domain_prefix":"df531f11f71a2e23","email_header_image":null,"enabled":true,"favicon":null,"modified_at":"2026-02-24T17:00:36.165599Z","name":"A
16-
Status Page","page_url":"https://frog.datadoghq.com/status-pages/3483924e-54de-4b7f-9177-56f224f8c6e6/view","subscriptions_enabled":false,"type":"internal","visualization_type":"bars_and_uptime_percentage"},"relationships":{"created_by_user":{"data":{"id":"3ad549bf-eba0-11e9-a77a-0705486660d0","type":"users"}},"last_modified_by_user":{"data":{"id":"3ad549bf-eba0-11e9-a77a-0705486660d0","type":"users"}}}}}'
15+
body: '{"data":{"id":"daae96b1-2114-4979-8668-2f782fe4a82b","type":"status_pages","attributes":{"company_logo":null,"components":[{"id":"0827c72a-5886-4850-b9a0-3c0b62fd5cbd","name":"Application","type":"group","position":0,"components":[{"id":"2944ac68-cc1f-43bc-9950-a81912daf613","name":"Login","type":"component","status":"operational","position":0},{"id":"7374a8e5-7d66-43be-83f0-4337a739bdfb","name":"Settings","type":"component","status":"operational","position":1}]}],"created_at":"2026-03-31T18:43:45.548049Z","custom_domain":null,"custom_domain_enabled":false,"domain_prefix":"9dbd15ff66733c82","email_header_image":null,"enabled":true,"favicon":null,"modified_at":"2026-03-31T18:43:45.548049Z","name":"A
16+
Status Page","page_url":"https://frog.datadoghq.com/status-pages/daae96b1-2114-4979-8668-2f782fe4a82b/view","subscriptions_enabled":false,"type":"internal","visualization_type":"bars_and_uptime_percentage"},"relationships":{"created_by_user":{"data":{"id":"3ad549bf-eba0-11e9-a77a-0705486660d0","type":"users"}},"last_modified_by_user":{"data":{"id":"3ad549bf-eba0-11e9-a77a-0705486660d0","type":"users"}}}}}'
1717
code: 201
1818
duration: 0ms
1919
headers:
@@ -31,9 +31,9 @@ interactions:
3131
- application/json
3232
id: 1
3333
method: POST
34-
url: https://api.datadoghq.com/api/v2/statuspages/3483924e-54de-4b7f-9177-56f224f8c6e6/components
34+
url: https://api.datadoghq.com/api/v2/statuspages/daae96b1-2114-4979-8668-2f782fe4a82b/components
3535
response:
36-
body: '{"data":{"id":"060dba63-7f63-4d0f-9278-aecabc6f9c30","type":"components","attributes":{"created_at":"2026-02-24T17:00:36.79986Z","modified_at":"2026-02-24T17:00:36.79986Z","name":"Logs","position":0,"status":"operational","type":"component"},"relationships":{"created_by_user":{"data":{"id":"3ad549bf-eba0-11e9-a77a-0705486660d0","type":"users"}},"group":{"data":null},"last_modified_by_user":{"data":{"id":"3ad549bf-eba0-11e9-a77a-0705486660d0","type":"users"}},"status_page":{"data":{"id":"3483924e-54de-4b7f-9177-56f224f8c6e6","type":"status_pages"}}}}}'
36+
body: '{"data":{"id":"dc1f6182-86a0-4f18-a4de-78f99ff1455f","type":"components","attributes":{"created_at":"2026-03-31T18:43:46.083871Z","modified_at":"2026-03-31T18:43:46.083871Z","name":"Logs","position":0,"status":"operational","type":"component"},"relationships":{"created_by_user":{"data":{"id":"3ad549bf-eba0-11e9-a77a-0705486660d0","type":"users"}},"group":{"data":null},"last_modified_by_user":{"data":{"id":"3ad549bf-eba0-11e9-a77a-0705486660d0","type":"users"}},"status_page":{"data":{"id":"daae96b1-2114-4979-8668-2f782fe4a82b","type":"status_pages"}}}}}'
3737
code: 201
3838
duration: 0ms
3939
headers:
@@ -48,7 +48,7 @@ interactions:
4848
- '*/*'
4949
id: 2
5050
method: DELETE
51-
url: https://api.datadoghq.com/api/v2/statuspages/3483924e-54de-4b7f-9177-56f224f8c6e6/components/060dba63-7f63-4d0f-9278-aecabc6f9c30
51+
url: https://api.datadoghq.com/api/v2/statuspages/daae96b1-2114-4979-8668-2f782fe4a82b/components/dc1f6182-86a0-4f18-a4de-78f99ff1455f
5252
response:
5353
body: ''
5454
code: 204
@@ -63,7 +63,7 @@ interactions:
6363
- '*/*'
6464
id: 3
6565
method: DELETE
66-
url: https://api.datadoghq.com/api/v2/statuspages/3483924e-54de-4b7f-9177-56f224f8c6e6
66+
url: https://api.datadoghq.com/api/v2/statuspages/daae96b1-2114-4979-8668-2f782fe4a82b
6767
response:
6868
body: ''
6969
code: 204
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2026-02-24T17:00:37.682Z
1+
2026-03-31T18:43:46.834Z

0 commit comments

Comments
 (0)