Retrieving Descriptor of Protected Directory Properties

Use the get-pd-location-descriptor operation to retrieve descriptor of protected directory properties. For details on descriptors, refer to the Representation of Object Descriptor section of the API RPC Reference and the Descriptors Overview Section of the API RPC Developer's Guide.

In this chapter:

Request Packet Structure

Response Packet Structure

Samples

 

Request Packet Structure

A request XML packet retrieving protected directory descriptors includes the get-pd-location-descriptor operation node:

<packet version="1.5.2.0">
<protected-dir>
<get-pd-location-descriptor>
...  
</get-pd-location-descriptor>
</protected-dir>
</packet>

 

The get-pd-location-descriptor node is presented by type ProtectedDirGetLocationDescriptor (protected_dir.xsd), and its graphical representation 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 required.
    All protected directories on a site share the same properties descriptor. To retrieve properties descriptor of all protected directories of a specific site (site-level descriptor), specify node site-id in the filtering rule. You can specify multiple site-id nodes to retrieve the properties descriptors for multiple sites. Use blank filter (<filter/>) to retrieve descriptor of common protected directory properties (server-level descriptor). . Data type: complex.
  • The site-id node is optional. It specifies the ID of the site containing protected directories. Data type: integer.
 

Response Packet Structure

The delete-user node of the output XML packet is presented by type ProtectedDirDeleteUserOutput (protected_dir.xsd) and 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 required. It wraps the response retrieved from the server. Data type: resultFilterType (common.xsd).
  • The status node is required. It specifies the execution status of the operation. Data type: string. Allowed values: ok | error.
  • The errcode node is optional. Is returns the error code if the operation fails. Data type: integer.
  • The errtext node is optional. It returns the error message if the operation fails. Data type: string.
  • The filter-id node is required if the request packet is valid. It returns the filtering rule parameter. For details, refer to the Available Filters section. Data type: anySimple.
  • The id node is optional. This node is not presented in the response packet of the operation.
  • The descriptor node is required only in Plesk for Linux/Unix if the operation succeeds. It contains the properties descriptor. Data type: complex. For details, refer to the section Representation of Object Descriptor. In Plesk for Windows the node is not presented in the response packet.
 

Samples

Retrieving server-level descriptor

The packet that requests for server-level properties descriptor looks as follows:

<packet>
<protected-dir>
    <get-pd-location-descriptor>
      <filter/>
    </get-pd-location-descriptor>
</protected-dir>
</packet>

Response (for Linux/Unix):

<packet>
<protected-dir>
    <get-pd-location-descriptor>
      <result>
         <status>ok</status>
         <descriptor>
            	<property>
		   <name>ssl</name>
		   <type>boolean</type>
		   <default>true</default>
	        </property>
            	<property>
		   <name>nonssl</name>
		   <type>boolean</type>
		   <default>true</default>
	        </property>
            	<property>
		   <name>cgi</name>
		   <type>boolean</type>
		   <default>false</default>
	        </property>
         </descriptor>
      </result>
    </get-pd-location-descriptor>
  </protected-dir>
</packet>

Response (for Windows):

<packet>
<protected-dir>
    <get-pd-location-descriptor>
      <result>
         <status>ok</status>
      </result>
    </get-pd-location-descriptor>
  </protected-dir>
</packet> 
Retrieving site-level descriptor

The packet that requests for site-level properties descriptor looks as follows::

<packet>
<protected-dir>
    <get-pd-location-descriptor>
      <filter>
        <site-id>100</site-id>
      </filter>
    </get-pd-location-descriptor>
  </protected-dir>
</packet>

Response (for Linux/Unix):

<packet>
<protected-dir>
    <get-pd-location-descriptor>
      <result>
         <status>ok</status>
         <filter-id>100</filter-id>
         <descriptor>
            	<property>
		   <name>ssl</name>
		   <type>boolean</type>
		   <default>true</default>
		   <writable-by>admin</writable-by>
		   <writable-by>client</writable-by>
		   <writable-by>domain-admin</writable-by>
	        </property>
            	<property>
		   <name>nonssl</name>
		   <type>boolean</type>
		   <default>true</default>
		   <writable-by>admin</writable-by>
		   <writable-by>client</writable-by>
		   <writable-by>domain-admin</writable-by>
	        </property>
            	<property>
		   <name>cgi</name>
		   <type>boolean</type>
		   <default>false</default>
		   <writable-by>admin</writable-by>
		   <writable-by>client</writable-by>
		   <writable-by>domain-admin</writable-by>
	        </property>
         </descriptor>
      </result>
    </get-pd-location-descriptor>
  </protected-dir>
</packet>

Response (for Windows):

<packet>
<protected-dir>
    <get-pd-location-descriptor>
      <result>
         <status>ok</status>
         <filter-id>100</filter-id>
      </result>
    </get-pd-location-descriptor>
  </protected-dir>
</packet>

 

 

Leave your feedback on this topic here

If you have questions or need support, please visit the Plesk forum or contact your hosting provider.
The comments below are for feedback on the documentation only. No timely answers or help will be provided.