Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

get
URL/api/v1/api.php?target=dnsServer&action=get
DescriptionIf provided with an id, fetches that DNS Server from the database. If not, fetches a list of all stored DNS Servers
Returns

Examples:

SUCCESSFUL:

{"success":1,"message":"Fetch Sucessful.","data":[{"id":"10","server":"mrbomasm-dns-4.onnet.net", "username":"user", "password":"vwvddp","port":"2600","customer_name":null,"transfer_type": "SCP","remote_directory":"zones", "named_conf_path":"\/etc\/zones","active":"1","post_command":null,"pre_command":null,"dyn_DNSSEC_contact":null, "powerdns_backend":"Bind","db_username":null,"db_password":"(","db_port":null,"db_name":null, "server_type":"slave","SOA":null,"master_id":null,"options": "{\"customer_name\":\"\",\"server_type\":\"slave\" ,\"SOA\":\"\",\"remote_directory\":\"zones\", \"named_conf_path\":\"\\\/etc\\\/zones\", \"dyn_DNSSEC_contact\" :\"\",\"post_command\":\"\" ,\"pre_command\":\"\",\"powerdns_backend\":\"Bind\", \"db_username\":\"\",\"db_password\":\"(\",\"db_port\":\"\",\"db_name\":\"\",\"enable_views\":\"1\"}", "testID":"963","zoneCount":"8","views":"[{\"id\":\"1\", \"server_id\":\"10\",\"name\":\"_6connectDefault\",\"extras\":\"[]\",\"description\":\"\",\"timestamp\":\"1371789181\"},{\"id\":\"3\",\"server_id\":\"10\",\"name\":\"internal\",\"extras\":\"[]\",\"description\":null,\"timestamp\":\"1374686650\"}]"}]}

ERROR:{"success":0, "message":"error message"}


Data Detail:

NameTypeDescription
idINTServer ID
serverSTRINGServer Name
usernameSTRINGLogin Name
passwordCRYPTLogin Password
portINTPort the Server listens on
zoneCountINTThe number of zones attached to this server.
   
optionsJSON

The options entry is a JSON-encoded string containing a variety of server-specific configuration options.

This string will vary widely by server type and configuration. The following are a selection of common settings.

transfer_typeSTRINGThe type of server this is. Valid settings include SCP, PowerDNS, Secure64, Secure64Signer
server_typeSTRINGWhether this server is a master or a slave server
SOASTRINGThe SOA entry to be used for zones on this server
remote_directorySTRINGThe directory where SCP will place the zone files.
named_conf_pathSTRINGThe path to the zone file location files used when writing the server configuration filewithin the named.conf file.
pre_commandSTRINGThe command executed on the server before the zones are transfered
post_commandSTRINGThe command executed on the server after the transfer is complete
enable_viewsINTWhether or not Views are enabled
   
viewsJSON

The views entry is a JSON-encoded string containing all the information about the Views attached to this server,

if any exist.

idINTThe View ID
server_idINTThe ID of the server the View is attached to
nameSTRINGThe name of the View
descriptionSTRINGA description of the View
timestampINTThe UNIX timestamp of when the view was created.
extrasJSONA JSON-encoded array of the extra attributes printed out in the view definition in the config file.
Optional Parameters
NameTypeExampleDescription
idINTEGER15The server id to fetch.

...

update
URL/api/v1/api.php?target=dnsServer&action=update
DescriptionUpdates an existing DNS Server with new information.
Returns

Examples:

SUCCESSFUL:{"success":1,"message":"Update Successful."}
ERROR:{"success":0, "message":"error message"}
Required Parameters
NameTypeExampleDescription
usernameSTRINGbobuserLogin name for Server
passwordSTRINGpassword1Login password for Server
transferTypeSTRINGSCPProtocol
Optional Parameters

There optional parameters vary according to what type of server is being configured.

NameTypeExampleDescription
customerNameSTRING/tmp/zonesCustomer Name
remoteDirectorySTRING/tmp/zonesZone Directory on Server
namedConfPathSTRING/tmpZone PathThe path to the zone files used within the named.conf file.
preCommandSTRING/path/to/stuff/precommand
postCommandSTRING/path/to/stuff/postcommand

...