Node management: Create node

You can create a Content Delivery Network node by using the API.

Note


Configurations that are created for endpoints are not immediately available.

To ensure that the custom domain name and ICP number that you entered match and are valid, you must first review them.This process can take up to one business day to complete. If the details do not pass the Internet Content Provider (ICP) review, delete the Content Delivery Network endpoint you created, and then create a new endpoint by using the correct custom domain name and ICP number. If the details do pass the ICP review, the Content Delivery Network service will be registered within 60 minutes, so that the network can propagate it.At the same time, you must also configure the CNAME mapping details, as indicated by the notifications in the interface, before the cache content can finally be accessed via the custom domain name.

Request

Method Request URI
POST https://restapi.cdn.azure.cn/subscriptions/{subscriptionId}/endpoints?apiVersion=1.0

URI parameter

Parameter name Description
subscriptionId Subscription unique identifier

Request header

Request header Description
x-azurecdn-request-date Required.Enter the current UTC request time in yyyy-MM-dd hh:mm:ss format.
Authorization Required.Refer to CDN API signing mechanism for authorization headers.
content-type Required.application/json

Request body

To create a Content Delivery Network node, specify the following parameters. An example JSON file is provided here:

{
  "CustomDomain": "www.example.com",
  "Host": "www.example.com",
  "ICP": "ICP123456",
  "Origin": {
    "Addresses": [
      "www.origin.com"
    ]
  },
  "ServiceType": "Web"
}
Parameter name Description
CustomDomain Accelerated domain names
Host Return-to-source host header
ICP ICP record number
Addresses Return-to-source address collection
ServiceType Acceleration type.
  • Web: Web page acceleration
  • Download: Download acceleration
  • VOD: On-demand acceleration
  • LiveStreaming: Live-streaming acceleration
  • ImageProcessing: Image-processing acceleration

Response

A response comprises a status code, response headers, and a response body.

Status code

Status code Description
202 Indicates that the server has successfully accepted the request.
Other General response indicating that an error has occurred.

Response header

Response header Description
X-Correlation-Id The request’s unique identifier, which is used to track request information.

Response body

JSON example for request succeeded:

{
  "EndpointID": "779bff4d-ef38-4fce-82d8-6b50cc4c183b",
  "Setting": {
    "CustomDomain": "www.example.com",
    "Host": "string",
    "ICP": "ICP123456",
    "Origin": {
      "Addresses": [
        "www.origin.com"
      ]
    },
    "ServiceType": "Web"
  },
  "Status": {
    "Enabled": "false",
    "IcpVerifyStatus": "IcpVerifying",
    "LifetimeStatus": "Creating",
    "CNameConfigured": "false",
    "FreeTrialExpired": "false",
    "TimeLastUpdated": "2017-04-28T07:34:54.849Z"
  }
}
Parameter name Description
EndpointID Node unique identifier
Enabled Task status
  • NotSet: State not set
  • Processing: Currently processing
  • Succeeded: Succeeded
  • Failed: Failed
IcpVerifyStatus ICP record verification information
  • IcpVerifying: Currently being verified
  • IcpVerifyFailed: Verification has failed
  • IcpVerified: Verification has succeeded
LifetimeStatus Node status
  • Normal: Normal
  • Creating: Creating
  • CreationFailed: Creation failed
  • Deleting: Deleting
  • Deleted: Deleted
  • Updating: Updating
  • Enabling: Activating
  • Disabling: Disabling
CNameConfigured Indicates whether the accelerated domain name CNAME record is already configured.
FreeTrialExpired Indicates whether the trial period has expired.
TimeLastUpdated Time of last update.

JSON example for request failed:

{
  "Succeeded": false,
  "ErrorInfo": {
    "Type": "MissingAuthorizationHeader",
    "Message": "Missing authorization header."
  }
}
Parameter name Description
Type Error type
  • CredentialInvalid: Invalid credentials
  • ParameterMissing: Parameter missing
  • ParameterInvalid: Invalid parameter
  • MissingAuthorizationHeader: Authorization header missing
  • InvalidRequestDateHeader: Invalid request date header
  • MissingRequestDateHeader: Missing request date header
  • AuthorizationHeaderExpired: Authorization header expired
  • InvalidAuthorizationHeader: Invalid authorization header
  • ApiKeyNotFound: API key not found
  • InvalidApiKey: Invalid API key
  • WrongSignature: Wrong signature
  • SubscriptionNotFound: Subscription does not exist
  • EndpointDoesNotBelongToSubscription: Endpoint does not belong to subscription
  • EndpointNotInActiveState: Endpoint not in active state
  • EndpointNotFound: Endpoint does not exist
  • MaliciousItemPathDetected: Malicious item path detected
  • PermissionDenied: Insufficient permissions
  • RequestThrottled: Request throttled

Message Error information