Retrieving Protected Directory Properties

Use the get operation to retrieve properties of a specific protected directory.

In this chapter:

Request Packet Structure

Response Packet Structure

Samples

 

Request Packet Structure

A request XML packet changing protected directory properties includes the get operation node:

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

 

The get node is presented by type ProtectedDirGetInput (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. It specifies the filtering rule. For details, refer to the Available Filters section. Data type: ProtectedDirFilter (protected_dir.xsd).
 

Response Packet Structure

The get node of the output XML packet is presented by type ProtectedDirGetOutput (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 required if the operation succeeds. It returns the ID of the protected directory which properties were retrieved. Data type: integer.
  • The data node is required if the operation succeeds. It specifies the protected directory properties. The node is presented by type: complex. Its graphical representation is as follows:

  • The name node is optional. It specifies the protected directory name. Data type: string.
  • The header node is optional. It specifies the protected directory header. It is the message that is displayed to a user when he tries to access the protected directory. Data type: string.
  • The location node is optional. It specifies protected directory properties. The node is present in the response packet only for Plesk for Linux/Unix servers. Data type: complex.
  • The property node is required if the location node is specified. It specifies the protected directory property. Data type: ProtectedDirLocationProperty (protected_dir.xsd).
  • The name node is required if the location node is specified. It specifies the protected directory property name. Data type: string. Names and values of properties that can be changed for a specific site or common for all domains properties can be retrieved using the get-pd-location-descriptor operation.
  • The value node is required if the location node is specified. It specifies the protected directory property value. Data type: boolean.
 

Samples

Retrieving properties of a single protected directory

The packet that retrieves properties of the protected directory with ID 1 looks as follows:

<packet>
<protected-dir>
    <get>
      <filter>
         <id>1</id>
      </filter>
    </get>
  </protected-dir>
</packet>

Response:

<packet>
<protected-dir>
      <get>
        <result>
          <status>ok</status>
          <filter-id>1</filter-id>
          <id>1</id>
          <data>
            <name>directory</name>
            <header>This is a header!</header>
            <location>
              <property>
                  <name>ssl</name>
                  <value>true</value>
              </property>
              <property>
                  <name>non-ssl</name>
                  <value>true</value>
              </property>
              <property>
                  <name>cgi</name>
                  <value>true</value>
              </property>
            </location>
          </data>  
        </result>
      </get>
    </protected-dir>
</packet>

 

If the protected directory was not found, the response from the server looks as follows:

<packet>
<protected-dir>
  <get>
    <result>
     <status>error</status>
     <errcode>1013</errcode>
     <errtext>Protected URL is not found</errtext>
     <filter-id>1</filter-id>
    </result>
  </get>
</protected-dir>
</packet> 
Retrieving properties of multiple protected directories

The packet that retrieves properties of all protected directories of the site with ID 132 looks as follows:

<packet>
<protected-dir>
    <get>
      <filter>
         <site-id>132</site-id>
      </filter>
    </get>
  </protected-dir>
</packet>

Response:

<packet>
<protected-dir>
      <get>
        <result>
          <status>ok</status>
          <filter-id>132</filter-id>
          <id>34</id>
          <data>
            <name>directory</name>
            <header>This is a header!</header>
            <location>
              <property>
                  <name>ssl</name>
                  <value>true</value>
              </property>
              <property>
                  <name>non-ssl</name>
                  <value>false</value>
              </property>
              <property>
                  <name>cgi</name>
                  <value>true</value>
              </property>
            </location>
          </data>  
        </result>
        <result>
          <status>ok</status>
          <filter-id>132</filter-id>
          <id>37</id>
          <data>
            <name>MySecondDirectory</name>
            <header>This is a the second directory header!</header>
            <location>
              <property>
                  <name>ssl</name>
                  <value>true</value>
              </property>
              <property>
                  <name>non-ssl</name>
                  <value>true</value>
              </property>
              <property>
                  <name>cgi</name>
                  <value>true</value>
              </property>
            </location>
          </data>  
        </result>
      </get>
    </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.