Creating a Record Set
Function
This API is used to create a record set.
URI
POST /v1/traffic/recordsets
Request Parameters
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
X-Auth-Token |
No |
String |
Identity authentication information. Requests for calling an API can be authenticated using either a token or AK/SK. If token-based authentication is used, this parameter is mandatory and must be set to a user token. |
|
X-Zone-Project-ID |
Yes |
String |
Project ID |
|
X-Zone-ID |
Yes |
String |
DNS zone ID |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
[items] |
Yes |
Array of CreateRecordSetRequestBody objects |
- |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
name |
Yes |
String |
Fully qualified domain name (FQDN) suffixed with a zone name. It is a complete host name ended with a period (.) |
|
ttl |
Yes |
Integer |
Record set TTL. It is the cache duration (in seconds) of the record set on a local DNS server. The longer the cache is, the slower the update is applied. |
|
records |
No |
Array of strings |
Record set value, which varies depending on the record set type |
|
line |
Yes |
String |
Resolution line ID |
|
weight |
No |
Integer |
Weight of a record set |
|
type |
No |
String |
Record set type. The value can be A or CNAME. |
Response Parameters
Status code: 201
|
Parameter |
Type |
Description |
|---|---|---|
|
[items] |
Array of RecordSet objects |
DNS record set |
|
Parameter |
Type |
Description |
|---|---|---|
|
id |
String |
Record set ID |
|
description |
String |
Description |
|
zone_id |
String |
Zone ID |
|
zone_name |
String |
Zone name |
|
type |
String |
Record set type |
|
project_id |
String |
Project ID |
|
name |
String |
Record set name |
|
ttl |
Integer |
Time to live (TTL) |
|
records |
Array of strings |
Record information |
|
weight |
Integer |
Weight |
|
line |
String |
Resolution line ID |
|
create_at |
String |
Creation time |
|
update_at |
String |
Update time |
|
default |
Boolean |
Whether the record set is default |
Status code: 400
|
Parameter |
Type |
Description |
|---|---|---|
|
- |
String |
- |
Status code: 500
|
Parameter |
Type |
Description |
|---|---|---|
|
- |
String |
- |
Example Requests
Creating a record set
POST https://ucs.myhuaweicloud.com/v1/traffic/recordsets
[ {
"name" : "xxx.test1110.com.",
"type" : "A",
"ttl" : 300,
"records" : [ "172.18.0.200" ],
"line" : "default_view",
"weight" : 1
} ]
Example Responses
Status code: 201
Created record set returned
[ {
"id" : "ff80808299859ea0019a6da52d3e7bb3",
"name" : "xxx.test1110.com.",
"description" : "",
"zone_id" : "ff80808299859ea0019a6d1206716694",
"zone_name" : "test1110.com.",
"type" : "A",
"ttl" : 300,
"records" : [ "172.18.0.200" ],
"create_at" : "",
"update_at" : "",
"default" : false,
"project_id" : "05495693df80d3c92fa1c01795c2be02",
"weight" : 1,
"line" : "default_view",
"tags" : null
} ]
Status Codes
|
Status Code |
Description |
|---|---|
|
201 |
Created record set returned |
|
400 |
Client request error. The server could not execute the request. |
|
500 |
Internal server error |
Error Codes
See Error Codes.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot