Manage your status pages and communicate service disruptions to stakeholders via Datadog’s API. See the Status Pages documentation for more information.
Creates a new status page. Note: Publishing a status page on creation via the enabled property will be deprecated. Use the dedicated publish status page endpoint after creation instead.
This endpoint requires the status_pages_settings_write permission.
引数
クエリ文字列
名前
種類
説明
include
string
Comma-separated list of resources to include. Supported values: created_by_user, last_modified_by_user.
The supported attributes for creating a status page.
company_logo
string
The base64-encoded image data displayed on the status page.
components
[object]
The components displayed on the status page.
components
[object]
If creating a component of type group, the components to create within the group.
id
uuid
The ID of the grouped component.
name
string
The name of the grouped component.
position
int64
The zero-indexed position of the grouped component. Relative to the other components in the group.
status
enum
The status of the component.
Allowed enum values: operational,degraded,partial_outage,major_outage,maintenance
type
enum
The type of the component.
Allowed enum values: component
id
uuid
The ID of the component.
name
string
The name of the component.
position
int64
The zero-indexed position of the component.
status
enum
The status of the component.
Allowed enum values: operational,degraded,partial_outage,major_outage,maintenance
type
enum
The type of the component.
Allowed enum values: component,group
domain_prefix [required]
string
The subdomain of the status page's url taking the form https://{domain_prefix}.statuspage.datadoghq.com. Globally unique across Datadog Status Pages.
email_header_image
string
Base64-encoded image data included in email notifications sent to status page subscribers.
enabled [required]
boolean
Whether the status page is enabled.
favicon
string
Base64-encoded image data displayed in the browser tab.
name [required]
string
The name of the status page.
subscriptions_enabled
boolean
Whether users can subscribe to the status page.
type [required]
enum
The type of the status page controlling how the status page is accessed.
Allowed enum values: public,internal
visualization_type [required]
enum
The visualization type of the status page.
Allowed enum values: bars_and_uptime_percentage,bars_only,component_name_only
type [required]
enum
Status pages resource type.
Allowed enum values: status_pages
default: status_pages
{"data":{"attributes":{"name":"A Status Page","domain_prefix":"5e2fd69be33e79aa","components":[{"name":"Login","type":"component","position":0},{"name":"Settings","type":"component","position":1}],"enabled":true,"type":"internal","visualization_type":"bars_and_uptime_percentage"},"type":"status_pages"}}
// Create status page returns "Created" responsepackagemainimport("context""encoding/json""fmt""os""github.com/DataDog/datadog-api-client-go/v2/api/datadog""github.com/DataDog/datadog-api-client-go/v2/api/datadogV2")funcmain(){body:=datadogV2.CreateStatusPageRequest{Data:&datadogV2.CreateStatusPageRequestData{Attributes:datadogV2.CreateStatusPageRequestDataAttributes{Name:"A Status Page",DomainPrefix:"5e2fd69be33e79aa",Components:[]datadogV2.CreateStatusPageRequestDataAttributesComponentsItems{{Name:datadog.PtrString("Login"),Type:datadogV2.CREATECOMPONENTREQUESTDATAATTRIBUTESTYPE_COMPONENT.Ptr(),Position:datadog.PtrInt64(0),},{Name:datadog.PtrString("Settings"),Type:datadogV2.CREATECOMPONENTREQUESTDATAATTRIBUTESTYPE_COMPONENT.Ptr(),Position:datadog.PtrInt64(1),},},Enabled:true,Type:datadogV2.CREATESTATUSPAGEREQUESTDATAATTRIBUTESTYPE_INTERNAL,VisualizationType:datadogV2.CREATESTATUSPAGEREQUESTDATAATTRIBUTESVISUALIZATIONTYPE_BARS_AND_UPTIME_PERCENTAGE,},Type:datadogV2.STATUSPAGEDATATYPE_STATUS_PAGES,},}ctx:=datadog.NewDefaultContext(context.Background())configuration:=datadog.NewConfiguration()apiClient:=datadog.NewAPIClient(configuration)api:=datadogV2.NewStatusPagesApi(apiClient)resp,r,err:=api.CreateStatusPage(ctx,body,*datadogV2.NewCreateStatusPageOptionalParameters())iferr!=nil{fmt.Fprintf(os.Stderr,"Error when calling `StatusPagesApi.CreateStatusPage`: %v\n",err)fmt.Fprintf(os.Stderr,"Full HTTP response: %v\n",r)}responseContent,_:=json.MarshalIndent(resp,""," ")fmt.Fprintf(os.Stdout,"Response from `StatusPagesApi.CreateStatusPage`:\n%s\n",responseContent)}
"""
Create status page returns "Created" response
"""fromdatadog_api_clientimportApiClient,Configurationfromdatadog_api_client.v2.api.status_pages_apiimportStatusPagesApifromdatadog_api_client.v2.model.create_component_request_data_attributes_typeimport(CreateComponentRequestDataAttributesType,)fromdatadog_api_client.v2.model.create_status_page_requestimportCreateStatusPageRequestfromdatadog_api_client.v2.model.create_status_page_request_dataimportCreateStatusPageRequestDatafromdatadog_api_client.v2.model.create_status_page_request_data_attributesimportCreateStatusPageRequestDataAttributesfromdatadog_api_client.v2.model.create_status_page_request_data_attributes_components_itemsimport(CreateStatusPageRequestDataAttributesComponentsItems,)fromdatadog_api_client.v2.model.create_status_page_request_data_attributes_typeimport(CreateStatusPageRequestDataAttributesType,)fromdatadog_api_client.v2.model.create_status_page_request_data_attributes_visualization_typeimport(CreateStatusPageRequestDataAttributesVisualizationType,)fromdatadog_api_client.v2.model.status_page_data_typeimportStatusPageDataTypebody=CreateStatusPageRequest(data=CreateStatusPageRequestData(attributes=CreateStatusPageRequestDataAttributes(name="A Status Page",domain_prefix="5e2fd69be33e79aa",components=[CreateStatusPageRequestDataAttributesComponentsItems(name="Login",type=CreateComponentRequestDataAttributesType.COMPONENT,position=0,),CreateStatusPageRequestDataAttributesComponentsItems(name="Settings",type=CreateComponentRequestDataAttributesType.COMPONENT,position=1,),],enabled=True,type=CreateStatusPageRequestDataAttributesType.INTERNAL,visualization_type=CreateStatusPageRequestDataAttributesVisualizationType.BARS_AND_UPTIME_PERCENTAGE,),type=StatusPageDataType.STATUS_PAGES,),)configuration=Configuration()withApiClient(configuration)asapi_client:api_instance=StatusPagesApi(api_client)response=api_instance.create_status_page(body=body)print(response)
# Create status page returns "Created" responserequire"datadog_api_client"api_instance=DatadogAPIClient::V2::StatusPagesAPI.newbody=DatadogAPIClient::V2::CreateStatusPageRequest.new({data:DatadogAPIClient::V2::CreateStatusPageRequestData.new({attributes:DatadogAPIClient::V2::CreateStatusPageRequestDataAttributes.new({name:"A Status Page",domain_prefix:"5e2fd69be33e79aa",components:[DatadogAPIClient::V2::CreateStatusPageRequestDataAttributesComponentsItems.new({name:"Login",type:DatadogAPIClient::V2::CreateComponentRequestDataAttributesType::COMPONENT,position:0,}),DatadogAPIClient::V2::CreateStatusPageRequestDataAttributesComponentsItems.new({name:"Settings",type:DatadogAPIClient::V2::CreateComponentRequestDataAttributesType::COMPONENT,position:1,}),],enabled:true,type:DatadogAPIClient::V2::CreateStatusPageRequestDataAttributesType::INTERNAL,visualization_type:DatadogAPIClient::V2::CreateStatusPageRequestDataAttributesVisualizationType::BARS_AND_UPTIME_PERCENTAGE,}),type:DatadogAPIClient::V2::StatusPageDataType::STATUS_PAGES,}),})papi_instance.create_status_page(body)
// Create status page returns "Created" response
usedatadog_api_client::datadog;usedatadog_api_client::datadogV2::api_status_pages::CreateStatusPageOptionalParams;usedatadog_api_client::datadogV2::api_status_pages::StatusPagesAPI;usedatadog_api_client::datadogV2::model::CreateComponentRequestDataAttributesType;usedatadog_api_client::datadogV2::model::CreateStatusPageRequest;usedatadog_api_client::datadogV2::model::CreateStatusPageRequestData;usedatadog_api_client::datadogV2::model::CreateStatusPageRequestDataAttributes;usedatadog_api_client::datadogV2::model::CreateStatusPageRequestDataAttributesComponentsItems;usedatadog_api_client::datadogV2::model::CreateStatusPageRequestDataAttributesType;usedatadog_api_client::datadogV2::model::CreateStatusPageRequestDataAttributesVisualizationType;usedatadog_api_client::datadogV2::model::StatusPageDataType;#[tokio::main]asyncfnmain(){letbody=CreateStatusPageRequest::new().data(CreateStatusPageRequestData::new(CreateStatusPageRequestDataAttributes::new("5e2fd69be33e79aa".to_string(),true,"A Status Page".to_string(),CreateStatusPageRequestDataAttributesType::INTERNAL,CreateStatusPageRequestDataAttributesVisualizationType::BARS_AND_UPTIME_PERCENTAGE,).components(vec![CreateStatusPageRequestDataAttributesComponentsItems::new().name("Login".to_string()).position(0).type_(CreateComponentRequestDataAttributesType::COMPONENT),CreateStatusPageRequestDataAttributesComponentsItems::new().name("Settings".to_string()).position(1).type_(CreateComponentRequestDataAttributesType::COMPONENT),]),StatusPageDataType::STATUS_PAGES,));letconfiguration=datadog::Configuration::new();letapi=StatusPagesAPI::with_config(configuration);letresp=api.create_status_page(body,CreateStatusPageOptionalParams::default()).await;ifletOk(value)=resp{println!("{:#?}",value);}else{println!("{:#?}",resp.unwrap_err());}}
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com"DD_API_KEY="<DD_API_KEY>"DD_APP_KEY="<DD_APP_KEY>"cargo run
/**
* Create status page returns "Created" response
*/import{client,v2}from"@datadog/datadog-api-client";constconfiguration=client.createConfiguration();constapiInstance=newv2.StatusPagesApi(configuration);constparams: v2.StatusPagesApiCreateStatusPageRequest={body:{data:{attributes:{name:"A Status Page",domainPrefix:"5e2fd69be33e79aa",components:[{name:"Login",type:"component",position: 0,},{name:"Settings",type:"component",position: 1,},],enabled: true,type:"internal",visualizationType:"bars_and_uptime_percentage",},type:"status_pages",},},};apiInstance.createStatusPage(params).then((data: v2.StatusPage)=>{console.log("API called successfully. Returned data: "+JSON.stringify(data));}).catch((error: any)=>console.error(error));
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 and unpublish status page endpoints instead.
This endpoint requires the status_pages_settings_write permission.
引数
パスパラメーター
名前
種類
説明
page_id [required]
string
The ID of the status page.
クエリ文字列
名前
種類
説明
delete_subscribers
boolean
Whether to delete existing subscribers when updating a status page’s type.
include
string
Comma-separated list of resources to include. Supported values: created_by_user, last_modified_by_user.
// Update status page returns "OK" responsepackagemainimport("context""encoding/json""fmt""os""github.com/DataDog/datadog-api-client-go/v2/api/datadog""github.com/DataDog/datadog-api-client-go/v2/api/datadogV2""github.com/google/uuid")funcmain(){// there is a valid "status_page" in the systemStatusPageDataID:=uuid.MustParse(os.Getenv("STATUS_PAGE_DATA_ID"))body:=datadogV2.PatchStatusPageRequest{Data:&datadogV2.PatchStatusPageRequestData{Attributes:datadogV2.PatchStatusPageRequestDataAttributes{Name:datadog.PtrString("A Status Page in US1"),},Id:StatusPageDataID,Type:datadogV2.STATUSPAGEDATATYPE_STATUS_PAGES,},}ctx:=datadog.NewDefaultContext(context.Background())configuration:=datadog.NewConfiguration()apiClient:=datadog.NewAPIClient(configuration)api:=datadogV2.NewStatusPagesApi(apiClient)resp,r,err:=api.UpdateStatusPage(ctx,StatusPageDataID,body,*datadogV2.NewUpdateStatusPageOptionalParameters())iferr!=nil{fmt.Fprintf(os.Stderr,"Error when calling `StatusPagesApi.UpdateStatusPage`: %v\n",err)fmt.Fprintf(os.Stderr,"Full HTTP response: %v\n",r)}responseContent,_:=json.MarshalIndent(resp,""," ")fmt.Fprintf(os.Stdout,"Response from `StatusPagesApi.UpdateStatusPage`:\n%s\n",responseContent)}
// Update status page returns "OK" responseimportcom.datadog.api.client.ApiClient;importcom.datadog.api.client.ApiException;importcom.datadog.api.client.v2.api.StatusPagesApi;importcom.datadog.api.client.v2.model.PatchStatusPageRequest;importcom.datadog.api.client.v2.model.PatchStatusPageRequestData;importcom.datadog.api.client.v2.model.PatchStatusPageRequestDataAttributes;importcom.datadog.api.client.v2.model.StatusPage;importcom.datadog.api.client.v2.model.StatusPageDataType;importjava.util.UUID;publicclassExample{publicstaticvoidmain(String[]args){ApiClientdefaultClient=ApiClient.getDefaultApiClient();StatusPagesApiapiInstance=newStatusPagesApi(defaultClient);// there is a valid "status_page" in the systemUUIDSTATUS_PAGE_DATA_ID=null;try{STATUS_PAGE_DATA_ID=UUID.fromString(System.getenv("STATUS_PAGE_DATA_ID"));}catch(IllegalArgumentExceptione){System.err.println("Error parsing UUID: "+e.getMessage());}PatchStatusPageRequestbody=newPatchStatusPageRequest().data(newPatchStatusPageRequestData().attributes(newPatchStatusPageRequestDataAttributes().name("A Status Page in US1")).id(STATUS_PAGE_DATA_ID).type(StatusPageDataType.STATUS_PAGES));try{StatusPageresult=apiInstance.updateStatusPage(STATUS_PAGE_DATA_ID,body);System.out.println(result);}catch(ApiExceptione){System.err.println("Exception when calling StatusPagesApi#updateStatusPage");System.err.println("Status code: "+e.getCode());System.err.println("Reason: "+e.getResponseBody());System.err.println("Response headers: "+e.getResponseHeaders());e.printStackTrace();}}}
"""
Update status page returns "OK" response
"""fromosimportenvironfromdatadog_api_clientimportApiClient,Configurationfromdatadog_api_client.v2.api.status_pages_apiimportStatusPagesApifromdatadog_api_client.v2.model.patch_status_page_requestimportPatchStatusPageRequestfromdatadog_api_client.v2.model.patch_status_page_request_dataimportPatchStatusPageRequestDatafromdatadog_api_client.v2.model.patch_status_page_request_data_attributesimportPatchStatusPageRequestDataAttributesfromdatadog_api_client.v2.model.status_page_data_typeimportStatusPageDataType# there is a valid "status_page" in the systemSTATUS_PAGE_DATA_ID=environ["STATUS_PAGE_DATA_ID"]body=PatchStatusPageRequest(data=PatchStatusPageRequestData(attributes=PatchStatusPageRequestDataAttributes(name="A Status Page in US1",),id=STATUS_PAGE_DATA_ID,type=StatusPageDataType.STATUS_PAGES,),)configuration=Configuration()withApiClient(configuration)asapi_client:api_instance=StatusPagesApi(api_client)response=api_instance.update_status_page(page_id=STATUS_PAGE_DATA_ID,body=body)print(response)
# Update status page returns "OK" responserequire"datadog_api_client"api_instance=DatadogAPIClient::V2::StatusPagesAPI.new# there is a valid "status_page" in the systemSTATUS_PAGE_DATA_ID=ENV["STATUS_PAGE_DATA_ID"]body=DatadogAPIClient::V2::PatchStatusPageRequest.new({data:DatadogAPIClient::V2::PatchStatusPageRequestData.new({attributes:DatadogAPIClient::V2::PatchStatusPageRequestDataAttributes.new({name:"A Status Page in US1",}),id:STATUS_PAGE_DATA_ID,type:DatadogAPIClient::V2::StatusPageDataType::STATUS_PAGES,}),})papi_instance.update_status_page(STATUS_PAGE_DATA_ID,body)
// Update status page returns "OK" response
usedatadog_api_client::datadog;usedatadog_api_client::datadogV2::api_status_pages::StatusPagesAPI;usedatadog_api_client::datadogV2::api_status_pages::UpdateStatusPageOptionalParams;usedatadog_api_client::datadogV2::model::PatchStatusPageRequest;usedatadog_api_client::datadogV2::model::PatchStatusPageRequestData;usedatadog_api_client::datadogV2::model::PatchStatusPageRequestDataAttributes;usedatadog_api_client::datadogV2::model::StatusPageDataType;#[tokio::main]asyncfnmain(){// there is a valid "status_page" in the system
letstatus_page_data_id=uuid::Uuid::parse_str(&std::env::var("STATUS_PAGE_DATA_ID").unwrap()).expect("Invalid UUID");letbody=PatchStatusPageRequest::new().data(PatchStatusPageRequestData::new(PatchStatusPageRequestDataAttributes::new().name("A Status Page in US1".to_string()),status_page_data_id.clone(),StatusPageDataType::STATUS_PAGES,));letconfiguration=datadog::Configuration::new();letapi=StatusPagesAPI::with_config(configuration);letresp=api.update_status_page(status_page_data_id.clone(),body,UpdateStatusPageOptionalParams::default(),).await;ifletOk(value)=resp{println!("{:#?}",value);}else{println!("{:#?}",resp.unwrap_err());}}
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com"DD_API_KEY="<DD_API_KEY>"DD_APP_KEY="<DD_APP_KEY>"cargo run
/**
* Update status page returns "OK" response
*/import{client,v2}from"@datadog/datadog-api-client";constconfiguration=client.createConfiguration();constapiInstance=newv2.StatusPagesApi(configuration);// there is a valid "status_page" in the system
constSTATUS_PAGE_DATA_ID=process.env.STATUS_PAGE_DATA_IDasstring;constparams: v2.StatusPagesApiUpdateStatusPageRequest={body:{data:{attributes:{name:"A Status Page in US1",},id: STATUS_PAGE_DATA_ID,type:"status_pages",},},pageId: STATUS_PAGE_DATA_ID,};apiInstance.updateStatusPage(params).then((data: v2.StatusPage)=>{console.log("API called successfully. Returned data: "+JSON.stringify(data));}).catch((error: any)=>console.error(error));
"""
List status pages returns "OK" response
"""fromdatadog_api_clientimportApiClient,Configurationfromdatadog_api_client.v2.api.status_pages_apiimportStatusPagesApiconfiguration=Configuration()withApiClient(configuration)asapi_client:api_instance=StatusPagesApi(api_client)response=api_instance.list_status_pages()print(response)
# List status pages returns "OK" responserequire"datadog_api_client"api_instance=DatadogAPIClient::V2::StatusPagesAPI.newpapi_instance.list_status_pages()
// List status pages returns "OK" responsepackagemainimport("context""encoding/json""fmt""os""github.com/DataDog/datadog-api-client-go/v2/api/datadog""github.com/DataDog/datadog-api-client-go/v2/api/datadogV2")funcmain(){ctx:=datadog.NewDefaultContext(context.Background())configuration:=datadog.NewConfiguration()apiClient:=datadog.NewAPIClient(configuration)api:=datadogV2.NewStatusPagesApi(apiClient)resp,r,err:=api.ListStatusPages(ctx,*datadogV2.NewListStatusPagesOptionalParameters())iferr!=nil{fmt.Fprintf(os.Stderr,"Error when calling `StatusPagesApi.ListStatusPages`: %v\n",err)fmt.Fprintf(os.Stderr,"Full HTTP response: %v\n",r)}responseContent,_:=json.MarshalIndent(resp,""," ")fmt.Fprintf(os.Stdout,"Response from `StatusPagesApi.ListStatusPages`:\n%s\n",responseContent)}
// List status pages returns "OK" responseimportcom.datadog.api.client.ApiClient;importcom.datadog.api.client.ApiException;importcom.datadog.api.client.v2.api.StatusPagesApi;importcom.datadog.api.client.v2.model.StatusPageArray;publicclassExample{publicstaticvoidmain(String[]args){ApiClientdefaultClient=ApiClient.getDefaultApiClient();StatusPagesApiapiInstance=newStatusPagesApi(defaultClient);try{StatusPageArrayresult=apiInstance.listStatusPages();System.out.println(result);}catch(ApiExceptione){System.err.println("Exception when calling StatusPagesApi#listStatusPages");System.err.println("Status code: "+e.getCode());System.err.println("Reason: "+e.getResponseBody());System.err.println("Response headers: "+e.getResponseHeaders());e.printStackTrace();}}}
// List status pages returns "OK" response
usedatadog_api_client::datadog;usedatadog_api_client::datadogV2::api_status_pages::ListStatusPagesOptionalParams;usedatadog_api_client::datadogV2::api_status_pages::StatusPagesAPI;#[tokio::main]asyncfnmain(){letconfiguration=datadog::Configuration::new();letapi=StatusPagesAPI::with_config(configuration);letresp=api.list_status_pages(ListStatusPagesOptionalParams::default()).await;ifletOk(value)=resp{println!("{:#?}",value);}else{println!("{:#?}",resp.unwrap_err());}}
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com"DD_API_KEY="<DD_API_KEY>"DD_APP_KEY="<DD_APP_KEY>"cargo run
/**
* List status pages returns "OK" response
*/import{client,v2}from"@datadog/datadog-api-client";constconfiguration=client.createConfiguration();constapiInstance=newv2.StatusPagesApi(configuration);apiInstance.listStatusPages().then((data: v2.StatusPageArray)=>{console.log("API called successfully. Returned data: "+JSON.stringify(data));}).catch((error: any)=>console.error(error));
"""
Get status page returns "OK" response
"""fromosimportenvironfromdatadog_api_clientimportApiClient,Configurationfromdatadog_api_client.v2.api.status_pages_apiimportStatusPagesApi# there is a valid "status_page" in the systemSTATUS_PAGE_DATA_ID=environ["STATUS_PAGE_DATA_ID"]configuration=Configuration()withApiClient(configuration)asapi_client:api_instance=StatusPagesApi(api_client)response=api_instance.get_status_page(page_id=STATUS_PAGE_DATA_ID,)print(response)
# Get status page returns "OK" responserequire"datadog_api_client"api_instance=DatadogAPIClient::V2::StatusPagesAPI.new# there is a valid "status_page" in the systemSTATUS_PAGE_DATA_ID=ENV["STATUS_PAGE_DATA_ID"]papi_instance.get_status_page(STATUS_PAGE_DATA_ID)
// Get status page returns "OK" responsepackagemainimport("context""encoding/json""fmt""os""github.com/DataDog/datadog-api-client-go/v2/api/datadog""github.com/DataDog/datadog-api-client-go/v2/api/datadogV2""github.com/google/uuid")funcmain(){// there is a valid "status_page" in the systemStatusPageDataID:=uuid.MustParse(os.Getenv("STATUS_PAGE_DATA_ID"))ctx:=datadog.NewDefaultContext(context.Background())configuration:=datadog.NewConfiguration()apiClient:=datadog.NewAPIClient(configuration)api:=datadogV2.NewStatusPagesApi(apiClient)resp,r,err:=api.GetStatusPage(ctx,StatusPageDataID,*datadogV2.NewGetStatusPageOptionalParameters())iferr!=nil{fmt.Fprintf(os.Stderr,"Error when calling `StatusPagesApi.GetStatusPage`: %v\n",err)fmt.Fprintf(os.Stderr,"Full HTTP response: %v\n",r)}responseContent,_:=json.MarshalIndent(resp,""," ")fmt.Fprintf(os.Stdout,"Response from `StatusPagesApi.GetStatusPage`:\n%s\n",responseContent)}
// Get status page returns "OK" responseimportcom.datadog.api.client.ApiClient;importcom.datadog.api.client.ApiException;importcom.datadog.api.client.v2.api.StatusPagesApi;importcom.datadog.api.client.v2.model.StatusPage;importjava.util.UUID;publicclassExample{publicstaticvoidmain(String[]args){ApiClientdefaultClient=ApiClient.getDefaultApiClient();StatusPagesApiapiInstance=newStatusPagesApi(defaultClient);// there is a valid "status_page" in the systemUUIDSTATUS_PAGE_DATA_ID=null;try{STATUS_PAGE_DATA_ID=UUID.fromString(System.getenv("STATUS_PAGE_DATA_ID"));}catch(IllegalArgumentExceptione){System.err.println("Error parsing UUID: "+e.getMessage());}try{StatusPageresult=apiInstance.getStatusPage(STATUS_PAGE_DATA_ID);System.out.println(result);}catch(ApiExceptione){System.err.println("Exception when calling StatusPagesApi#getStatusPage");System.err.println("Status code: "+e.getCode());System.err.println("Reason: "+e.getResponseBody());System.err.println("Response headers: "+e.getResponseHeaders());e.printStackTrace();}}}
// Get status page returns "OK" response
usedatadog_api_client::datadog;usedatadog_api_client::datadogV2::api_status_pages::GetStatusPageOptionalParams;usedatadog_api_client::datadogV2::api_status_pages::StatusPagesAPI;#[tokio::main]asyncfnmain(){// there is a valid "status_page" in the system
letstatus_page_data_id=uuid::Uuid::parse_str(&std::env::var("STATUS_PAGE_DATA_ID").unwrap()).expect("Invalid UUID");letconfiguration=datadog::Configuration::new();letapi=StatusPagesAPI::with_config(configuration);letresp=api.get_status_page(status_page_data_id.clone(),GetStatusPageOptionalParams::default(),).await;ifletOk(value)=resp{println!("{:#?}",value);}else{println!("{:#?}",resp.unwrap_err());}}
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com"DD_API_KEY="<DD_API_KEY>"DD_APP_KEY="<DD_APP_KEY>"cargo run
/**
* Get status page returns "OK" response
*/import{client,v2}from"@datadog/datadog-api-client";constconfiguration=client.createConfiguration();constapiInstance=newv2.StatusPagesApi(configuration);// there is a valid "status_page" in the system
constSTATUS_PAGE_DATA_ID=process.env.STATUS_PAGE_DATA_IDasstring;constparams: v2.StatusPagesApiGetStatusPageRequest={pageId: STATUS_PAGE_DATA_ID,};apiInstance.getStatusPage(params).then((data: v2.StatusPage)=>{console.log("API called successfully. Returned data: "+JSON.stringify(data));}).catch((error: any)=>console.error(error));
"""
Delete status page returns "No Content" response
"""fromosimportenvironfromdatadog_api_clientimportApiClient,Configurationfromdatadog_api_client.v2.api.status_pages_apiimportStatusPagesApi# there is a valid "status_page" in the systemSTATUS_PAGE_DATA_ID=environ["STATUS_PAGE_DATA_ID"]configuration=Configuration()withApiClient(configuration)asapi_client:api_instance=StatusPagesApi(api_client)api_instance.delete_status_page(page_id=STATUS_PAGE_DATA_ID,)
# Delete status page returns "No Content" responserequire"datadog_api_client"api_instance=DatadogAPIClient::V2::StatusPagesAPI.new# there is a valid "status_page" in the systemSTATUS_PAGE_DATA_ID=ENV["STATUS_PAGE_DATA_ID"]api_instance.delete_status_page(STATUS_PAGE_DATA_ID)
// Delete status page returns "No Content" responsepackagemainimport("context""fmt""os""github.com/DataDog/datadog-api-client-go/v2/api/datadog""github.com/DataDog/datadog-api-client-go/v2/api/datadogV2""github.com/google/uuid")funcmain(){// there is a valid "status_page" in the systemStatusPageDataID:=uuid.MustParse(os.Getenv("STATUS_PAGE_DATA_ID"))ctx:=datadog.NewDefaultContext(context.Background())configuration:=datadog.NewConfiguration()apiClient:=datadog.NewAPIClient(configuration)api:=datadogV2.NewStatusPagesApi(apiClient)r,err:=api.DeleteStatusPage(ctx,StatusPageDataID)iferr!=nil{fmt.Fprintf(os.Stderr,"Error when calling `StatusPagesApi.DeleteStatusPage`: %v\n",err)fmt.Fprintf(os.Stderr,"Full HTTP response: %v\n",r)}}
// Delete status page returns "No Content" responseimportcom.datadog.api.client.ApiClient;importcom.datadog.api.client.ApiException;importcom.datadog.api.client.v2.api.StatusPagesApi;importjava.util.UUID;publicclassExample{publicstaticvoidmain(String[]args){ApiClientdefaultClient=ApiClient.getDefaultApiClient();StatusPagesApiapiInstance=newStatusPagesApi(defaultClient);// there is a valid "status_page" in the systemUUIDSTATUS_PAGE_DATA_ID=null;try{STATUS_PAGE_DATA_ID=UUID.fromString(System.getenv("STATUS_PAGE_DATA_ID"));}catch(IllegalArgumentExceptione){System.err.println("Error parsing UUID: "+e.getMessage());}try{apiInstance.deleteStatusPage(STATUS_PAGE_DATA_ID);}catch(ApiExceptione){System.err.println("Exception when calling StatusPagesApi#deleteStatusPage");System.err.println("Status code: "+e.getCode());System.err.println("Reason: "+e.getResponseBody());System.err.println("Response headers: "+e.getResponseHeaders());e.printStackTrace();}}}
// Delete status page returns "No Content" response
usedatadog_api_client::datadog;usedatadog_api_client::datadogV2::api_status_pages::StatusPagesAPI;#[tokio::main]asyncfnmain(){// there is a valid "status_page" in the system
letstatus_page_data_id=uuid::Uuid::parse_str(&std::env::var("STATUS_PAGE_DATA_ID").unwrap()).expect("Invalid UUID");letconfiguration=datadog::Configuration::new();letapi=StatusPagesAPI::with_config(configuration);letresp=api.delete_status_page(status_page_data_id.clone()).await;ifletOk(value)=resp{println!("{:#?}",value);}else{println!("{:#?}",resp.unwrap_err());}}
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com"DD_API_KEY="<DD_API_KEY>"DD_APP_KEY="<DD_APP_KEY>"cargo run
/**
* Delete status page returns "No Content" response
*/import{client,v2}from"@datadog/datadog-api-client";constconfiguration=client.createConfiguration();constapiInstance=newv2.StatusPagesApi(configuration);// there is a valid "status_page" in the system
constSTATUS_PAGE_DATA_ID=process.env.STATUS_PAGE_DATA_IDasstring;constparams: v2.StatusPagesApiDeleteStatusPageRequest={pageId: STATUS_PAGE_DATA_ID,};apiInstance.deleteStatusPage(params).then((data: any)=>{console.log("API called successfully. Returned data: "+JSON.stringify(data));}).catch((error: any)=>console.error(error));
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.
This endpoint requires
any
of the following permissions:
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.
This endpoint requires
any
of the following permissions:
// Create component returns "Created" responsepackagemainimport("context""encoding/json""fmt""os""github.com/DataDog/datadog-api-client-go/v2/api/datadog""github.com/DataDog/datadog-api-client-go/v2/api/datadogV2""github.com/google/uuid")funcmain(){// there is a valid "status_page" in the systemStatusPageDataID:=uuid.MustParse(os.Getenv("STATUS_PAGE_DATA_ID"))body:=datadogV2.CreateComponentRequest{Data:&datadogV2.CreateComponentRequestData{Attributes:datadogV2.CreateComponentRequestDataAttributes{Name:"Logs",Position:0,Type:datadogV2.CREATECOMPONENTREQUESTDATAATTRIBUTESTYPE_COMPONENT,},Type:datadogV2.STATUSPAGESCOMPONENTGROUPTYPE_COMPONENTS,},}ctx:=datadog.NewDefaultContext(context.Background())configuration:=datadog.NewConfiguration()apiClient:=datadog.NewAPIClient(configuration)api:=datadogV2.NewStatusPagesApi(apiClient)resp,r,err:=api.CreateComponent(ctx,StatusPageDataID,body,*datadogV2.NewCreateComponentOptionalParameters())iferr!=nil{fmt.Fprintf(os.Stderr,"Error when calling `StatusPagesApi.CreateComponent`: %v\n",err)fmt.Fprintf(os.Stderr,"Full HTTP response: %v\n",r)}responseContent,_:=json.MarshalIndent(resp,""," ")fmt.Fprintf(os.Stdout,"Response from `StatusPagesApi.CreateComponent`:\n%s\n",responseContent)}
// Create component returns "Created" responseimportcom.datadog.api.client.ApiClient;importcom.datadog.api.client.ApiException;importcom.datadog.api.client.v2.api.StatusPagesApi;importcom.datadog.api.client.v2.model.CreateComponentRequest;importcom.datadog.api.client.v2.model.CreateComponentRequestData;importcom.datadog.api.client.v2.model.CreateComponentRequestDataAttributes;importcom.datadog.api.client.v2.model.CreateComponentRequestDataAttributesType;importcom.datadog.api.client.v2.model.StatusPagesComponent;importcom.datadog.api.client.v2.model.StatusPagesComponentGroupType;importjava.util.UUID;publicclassExample{publicstaticvoidmain(String[]args){ApiClientdefaultClient=ApiClient.getDefaultApiClient();StatusPagesApiapiInstance=newStatusPagesApi(defaultClient);// there is a valid "status_page" in the systemUUIDSTATUS_PAGE_DATA_ID=null;try{STATUS_PAGE_DATA_ID=UUID.fromString(System.getenv("STATUS_PAGE_DATA_ID"));}catch(IllegalArgumentExceptione){System.err.println("Error parsing UUID: "+e.getMessage());}CreateComponentRequestbody=newCreateComponentRequest().data(newCreateComponentRequestData().attributes(newCreateComponentRequestDataAttributes().name("Logs").position(0L).type(CreateComponentRequestDataAttributesType.COMPONENT)).type(StatusPagesComponentGroupType.COMPONENTS));try{StatusPagesComponentresult=apiInstance.createComponent(STATUS_PAGE_DATA_ID,body);System.out.println(result);}catch(ApiExceptione){System.err.println("Exception when calling StatusPagesApi#createComponent");System.err.println("Status code: "+e.getCode());System.err.println("Reason: "+e.getResponseBody());System.err.println("Response headers: "+e.getResponseHeaders());e.printStackTrace();}}}
"""
Create component returns "Created" response
"""fromosimportenvironfromdatadog_api_clientimportApiClient,Configurationfromdatadog_api_client.v2.api.status_pages_apiimportStatusPagesApifromdatadog_api_client.v2.model.create_component_requestimportCreateComponentRequestfromdatadog_api_client.v2.model.create_component_request_dataimportCreateComponentRequestDatafromdatadog_api_client.v2.model.create_component_request_data_attributesimportCreateComponentRequestDataAttributesfromdatadog_api_client.v2.model.create_component_request_data_attributes_typeimport(CreateComponentRequestDataAttributesType,)fromdatadog_api_client.v2.model.status_pages_component_group_typeimportStatusPagesComponentGroupType# there is a valid "status_page" in the systemSTATUS_PAGE_DATA_ID=environ["STATUS_PAGE_DATA_ID"]body=CreateComponentRequest(data=CreateComponentRequestData(attributes=CreateComponentRequestDataAttributes(name="Logs",position=0,type=CreateComponentRequestDataAttributesType.COMPONENT,),type=StatusPagesComponentGroupType.COMPONENTS,),)configuration=Configuration()withApiClient(configuration)asapi_client:api_instance=StatusPagesApi(api_client)response=api_instance.create_component(page_id=STATUS_PAGE_DATA_ID,body=body)print(response)
# Create component returns "Created" responserequire"datadog_api_client"api_instance=DatadogAPIClient::V2::StatusPagesAPI.new# there is a valid "status_page" in the systemSTATUS_PAGE_DATA_ID=ENV["STATUS_PAGE_DATA_ID"]body=DatadogAPIClient::V2::CreateComponentRequest.new({data:DatadogAPIClient::V2::CreateComponentRequestData.new({attributes:DatadogAPIClient::V2::CreateComponentRequestDataAttributes.new({name:"Logs",position:0,type:DatadogAPIClient::V2::CreateComponentRequestDataAttributesType::COMPONENT,}),type:DatadogAPIClient::V2::StatusPagesComponentGroupType::COMPONENTS,}),})papi_instance.create_component(STATUS_PAGE_DATA_ID,body)
// Create component returns "Created" response
usedatadog_api_client::datadog;usedatadog_api_client::datadogV2::api_status_pages::CreateComponentOptionalParams;usedatadog_api_client::datadogV2::api_status_pages::StatusPagesAPI;usedatadog_api_client::datadogV2::model::CreateComponentRequest;usedatadog_api_client::datadogV2::model::CreateComponentRequestData;usedatadog_api_client::datadogV2::model::CreateComponentRequestDataAttributes;usedatadog_api_client::datadogV2::model::CreateComponentRequestDataAttributesType;usedatadog_api_client::datadogV2::model::StatusPagesComponentGroupType;#[tokio::main]asyncfnmain(){// there is a valid "status_page" in the system
letstatus_page_data_id=uuid::Uuid::parse_str(&std::env::var("STATUS_PAGE_DATA_ID").unwrap()).expect("Invalid UUID");letbody=CreateComponentRequest::new().data(CreateComponentRequestData::new(CreateComponentRequestDataAttributes::new("Logs".to_string(),0,CreateComponentRequestDataAttributesType::COMPONENT,),StatusPagesComponentGroupType::COMPONENTS,));letconfiguration=datadog::Configuration::new();letapi=StatusPagesAPI::with_config(configuration);letresp=api.create_component(status_page_data_id.clone(),body,CreateComponentOptionalParams::default(),).await;ifletOk(value)=resp{println!("{:#?}",value);}else{println!("{:#?}",resp.unwrap_err());}}
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com"DD_API_KEY="<DD_API_KEY>"DD_APP_KEY="<DD_APP_KEY>"cargo run
/**
* Create component returns "Created" response
*/import{client,v2}from"@datadog/datadog-api-client";constconfiguration=client.createConfiguration();constapiInstance=newv2.StatusPagesApi(configuration);// there is a valid "status_page" in the system
constSTATUS_PAGE_DATA_ID=process.env.STATUS_PAGE_DATA_IDasstring;constparams: v2.StatusPagesApiCreateComponentRequest={body:{data:{attributes:{name:"Logs",position: 0,type:"component",},type:"components",},},pageId: STATUS_PAGE_DATA_ID,};apiInstance.createComponent(params).then((data: v2.StatusPagesComponent)=>{console.log("API called successfully. Returned data: "+JSON.stringify(data));}).catch((error: any)=>console.error(error));
// Update component returns "OK" responsepackagemainimport("context""encoding/json""fmt""os""github.com/DataDog/datadog-api-client-go/v2/api/datadog""github.com/DataDog/datadog-api-client-go/v2/api/datadogV2""github.com/google/uuid")funcmain(){// there is a valid "status_page" in the systemStatusPageDataAttributesComponents0ID:=uuid.MustParse(os.Getenv("STATUS_PAGE_DATA_ATTRIBUTES_COMPONENTS_0_ID"))StatusPageDataID:=uuid.MustParse(os.Getenv("STATUS_PAGE_DATA_ID"))body:=datadogV2.PatchComponentRequest{Data:&datadogV2.PatchComponentRequestData{Attributes:datadogV2.PatchComponentRequestDataAttributes{Name:datadog.PtrString("Logs Indexing"),},Id:StatusPageDataAttributesComponents0ID,Type:datadogV2.STATUSPAGESCOMPONENTGROUPTYPE_COMPONENTS,},}ctx:=datadog.NewDefaultContext(context.Background())configuration:=datadog.NewConfiguration()apiClient:=datadog.NewAPIClient(configuration)api:=datadogV2.NewStatusPagesApi(apiClient)resp,r,err:=api.UpdateComponent(ctx,StatusPageDataID,StatusPageDataAttributesComponents0ID,body,*datadogV2.NewUpdateComponentOptionalParameters())iferr!=nil{fmt.Fprintf(os.Stderr,"Error when calling `StatusPagesApi.UpdateComponent`: %v\n",err)fmt.Fprintf(os.Stderr,"Full HTTP response: %v\n",r)}responseContent,_:=json.MarshalIndent(resp,""," ")fmt.Fprintf(os.Stdout,"Response from `StatusPagesApi.UpdateComponent`:\n%s\n",responseContent)}
// Update component returns "OK" responseimportcom.datadog.api.client.ApiClient;importcom.datadog.api.client.ApiException;importcom.datadog.api.client.v2.api.StatusPagesApi;importcom.datadog.api.client.v2.model.PatchComponentRequest;importcom.datadog.api.client.v2.model.PatchComponentRequestData;importcom.datadog.api.client.v2.model.PatchComponentRequestDataAttributes;importcom.datadog.api.client.v2.model.StatusPagesComponent;importcom.datadog.api.client.v2.model.StatusPagesComponentGroupType;importjava.util.UUID;publicclassExample{publicstaticvoidmain(String[]args){ApiClientdefaultClient=ApiClient.getDefaultApiClient();StatusPagesApiapiInstance=newStatusPagesApi(defaultClient);// there is a valid "status_page" in the systemUUIDSTATUS_PAGE_DATA_ATTRIBUTES_COMPONENTS_0_ID=null;try{STATUS_PAGE_DATA_ATTRIBUTES_COMPONENTS_0_ID=UUID.fromString(System.getenv("STATUS_PAGE_DATA_ATTRIBUTES_COMPONENTS_0_ID"));}catch(IllegalArgumentExceptione){System.err.println("Error parsing UUID: "+e.getMessage());}UUIDSTATUS_PAGE_DATA_ID=null;try{STATUS_PAGE_DATA_ID=UUID.fromString(System.getenv("STATUS_PAGE_DATA_ID"));}catch(IllegalArgumentExceptione){System.err.println("Error parsing UUID: "+e.getMessage());}PatchComponentRequestbody=newPatchComponentRequest().data(newPatchComponentRequestData().attributes(newPatchComponentRequestDataAttributes().name("Logs Indexing")).id(STATUS_PAGE_DATA_ATTRIBUTES_COMPONENTS_0_ID).type(StatusPagesComponentGroupType.COMPONENTS));try{StatusPagesComponentresult=apiInstance.updateComponent(STATUS_PAGE_DATA_ID,STATUS_PAGE_DATA_ATTRIBUTES_COMPONENTS_0_ID,body);System.out.println(result);}catch(ApiExceptione){System.err.println("Exception when calling StatusPagesApi#updateComponent");System.err.println("Status code: "+e.getCode());System.err.println("Reason: "+e.getResponseBody());System.err.println("Response headers: "+e.getResponseHeaders());e.printStackTrace();}}}
"""
Update component returns "OK" response
"""fromosimportenvironfromdatadog_api_clientimportApiClient,Configurationfromdatadog_api_client.v2.api.status_pages_apiimportStatusPagesApifromdatadog_api_client.v2.model.patch_component_requestimportPatchComponentRequestfromdatadog_api_client.v2.model.patch_component_request_dataimportPatchComponentRequestDatafromdatadog_api_client.v2.model.patch_component_request_data_attributesimportPatchComponentRequestDataAttributesfromdatadog_api_client.v2.model.status_pages_component_group_typeimportStatusPagesComponentGroupType# there is a valid "status_page" in the systemSTATUS_PAGE_DATA_ATTRIBUTES_COMPONENTS_0_ID=environ["STATUS_PAGE_DATA_ATTRIBUTES_COMPONENTS_0_ID"]STATUS_PAGE_DATA_ID=environ["STATUS_PAGE_DATA_ID"]body=PatchComponentRequest(data=PatchComponentRequestData(attributes=PatchComponentRequestDataAttributes(name="Logs Indexing",),id=STATUS_PAGE_DATA_ATTRIBUTES_COMPONENTS_0_ID,type=StatusPagesComponentGroupType.COMPONENTS,),)configuration=Configuration()withApiClient(configuration)asapi_client:api_instance=StatusPagesApi(api_client)response=api_instance.update_component(page_id=STATUS_PAGE_DATA_ID,component_id=STATUS_PAGE_DATA_ATTRIBUTES_COMPONENTS_0_ID,body=body)print(response)
# Update component returns "OK" responserequire"datadog_api_client"api_instance=DatadogAPIClient::V2::StatusPagesAPI.new# there is a valid "status_page" in the systemSTATUS_PAGE_DATA_ATTRIBUTES_COMPONENTS_0_ID=ENV["STATUS_PAGE_DATA_ATTRIBUTES_COMPONENTS_0_ID"]STATUS_PAGE_DATA_ID=ENV["STATUS_PAGE_DATA_ID"]body=DatadogAPIClient::V2::PatchComponentRequest.new({data:DatadogAPIClient::V2::PatchComponentRequestData.new({attributes:DatadogAPIClient::V2::PatchComponentRequestDataAttributes.new({name:"Logs Indexing",}),id:STATUS_PAGE_DATA_ATTRIBUTES_COMPONENTS_0_ID,type:DatadogAPIClient::V2::StatusPagesComponentGroupType::COMPONENTS,}),})papi_instance.update_component(STATUS_PAGE_DATA_ID,STATUS_PAGE_DATA_ATTRIBUTES_COMPONENTS_0_ID,body)
// Update component returns "OK" response
usedatadog_api_client::datadog;usedatadog_api_client::datadogV2::api_status_pages::StatusPagesAPI;usedatadog_api_client::datadogV2::api_status_pages::UpdateComponentOptionalParams;usedatadog_api_client::datadogV2::model::PatchComponentRequest;usedatadog_api_client::datadogV2::model::PatchComponentRequestData;usedatadog_api_client::datadogV2::model::PatchComponentRequestDataAttributes;usedatadog_api_client::datadogV2::model::StatusPagesComponentGroupType;#[tokio::main]asyncfnmain(){// there is a valid "status_page" in the system
letstatus_page_data_attributes_components_0_id=uuid::Uuid::parse_str(&std::env::var("STATUS_PAGE_DATA_ATTRIBUTES_COMPONENTS_0_ID").unwrap(),).expect("Invalid UUID");letstatus_page_data_id=uuid::Uuid::parse_str(&std::env::var("STATUS_PAGE_DATA_ID").unwrap()).expect("Invalid UUID");letbody=PatchComponentRequest::new().data(PatchComponentRequestData::new(PatchComponentRequestDataAttributes::new().name("Logs Indexing".to_string()),status_page_data_attributes_components_0_id.clone(),StatusPagesComponentGroupType::COMPONENTS,));letconfiguration=datadog::Configuration::new();letapi=StatusPagesAPI::with_config(configuration);letresp=api.update_component(status_page_data_id.clone(),status_page_data_attributes_components_0_id.clone(),body,UpdateComponentOptionalParams::default(),).await;ifletOk(value)=resp{println!("{:#?}",value);}else{println!("{:#?}",resp.unwrap_err());}}
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com"DD_API_KEY="<DD_API_KEY>"DD_APP_KEY="<DD_APP_KEY>"cargo run
/**
* Update component returns "OK" response
*/import{client,v2}from"@datadog/datadog-api-client";constconfiguration=client.createConfiguration();constapiInstance=newv2.StatusPagesApi(configuration);// there is a valid "status_page" in the system
constSTATUS_PAGE_DATA_ATTRIBUTES_COMPONENTS_0_ID=process.env.STATUS_PAGE_DATA_ATTRIBUTES_COMPONENTS_0_IDasstring;constSTATUS_PAGE_DATA_ID=process.env.STATUS_PAGE_DATA_IDasstring;constparams: v2.StatusPagesApiUpdateComponentRequest={body:{data:{attributes:{name:"Logs Indexing",},id: STATUS_PAGE_DATA_ATTRIBUTES_COMPONENTS_0_ID,type:"components",},},pageId: STATUS_PAGE_DATA_ID,componentId: STATUS_PAGE_DATA_ATTRIBUTES_COMPONENTS_0_ID,};apiInstance.updateComponent(params).then((data: v2.StatusPagesComponent)=>{console.log("API called successfully. Returned data: "+JSON.stringify(data));}).catch((error: any)=>console.error(error));
"""
List components returns "OK" response
"""fromosimportenvironfromdatadog_api_clientimportApiClient,Configurationfromdatadog_api_client.v2.api.status_pages_apiimportStatusPagesApi# there is a valid "status_page" in the systemSTATUS_PAGE_DATA_ID=environ["STATUS_PAGE_DATA_ID"]configuration=Configuration()withApiClient(configuration)asapi_client:api_instance=StatusPagesApi(api_client)response=api_instance.list_components(page_id=STATUS_PAGE_DATA_ID,)print(response)
# List components returns "OK" responserequire"datadog_api_client"api_instance=DatadogAPIClient::V2::StatusPagesAPI.new# there is a valid "status_page" in the systemSTATUS_PAGE_DATA_ID=ENV["STATUS_PAGE_DATA_ID"]papi_instance.list_components(STATUS_PAGE_DATA_ID)
// List components returns "OK" responsepackagemainimport("context""encoding/json""fmt""os""github.com/DataDog/datadog-api-client-go/v2/api/datadog""github.com/DataDog/datadog-api-client-go/v2/api/datadogV2""github.com/google/uuid")funcmain(){// there is a valid "status_page" in the systemStatusPageDataID:=uuid.MustParse(os.Getenv("STATUS_PAGE_DATA_ID"))ctx:=datadog.NewDefaultContext(context.Background())configuration:=datadog.NewConfiguration()apiClient:=datadog.NewAPIClient(configuration)api:=datadogV2.NewStatusPagesApi(apiClient)resp,r,err:=api.ListComponents(ctx,StatusPageDataID,*datadogV2.NewListComponentsOptionalParameters())iferr!=nil{fmt.Fprintf(os.Stderr,"Error when calling `StatusPagesApi.ListComponents`: %v\n",err)fmt.Fprintf(os.Stderr,"Full HTTP response: %v\n",r)}responseContent,_:=json.MarshalIndent(resp,""," ")fmt.Fprintf(os.Stdout,"Response from `StatusPagesApi.ListComponents`:\n%s\n",responseContent)}
// List components returns "OK" responseimportcom.datadog.api.client.ApiClient;importcom.datadog.api.client.ApiException;importcom.datadog.api.client.v2.api.StatusPagesApi;importcom.datadog.api.client.v2.model.StatusPagesComponentArray;importjava.util.UUID;publicclassExample{publicstaticvoidmain(String[]args){ApiClientdefaultClient=ApiClient.getDefaultApiClient();StatusPagesApiapiInstance=newStatusPagesApi(defaultClient);// there is a valid "status_page" in the systemUUIDSTATUS_PAGE_DATA_ID=null;try{STATUS_PAGE_DATA_ID=UUID.fromString(System.getenv("STATUS_PAGE_DATA_ID"));}catch(IllegalArgumentExceptione){System.err.println("Error parsing UUID: "+e.getMessage());}try{StatusPagesComponentArrayresult=apiInstance.listComponents(STATUS_PAGE_DATA_ID);System.out.println(result);}catch(ApiExceptione){System.err.println("Exception when calling StatusPagesApi#listComponents");System.err.println("Status code: "+e.getCode());System.err.println("Reason: "+e.getResponseBody());System.err.println("Response headers: "+e.getResponseHeaders());e.printStackTrace();}}}
// List components returns "OK" response
usedatadog_api_client::datadog;usedatadog_api_client::datadogV2::api_status_pages::ListComponentsOptionalParams;usedatadog_api_client::datadogV2::api_status_pages::StatusPagesAPI;#[tokio::main]asyncfnmain(){// there is a valid "status_page" in the system
letstatus_page_data_id=uuid::Uuid::parse_str(&std::env::var("STATUS_PAGE_DATA_ID").unwrap()).expect("Invalid UUID");letconfiguration=datadog::Configuration::new();letapi=StatusPagesAPI::with_config(configuration);letresp=api.list_components(status_page_data_id.clone(),ListComponentsOptionalParams::default(),).await;ifletOk(value)=resp{println!("{:#?}",value);}else{println!("{:#?}",resp.unwrap_err());}}
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com"DD_API_KEY="<DD_API_KEY>"DD_APP_KEY="<DD_APP_KEY>"cargo run
/**
* List components returns "OK" response
*/import{client,v2}from"@datadog/datadog-api-client";constconfiguration=client.createConfiguration();constapiInstance=newv2.StatusPagesApi(configuration);// there is a valid "status_page" in the system
constSTATUS_PAGE_DATA_ID=process.env.STATUS_PAGE_DATA_IDasstring;constparams: v2.StatusPagesApiListComponentsRequest={pageId: STATUS_PAGE_DATA_ID,};apiInstance.listComponents(params).then((data: v2.StatusPagesComponentArray)=>{console.log("API called successfully. Returned data: "+JSON.stringify(data));}).catch((error: any)=>console.error(error));
"""
Get component returns "OK" response
"""fromosimportenvironfromdatadog_api_clientimportApiClient,Configurationfromdatadog_api_client.v2.api.status_pages_apiimportStatusPagesApi# there is a valid "status_page" in the systemSTATUS_PAGE_DATA_ATTRIBUTES_COMPONENTS_0_ID=environ["STATUS_PAGE_DATA_ATTRIBUTES_COMPONENTS_0_ID"]STATUS_PAGE_DATA_ID=environ["STATUS_PAGE_DATA_ID"]configuration=Configuration()withApiClient(configuration)asapi_client:api_instance=StatusPagesApi(api_client)response=api_instance.get_component(page_id=STATUS_PAGE_DATA_ID,component_id=STATUS_PAGE_DATA_ATTRIBUTES_COMPONENTS_0_ID,)print(response)
# Get component returns "OK" responserequire"datadog_api_client"api_instance=DatadogAPIClient::V2::StatusPagesAPI.new# there is a valid "status_page" in the systemSTATUS_PAGE_DATA_ATTRIBUTES_COMPONENTS_0_ID=ENV["STATUS_PAGE_DATA_ATTRIBUTES_COMPONENTS_0_ID"]STATUS_PAGE_DATA_ID=ENV["STATUS_PAGE_DATA_ID"]papi_instance.get_component(STATUS_PAGE_DATA_ID,STATUS_PAGE_DATA_ATTRIBUTES_COMPONENTS_0_ID)
// Get component returns "OK" responsepackagemainimport("context""encoding/json""fmt""os""github.com/DataDog/datadog-api-client-go/v2/api/datadog""github.com/DataDog/datadog-api-client-go/v2/api/datadogV2""github.com/google/uuid")funcmain(){// there is a valid "status_page" in the systemStatusPageDataAttributesComponents0ID:=uuid.MustParse(os.Getenv("STATUS_PAGE_DATA_ATTRIBUTES_COMPONENTS_0_ID"))StatusPageDataID:=uuid.MustParse(os.Getenv("STATUS_PAGE_DATA_ID"))ctx:=datadog.NewDefaultContext(context.Background())configuration:=datadog.NewConfiguration()apiClient:=datadog.NewAPIClient(configuration)api:=datadogV2.NewStatusPagesApi(apiClient)resp,r,err:=api.GetComponent(ctx,StatusPageDataID,StatusPageDataAttributesComponents0ID,*datadogV2.NewGetComponentOptionalParameters())iferr!=nil{fmt.Fprintf(os.Stderr,"Error when calling `StatusPagesApi.GetComponent`: %v\n",err)fmt.Fprintf(os.Stderr,"Full HTTP response: %v\n",r)}responseContent,_:=json.MarshalIndent(resp,""," ")fmt.Fprintf(os.Stdout,"Response from `StatusPagesApi.GetComponent`:\n%s\n",responseContent)}
// Get component returns "OK" responseimportcom.datadog.api.client.ApiClient;importcom.datadog.api.client.ApiException;importcom.datadog.api.client.v2.api.StatusPagesApi;importcom.datadog.api.client.v2.model.StatusPagesComponent;importjava.util.UUID;publicclassExample{publicstaticvoidmain(String[]args){ApiClientdefaultClient=ApiClient.getDefaultApiClient();StatusPagesApiapiInstance=newStatusPagesApi(defaultClient);// there is a valid "status_page" in the systemUUIDSTATUS_PAGE_DATA_ATTRIBUTES_COMPONENTS_0_ID=null;try{STATUS_PAGE_DATA_ATTRIBUTES_COMPONENTS_0_ID=UUID.fromString(System.getenv("STATUS_PAGE_DATA_ATTRIBUTES_COMPONENTS_0_ID"));}catch(IllegalArgumentExceptione){System.err.println("Error parsing UUID: "+e.getMessage());}UUIDSTATUS_PAGE_DATA_ID=null;try{STATUS_PAGE_DATA_ID=UUID.fromString(System.getenv("STATUS_PAGE_DATA_ID"));}catch(IllegalArgumentExceptione){System.err.println("Error parsing UUID: "+e.getMessage());}try{StatusPagesComponentresult=apiInstance.getComponent(STATUS_PAGE_DATA_ID,STATUS_PAGE_DATA_ATTRIBUTES_COMPONENTS_0_ID);System.out.println(result);}catch(ApiExceptione){System.err.println("Exception when calling StatusPagesApi#getComponent");System.err.println("Status code: "+e.getCode());System.err.println("Reason: "+e.getResponseBody());System.err.println("Response headers: "+e.getResponseHeaders());e.printStackTrace();}}}
// Get component returns "OK" response
usedatadog_api_client::datadog;usedatadog_api_client::datadogV2::api_status_pages::GetComponentOptionalParams;usedatadog_api_client::datadogV2::api_status_pages::StatusPagesAPI;#[tokio::main]asyncfnmain(){// there is a valid "status_page" in the system
letstatus_page_data_attributes_components_0_id=uuid::Uuid::parse_str(&std::env::var("STATUS_PAGE_DATA_ATTRIBUTES_COMPONENTS_0_ID").unwrap(),).expect("Invalid UUID");letstatus_page_data_id=uuid::Uuid::parse_str(&std::env::var("STATUS_PAGE_DATA_ID").unwrap()).expect("Invalid UUID");letconfiguration=datadog::Configuration::new();letapi=StatusPagesAPI::with_config(configuration);letresp=api.get_component(status_page_data_id.clone(),status_page_data_attributes_components_0_id.clone(),GetComponentOptionalParams::default(),).await;ifletOk(value)=resp{println!("{:#?}",value);}else{println!("{:#?}",resp.unwrap_err());}}
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com"DD_API_KEY="<DD_API_KEY>"DD_APP_KEY="<DD_APP_KEY>"cargo run
/**
* Get component returns "OK" response
*/import{client,v2}from"@datadog/datadog-api-client";constconfiguration=client.createConfiguration();constapiInstance=newv2.StatusPagesApi(configuration);// there is a valid "status_page" in the system
constSTATUS_PAGE_DATA_ATTRIBUTES_COMPONENTS_0_ID=process.env.STATUS_PAGE_DATA_ATTRIBUTES_COMPONENTS_0_IDasstring;constSTATUS_PAGE_DATA_ID=process.env.STATUS_PAGE_DATA_IDasstring;constparams: v2.StatusPagesApiGetComponentRequest={pageId: STATUS_PAGE_DATA_ID,componentId: STATUS_PAGE_DATA_ATTRIBUTES_COMPONENTS_0_ID,};apiInstance.getComponent(params).then((data: v2.StatusPagesComponent)=>{console.log("API called successfully. Returned data: "+JSON.stringify(data));}).catch((error: any)=>console.error(error));
"""
Delete component returns "No Content" response
"""fromosimportenvironfromdatadog_api_clientimportApiClient,Configurationfromdatadog_api_client.v2.api.status_pages_apiimportStatusPagesApi# there is a valid "status_page" in the systemSTATUS_PAGE_DATA_ATTRIBUTES_COMPONENTS_0_ID=environ["STATUS_PAGE_DATA_ATTRIBUTES_COMPONENTS_0_ID"]STATUS_PAGE_DATA_ID=environ["STATUS_PAGE_DATA_ID"]configuration=Configuration()withApiClient(configuration)asapi_client:api_instance=StatusPagesApi(api_client)api_instance.delete_component(page_id=STATUS_PAGE_DATA_ID,component_id=STATUS_PAGE_DATA_ATTRIBUTES_COMPONENTS_0_ID,)
# Delete component returns "No Content" responserequire"datadog_api_client"api_instance=DatadogAPIClient::V2::StatusPagesAPI.new# there is a valid "status_page" in the systemSTATUS_PAGE_DATA_ATTRIBUTES_COMPONENTS_0_ID=ENV["STATUS_PAGE_DATA_ATTRIBUTES_COMPONENTS_0_ID"]STATUS_PAGE_DATA_ID=ENV["STATUS_PAGE_DATA_ID"]api_instance.delete_component(STATUS_PAGE_DATA_ID,STATUS_PAGE_DATA_ATTRIBUTES_COMPONENTS_0_ID)
// Delete component returns "No Content" responsepackagemainimport("context""fmt""os""github.com/DataDog/datadog-api-client-go/v2/api/datadog""github.com/DataDog/datadog-api-client-go/v2/api/datadogV2""github.com/google/uuid")funcmain(){// there is a valid "status_page" in the systemStatusPageDataAttributesComponents0ID:=uuid.MustParse(os.Getenv("STATUS_PAGE_DATA_ATTRIBUTES_COMPONENTS_0_ID"))StatusPageDataID:=uuid.MustParse(os.Getenv("STATUS_PAGE_DATA_ID"))ctx:=datadog.NewDefaultContext(context.Background())configuration:=datadog.NewConfiguration()apiClient:=datadog.NewAPIClient(configuration)api:=datadogV2.NewStatusPagesApi(apiClient)r,err:=api.DeleteComponent(ctx,StatusPageDataID,StatusPageDataAttributesComponents0ID)iferr!=nil{fmt.Fprintf(os.Stderr,"Error when calling `StatusPagesApi.DeleteComponent`: %v\n",err)fmt.Fprintf(os.Stderr,"Full HTTP response: %v\n",r)}}
// Delete component returns "No Content" responseimportcom.datadog.api.client.ApiClient;importcom.datadog.api.client.ApiException;importcom.datadog.api.client.v2.api.StatusPagesApi;importjava.util.UUID;publicclassExample{publicstaticvoidmain(String[]args){ApiClientdefaultClient=ApiClient.getDefaultApiClient();StatusPagesApiapiInstance=newStatusPagesApi(defaultClient);// there is a valid "status_page" in the systemUUIDSTATUS_PAGE_DATA_ATTRIBUTES_COMPONENTS_0_ID=null;try{STATUS_PAGE_DATA_ATTRIBUTES_COMPONENTS_0_ID=UUID.fromString(System.getenv("STATUS_PAGE_DATA_ATTRIBUTES_COMPONENTS_0_ID"));}catch(IllegalArgumentExceptione){System.err.println("Error parsing UUID: "+e.getMessage());}UUIDSTATUS_PAGE_DATA_ID=null;try{STATUS_PAGE_DATA_ID=UUID.fromString(System.getenv("STATUS_PAGE_DATA_ID"));}catch(IllegalArgumentExceptione){System.err.println("Error parsing UUID: "+e.getMessage());}try{apiInstance.deleteComponent(STATUS_PAGE_DATA_ID,STATUS_PAGE_DATA_ATTRIBUTES_COMPONENTS_0_ID);}catch(ApiExceptione){System.err.println("Exception when calling StatusPagesApi#deleteComponent");System.err.println("Status code: "+e.getCode());System.err.println("Reason: "+e.getResponseBody());System.err.println("Response headers: "+e.getResponseHeaders());e.printStackTrace();}}}
// Delete component returns "No Content" response
usedatadog_api_client::datadog;usedatadog_api_client::datadogV2::api_status_pages::StatusPagesAPI;#[tokio::main]asyncfnmain(){// there is a valid "status_page" in the system
letstatus_page_data_attributes_components_0_id=uuid::Uuid::parse_str(&std::env::var("STATUS_PAGE_DATA_ATTRIBUTES_COMPONENTS_0_ID").unwrap(),).expect("Invalid UUID");letstatus_page_data_id=uuid::Uuid::parse_str(&std::env::var("STATUS_PAGE_DATA_ID").unwrap()).expect("Invalid UUID");letconfiguration=datadog::Configuration::new();letapi=StatusPagesAPI::with_config(configuration);letresp=api.delete_component(status_page_data_id.clone(),status_page_data_attributes_components_0_id.clone(),).await;ifletOk(value)=resp{println!("{:#?}",value);}else{println!("{:#?}",resp.unwrap_err());}}
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com"DD_API_KEY="<DD_API_KEY>"DD_APP_KEY="<DD_APP_KEY>"cargo run
/**
* Delete component returns "No Content" response
*/import{client,v2}from"@datadog/datadog-api-client";constconfiguration=client.createConfiguration();constapiInstance=newv2.StatusPagesApi(configuration);// there is a valid "status_page" in the system
constSTATUS_PAGE_DATA_ATTRIBUTES_COMPONENTS_0_ID=process.env.STATUS_PAGE_DATA_ATTRIBUTES_COMPONENTS_0_IDasstring;constSTATUS_PAGE_DATA_ID=process.env.STATUS_PAGE_DATA_IDasstring;constparams: v2.StatusPagesApiDeleteComponentRequest={pageId: STATUS_PAGE_DATA_ID,componentId: STATUS_PAGE_DATA_ATTRIBUTES_COMPONENTS_0_ID,};apiInstance.deleteComponent(params).then((data: any)=>{console.log("API called successfully. Returned data: "+JSON.stringify(data));}).catch((error: any)=>console.error(error));
{"data":{"attributes":{"components_affected":[{"id":"4e9d3726-bdd7-0079-613c-e9aaba89eb01","status":"major_outage"}],"description":"Our API is experiencing elevated latency. We are investigating the issue.","status":"investigating","title":"Elevated API Latency"},"type":"degradations"}}
// Create degradation returns "Created" responsepackagemainimport("context""encoding/json""fmt""os""github.com/DataDog/datadog-api-client-go/v2/api/datadog""github.com/DataDog/datadog-api-client-go/v2/api/datadogV2""github.com/google/uuid")funcmain(){// there is a valid "status_page" in the systemStatusPageDataAttributesComponents0Components0ID:=uuid.MustParse(os.Getenv("STATUS_PAGE_DATA_ATTRIBUTES_COMPONENTS_0_COMPONENTS_0_ID"))StatusPageDataID:=uuid.MustParse(os.Getenv("STATUS_PAGE_DATA_ID"))body:=datadogV2.CreateDegradationRequest{Data:&datadogV2.CreateDegradationRequestData{Attributes:datadogV2.CreateDegradationRequestDataAttributes{ComponentsAffected:[]datadogV2.CreateDegradationRequestDataAttributesComponentsAffectedItems{{Id:StatusPageDataAttributesComponents0Components0ID,Status:datadogV2.STATUSPAGESCOMPONENTDATAATTRIBUTESSTATUS_MAJOR_OUTAGE,},},Description:datadog.PtrString("Our API is experiencing elevated latency. We are investigating the issue."),Status:datadogV2.CREATEDEGRADATIONREQUESTDATAATTRIBUTESSTATUS_INVESTIGATING,Title:"Elevated API Latency",},Type:datadogV2.PATCHDEGRADATIONREQUESTDATATYPE_DEGRADATIONS,},}ctx:=datadog.NewDefaultContext(context.Background())configuration:=datadog.NewConfiguration()apiClient:=datadog.NewAPIClient(configuration)api:=datadogV2.NewStatusPagesApi(apiClient)resp,r,err:=api.CreateDegradation(ctx,StatusPageDataID,body,*datadogV2.NewCreateDegradationOptionalParameters())iferr!=nil{fmt.Fprintf(os.Stderr,"Error when calling `StatusPagesApi.CreateDegradation`: %v\n",err)fmt.Fprintf(os.Stderr,"Full HTTP response: %v\n",r)}responseContent,_:=json.MarshalIndent(resp,""," ")fmt.Fprintf(os.Stdout,"Response from `StatusPagesApi.CreateDegradation`:\n%s\n",responseContent)}
// Create degradation returns "Created" responseimportcom.datadog.api.client.ApiClient;importcom.datadog.api.client.ApiException;importcom.datadog.api.client.v2.api.StatusPagesApi;importcom.datadog.api.client.v2.model.CreateDegradationRequest;importcom.datadog.api.client.v2.model.CreateDegradationRequestData;importcom.datadog.api.client.v2.model.CreateDegradationRequestDataAttributes;importcom.datadog.api.client.v2.model.CreateDegradationRequestDataAttributesComponentsAffectedItems;importcom.datadog.api.client.v2.model.CreateDegradationRequestDataAttributesStatus;importcom.datadog.api.client.v2.model.Degradation;importcom.datadog.api.client.v2.model.PatchDegradationRequestDataType;importcom.datadog.api.client.v2.model.StatusPagesComponentDataAttributesStatus;importjava.util.Collections;importjava.util.UUID;publicclassExample{publicstaticvoidmain(String[]args){ApiClientdefaultClient=ApiClient.getDefaultApiClient();StatusPagesApiapiInstance=newStatusPagesApi(defaultClient);// there is a valid "status_page" in the systemUUIDSTATUS_PAGE_DATA_ATTRIBUTES_COMPONENTS_0_COMPONENTS_0_ID=null;try{STATUS_PAGE_DATA_ATTRIBUTES_COMPONENTS_0_COMPONENTS_0_ID=UUID.fromString(System.getenv("STATUS_PAGE_DATA_ATTRIBUTES_COMPONENTS_0_COMPONENTS_0_ID"));}catch(IllegalArgumentExceptione){System.err.println("Error parsing UUID: "+e.getMessage());}UUIDSTATUS_PAGE_DATA_ID=null;try{STATUS_PAGE_DATA_ID=UUID.fromString(System.getenv("STATUS_PAGE_DATA_ID"));}catch(IllegalArgumentExceptione){System.err.println("Error parsing UUID: "+e.getMessage());}CreateDegradationRequestbody=newCreateDegradationRequest().data(newCreateDegradationRequestData().attributes(newCreateDegradationRequestDataAttributes().componentsAffected(Collections.singletonList(newCreateDegradationRequestDataAttributesComponentsAffectedItems().id(STATUS_PAGE_DATA_ATTRIBUTES_COMPONENTS_0_COMPONENTS_0_ID).status(StatusPagesComponentDataAttributesStatus.MAJOR_OUTAGE))).description("Our API is experiencing elevated latency. We are investigating the"+" issue.").status(CreateDegradationRequestDataAttributesStatus.INVESTIGATING).title("Elevated API Latency")).type(PatchDegradationRequestDataType.DEGRADATIONS));try{Degradationresult=apiInstance.createDegradation(STATUS_PAGE_DATA_ID,body);System.out.println(result);}catch(ApiExceptione){System.err.println("Exception when calling StatusPagesApi#createDegradation");System.err.println("Status code: "+e.getCode());System.err.println("Reason: "+e.getResponseBody());System.err.println("Response headers: "+e.getResponseHeaders());e.printStackTrace();}}}
"""
Create degradation returns "Created" response
"""fromosimportenvironfromdatadog_api_clientimportApiClient,Configurationfromdatadog_api_client.v2.api.status_pages_apiimportStatusPagesApifromdatadog_api_client.v2.model.create_degradation_requestimportCreateDegradationRequestfromdatadog_api_client.v2.model.create_degradation_request_dataimportCreateDegradationRequestDatafromdatadog_api_client.v2.model.create_degradation_request_data_attributesimport(CreateDegradationRequestDataAttributes,)fromdatadog_api_client.v2.model.create_degradation_request_data_attributes_components_affected_itemsimport(CreateDegradationRequestDataAttributesComponentsAffectedItems,)fromdatadog_api_client.v2.model.create_degradation_request_data_attributes_statusimport(CreateDegradationRequestDataAttributesStatus,)fromdatadog_api_client.v2.model.patch_degradation_request_data_typeimportPatchDegradationRequestDataTypefromdatadog_api_client.v2.model.status_pages_component_data_attributes_statusimport(StatusPagesComponentDataAttributesStatus,)# there is a valid "status_page" in the systemSTATUS_PAGE_DATA_ATTRIBUTES_COMPONENTS_0_COMPONENTS_0_ID=environ["STATUS_PAGE_DATA_ATTRIBUTES_COMPONENTS_0_COMPONENTS_0_ID"]STATUS_PAGE_DATA_ID=environ["STATUS_PAGE_DATA_ID"]body=CreateDegradationRequest(data=CreateDegradationRequestData(attributes=CreateDegradationRequestDataAttributes(components_affected=[CreateDegradationRequestDataAttributesComponentsAffectedItems(id=STATUS_PAGE_DATA_ATTRIBUTES_COMPONENTS_0_COMPONENTS_0_ID,status=StatusPagesComponentDataAttributesStatus.MAJOR_OUTAGE,),],description="Our API is experiencing elevated latency. We are investigating the issue.",status=CreateDegradationRequestDataAttributesStatus.INVESTIGATING,title="Elevated API Latency",),type=PatchDegradationRequestDataType.DEGRADATIONS,),)configuration=Configuration()withApiClient(configuration)asapi_client:api_instance=StatusPagesApi(api_client)response=api_instance.create_degradation(page_id=STATUS_PAGE_DATA_ID,body=body)print(response)
# Create degradation returns "Created" responserequire"datadog_api_client"api_instance=DatadogAPIClient::V2::StatusPagesAPI.new# there is a valid "status_page" in the systemSTATUS_PAGE_DATA_ATTRIBUTES_COMPONENTS_0_COMPONENTS_0_ID=ENV["STATUS_PAGE_DATA_ATTRIBUTES_COMPONENTS_0_COMPONENTS_0_ID"]STATUS_PAGE_DATA_ID=ENV["STATUS_PAGE_DATA_ID"]body=DatadogAPIClient::V2::CreateDegradationRequest.new({data:DatadogAPIClient::V2::CreateDegradationRequestData.new({attributes:DatadogAPIClient::V2::CreateDegradationRequestDataAttributes.new({components_affected:[DatadogAPIClient::V2::CreateDegradationRequestDataAttributesComponentsAffectedItems.new({id:STATUS_PAGE_DATA_ATTRIBUTES_COMPONENTS_0_COMPONENTS_0_ID,status:DatadogAPIClient::V2::StatusPagesComponentDataAttributesStatus::MAJOR_OUTAGE,}),],description:"Our API is experiencing elevated latency. We are investigating the issue.",status:DatadogAPIClient::V2::CreateDegradationRequestDataAttributesStatus::INVESTIGATING,title:"Elevated API Latency",}),type:DatadogAPIClient::V2::PatchDegradationRequestDataType::DEGRADATIONS,}),})papi_instance.create_degradation(STATUS_PAGE_DATA_ID,body)
// Create degradation returns "Created" response
usedatadog_api_client::datadog;usedatadog_api_client::datadogV2::api_status_pages::CreateDegradationOptionalParams;usedatadog_api_client::datadogV2::api_status_pages::StatusPagesAPI;usedatadog_api_client::datadogV2::model::CreateDegradationRequest;usedatadog_api_client::datadogV2::model::CreateDegradationRequestData;usedatadog_api_client::datadogV2::model::CreateDegradationRequestDataAttributes;usedatadog_api_client::datadogV2::model::CreateDegradationRequestDataAttributesComponentsAffectedItems;usedatadog_api_client::datadogV2::model::CreateDegradationRequestDataAttributesStatus;usedatadog_api_client::datadogV2::model::PatchDegradationRequestDataType;usedatadog_api_client::datadogV2::model::StatusPagesComponentDataAttributesStatus;#[tokio::main]asyncfnmain(){// there is a valid "status_page" in the system
letstatus_page_data_attributes_components_0_components_0_id=uuid::Uuid::parse_str(&std::env::var("STATUS_PAGE_DATA_ATTRIBUTES_COMPONENTS_0_COMPONENTS_0_ID").unwrap(),).expect("Invalid UUID");letstatus_page_data_id=uuid::Uuid::parse_str(&std::env::var("STATUS_PAGE_DATA_ID").unwrap()).expect("Invalid UUID");letbody=CreateDegradationRequest::new().data(CreateDegradationRequestData::new(CreateDegradationRequestDataAttributes::new(vec![CreateDegradationRequestDataAttributesComponentsAffectedItems::new(status_page_data_attributes_components_0_components_0_id.clone(),StatusPagesComponentDataAttributesStatus::MAJOR_OUTAGE,),],CreateDegradationRequestDataAttributesStatus::INVESTIGATING,"Elevated API Latency".to_string(),).description("Our API is experiencing elevated latency. We are investigating the issue.".to_string(),),PatchDegradationRequestDataType::DEGRADATIONS,));letconfiguration=datadog::Configuration::new();letapi=StatusPagesAPI::with_config(configuration);letresp=api.create_degradation(status_page_data_id.clone(),body,CreateDegradationOptionalParams::default(),).await;ifletOk(value)=resp{println!("{:#?}",value);}else{println!("{:#?}",resp.unwrap_err());}}
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com"DD_API_KEY="<DD_API_KEY>"DD_APP_KEY="<DD_APP_KEY>"cargo run
/**
* Create degradation returns "Created" response
*/import{client,v2}from"@datadog/datadog-api-client";constconfiguration=client.createConfiguration();constapiInstance=newv2.StatusPagesApi(configuration);// there is a valid "status_page" in the system
constSTATUS_PAGE_DATA_ATTRIBUTES_COMPONENTS_0_COMPONENTS_0_ID=process.env.STATUS_PAGE_DATA_ATTRIBUTES_COMPONENTS_0_COMPONENTS_0_IDasstring;constSTATUS_PAGE_DATA_ID=process.env.STATUS_PAGE_DATA_IDasstring;constparams: v2.StatusPagesApiCreateDegradationRequest={body:{data:{attributes:{componentsAffected:[{id: STATUS_PAGE_DATA_ATTRIBUTES_COMPONENTS_0_COMPONENTS_0_ID,status:"major_outage",},],description:"Our API is experiencing elevated latency. We are investigating the issue.",status:"investigating",title:"Elevated API Latency",},type:"degradations",},},pageId: STATUS_PAGE_DATA_ID,};apiInstance.createDegradation(params).then((data: v2.Degradation)=>{console.log("API called successfully. Returned data: "+JSON.stringify(data));}).catch((error: any)=>console.error(error));
## default
#
# Path parameters exportpage_id="1234abcd-12ab-34cd-56ef-123456abcdef" exportdegradation_id="1234abcd-12ab-34cd-56ef-123456abcdef" # Curl command curl-XPATCH"https://api.ap1.datadoghq.com"https://api.ap2.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/statuspages/${page_id}/degradations/${degradation_id}" \
-H"Accept: application/json" \
-H"Content-Type: application/json" \
-H"DD-API-KEY: ${DD_API_KEY}" \
-H"DD-APPLICATION-KEY: ${DD_APP_KEY}" \
-d@-<<EOF{
"data": {
"attributes": {
"components_affected": [
{
"id": "1234abcd-12ab-34cd-56ef-123456abcdef",
"status": "operational"
}
],
"description": "We've deployed a fix and latency has returned to normal. This issue has been resolved.",
"status": "resolved",
"title": "Elevated API Latency in US1"
},
"id": "1234abcd-12ab-34cd-56ef-123456abcdef",
"type": "degradations"
}
}EOF
// Update degradation returns "OK" responsepackagemainimport("context""encoding/json""fmt""os""github.com/DataDog/datadog-api-client-go/v2/api/datadog""github.com/DataDog/datadog-api-client-go/v2/api/datadogV2""github.com/google/uuid")funcmain(){// there is a valid "status_page" in the systemStatusPageDataID:=uuid.MustParse(os.Getenv("STATUS_PAGE_DATA_ID"))// there is a valid "degradation" in the systemDegradationDataID:=uuid.MustParse(os.Getenv("DEGRADATION_DATA_ID"))body:=datadogV2.PatchDegradationRequest{Data:&datadogV2.PatchDegradationRequestData{Attributes:datadogV2.PatchDegradationRequestDataAttributes{Title:datadog.PtrString("Elevated API Latency in US1"),},Id:DegradationDataID,Type:datadogV2.PATCHDEGRADATIONREQUESTDATATYPE_DEGRADATIONS,},}ctx:=datadog.NewDefaultContext(context.Background())configuration:=datadog.NewConfiguration()apiClient:=datadog.NewAPIClient(configuration)api:=datadogV2.NewStatusPagesApi(apiClient)resp,r,err:=api.UpdateDegradation(ctx,StatusPageDataID,DegradationDataID,body,*datadogV2.NewUpdateDegradationOptionalParameters())iferr!=nil{fmt.Fprintf(os.Stderr,"Error when calling `StatusPagesApi.UpdateDegradation`: %v\n",err)fmt.Fprintf(os.Stderr,"Full HTTP response: %v\n",r)}responseContent,_:=json.MarshalIndent(resp,""," ")fmt.Fprintf(os.Stdout,"Response from `StatusPagesApi.UpdateDegradation`:\n%s\n",responseContent)}
// Update degradation returns "OK" responseimportcom.datadog.api.client.ApiClient;importcom.datadog.api.client.ApiException;importcom.datadog.api.client.v2.api.StatusPagesApi;importcom.datadog.api.client.v2.model.Degradation;importcom.datadog.api.client.v2.model.PatchDegradationRequest;importcom.datadog.api.client.v2.model.PatchDegradationRequestData;importcom.datadog.api.client.v2.model.PatchDegradationRequestDataAttributes;importcom.datadog.api.client.v2.model.PatchDegradationRequestDataType;importjava.util.UUID;publicclassExample{publicstaticvoidmain(String[]args){ApiClientdefaultClient=ApiClient.getDefaultApiClient();StatusPagesApiapiInstance=newStatusPagesApi(defaultClient);// there is a valid "status_page" in the systemUUIDSTATUS_PAGE_DATA_ID=null;try{STATUS_PAGE_DATA_ID=UUID.fromString(System.getenv("STATUS_PAGE_DATA_ID"));}catch(IllegalArgumentExceptione){System.err.println("Error parsing UUID: "+e.getMessage());}// there is a valid "degradation" in the systemUUIDDEGRADATION_DATA_ID=null;try{DEGRADATION_DATA_ID=UUID.fromString(System.getenv("DEGRADATION_DATA_ID"));}catch(IllegalArgumentExceptione){System.err.println("Error parsing UUID: "+e.getMessage());}PatchDegradationRequestbody=newPatchDegradationRequest().data(newPatchDegradationRequestData().attributes(newPatchDegradationRequestDataAttributes().title("Elevated API Latency in US1")).id(DEGRADATION_DATA_ID).type(PatchDegradationRequestDataType.DEGRADATIONS));try{Degradationresult=apiInstance.updateDegradation(STATUS_PAGE_DATA_ID,DEGRADATION_DATA_ID,body);System.out.println(result);}catch(ApiExceptione){System.err.println("Exception when calling StatusPagesApi#updateDegradation");System.err.println("Status code: "+e.getCode());System.err.println("Reason: "+e.getResponseBody());System.err.println("Response headers: "+e.getResponseHeaders());e.printStackTrace();}}}
"""
Update degradation returns "OK" response
"""fromosimportenvironfromdatadog_api_clientimportApiClient,Configurationfromdatadog_api_client.v2.api.status_pages_apiimportStatusPagesApifromdatadog_api_client.v2.model.patch_degradation_requestimportPatchDegradationRequestfromdatadog_api_client.v2.model.patch_degradation_request_dataimportPatchDegradationRequestDatafromdatadog_api_client.v2.model.patch_degradation_request_data_attributesimportPatchDegradationRequestDataAttributesfromdatadog_api_client.v2.model.patch_degradation_request_data_typeimportPatchDegradationRequestDataType# there is a valid "status_page" in the systemSTATUS_PAGE_DATA_ID=environ["STATUS_PAGE_DATA_ID"]# there is a valid "degradation" in the systemDEGRADATION_DATA_ID=environ["DEGRADATION_DATA_ID"]body=PatchDegradationRequest(data=PatchDegradationRequestData(attributes=PatchDegradationRequestDataAttributes(title="Elevated API Latency in US1",),id=DEGRADATION_DATA_ID,type=PatchDegradationRequestDataType.DEGRADATIONS,),)configuration=Configuration()withApiClient(configuration)asapi_client:api_instance=StatusPagesApi(api_client)response=api_instance.update_degradation(page_id=STATUS_PAGE_DATA_ID,degradation_id=DEGRADATION_DATA_ID,body=body)print(response)
# Update degradation returns "OK" responserequire"datadog_api_client"api_instance=DatadogAPIClient::V2::StatusPagesAPI.new# there is a valid "status_page" in the systemSTATUS_PAGE_DATA_ID=ENV["STATUS_PAGE_DATA_ID"]# there is a valid "degradation" in the systemDEGRADATION_DATA_ID=ENV["DEGRADATION_DATA_ID"]body=DatadogAPIClient::V2::PatchDegradationRequest.new({data:DatadogAPIClient::V2::PatchDegradationRequestData.new({attributes:DatadogAPIClient::V2::PatchDegradationRequestDataAttributes.new({title:"Elevated API Latency in US1",}),id:DEGRADATION_DATA_ID,type:DatadogAPIClient::V2::PatchDegradationRequestDataType::DEGRADATIONS,}),})papi_instance.update_degradation(STATUS_PAGE_DATA_ID,DEGRADATION_DATA_ID,body)
// Update degradation returns "OK" response
usedatadog_api_client::datadog;usedatadog_api_client::datadogV2::api_status_pages::StatusPagesAPI;usedatadog_api_client::datadogV2::api_status_pages::UpdateDegradationOptionalParams;usedatadog_api_client::datadogV2::model::PatchDegradationRequest;usedatadog_api_client::datadogV2::model::PatchDegradationRequestData;usedatadog_api_client::datadogV2::model::PatchDegradationRequestDataAttributes;usedatadog_api_client::datadogV2::model::PatchDegradationRequestDataType;#[tokio::main]asyncfnmain(){// there is a valid "status_page" in the system
letstatus_page_data_id=uuid::Uuid::parse_str(&std::env::var("STATUS_PAGE_DATA_ID").unwrap()).expect("Invalid UUID");// there is a valid "degradation" in the system
letdegradation_data_id=uuid::Uuid::parse_str(&std::env::var("DEGRADATION_DATA_ID").unwrap()).expect("Invalid UUID");letbody=PatchDegradationRequest::new().data(PatchDegradationRequestData::new(PatchDegradationRequestDataAttributes::new().title("Elevated API Latency in US1".to_string()),degradation_data_id.clone(),PatchDegradationRequestDataType::DEGRADATIONS,));letconfiguration=datadog::Configuration::new();letapi=StatusPagesAPI::with_config(configuration);letresp=api.update_degradation(status_page_data_id.clone(),degradation_data_id.clone(),body,UpdateDegradationOptionalParams::default(),).await;ifletOk(value)=resp{println!("{:#?}",value);}else{println!("{:#?}",resp.unwrap_err());}}
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com"DD_API_KEY="<DD_API_KEY>"DD_APP_KEY="<DD_APP_KEY>"cargo run
/**
* Update degradation returns "OK" response
*/import{client,v2}from"@datadog/datadog-api-client";constconfiguration=client.createConfiguration();constapiInstance=newv2.StatusPagesApi(configuration);// there is a valid "status_page" in the system
constSTATUS_PAGE_DATA_ID=process.env.STATUS_PAGE_DATA_IDasstring;// there is a valid "degradation" in the system
constDEGRADATION_DATA_ID=process.env.DEGRADATION_DATA_IDasstring;constparams: v2.StatusPagesApiUpdateDegradationRequest={body:{data:{attributes:{title:"Elevated API Latency in US1",},id: DEGRADATION_DATA_ID,type:"degradations",},},pageId: STATUS_PAGE_DATA_ID,degradationId: DEGRADATION_DATA_ID,};apiInstance.updateDegradation(params).then((data: v2.Degradation)=>{console.log("API called successfully. Returned data: "+JSON.stringify(data));}).catch((error: any)=>console.error(error));
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com"DD_API_KEY="<DD_API_KEY>"DD_APP_KEY="<DD_APP_KEY>"cargo run
/**
* List degradations returns "OK" response
*/import{client,v2}from"@datadog/datadog-api-client";constconfiguration=client.createConfiguration();constapiInstance=newv2.StatusPagesApi(configuration);apiInstance.listDegradations().then((data: v2.DegradationArray)=>{console.log("API called successfully. Returned data: "+JSON.stringify(data));}).catch((error: any)=>console.error(error));
"""
Get degradation returns "OK" response
"""fromosimportenvironfromdatadog_api_clientimportApiClient,Configurationfromdatadog_api_client.v2.api.status_pages_apiimportStatusPagesApi# there is a valid "status_page" in the systemSTATUS_PAGE_DATA_ID=environ["STATUS_PAGE_DATA_ID"]# there is a valid "degradation" in the systemDEGRADATION_DATA_ID=environ["DEGRADATION_DATA_ID"]configuration=Configuration()withApiClient(configuration)asapi_client:api_instance=StatusPagesApi(api_client)response=api_instance.get_degradation(page_id=STATUS_PAGE_DATA_ID,degradation_id=DEGRADATION_DATA_ID,)print(response)
# Get degradation returns "OK" responserequire"datadog_api_client"api_instance=DatadogAPIClient::V2::StatusPagesAPI.new# there is a valid "status_page" in the systemSTATUS_PAGE_DATA_ID=ENV["STATUS_PAGE_DATA_ID"]# there is a valid "degradation" in the systemDEGRADATION_DATA_ID=ENV["DEGRADATION_DATA_ID"]papi_instance.get_degradation(STATUS_PAGE_DATA_ID,DEGRADATION_DATA_ID)
// Get degradation returns "OK" responsepackagemainimport("context""encoding/json""fmt""os""github.com/DataDog/datadog-api-client-go/v2/api/datadog""github.com/DataDog/datadog-api-client-go/v2/api/datadogV2""github.com/google/uuid")funcmain(){// there is a valid "status_page" in the systemStatusPageDataID:=uuid.MustParse(os.Getenv("STATUS_PAGE_DATA_ID"))// there is a valid "degradation" in the systemDegradationDataID:=uuid.MustParse(os.Getenv("DEGRADATION_DATA_ID"))ctx:=datadog.NewDefaultContext(context.Background())configuration:=datadog.NewConfiguration()apiClient:=datadog.NewAPIClient(configuration)api:=datadogV2.NewStatusPagesApi(apiClient)resp,r,err:=api.GetDegradation(ctx,StatusPageDataID,DegradationDataID,*datadogV2.NewGetDegradationOptionalParameters())iferr!=nil{fmt.Fprintf(os.Stderr,"Error when calling `StatusPagesApi.GetDegradation`: %v\n",err)fmt.Fprintf(os.Stderr,"Full HTTP response: %v\n",r)}responseContent,_:=json.MarshalIndent(resp,""," ")fmt.Fprintf(os.Stdout,"Response from `StatusPagesApi.GetDegradation`:\n%s\n",responseContent)}
// Get degradation returns "OK" responseimportcom.datadog.api.client.ApiClient;importcom.datadog.api.client.ApiException;importcom.datadog.api.client.v2.api.StatusPagesApi;importcom.datadog.api.client.v2.model.Degradation;importjava.util.UUID;publicclassExample{publicstaticvoidmain(String[]args){ApiClientdefaultClient=ApiClient.getDefaultApiClient();StatusPagesApiapiInstance=newStatusPagesApi(defaultClient);// there is a valid "status_page" in the systemUUIDSTATUS_PAGE_DATA_ID=null;try{STATUS_PAGE_DATA_ID=UUID.fromString(System.getenv("STATUS_PAGE_DATA_ID"));}catch(IllegalArgumentExceptione){System.err.println("Error parsing UUID: "+e.getMessage());}// there is a valid "degradation" in the systemUUIDDEGRADATION_DATA_ID=null;try{DEGRADATION_DATA_ID=UUID.fromString(System.getenv("DEGRADATION_DATA_ID"));}catch(IllegalArgumentExceptione){System.err.println("Error parsing UUID: "+e.getMessage());}try{Degradationresult=apiInstance.getDegradation(STATUS_PAGE_DATA_ID,DEGRADATION_DATA_ID);System.out.println(result);}catch(ApiExceptione){System.err.println("Exception when calling StatusPagesApi#getDegradation");System.err.println("Status code: "+e.getCode());System.err.println("Reason: "+e.getResponseBody());System.err.println("Response headers: "+e.getResponseHeaders());e.printStackTrace();}}}
// Get degradation returns "OK" response
usedatadog_api_client::datadog;usedatadog_api_client::datadogV2::api_status_pages::GetDegradationOptionalParams;usedatadog_api_client::datadogV2::api_status_pages::StatusPagesAPI;#[tokio::main]asyncfnmain(){// there is a valid "status_page" in the system
letstatus_page_data_id=uuid::Uuid::parse_str(&std::env::var("STATUS_PAGE_DATA_ID").unwrap()).expect("Invalid UUID");// there is a valid "degradation" in the system
letdegradation_data_id=uuid::Uuid::parse_str(&std::env::var("DEGRADATION_DATA_ID").unwrap()).expect("Invalid UUID");letconfiguration=datadog::Configuration::new();letapi=StatusPagesAPI::with_config(configuration);letresp=api.get_degradation(status_page_data_id.clone(),degradation_data_id.clone(),GetDegradationOptionalParams::default(),).await;ifletOk(value)=resp{println!("{:#?}",value);}else{println!("{:#?}",resp.unwrap_err());}}
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com"DD_API_KEY="<DD_API_KEY>"DD_APP_KEY="<DD_APP_KEY>"cargo run
/**
* Get degradation returns "OK" response
*/import{client,v2}from"@datadog/datadog-api-client";constconfiguration=client.createConfiguration();constapiInstance=newv2.StatusPagesApi(configuration);// there is a valid "status_page" in the system
constSTATUS_PAGE_DATA_ID=process.env.STATUS_PAGE_DATA_IDasstring;// there is a valid "degradation" in the system
constDEGRADATION_DATA_ID=process.env.DEGRADATION_DATA_IDasstring;constparams: v2.StatusPagesApiGetDegradationRequest={pageId: STATUS_PAGE_DATA_ID,degradationId: DEGRADATION_DATA_ID,};apiInstance.getDegradation(params).then((data: v2.Degradation)=>{console.log("API called successfully. Returned data: "+JSON.stringify(data));}).catch((error: any)=>console.error(error));
"""
Delete degradation returns "No Content" response
"""fromosimportenvironfromdatadog_api_clientimportApiClient,Configurationfromdatadog_api_client.v2.api.status_pages_apiimportStatusPagesApi# there is a valid "status_page" in the systemSTATUS_PAGE_DATA_ID=environ["STATUS_PAGE_DATA_ID"]# there is a valid "degradation" in the systemDEGRADATION_DATA_ID=environ["DEGRADATION_DATA_ID"]configuration=Configuration()withApiClient(configuration)asapi_client:api_instance=StatusPagesApi(api_client)api_instance.delete_degradation(page_id=STATUS_PAGE_DATA_ID,degradation_id=DEGRADATION_DATA_ID,)
# Delete degradation returns "No Content" responserequire"datadog_api_client"api_instance=DatadogAPIClient::V2::StatusPagesAPI.new# there is a valid "status_page" in the systemSTATUS_PAGE_DATA_ID=ENV["STATUS_PAGE_DATA_ID"]# there is a valid "degradation" in the systemDEGRADATION_DATA_ID=ENV["DEGRADATION_DATA_ID"]api_instance.delete_degradation(STATUS_PAGE_DATA_ID,DEGRADATION_DATA_ID)
// Delete degradation returns "No Content" responsepackagemainimport("context""fmt""os""github.com/DataDog/datadog-api-client-go/v2/api/datadog""github.com/DataDog/datadog-api-client-go/v2/api/datadogV2""github.com/google/uuid")funcmain(){// there is a valid "status_page" in the systemStatusPageDataID:=uuid.MustParse(os.Getenv("STATUS_PAGE_DATA_ID"))// there is a valid "degradation" in the systemDegradationDataID:=uuid.MustParse(os.Getenv("DEGRADATION_DATA_ID"))ctx:=datadog.NewDefaultContext(context.Background())configuration:=datadog.NewConfiguration()apiClient:=datadog.NewAPIClient(configuration)api:=datadogV2.NewStatusPagesApi(apiClient)r,err:=api.DeleteDegradation(ctx,StatusPageDataID,DegradationDataID)iferr!=nil{fmt.Fprintf(os.Stderr,"Error when calling `StatusPagesApi.DeleteDegradation`: %v\n",err)fmt.Fprintf(os.Stderr,"Full HTTP response: %v\n",r)}}
// Delete degradation returns "No Content" responseimportcom.datadog.api.client.ApiClient;importcom.datadog.api.client.ApiException;importcom.datadog.api.client.v2.api.StatusPagesApi;importjava.util.UUID;publicclassExample{publicstaticvoidmain(String[]args){ApiClientdefaultClient=ApiClient.getDefaultApiClient();StatusPagesApiapiInstance=newStatusPagesApi(defaultClient);// there is a valid "status_page" in the systemUUIDSTATUS_PAGE_DATA_ID=null;try{STATUS_PAGE_DATA_ID=UUID.fromString(System.getenv("STATUS_PAGE_DATA_ID"));}catch(IllegalArgumentExceptione){System.err.println("Error parsing UUID: "+e.getMessage());}// there is a valid "degradation" in the systemUUIDDEGRADATION_DATA_ID=null;try{DEGRADATION_DATA_ID=UUID.fromString(System.getenv("DEGRADATION_DATA_ID"));}catch(IllegalArgumentExceptione){System.err.println("Error parsing UUID: "+e.getMessage());}try{apiInstance.deleteDegradation(STATUS_PAGE_DATA_ID,DEGRADATION_DATA_ID);}catch(ApiExceptione){System.err.println("Exception when calling StatusPagesApi#deleteDegradation");System.err.println("Status code: "+e.getCode());System.err.println("Reason: "+e.getResponseBody());System.err.println("Response headers: "+e.getResponseHeaders());e.printStackTrace();}}}
// Delete degradation returns "No Content" response
usedatadog_api_client::datadog;usedatadog_api_client::datadogV2::api_status_pages::StatusPagesAPI;#[tokio::main]asyncfnmain(){// there is a valid "status_page" in the system
letstatus_page_data_id=uuid::Uuid::parse_str(&std::env::var("STATUS_PAGE_DATA_ID").unwrap()).expect("Invalid UUID");// there is a valid "degradation" in the system
letdegradation_data_id=uuid::Uuid::parse_str(&std::env::var("DEGRADATION_DATA_ID").unwrap()).expect("Invalid UUID");letconfiguration=datadog::Configuration::new();letapi=StatusPagesAPI::with_config(configuration);letresp=api.delete_degradation(status_page_data_id.clone(),degradation_data_id.clone()).await;ifletOk(value)=resp{println!("{:#?}",value);}else{println!("{:#?}",resp.unwrap_err());}}
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com"DD_API_KEY="<DD_API_KEY>"DD_APP_KEY="<DD_APP_KEY>"cargo run
/**
* Delete degradation returns "No Content" response
*/import{client,v2}from"@datadog/datadog-api-client";constconfiguration=client.createConfiguration();constapiInstance=newv2.StatusPagesApi(configuration);// there is a valid "status_page" in the system
constSTATUS_PAGE_DATA_ID=process.env.STATUS_PAGE_DATA_IDasstring;// there is a valid "degradation" in the system
constDEGRADATION_DATA_ID=process.env.DEGRADATION_DATA_IDasstring;constparams: v2.StatusPagesApiDeleteDegradationRequest={pageId: STATUS_PAGE_DATA_ID,degradationId: DEGRADATION_DATA_ID,};apiInstance.deleteDegradation(params).then((data: any)=>{console.log("API called successfully. Returned data: "+JSON.stringify(data));}).catch((error: any)=>console.error(error));
{"data":{"attributes":{"title":"API Maintenance","scheduled_description":"We will be performing maintenance on the API to improve performance.","in_progress_description":"We are currently performing maintenance on the API to improve performance.","completed_description":"We have completed maintenance on the API to improve performance.","start_date":"2021-11-11T12:11:11+00:00","completed_date":"2021-11-11T13:11:11+00:00","components_affected":[{"id":"4e9d3726-bdd7-0079-613c-e9aaba89eb01","status":"operational"}]},"type":"maintenances"}}
## default
#
# Path parameters exportpage_id="CHANGE_ME" # Curl command curl-XPOST"https://api.ap1.datadoghq.com"https://api.ap2.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/statuspages/${page_id}/maintenances" \
-H"Accept: application/json" \
-H"Content-Type: application/json" \
-H"DD-API-KEY: ${DD_API_KEY}" \
-H"DD-APPLICATION-KEY: ${DD_APP_KEY}" \
-d@-<<EOF{
"data": {
"attributes": {
"completed_date": "2026-02-18T19:51:13.332360075Z",
"completed_description": "We have completed maintenance on the API to improve performance.",
"components_affected": [
{
"id": "1234abcd-12ab-34cd-56ef-123456abcdef",
"status": "operational"
}
],
"in_progress_description": "We are currently performing maintenance on the API to improve performance.",
"scheduled_description": "We will be performing maintenance on the API to improve performance.",
"start_date": "2026-02-18T19:21:13.332360075Z",
"title": "API Maintenance"
},
"type": "maintenances"
}
}EOF
{"data":{"attributes":{"scheduled_description":"We will be performing maintenance on the API to improve performance for 40 minutes.","in_progress_description":"We are currently performing maintenance on the API to improve performance for 40 minutes."},"id":"6a167dcd-4975-9fda-c895-ee008c4256f9","type":"maintenances"}}