Update a Recordset

Overview

  • Update a recordset

Classification

  • Update

API Operation Object

  • Recordset

Synchronous / Asynchronous

  • Synchronous

Request

HTTP Request Method

  • PUT

HTTP Request Path

{api_endpoint}/v2/zones/{zone_id}/recordsets/{recordset_id}

HTTP Request Header

Format

Content-Type: application/json
Accept: application/json
X-Auth-Token: <token_id>

HTTP Request Body

Format

{
  "name" : <name>,
  "description" : <description>,
  "ttl" : <ttl>,
  "records" : <record>
}

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
recordset_id path uuid ID for the recordset. required - Terminate 400,404
ttl body integer(0-86400) TTL (Time to Live) for the recordset. optional - Terminate 400
description body string(0-255characters) Description for this recordset. optional - Terminate 400
name body hostname DNS Name for the recordset. optional - Terminate 400,409
record body string list A list of data for this recordset. These items should conform to the DNS spec for the record type - e.g. A records must be IPv4 addresses, CNAME records must be a hostname. Number of the records must be 1. optional - Terminate 400,409

Response

HTTP Response Header

Format

HTTP/1.1 <response_code>       (ex. 200)
  • <response_code>: see "Response Code" section
  • <status>: message based on the response code

Response Code

response code status condition message
202 Accepted normal end  
400 Bad Request invalid value E2040 Input parameters are required.
  Bad Request invalid value E2011 Invalid recordset format.
  Bad Request invalid value E2015 Can't set domain name not end with zone name.
  Bad Request invalid value E2016 Can't set multiple values on PTR recordset.
  Bad Request invalid value E2017 Invalid recordset format. (Must be IPaddress(v4) format.)
  Bad Request invalid value E2018 Invalid recordset format. (Must be IPaddress(v6) format.)
  Bad Request invalid value E2019 Invalid recordset format. (Must be priority and server name.)
  Bad Request invalid value E2020 Priority must be positive integer value. (0 - 65535)
  Bad Request invalid value E2021 Server name must be domain format
  Bad Request invalid value E2022 Invalid recordset format. (Must be priority and weight and service port and server name.)
  Bad Request invalid value E2023 Priority must be positive integer value. (0 - 65535)
  Bad Request invalid value E2024 Weight must be positive integer value. (0 - 65535)
  Bad Request invalid value E2025 Port must be positive integer value. (0 - 65535)
  Bad Request invalid value E2026 Server name must be domain format.
  Bad Request invalid value E2027 Invalid recordset format. (Must be IPaddress(v4) format or domain name format.)
  Bad Request invalid value E2028 Invalid recordset format. (Must be domain format.)
  Bad Request invalid value E2040 Input parameters are required.
  Bad Request invalid value E2042 Zone id is required.
  Bad Request invalid value E2044 At least domain name or TTL or recordset value is required.
  Bad Request invalid value E2049 Recordset id is required.
  Bad Request invalid value E2055 Domain name must be less than or equal to 255.
  Bad Request invalid value E2056 TTL value must be less than or equal to {max_value}
  Bad Request invalid value E2057 TTL value must be more than or equal to 0
  Bad Request invalid value E2058 Description must input less than or equal to 255.
404 Not Found not exists E2007 Specified zone is not found.
  Not Found not exists E2008 Specified recordset is not found.
409 conflict conflict E2036 Specified recordset already exists.
  conflict conflict E2037 Specified domain name of CNAME record already exists.
  conflict conflict E2038 Request recordset values conflict.
  conflict conflict E2066 Specified domain name already exists CNAME record.
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>,
  "name": <name>,
  "ttl": <ttl>,
  "description": <description>,
  "records": <records>,
  "type": <type>,
  "version": <version>,
  "created_at": <created_at>,
  "updated_at": <updated_at>,
  "zone_id": <zone_id>,
  "links": {
    <links>
  }
}

Response Parameter

item format Description
id uuid ID for the resource.
name hostname DNS Name for the recordset.
ttl integer TTL (Time to Live) for the recordset.
description string Description for this recordset.
records string list A list of data for this recordset. Each item will be a separate record in SDPF DNS These items should conform to the DNS spec for the record type - e.g. A records must be IPv4 addresses, CNAME records must be a hostname.
type string They RRTYPE of the recordset.
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.
zone_id uuid ID for the zone that contains this recordset.
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

PUT /v2/zones/fbe8562b-66a5-4071-b4c2-250487d15a81/recordsets/2514d0c1-d41e-4fd0-b736-acf3fbd1e03a

Request Header

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

Request Body

{
  "name": "ex2.example.uk",
  "description": "updated description",
  "ttl": 300,
  "records": [
    "203.0.113.4"
  ]
}

Sample API Response

Response Header

HTTP/1.1 202
Date: Mon, 24 Oct 2016 06:15:59 GMT
Content-Type: application/json
Content-Length: 400
Connection: keep-alive
Set-Cookie: TS0183560f=01cce65ce12ede6cd54137c01adbf25c87fd4208f9f52dc93a0b5d69ace3df819dad6761ec; Path=/

Response Body

{
  "id": "2514d0c1-d41e-4fd0-b736-acf3fbd1e03a",
  "name": "ex2.example.uk.",
  "ttl": 300,
  "description": "updated description",
  "records": "203.0.113.4",
  "type": "A",
  "version": 1,
  "created_at": null,
  "updated_at": null,
  "zone_id": "fbe8562b-66a5-4071-b4c2-250487d15a81",
  "links": {
    "self": "https://endpoint.api.example.com/v2/zones/fbe8562b-66a5-4071-b4c2-250487d15a81/recordsets/2514d0c1-d41e-4fd0-b736-acf3fbd1e03a"
  }
}

Sample Error Response

Response

HTTP/1.1 404
Date: Mon, 24 Oct 2016 06:19:30 GMT
Content-Type: application/json
Content-Length: 94
Connection: keep-alive
Set-Cookie: TS0183560f=01cce65ce1d1e9bc9647943a25552b784083a729b3d7b22e5bda55e34bae03190901b9f01c; Path=/

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