Creating a Domain Name
Function
This API is used to create a domain name.
URI
POST /v1.0/cdn/domains
Request Parameters
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
X-Auth-Token |
Yes |
String |
User token. It can be obtained by calling the corresponding IAM API (value of X-Subject-Token in the response header). |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
domain |
Yes |
DomainBody object |
Body for creating a domain name. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
domain_name |
Yes |
String |
Domain name. The domain name consists of one or more parts, representing domains at different levels. These parts, technically known as labels, are concatenated and delimited by periods (.). A label consists of case-insensitive letters, numbers, and hyphens (-). The domain name can contain up to 75 characters. Do not start or end a domain name with hyphens (-). |
business_type |
Yes |
String |
Service type. Possible values: web (website acceleration), download (download acceleration), and video (on-demand service acceleration). |
sources |
Yes |
Array of Sources objects |
Origin server settings. |
service_area |
Yes |
String |
Service area of the domain name. Possible values: europe (Europe) and outside_mainland_china (outside the Chinese mainland). |
enterprise_project_id |
No |
String |
Enterprise project to which the domain name is added. This parameter is valid only when the enterprise project function is enabled. This parameter is mandatory when you use an IAM user to call this API. Obtain the enterprise project ID by calling the API for listing enterprise projects of Enterprise Project Management Service (EPS). |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
origin_type |
Yes |
String |
Origin server type. Possible values: ipaddr (IP address) and domain (domain name). |
ip_or_domain |
Yes |
String |
Non-intranet IP address or domain name of the origin server. |
active_standby |
Yes |
Integer |
Whether the origin server is primary or standby. Possible values: 1 (primary) and 0 (standby). |
Response Parameters
Status code: 200
Parameter |
Type |
Description |
---|---|---|
domain |
Response to the request for creating a domain name. |
Parameter |
Type |
Description |
---|---|---|
id |
String |
Domain name ID. |
domain_name |
String |
Domain name. |
business_type |
String |
Service type of the domain name. Possible values:
|
service_area |
String |
Service area of the domain name. Possible values: europe (Europe) and outside_mainland_china (outside the Chinese mainland). |
domain_status |
String |
Domain name status. Possible values:
|
cname |
String |
CNAME record of the domain name. |
sources |
Array of Sources objects |
Origin server details. |
https_status |
Integer |
Whether HTTPS is enabled for acceleration. |
create_time |
Long |
Time when the domain name was created. The value is the number of milliseconds since the UNIX epoch (Jan 1, 1970). |
modify_time |
Long |
Time when the domain name was modified. The value is the number of milliseconds since the UNIX epoch (Jan 1, 1970). |
disabled |
Integer |
Whether the domain name is banned. Possible values: 0 (not banned) and 1 (banned). |
locked |
Integer |
Whether the domain name is locked. Possible values: 0 (not locked) and 1 (locked). |
range_status |
String |
Whether range-based retrieval is enabled. Possible values: off (disabled) and on (enabled). |
follow_status |
String |
Status of 302 redirect. Possible values: off (disabled) and on (enabled). |
origin_status |
String |
Origin pull status. off: disabled. on: enabled. |
Parameter |
Type |
Description |
---|---|---|
origin_type |
String |
Origin server type. Possible values: ipaddr (IP address) and domain (domain name). |
ip_or_domain |
String |
Non-intranet IP address or domain name of the origin server. |
active_standby |
Integer |
Whether the origin server is primary or standby. Possible values: 1 (primary) and 0 (standby). |
Example Requests
POST https://cdn.myhuaweicloud.eu/v1.0/cdn/domains { "domain" : { "domain_name" : "example1.example2.example3.com", "business_type" : "web", "sources" : [ { "ip_or_domain" : "example.origin.com", "origin_type" : "domain", "active_standby" : 1 } ], "service_area" : "europe", "enterprise_project_id" : "0" } }
Example Responses
Status code: 200
OK
{ "domain" : { "sources" : { "ip_or_domain" : "example.origin.com", "origin_type" : "domain", "active_standby" : 1 }, "id" : "ff80*************************07b", "domain_name" : "example11.example2.example3.com", "business_type" : "web", "service_area" : "europe", "cname" : "example1.example2.example3.com.c.example4.com", "domain_status" : "configuring", "https_status" : 0, "create_time" : 1513152634467, "modify_time" : 1513152634467, "disabled" : 0, "locked" : 0, "range_status" : "off", "follow_status" : "off", "origin_status" : "on" } }
Status Codes
Status Code |
Description |
---|---|
200 |
OK |
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.