Summary:
List configured zones, and create new zones.
URL:
http(s)://{server hostname}/api/zones
Methods summary
- GET Method - lists configured zones.
- POST Method - creates a new zone.
GET Method detail
Lists configured zones.
Response:
Response includes a list of zones. Each zone has following attributes:
Name | Description |
---|---|
id | zone ID, unique to the server. |
name | zone name. |
serverId | Entuity server ID on which resource resides. |
Examples:
INPUT
curl -u admin:admin https://localhost/api/zones?media=json
OUTPUT
{
"items": [
{
"serverId": "ee934fe2-1f4d-4f1e-a0b5-a87b261eb30a",
"id": "0",
"name": "None"
}
],
"count": 1
}
INPUT
curl -u admin:admin https://localhost/api/zones?media=xml
OUTPUT
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<items count="1">
<item xsi:type="namedItem" name="None" id="0" serverId="ee934fe2-1f4d-4f1e-a0b5-a87b261eb30a" xmlns:xsi="https://www.w3.org/2001/XMLSchema-instance"/>
</items>
POST Method detail
Creates a new zone.
Request:
Name | Description |
---|---|
id |
zone ID. |
name |
name of the zone. |
flags |
zone flags, should be set to 0. |
description |
description of the zone. |
v4interface |
IPv4 interface for the zone. |
v6interface |
IPv6 interface for the zone. |
domainSuffix |
domain suffix for the zone. |
proxy |
(this is unused.) |
devicePrefix |
specified device prefix that is included with each device name found under this zone, maximum of 5 characters. |
hostFile |
host file. |
dnsServer |
list of DNS servers. |
Response:
The list of zones after an update, as GET method would return them.
Examples:
INPUT
curl -u admin:admin https://localhost/api/zones?media=json -X POST -H "content-type:application/json" -d \
'{
"name" : "A",
"flags" : 0,
"description" : "",
"v4Interface" : "10.44.2.103",
"v6Interface" : "",
"domainSuffix" : "",
"proxy" : "",
"devicePrefix" : "",
"hostFile" : "",
"dnsServers" : [ "a.b.c.d" ]
}'
OUTPUT
{
"items": [
{
"serverId": "ee934fe2-1f4d-4f1e-a0b5-a87b261eb30a",
"id": "1",
"name": "A"
}, {
"serverId": "ee934fe2-1f4d-4f1e-a0b5-a87b261eb30a",
"id": "0",
"name": "None"
}
],
"count": 2
}
INPUT
curl -u admin:admin https://localhost/api/zones?media=xml -X POST -H "content-type:application/xml" -d \
'<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<zoneParametersInfo>
<name>A</name>
<flags>0</flags>
<description></description>
<v4Interface>10.44.2.103</v4Interface>
<v6Interface></v6Interface>
<domainSuffix></domainSuffix>
<proxy></proxy>
<devicePrefix></devicePrefix>
<hostFile></hostFile>
<dnsServers>
<server>a.b.c.d</server>
</dnsServers>
</zoneParametersInfo>'
OUTPUT
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<items count="2">
<item xsi:type="namedItem" name="A" id="1" serverId="ee934fe2-1f4d-4f1e-a0b5-a87b261eb30a" xmlns:xsi="https://www.w3.org/2001/XMLSchema-instance"/>
<item xsi:type="namedItem" name="None" id="0" serverId="ee934fe2-1f4d-4f1e-a0b5-a87b261eb30a" xmlns:xsi="https://www.w3.org/2001/XMLSchema-instance"/>
</items>
Comments
0 comments
Please sign in to leave a comment.