Retrieving Descriptor of Limits
Use the get-limit-descriptor operation to retrieve limits descriptors of service plans. For details on the limits descriptors, refer to the Representation of Object Descriptors section. For details on limits of service plans, refer to the Limits section.
Request Packet Structure
A request XML packet retrieving service plan limits includes the get-limit-descriptor operation node:
<packet>
<service-plan>
<get-limit-descriptor>
...
</get-limit-descriptor>
</service-plan>
</packet>
The get-limit-descriptor node is presented by type
DomainTemplateGetInputType (domain_template.xsd)
. Its graphical
representation is as follows:
- The filter node is required. It specifies a criteria by which
service plans will be selected. Data type: DomainTemplateFilterType
(
domain_template.xsd
). See the Available Filters section for details on this node. - The owner-id node is optional. It specifies the ID of the service plan owner. Data type: integer.
- The owner-login node is optional. It specifies the username of the service plan owner. Data type: string.
Note: When creating request packets, put nodes and elements in the order they follow in the packet structure.
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.
Response packet Structure
The get-limit-descriptor node of the output XML packet is of type
DomainTemplateDescriptorOutput (domain_template.xsd
) which is
structured as follows:
-
The result node is required. It wraps the result of the requested get-limit-descriptor operation. Data type: ResultFilterType (
common.xsd
). -
The status node is required. It returns the execution status of the get-limit-descriptor operation. Data type: result_status (
common.xsd
). Allowed values:ok|error
. -
The errcode node is optional. Is used to return the error code when the get-limit-descriptor operation fails. Data type: unsignedInt.
-
The errtext node is optional. Can be used to return an error message if the get-limit-descriptor operation fails. Data type: string.
-
The id node is optional. It is required if the operation succeeds and the results are filtered by ID. It returns an ID of the service plan which limits descriptor was displayed. Data type: id_type (
common.xsd
). -
The name node is optional. It is required if the operation succeeds and the results are filtered by name. It returns a name of the service plan which limits descriptor was displayed. Data type: string (
common.xsd
). -
The guid node is optional. It is required if the operation succeeds and the results are filtered by GUID. It returns a GUID of the service plan which limits descriptor was displayed. Data type: string (
common.xsd
). -
The external-id node is optional. It is required if the operation succeeds and the results are filtered by external ID. It returns the external ID of the service plan which limits descriptor was displayed. Data type: string (
common.xsd
). -
The descriptor node is required if the get-limit-descriptor operation succeeds. It specifies object descriptor. For details, refer to the Representation of Object Descriptors section. Data type: string.
Note: This descriptor contains limits extensions. For details, refer to the Representation of Object Descriptors: Property Descriptor > Extension of Limits Descriptor section.
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.
Samples
The following packet retrieves limits descriptor for a service plan:
<packet>
<service-plan>
<get-limit-descriptor>
<filter>
<name>base_plan</name>
</filter>
</get-limit-descriptor>
</service-plan>
</packet>
Response:
<?xml version="1.0" encoding="UTF-8"?>
<packet version="1.6.7.0">
<service-plan>
<get-limit-descriptor>
<result>
<status>ok</status>
<name>base_plan</name>
<descriptor>
<property>
<name>max_site</name>
<type>int</type>
<writable-by>admin</writable-by>
<label>Domains</label>
<extension>
<shared>false</shared>
</extension>
</property>
...
<property>
<name>cgroups_cpu_usage</name>
<type>int</type>
<writable-by>admin</writable-by>
<label>Maximum CPU usage</label>
<extension>
<shared>false</shared>
</extension>
</property>
...
</descriptor>
</result>
</get-limit-descriptor>
</service-plan>
</packet>
Note: Data structures that describe a number of properties are omitted to improve the readability of the sample.
A single filter can specify multiple plans, all specified either by ID or by name.
<packet>
<service-plan>
<get-limit-descriptor>
<filter>
<name>base_plan</name>
<name>quick_plan</name>
</filter>
</get-limit-descriptor>
</service-plan>
</packet>