You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

 

DHCPv2 Module

The DHCPv2 system is built upon the Resource API, so actions relating to DHCP tasks are largely expressed in terms of Resource actions.  

This section describes common DHCP tasks and how they are accomplished via the DHCPv2 system.

 

get all DHCP-enabled resources

DescriptionIf provided with an id, fetches that DNS Server from the database. If not, fetches a list of all stored DNS Servers
URL/api/v1/api.php?target=dnsServer&action=get
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
idINTEGERServer ID
serverSTRINGServer Name
usernameSTRINGLogin Name
passwordCRYPTLogin Password
portINTEGERPort the Server listens on
zoneCountINTEGERThe 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_typeSTRINGProtocol used for transfer of DNS zones and records. 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 files used within the named.conf file.
pre_commandSTRINGThe command executed on the server before the zones are transferred
post_commandSTRINGThe command executed on the server after the transfer is complete
enable_viewsINTEGERWhether 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.

idINTEGERThe View ID
server_idINTEGERThe ID of the server the View is attached to
nameSTRINGThe name of the View
descriptionSTRINGA description of the View
timestampINTEGERThe 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.
Required ParametersNone
Optional Parameters
NameTypeExampleDescription
idINTEGER15The server id to fetch.
Example URL/api/v1/api.php?target=dnsServer&action=get&id=15




  • No labels