Update a Zone

Overview

  • Update the attribute(s) for an existing zone.

Classification

  • Update

API Operation Object

  • Zone

Synchronous / Asynchronous

  • Synchronous

Request

HTTP Request Method

  • PATCH

HTTP Request Path

{api_endpoint}/v2/zones/{zone_id}

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>,
  "ttl": <ttl>
}

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

zone_id

path

uuid

ID for the zone.

required

-

Terminate

400, 404

description

body

string(0-255 characters)

Description for this zone

optional

-

Terminate

400

email

body

string

e-mail for the zone. Used in SOA records for the zone. This parameter is not currently supported.

optional

-

Terminate

masters

body

enum list

For secondary zones. The servers to slave from to get DNS information. This parameter is not currently supported.

optional

-

Terminate

ttl

body

integer

TTL (Time to Live) for the zone. This parameter is not currently supported.

optional

-

Terminate

Response

HTTP Response Header

Format

HTTP/1.1 <response_code>       (ex. 200)
  • <response_code>: see "Response Code" section

Response Code

response code

status

condition

message

200

ok

normal end

400

Bad Request

invalid value

E2054 Description must be less than or equal to 255.

404

Not Found

not found

E2007 Specified zone is not found.

401

Unauthorized

authentication failure

E2001 Invalid token.

500

Internal Server Error

internal server error

E9001 Internal Server Error. Request failed.

Response Body

Format

{
  "zones": [
  {
    "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>,
    "action": <action>,
    "attributes": [],
    "created_at": <created_at>,
    "updated_at": <updated_at>,
    "links": {
      <links>
    }
 }

Response Parameter

item

format

description

id

uuid

ID for the zone.

pool_id

uuid

ID for the pool hosting this zone. This parameter is not currently supported. It always returns an empty string.

project_id

uuid

ID for the project(tenant) that owns the resource.

name

zonename

DNS Name for the zone.

email

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

PATCH /v2/zones/fbe8562b-66a5-4071-b4c2-250487d15a81

Request Header

Content-Type: application/json
Accept: application/json
X-Auth-Token: e8c788fbaeb14964ae19759eb1df4ff1

Request Body

{
  "description": "This is an updated comment.",
  "email": "updated@example.com",
  "masters": ["updated"],
  "ttl": 3600
}

Sample API Response

Response Header

HTTP/1.1 200
Date: Mon, 24 Oct 2016 04:14:37 GMT
Content-Type: application/json
Content-Length: 451
Connection: keep-alive
Set-Cookie: TS0183560f=01cce65ce18e0541df13d9bef024cf9f38aeb9a2d05c9a41d058fa9f37392492c4daeb56da; Path=/

Response Body

{
  "id": "fbe8562b-66a5-4071-b4c2-250487d15a81",
  "pool_id": "",
  "project_id": "9348360ee0984a85a54e188a34c94851",
  "name": "example.uk.",
  "email": "",
  "ttl": 0,
  "serial": 0,
  "status": "ACTIVE",
  "description": "This is an updated comment.",
  "masters": [],
  "type": "",
  "transferred_at": null,
  "version": 1,
  "created_at": "2016-10-24T03:36:01",
  "updated_at": "2016-10-24T04:14:38",
  "links": {
    "self": "https://endpoint.api.example.com/v2/zones/fbe8562b-66a5-4071-b4c2-250487d15a81"
  }
}

Sample Error Response

Response

HTTP/1.1 404
Date: Mon, 24 Oct 2016 04:14:15 GMT
Content-Type: application/json
Content-Length: 89
Connection: keep-alive
Set-Cookie: TS0183560f=01cce65ce102f857a066a5831d0ad5de2999f76b95ae65c6b69b6d2b8957f0002f52b8e4b3; Path=/

{"error":{"code":404,"title":"Not Found","message":"E2007 Specified zone is not found."}}