Getting Descriptors of Hosting Settings
Use the get-physical-hosting-descriptor operation to retrieve descriptor of hosting settings you can set for your sites. For details on descriptors, refer to the Representation of Object Descriptor section:
- For information on property descriptors, refer to the section Representation of Object Descriptors: Property Descriptor.
- For information about property extensions, refer to the section Representation of Object Descriptors: Property Descriptor > Extension of Hosting Settings Descriptor.
For details on hosting settings, refer to the Hosting section.
Request Packet Structure
A request XML packet retrieving descriptor of hosting settings includes the get-physical-hosting-descriptor operation node:
<packet>
<site>
<get-physical-hosting-descriptor>
...
</get-physical-hosting-descriptor>
</site>
</packet>
You can retrieve descriptor for the specified site (or multiple sites
specified by a filtering rule) or the server-level descriptor of hosting
settings. The get-physical-hosting-descriptor node (site.xsd
)
has the following graphical representation:
Note: The interactive schema navigator for all request packets is available here: http://plesk.github.io/api-schemas/1.6.9.1/agent_input.svg.
-
filter, required
It specifies a filtering rule. For info on filters, refer to the Filters of Descriptors section. Data type: siteFilterType (
site.xsd
).
Response Packet Structure
The get-physical-hosting-descriptor 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.9.1/agent_output.svg.
-
result, required
It wraps the response retrieved from the server. Data type: ResultFilterType (
plesk_common.xsd
). -
status, required
It specifies the execution status of the operation. Data type: string. Allowed values: ok | error.
-
errcode, optional
It is used to return the error code when the operation fails. Data type: unsignedInt.
-
errtext, optional
Can be used to return the error message if the operation fails. Data type: string.
-
filter-id, optional
It is required if the operation succeeds. It returns a filtering rule you specified in the request packet. For info on filters, refer to the Filters of Descriptors section. Data type: anySimple.
-
id, optional
It is required if the operation succeeds. Returns the unique identifier of the site. Data type: integer.
-
descriptor, optional
It specifies the object descriptor. For details, refer to Representation of Object Descriptor. Data type: string.
Note: This descriptor contains hosting settings extensions. For details, refer to the Extension of Hosting Settings Descriptor section.
Samples
A request for available hosting settings for site with ID 19 looks as follows:
<packet>
<site>
<get-physical-hosting-descriptor>
<filter>
<id>19</id>
</filter>
</get-physical-hosting-descriptor>
</site>
</packet>
Response:
<packet>
<site>
<get-physical-hosting-descriptor>
<result>
<status>ok</status>
<filter-id>19</filter-id>
<id>19</id>
<descriptor>
<property>
<name>fp_login</name>
<type>string</type>
<writable-by>admin</writable-by>
<writable-by>client</writable-by>
<writable-by>reseller</writable-by>
<label>hst_def__fp_admin_login</label>
<extension>
<levels>domain</levels>
<levels>subdomain</levels>
</extension>
</property>
<property>
<name>ftp_password</name>
<type>passwordString</type>
<writable-by>admin</writable-by>
<writable-by>client</writable-by>
<writable-by>reseller</writable-by>
<label>hst_def__fp_admin_passwd</label>
<extension>
<levels>domain</levels>
</extension>
</property>
<property>
<name>fp_quota</name>
<type>bytes</type>
<writable-by>none</writable-by>
<label>Hard disk quota</label>
<extension>
<levels>domain</levels>
<levels>subdomain</levels>
</extension>
</property>
<bind>
<ref>php_handler_id</ref>
<relevant>
<name>php</name>
<value>true</value>
</relevant>
<read-only>0</read-only>
</bind>
<bind>
<ref>cgi_mode</ref>
<relevant>
<name>cgi</name>
<value>true</value>
</relevant>
<read-only>0</read-only>
</bind>
</descriptor>
</result>
</get-physical-hosting-descriptor>
</site>
</packet>
The <extension>
element indicates the level at which a property is
applicable (domain or subdomain).
If the site specified in the request packet was not found on the server, the result is as follows:
<packet>
<site>
<get-physical-hosting-descriptor>
<result>
<status>error</status>
<errcode>1013</errcode>
<errtext>Site does not exist</errtext>
<filter-id>19</filter-id>
<id>19</id>
</result>
</get-physical-hosting-descriptor>
</site>
</packet>
You can see the full list of properties available in the system if you send the following request packet:
<packet>
<site>
<get-physical-hosting-descriptor>
<filter/>
</get-physical-hosting-descriptor>
</site>
</packet>