Zone Templates

Get

URL/api/v1/api.php?target=zoneTemplate&action=get
DescriptionReturns success or failure of a connection to an external server via SSH.
Returns

Examples:

SUCCESSFUL{"success":1,"message":"Found 1 records for template \"Awesome Template\".","data":{"templateId":"1011","name":"Awesome Template","created":"2013-07-31 14:01:24","modified":"2013-07-31 14:01:24","userId":"112","soa":null,"refresh":"14400","retry":"3600","expire":"604800","minimum":null,"ttl":null,"userName":"joe@smith.com","records":[{"templateRecordId":"4","templateId":"1011","host":"www","type":"A","ttl":"3600","value":"1.2.3.4","ordering":"0"}]}}
ERROR{'success':0, 'message':'error message'}
Required Parameters

None

Optional Parameters
Name
Type
Example
Description
templateIdNUMBER3ID of the specific template to get.




Example URL/api/v1/api.php?target=zoneTemplate&action=get

 

Update

URL/api/v1/api.php?target=zoneTemplate&action=update
DescriptionCreate a new template or update an existing template.
ReturnsExamples:
SUCCESSFUL: {"success":1,"message":"Template updated","data":{"templateId":"1011","name":"Awesome Template","created":"2013-08-05 23:15:52","modified":"2013-08-05 23:15:52","userId":"112","soa":"ns1.test.net hostmaster.ns1.test.net","refresh":"14400","retry":"3600","expire":"604800","minimum":null,"ttl":false,"userName":"anna@6connect.com","records":"1"}}
ERROR: {'success':0, 'message':'Error updating template: error details'}>
Required Parameters
Name
Type
Example
Description
nameSTRINGTest TemplateThe name of the template to be created or updated.




Optional Parameters
Name
Type
Example
Description
soaSTRINGns1.test.net hostmaster.ns1.test.netA valid SOA for the template in for format
ttl INTEGER 86400 The TTL for the zone template, which is the default expiration time for all records without their own TTL.
refresh INTEGER 14400 The time period for slaves to refresh the zone.
retry INTEGER 3600 Time that a slave should retry refreshing the zone in case of incident.
expire INTEGER604800 Time for a slave to expire a zone.
mininum INTEGER 3600 The maximum caching time in the event of failed lookups.
count_recordsINTEGER5Number of host records submitted with the update. All the following parameters names should be followed with their position in the count. In this example, the first record would have all the parameters for the first record followed by _1, the second record _2, and so on. This will be the order all records in the template follow.
host_1STRING
The DNS record value.
ttl_1INTEGER3600TTL of the specific host record.
type_1STRINGAA valid DNS record type.
value_1IP1.2.3.4A valid IPv4 or IPv6 address.
Example URL

api/v1/api.php?target=zoneTemplate&action=update&templateId=1011&count_records=1&name=Awesome+Template&soa=ns1.test.net+hostmaster.ns1.test.net

&refresh=14400&retry=3600&expire=604800&minimum=3600&value_0=undefined+undefined&host_1=www&ttl_1=3600&type_1=A&value_1=1.2.3.4

 

Delete

URL/api/v1/api.php?target=zoneTemplate&action=delete
DescriptionDeletes a DNS template.
Returns

Examples:

SUCCESSFUL
{"success":1,"message":"Template \"Test Template\" delete."}
ERROR{"success":0,"message":"No template found for templateId \"1005\"."}
Required Parameters
Name
Type
Example
Description
templateIdINTEGER3ID of the template to delete.
Optional Parameters

None.


Example URL/api/v1/api.php?target=zoneTemplate&action=delete&templateId=1005