Creates a new status page in an unpublished state. Use the dedicated publish status page endpoint to publish the page after creation.
This endpoint requires the status_pages_settings_write permission.
OAuth apps require the status_pages_settings_write authorization scope to access this endpoint.
引数
クエリ文字列
名前
種類
説明
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
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.
slack_app_icon
string
The Slack app icon URL for the status page.
slack_subscriptions_enabled
boolean
Whether Slack subscriptions are enabled for 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}],"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),},},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,),],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,}),],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(),"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.comuk1.datadoghq.comddog-gov.comus2.ddog-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,},],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));