API Module Nameserver createTemplateDnsRequest
From Openprovider API documentation
(Difference between revisions)
(Created page with '==Module DNS template > Create== {| border="1" cellpadding="4" |- style="background-color:#BBBBBB;" |'''Module''' |DNS template |- style="background-color:#EEEEEE;" |'''Command n…') |
|||
(5 intermediate revisions not shown) | |||
Line 9: | Line 9: | ||
|- | |- | ||
|'''Use''' | |'''Use''' | ||
- | |Creates a new DNS template object | + | |Creates a new DNS zone template object |
|- style="vertical-align:top;" | |- style="vertical-align:top;" | ||
|'''Input''' | |'''Input''' | ||
Line 15: | Line 15: | ||
*'''name''' | *'''name''' | ||
*'''[[API Format Records|records]]''' | *'''[[API Format Records|records]]''' | ||
+ | *isSpamexpertsEnabled ''(to enable spam filtering by default on domain created with this DNS zone template, default value: 0)'' | ||
|- style="vertical-align:top;" | |- style="vertical-align:top;" | ||
|'''Output''' | |'''Output''' | ||
Line 31: | Line 32: | ||
array( | array( | ||
'type' => 'A', | 'type' => 'A', | ||
- | 'name' => | + | 'name' => "", |
'value' => '89.255.0.43', | 'value' => '89.255.0.43', | ||
'ttl' => 86400 | 'ttl' => 86400 | ||
Line 43: | Line 44: | ||
array( | array( | ||
'type' => 'MX', | 'type' => 'MX', | ||
- | 'name' => | + | 'name' => "", |
'value' => 'mail.%domain%', | 'value' => 'mail.%domain%', | ||
'prio' => 10, | 'prio' => 10, | ||
Line 52: | Line 53: | ||
===Raw XML=== | ===Raw XML=== | ||
+ | ''Please note that newlines and leading spaces are added only for readability. Those whitespaces should be excluded from your XML command before sending it to Openprovider.'' | ||
<?xml version="1.0" encoding="UTF-8"?> | <?xml version="1.0" encoding="UTF-8"?> | ||
<openXML> | <openXML> | ||
Line 89: | Line 91: | ||
<openXML> | <openXML> | ||
<reply> | <reply> | ||
- | < code>0</code> | + | <nowiki><code>0</code></nowiki> |
<desc></desc> | <desc></desc> | ||
<data>5936</data> | <data>5936</data> | ||
</reply> | </reply> | ||
</openXML> | </openXML> |
Current revision as of 09:32, 25 August 2016
Contents |
Module DNS template > Create
Module | DNS template |
Command name | createTemplateDnsRequest |
Use | Creates a new DNS zone template object |
Input |
|
Output | Result set of DNS template details:
|
Examples
Using PHP class
$request = new OP_Request; $request->setCommand('createTemplateDnsRequest') ->setAuth(array('username' => 'username', 'password' => 'password')) ->setArgs(array( 'name' => 'Demo', 'records' => array( array( 'type' => 'A', 'name' => "", 'value' => '89.255.0.43', 'ttl' => 86400 ), array( 'type' => 'A', 'name' => '*', 'value' => '89.255.0.43', 'ttl' => 86400 ), array( 'type' => 'MX', 'name' => "", 'value' => 'mail.%domain%', 'prio' => 10, 'ttl' => 86400 ) ) ));
Raw XML
Please note that newlines and leading spaces are added only for readability. Those whitespaces should be excluded from your XML command before sending it to Openprovider.
<?xml version="1.0" encoding="UTF-8"?> <openXML> <credentials> <username>username</username> <password>password</password> </credentials> <createTemplateDnsRequest> <name>Demo</name> <records> <array> <item> <type>A</type> <name></name> <value>89.255.0.43</value> <ttl>86400</ttl> </item> <item> <type>A</type> <name>*</name> <value>89.255.0.43</value> <ttl>86400</ttl> </item> <item> <type>MX</type> <name></name> <value>mail.%domain%</value> <prio>10</prio> <ttl>86400</ttl> </item> </array> </records> </createTemplateDnsRequest> </openXML>
<?xml version="1.0" encoding="UTF-8"?> <openXML> <reply> <code>0</code> <desc></desc> <data>5936</data> </reply> </openXML>