CreateDomain

1. API Description

This API (CreateDomain) is used to create an accelerated domain.

Preparation

Notes

  • The domain must be globally unique and cannot be duplicated.

  • The domainName must not be the same as the origin, as this will create a loop and prevent acceleration from working.

  • This is an asynchronous API. After a successful request, the creation of the accelerated domain is not immediately complete. During this period, the status of the accelerated domain will be Deploying. You can check the status of the accelerated domain by calling the DescribeCdnDomains API. If the domain status changes from Deploying to Deployed, the deployment is successful; if it changes to Failed, the configuration failed.

2. Request Parameters

The following table lists the required request parameters for this API.

3. Output Parameters

4. Code Example

  1. Create an Accelerated Domain

POST / HTTP/1.1
Host: console.zenlayer.com/api/v2/cdn
Content-Type: application/json
X-ZC-Action: CreateDomain
<Common Request Params>

Request:
{
    "domainName": "cdntest.zenlayer.com",
    "businessTypeId": "xxx-xx",
    "accelerationRegionId": "xxx-xx",
    "resourceGroupId":"xxx-xx",
    "origin": {
        "masterSource": "1.1.1.1",
        "slaverSource": "2.2.2.2",
        "originPort": "80",
        "originPortHttps": "443"
    }
}

Response:
{
    "requestId": "TEEFDCA5B-76FB-4E91-A18E-DF7F5D2CE41F",
    "response": {
        "requestId": "TEEFDCA5B-76FB-4E91-A18E-DF7F5D2CE41F",
        "domainId": "domainIdxxxxx"
    }
}

5. Error Codes

The following includes error codes encountered in business logic. For other error codes, see Common Error Codes.

Last updated