Chapter 3. Nameserver

Table of Contents

Create
Status
Get All
Update
Activate/Deactivate

Nameserver management API

Generic reference:

/nameserver/OPCODE/HOSTNAME/USER_ID/

Where:

OPCODE(operation type) available values:create,status,all,own,update,activate
HOSTNAME: your nameserver ip or name
USER_ID: Your specific id assigned by BDOM system

Create

Reference: /bdom/nameserver/create/HOSTNAME/USER_ID/

Operation Type: PUT

Where USER_ID: Your specific id assigned by BDOM system

Validator

Validation XSD

Example 3.1. Nameserver validation XSD

Source:

        
<?xml version="1.0" encoding="UTF-8" ?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="unqualified">
    <xs:element name="request">
        <xs:complexType>
            <xs:all>
                <!-- the server name -->
                <xs:element name="hostname" type="HostType" />
                <!-- the server IP -->
                <xs:element name="ip" type="IPType" minOccurs="0" />
                <xs:element name="ipv6" type="xs:string" minOccurs="0" />
                <!-- activate-deactivate nameserver -->
                <xs:element name="active" type="xs:string" minOccurs="0"/>
            </xs:all>
        </xs:complexType>
    </xs:element>
    <xs:simpleType name="HostType">
        <xs:restriction base="xs:string">
            <xs:pattern value="\s*((\w|\-){1,64}\.)+\w{2,10}\s*" />
        </xs:restriction>
    </xs:simpleType>
    <xs:simpleType name="IPType">
        <xs:restriction base="xs:string">
            <xs:pattern value="\s*\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\s*" />
        </xs:restriction>
    </xs:simpleType>
</xs:schema>
        
      

[Important] Important
Required Fields: hostname, ip or ipv6
Optional Fields: active
[Note] Note

Default nameservers are created as active

To deactivate created nameserver use activate request

Example 3.2. NS Create:valid

