Updating SOA Record
Use the set operation to update a SOA record for the DNS zone template, or for the site (site alias) specified by ID. The parameters in the SOA record of the zone template will be applied to a new site or site alias on creation. You can update multiple SOA records in a single packet. For more information about SOA records, refer to the SOA parameters section.
Request Packet Structure
A request XML packet updating a SOA record includes the set operation node:
<packet>
<dns>
<set>
...
</set>
</dns>
</packet>
The graphical representation of the set node is as follows:
Note: The interactive schema navigator for all request packets is available here: http://plesk.github.io/api-schemas/1.6.8.0/agent_input.svg.
- The filter node is optional. It specifies the filtering rule.
For more information, refer to the Available Filters
section. Data type: simpleFilterType (
dns_input.xsd
) . - The soa node is required. Specifies the SOA parameters. Data
type: SOAType (
plesk_dns.xsd
) .
Note: If you omit the filter node, the operation will update SOA parameters for the DNS zone template.
You can update multiple SOA records in a single packet. Add as many set operations as the number of different filtering rules.
<dns>
<set>
...
</set>
...
<set>
...
</set>
</dns>
Note: When creating request packets, put nodes and elements in the order they follow in the packet structure.
Response Packet Structure
The set node of the output XML packet is structured as follows:
Note: The interactive schema navigator for all response packets is available here: http://plesk.github.io/api-schemas/1.6.8.0/agent_output.svg.
- The result node is optional. It is required in case when an
error (if it occurred) was not of a system type. Data type:
resultType (
common.xsd
). - The status node is required. It specifies the execution status of the set operation. Data type: string. Allowed values: ok | error.
- The errcode node is optional. It is used to return the error code when the set operation fails. Data type: unsignedInt.
- The errtext node is optional. It is used to return the error message if the set operation fails. Data type: string.
- The site-id node is optional. It is required if the site ID was set as a filtering rule in the request packet. Data type: integer.
- The site-alias-id node is optional. It is required if the site alias ID was set as a filtering rule in the request packet. Data type: integer.
Samples
Updating a single SOA record
This request packet updates a SOA record of the site with ID 12.
<packet>
<dns>
<set>
<filter>
<site-id>12</site-id>
</filter>
<soa>
<ttl>86400</ttl>
<refresh>10800</refresh>
<retry>3600</retry>
<expire>604800</expire>
<minimum>10800</minimum>
</soa>
</set>
</dns>
</packet>
Response:
<packet>
<dns>
<set>
<result>
<status>ok</status>
<site-id>12</site-id>
</result>
</set>
</dns>
</packet>
Updating multiple SOA records
This request packet updates SOA records of the sites with ID 12 and ID 13.
<packet>
<dns>
<set>
<filter>
<site-id>12</site-id>
<site-id>13</site-id>
</filter>
<soa>
<ttl>86400</ttl>
<refresh>10800</refresh>
<retry>3600</retry>
<expire>604800</expire>
<minimum>10800</minimum>
</soa>
</set>
</dns>
</packet>
Response (when the site with ID 13 was not found on the server, and the site with ID 12 was updated):
<packet>
<dns>
<set>
<result>
<status>ok</status>
<site-id>12</site-id>
</result>
<result>
<status>error</status>
<errcode>1015</errcode>
<errtext>Site alias does not exist.</errtext>
<site-id>13</site-id>
</result>
</set>
</dns>
</packet>