Versions Compared

Key

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

...

/api/v1/api.php?target=dnsServer&action=get&id=15

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 ServersFinds all resources from section 'dhcp_module,' which indicates that their parents are DHCP-enabled. Adding in other Resource-Get API parameters can filter this list further.
URL/api/v1/api.php?target=dnsServerresource&action=get&type=dhcp_module
Returns

Examples:

SUCCESSFUL:{"success":1,"message":"Fetch Sucessful.Search successful","data":[{"id":"101432", "servername":"mrbomasm-dns-4.onnet.net1392 DHCP Module" ,"usernameslug":"user", "password":"vwvddp","port":"2600","customer_name":null,"transfer_1392-dhcp-module", "type":"SCP","remote_directory":"zonesdhcp_module", "namedparent_conf_pathid":"\/etc\/zones1392", "active":"1","post_commandcategory_id":null, "pre_commandattr":null,{"dyn_DNSSECdhcp_contactattributes":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_nametype\":\"ISC\", \"server_typenotes\":\"slave\", \"SOAusername\":\"\", \"remote_directoryport\":\"zones\", \"namedconfig_conf_pathtest\":\"\\\/etc\\/init.d\/zonesdhcpd configtest\", \"dynserver_DNSSEC_contactstop\":\"\",\"post_command\":\"/etc\/init.d\/dhcpd stop\", \"preserver_commandstart\":\"\",\"powerdns_backend\":\"Bind\"/etc\/init.d\/dhcpd start\", \"dbconfig_usernamepath\":\"\", \"dboption_passwordrouters\":\"(\", \"db_port\":\"\",\"db_nameoption_domain_name_servers\":\"\", \"enableoption_domain_viewsname\":\"1\"}", "testID":"963","zoneCount":"8", "views":"[{ \"idauthoritative\":\"1\", \"serverdefault_lease_idtime\":\"10600\", \"name\":\"_6connectDefault\",\"extrasmax_lease_time\":\"[]7200\", \"descriptionlocal_port\":\"67\", \"timestamplog_facility\":\"1371789181local7\"}, { \"idpassword\":\"3\", \"server_idip\":\"10.0.0.0\", \"namefreeLines\":\0}"internal\", \"extras\"_dhcp_config_id":\"33"[}}]\", \ "description\result_count":null1, \ "timestamp\":\"1374686650\"}]"}]found_count":1}
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.
of the dhcp_module resource
nameSTRINGThe name of the dhcp_module
slugSTRINGThe unique reference string for this resource
typeSTRINGAlways 'dhcp_module
parent_idINTEGERThe resource to which the dhcp_module is attached
category_idINTEGERThe category to which this dhcp_module is associated


Attributes:

KeyTypeDescription
idINTEGERID of the dhcp_module resource
Example URL



Children Display