Create a Zone¶
Overview¶
- Create a zone
Classification¶
- Create
API Operation Object¶
- Zone
Synchronous / Asynchronous¶
- Synchronous
Request¶
HTTP Request Method¶
- POST
HTTP Request Path¶
{api_endpoint}/v2/zones
HTTP Request Header¶
Format¶
Content-Type: application/json
Accept: application/json
X-Auth-Token: <token_id>
HTTP Request Body¶
Format¶
{
"description": <description>,
"email": <email>,
"masters": <masters>,
"name": <name>,
"ttl": <ttl>,
"type": <type>
}
Request Parameter¶
name | style | format | description | required/optional | default value | action for invalid parameter | response code for invalid parameter |
---|---|---|---|---|---|---|---|
token_id | header | authentication token string | authentication token | required | - | Terminate | 401 |
description | body | string(1-255 characters) | Description for this zone | optional | - | Terminate | 400 |
body | string | e-mail for the zone. Used in SOA records for the zone. This parameter is not currently supported. | optional | - | Terminate | 400 | |
masters | body | enum list | For secondary zones. The servers to slave from to get DNS information. This parameter is not currently supported. | optional | - | Terminate | 400 |
name | body | zonename(1-128bytes) | DNS Name for the zone. | required | - | Terminate | 400 |
ttl | body | integer | TTL (Time to Live) for the zone. This parameter is not currently supported. | optional | - | Terminate | 400 |
type | body | enum | Type of zone. PRIMARY is controlled by SDPF DNS, SECONDARY zones are slaved from another DNS Server. Defaults to PRIMARY. This parameter is not currently supported. | optional | PRIMARY | Terminate | 400 |
Response¶
HTTP Response Header¶
Response Code¶
response code | status | condition | message |
---|---|---|---|
202 | Accepted | normal end | |
400 | Bad Request | invalid value | E2003 Zone count reaches the upper limit. |
Bad Request | invalid value | E2010 Invalid domain name format. | |
Bad Request | invalid value | E2012 Invalid zone name. (Must end with a period.) | |
Bad Request | invalid value | E2013 Invalid zone name. (Must be domain name format.) | |
Bad Request | invalid value | E2014 Can't set domain name perfect matching zone name. | |
Bad Request | invalid value | E2015 Can't set domain name not end with zone name. | |
Bad Request | invalid value | E2040 Input parameters are required. | |
Bad Request | invalid value | E2041 Zone name is required. | |
Bad Request | invalid value | E2053 Zone name must be less than or equal to 128. | |
Bad Request | invalid value | E2054 Description must be less than or equal to 255. | |
401 | Unauthorized | authentication failure | E2001 Invalid token. |
500 | Internal Server Error | internal server error | E9001 Internal Server Error. Request failed. |
Response Body¶
Format¶
{
"id":<id>,
"pool_id":<pool_id>,
"project_id":<project_id>,
"name":<name>,
"email":<email>,
"ttl":<ttl>,
"serial":<serial>,
"status":<status>,
"description":<description>,
"masters":<masters>,
"type":<type>,
"transferred_at":<transferred_at>,
"version":<version>,
"created_at":<created_at>,
"updated_at":<updated_at>,
"links":{
<links>
}
}
Response Parameter¶
item | format | description |
---|---|---|
id | uuid | ID for the resource. |
pool_id | uuid | ID for the pool hosting this zone. This parameter is not currently supported. |
project_id | uuid | ID for the project(tenant) that owns the resource. |
name | zonename | DNS Name for the zone. |
string | e-mail for the zone. Used in SOA records for the zone. This parameter is not currently supported. It always returns an empty string. | |
ttl | integer | TTL (Time to Live) for the zone. This parameter is not currently supported. it always return zero. |
serial | integer | current serial number for the zone. This parameter is not currently supported. it always return zero. |
status | enum | status of the resource. |
description | string | Description for this zone |
masters | enum list | For secondary zones. The servers to slave from to get DNS information. This parameter is not currently supported. It always returns an empty string. |
type | enum | Type of zone. PRIMARY is controlled by SDPF DNS, SECONDARY zones are slaved from another DNS Server. Defaults to PRIMARY. This parameter is not currently supported. It always returns an empty string. |
transferred_at | enum | For secondary zones. The last time an update was retrieved from the master servers. This parameter is not currently supported. it always return null. |
version | integer | Version of the resource. This parameter is not currently supported. it always return 1. |
created_at | datestamp | Date / Time when resource was created. |
updated_at | datestamp | Date / Time when resource last updated. |
links | links | Links to the resource, and other related resources. When a response has been broken into pages, we will include a next link that should be followed to retrieve all results |
Sample Request and Response¶
Sample API Request¶
Request URL¶
POST /v2/zones
Request Header¶
Content-Type: application/json
Accept: application/json
X-Auth-Token: e8c788fbaeb14964ae19759eb1df4ff1
Request Body¶
{
"description": "This is a test zone.",
"email": "master@example.com",
"masters": ["ns-1.example.uk","ns-2.example.uk"],
"name": "example.uk.",
"ttl": 600,
"type": "PRIMARY"
}
Sample API Response¶
Response Header¶
HTTP/1.1 202
Date: Mon, 24 Oct 2016 01:30:52 GMT
Content-Type: application/json
Content-Length: 428
Connection: keep-alive
Set-Cookie: TS0183560f=01cce65ce13e8b2040a67520197b4386f256713c8ddb5eb8b42201eb564537fd1b13befa02; Path=/
Response Body¶
{
"id":"7f0e3541-9fc6-410d-b338-087909f04ebc",
"pool_id":"",
"project_id":"9348360ee0984a85a54e188a34c94851",
"name":"example.uk.",
"email":"",
"ttl":0,
"serial":0,
"status":"CREATING",
"description":"This is a test zone.",
"masters":[],
"type":"",
"transferred_at":null,
"version":1,
"created_at":"2016-10-24T01:30:52",
"updated_at":null,
"links":{
"self":"https://endpoint.api.example.com/v2/zones/7f0e3541-9fc6-410d-b338-087909f04ebc"
}
}
Sample Error Response¶
Response¶
HTTP/1.1 400
Date: Wed, 26 Oct 2016 04:46:07 GMT
Content-Type: application/json
Content-Length: 90
Connection: keep-alive
Set-Cookie: TS0183560f=01cce65ce116bed7c1ea09e8fa32c47766854d3e0595b350c8e8288bb4faf01150e4f62661; Path=/
{"error":{"code":400,"title":"Bad Request","message":"E2039 Nameservers is unavailable."}}