Contents
The management of hosts via REST API Gateway allows for easy checking, creation, deleting, and updating of name servers.
Host management commands can be applied only to the host name objects that have a subordinate relationship to a superordinate domain name, in other words – registrar is able to manage only host name objects related to the domain names within his domain repository in ST Registry.
1. Check Host availability
Host check command is used to determine if a name server host exists. It provides a hint that allows a client to anticipate the success or failure of provisioning, changing or deleting a name server host object.
Command provide possibility to check one(1) hostname per request.
URI: /hosts/:name/check
Request method: GET
Name | Description |
---|---|
name | Host name |
Request example:
1 2 3 4 5 6 |
GET /hosts/ns1.hostname.st/check HTTP/1.1 Host: apihost Content-Type: application/json Api-Version: 1.0 Api-ClientTransactionId: 9a6c67e4-d666-54a8-9465-4847bee812e2 Api-ClientToken: 1a2B3C4d5e6F |
After successful request, response will contain following elements:
- avail – identify if host name available for registration/creation or not. 0 – not available. 1 – available
- code – response code. 1000 if operation successful.
- message – response message. Generally its a description for response code.
- cltrid – client transaction ID which was provided in request.
- svtrid – server transaction ID which was generated by ST Registry for corresponding request.
- time – request execution time in seconds.
Response example:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
HTTP/1.1 200 OK Date: Tue, 01 Jan 2014 00:00:01 GMT Server: Apache/2.2.15 (CentOS) X-Powered-By: PHP/5.4.11 Connection: close Transfer-Encoding: chunked Content-Type: application/json { "avail": 1, "code": 1000, "message": "OK", "cltrid": "9a6c67e4-d666-54a8-9465-4847bee812e2", "svtrid": "3574e2c0-a4cc-4655-aaec-02d891a2b7df", "time": 0.0075540542602539 } |
2. Create Host
Name server hosts can be created using the Host create command. Request body may include:
- name – element that contains the fully qualified name of a host. This value is obligatory.
- addr – elements that contain collection of IP addresses to be associated with the host which should be represented in pairs key->value.
- Key may obtain value “v4” or “v6” which identify IP version.
- Value should represent IP in version that is identified by Key.
URI: /hosts
Request method: PUT
Request example:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
PUT /hosts HTTP/1.1 Host: apihost Content-Type: application/json Api-Version: 1.0 Api-ClientTransactionId: 9a6c67e4-d666-54a8-9465-4847bee812e2 Api-ClientToken: 1a2B3C4d5e6F { "name": "ns10.hostname.st", "addr": [ { "v4": "192.0.2.1" }, { "v6": "2001:db8:8:4::2" } ] } |
After successful request, response will contain following elements:
- name – created host name.
- crDate – date and time when host was created.
- code – response code. 1000 if operation successful.
- message – response message. Generally its a description for response code.
- cltrid – client transaction ID which was provided in request.
- svtrid – server transaction ID which was generated by ST Registry for corresponding request.
- time – request execution time in seconds.
Response example:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
HTTP/1.1 200 OK Date: Tue, 01 Jan 2014 00:00:01 GMT Server: Apache/2.2.15 (CentOS) X-Powered-By: PHP/5.4.11 Connection: close Transfer-Encoding: chunked Content-Type: application/json { name: "ns10.hostname.st" crDate: "2014-01-01T00:00:01+00:00" "message": "OK", "cltrid": "9a6c67e4-d666-54a8-9465-4847bee812e2", "svtrid": "3574e2c0-a4cc-4655-aaec-02d891a2b7df", "time": 0.0014278888702393 } |
3. Query Host
Host query command is used to retrieve information associated with a host object.
URI: /hosts/:name
Request method: GET
Name | Description |
---|---|
name | Host name |
Request example:
1 2 3 4 5 6 |
GET /hosts/ns10.hostname.st HTTP/1.1 Host: apihost Content-Type: application/json Api-Version: 1.0 Api-ClientTransactionId: 9a6c67e4-d666-54a8-9465-4847bee812e2 Api-ClientToken: 1a2B3C4d5e6F |
After successful request, response will contain following elements:
- name – host name queried in this request.
- clID – ClientID – current host sponsor.
- crID – ClientID – host creator.
- crDate – date when host was created.
- addr – elements that contain collection of IP addresses associated with current host which is represented in pairs key->value.
- Key may obtain value “v4” or “v6” which identify IP version.
- Value should represent IP in version that is identified by Key.
- code – response code. 1000 if operation successful.
- message – response message. Generally its a description for response code.
- cltrid – client transaction ID which was provided in request.
- svtrid – server transaction ID which was generated by ST Registry for corresponding request.
- time – request execution time in seconds.
Response example:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
HTTP/1.1 200 OK Date: Tue, 01 Jan 2014 00:00:01 GMT Server: Apache/2.2.15 (CentOS) X-Powered-By: PHP/5.4.11 Connection: close Transfer-Encoding: chunked Content-Type: application/json { "info": { "name": "ns10.hostname.st" "clID": "ClientID" "crID": "ClientID" "crDate": "2014-01-01T00:00:01+00:00" "addr": [ { v4: "192.0.2.1" } { v6: "2001:db8:8:4::2" } ] } "code": 1000, "message": "OK", "cltrid": "9a6c67e4-d666-54a8-9465-4847bee812e2", "svtrid": "3574e2c0-a4cc-4655-aaec-02d891a2b7df", "time": 0.0071749687194824 } |
4. Update Host
Host update command allows modification of attributes in existing host object. Request body may contain following elements/instructions:
- add – optional element that contains attribute values to be added to the object.
- rem – optional element that contains attribute values to be removed from the object.
- chg – instruction is not used in host update command, updates to the host object are performed only by using “add” and “rem” instruction. If registrar would like to update some attribute like IP address – he will need to delete old and add new one.
URI: /hosts/:name
Request method: POST
Name | Description |
---|---|
name | Host name |
Request example:
In request example below we have provided all possible host attributes that is possible to update.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
POST /hosts/example.st HTTP/1.1 Host: apihost Content-Type: application/json Api-Version: 1.0 Api-ClientTransactionId: 9a6c67e4-d666-54a8-9465-4847bee812e2 Api-ClientToken: 1a2B3C4d5e6F { "add": { "addr": [ { "0": { "version": "v4", "address": "192.0.2.1" }, "1": { "version": "v6", "address": "2002:0:0:0:0:0:c633:6401" } } ], "status": [ "clientDeleteProhibited" ] }, "rem": { "addr": [ { "0": { "version": "v4", "address": "192.0.2.2" }, "1": { "version": "v6", "address": "fe80:0:0:0:0:0:c0a8:1" } } ], "status": [ "clientUpdateProhibited" ] }, "chg": {} } |
After successful request, response will contain following elements:
- code – response code. 1000 if operation successful.
- message – response message. Generally its a description for response code.
- cltrid – client transaction ID which was provided in request.
- svtrid – server transaction ID which was generated by ST Registry for corresponding request.
- time – request execution time in seconds.
Response example:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
HTTP/1.1 200 OK Date: Tue, 01 Jan 2014 00:00:01 GMT Server: Apache/2.2.15 (CentOS) X-Powered-By: PHP/5.4.11 Connection: close Transfer-Encoding: chunked Content-Type: application/json { "code": 1000, "message": "OK", "cltrid": "9a6c67e4-d666-54a8-9465-4847bee812e2", "svtrid": "3b5a9732-3919-44eb-8a8c-fc504151bb64", "time": 0.005012035369873 } |
5. Delete Host
Host delete command is supposed to be used to delete Host object. Only object sponsor/owner may delete it (refer to clID attribute).
If contact have a status “clientDeleteProhibited” or “serverDeleteProhibited” then Host delete request will be rejected. Also, request will be rejected if host is linked with another object in a Registry repository.
URI: /hosts/:name
Request method: DELETE
Name | Description |
---|---|
name | Host name |
Request example:
1 2 3 4 5 6 |
DELETE /hosts/ns10.hostname.st HTTP/1.1 Host: apihost Content-Type: application/json Api-Version: 1.0 Api-ClientTransactionId: 9a6c67e4-d666-54a8-9465-4847bee812e2 Api-ClientToken: 1a2B3C4d5e6F |
After successful request, response will contain following elements:
- code – response code. 1000 if operation successful.
- message – response message. Generally its a description for response code.
- cltrid – client transaction ID which was provided in request.
- svtrid – server transaction ID which was generated by ST Registry for corresponding request.
- time – request execution time in seconds.
Response example:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
HTTP/1.1 200 OK Date: Tue, 01 Jan 2014 00:00:01 GMT Server: Apache/2.2.15 (CentOS) X-Powered-By: PHP/5.4.11 Connection: close Transfer-Encoding: chunked Content-Type: application/json { "code": 1000, "message": "OK", "cltrid": "9a6c67e4-d666-54a8-9465-4847bee812e2", "svtrid": "3574e2c0-a4cc-4655-aaec-02d891a2b7df", "time": 0.012952089309692 } |
6. Host status codes
Same as for domain objects there is 2 different types of status codes: client and server codes. Client status codes are set by registrars. Server status codes are set by ST Registry and they take precedence over client codes.
The following are two tables containing 10 possible host object status codes, these tables will explain what each status means.
Server codes:
Status code Description ok This is the standard status for a domain, meaning it has no holds or restrictions. This status code is set and removed by ST Registry as other status values are added or removed. linked The host object has at least one active association with a domain object. Registrars are unable to delete such host object unless all associations between host object and domains will be destroyed. To find all domains with association to corresponding host object please refer to the manual – Collections. serverDeleteProhibited Any request to delete host object will be rejected by ST Registry. serverUpdateProhibited Any request to update host object (other than to remove this status) will be rejected by ST Registry. pendingCreate This status code indicates that a request to create host object has been received and is being processed. Status is removed when host object will be propagated to the root ST zone. pendingUpdate This status indicates that a request to update host object has been received and is being processed. Status is removed when host object updates will be propagated to the root ST zone. pendingTransfer This status indicates that a request to transfer the host object superordinate domain object has been received and is being processed. pendingDelete This status indicates that a request to delete host object has been received and is being processed. Status code is removed and host object completely deleted from ST Registry repository after changes propagated to the root ST zone.
7. Response codes
To simplify initial integration process, instead of general error messages, ST Registry provide different response messages for same response code depending from exception which generated corresponding response code. Below you can find list of all possible response codes and their messages for host related operations.
Response code | Message |
1000 | Command completed successfully |
2003 | Missing host name |
2005 | Invalid host:name |
2005 | Invalid host:addr |
2203 | Operation not permitted |
2302 | Host already exists |
2302 | Host with name {hostaname} already exists |
2304 | Object status prohibits operation |
2305 | Host must be subordinate to one of the registrar domains |