Generic Operation: PUT(http://backend.antagus.de/bdom/nameserver/create/ns-example.antagus.de/13048/,xml)

Where xml:

        
<?xml version="1.0" encoding="UTF-8"?>
<request xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <hostname>ns-example.antagus.de</hostname>
  <ip>192.168.1.1</ip>
</request>
        
        

RESPONSE:

        
<response><id>1393965</id></response>*
        
        
        

[Note] Note

*represents BDOM internal object ID

Example 3.3. NS Create:invalid

REQUEST:

Generic Operation: PUT(http://backend.antagus.de/bdom/nameserver/create/ns-example1.antagus.de/942/,xml)

Where xml:

        
<?xml version="1.0" encoding="UTF-8"?>
<request xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNameSpaceSchemaLocation="NameServer.xsd">
        <hostname>ns-example1.antagus.de</hostname>
        <ip>192.168.11</ip>
</request>
      
      

RESPONSE:

        
<error-list>
<error>
<code>406</code>
<msg>[OBJECT_ERROR] Error [XML_ERROR] XML error Validation error: Illegal
value  192.168.11  in element -ip-, does not match required pattern.</msg>
</error>
</error-list>
        
        

Status

Description: Nameserver status infornation based on server name and user id

Reference: /bdom/nameserver/status/HOSTNAME/USER_ID/

Operation Type: GET

Where:

USER_ID: your specific id assigned by BDOM system
HOSTNAME: your nameserver ip or name

Example 3.4. NS Status: Valid request

REQUEST:

Generic Operation:

GET(http://backend.antagus.de/bdom/nameserver/status/ns-example.antagus.de/13048/)

RESPONSE:

        
<response >
  <active>1</active>
  <hostname>ns-example.antagus.de</hostname>
  <ip>192.168.1.1</ip>
  <user_id>13048</user_id>
</response>
        
        

Example 3.5. NS Status: Invalid request - wrong user_id

Generic Operation:

GET(http://backend.antagus.de/bdom/nameserver/status/ns-example.antagus.de/13049/

RESPONSE:

        
<error-list>
<error>
<code>401</code>
<msg>[OBJECT_ERROR] Error Nameserver belongs to different user or does not
exist</msg>
</error>
</error-list>
        
        

Get All

Description: Return list with nameserver entries available for a given USER_ID

Reference: /bdom/nameserver/all/-/USER_ID/

Reference: /bdom/nameserver/own/-/USER_ID/

Operation: GET

Where:

USER_ID: your specific id assigned by BDOM system

Requests with personal nameserver defined:

Example 3.6. Get all available nameservers

REQUEST:

Generic Operation: GET(http://backend.antagus.de/bdom/nameserver/all/-/13048/)

RESPONSE:

        
<multiresponse>
<response >
  <hostname>ns1.ns-serve.net</hostname>
  <ip>193.254.185.254</ip>
</response>
<response >
  <hostname>ns2.ns-serve.net</hostname>
  <ip>193.254.187.110</ip>
</response>
<response >
  <hostname>ns-example.antagus.de</hostname>
  <ip>192.168.1.1</ip>
</response>
<response >
  <hostname>ns-example1.antagus.de</hostname>
  <ip>192.168.1.1</ip>
</response>

</multiresponse>
       
       

Example 3.7. Get Own nameservers

REQUEST:

Generic Operation: GET(http://backend.antagus.de/bdom/nameserver/own/-/13048/)

RESPONSE:

        
<multiresponse>
<response >
  <hostname>ns-example.antagus.de</hostname>
  <ip>192.168.1.1</ip>
</response>
<response >
  <hostname>ns-example1.antagus.de</hostname>
  <ip>192.168.1.1</ip>
</response>

</multiresponse>
        
        

Update

Reference: /bdom/nameserver/update/HOSTNAME/USER_ID/

Operation Type: POST

USER_ID: your specific id assigned by BDOM system
HOSTNAME: your nameserver ip or name
Validator

Validation XSD:

Example 3.8. Nameserver validation XSD

Source:

        
<?xml version="1.0" encoding="UTF-8" ?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="unqualified">

    <xs:element name="request">
        <xs:complexType>
            <xs:all>
                <xs:element name="hostname" type="HostType" />
                <xs:element name="ip" type="IPType" minOccurs="0" />
                <xs:element name="ipv6" type="xs:string" minOccurs="0"/>
            </xs:all>
        </xs:complexType>
    </xs:element>

    <xs:simpleType name="IPType">
        <xs:restriction base="xs:string">
            <xs:pattern value="\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}" />
        </xs:restriction>
    </xs:simpleType>

    <xs:simpleType name="HostType">
        <xs:restriction base="xs:string">
            <xs:pattern value="(\w|\.|\-)+\w{2,10}" />
        </xs:restriction>
    </xs:simpleType>

</xs:schema>
        
        

[Important] Important
Required Fields: hostname, ip or ipv6
Optional Fields:

Example 3.9. NS Update:valid

Change nameserver ip

REQUEST:

Generic Operation:

POST(http://backend.antagus.de/bdom/nameserver/update/ns-example.antagus.de/13048/,xml)

Where xml:

        
<?xml version="1.0" encoding="UTF-8"?>
<request xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <hostname>ns-example.antagus.de</hostname>
  <ip>192.168.1.15</ip>
</request>
        
        

RESPONSE:

        
<response>1 updated</response>
        
        

Example 3.10. NS Update:invalid

Attempt to change ip but wrong user supplied

REQUEST:

Generic Operation:

POST(http://backend.antagus.de/bdom/nameserver/update/ns-example.antagus.de/13049/,xml)

Where xml:

        
<?xml version="1.0" encoding="UTF-8"?>
<request xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <hostname>ns-example.antagus.de</hostname>
  <ip>192.168.1.15</ip>
</request>
        
        

RESPONSE:

        
<error-list><error><code>401</code><msg>[OBJECT_ERROR] Error Nameserver
belongs to different user or does not exist</msg></error></error-list>
        
        

Activate/Deactivate

Reference: /bdom/nameserver/activate/HOSTNAME/USER_ID/

Operation Type: POST

USER_ID: your specific id assigned by BDOM system
HOSTNAME: your nameserver ip or name

Validation XSD:

Validator

Example 3.11. Nameserver validation XSD

Source:

        
<?xml version="1.0" encoding="UTF-8" ?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="unqualified">

    <xs:element name="request">
        <xs:complexType>
            <xs:all>
                <xs:element name="hostname" type="HostType" />
                <xs:element name="active" type="xs:int"/>
            </xs:all>
        </xs:complexType>
    </xs:element>

    <xs:simpleType name="HostType">
        <xs:restriction base="xs:string">
            <xs:pattern value="(\w|\.|\-)+\w{2,10}" />
        </xs:restriction>
    </xs:simpleType>

</xs:schema>
        
        

[Important] Important
Required Fields: hostname, active
Optional Fields:

Example 3.12. NS Activate

Activate specified nameserver

REQUEST:

Generic Operation:

POST(http://backend.antagus.de/bdom/nameserver/activate/ns-test.antagus.de/942/,xml)

Where xml:

        
<?xml version="1.0" encoding="UTF-8"?>
<request xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <hostname>ns-example.antagus.de</hostname>
  <active>1</active>
</request>
        
        

RESPONSE:

        
<response>Update OK</response>
        
        

Example 3.13. NS Deactivate

Deactivate specified nameserver

REQUEST:

Generic Operation:

POST(http://backend.antagus.de/bdom/nameserver/activate/ns-test.antagus.de/942/,xml)

Where xml:

        
<?xml version="1.0" encoding="UTF-8"?>
<request xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <hostname>ns-example.antagus.de</hostname>
  <active>0</active>
</request>
        
        

RESPONSE:

        
<response>Update OK</response>