The update operation lets you change settings of specified virtual directories.

Request Packet Structure

A request XML packet that changes a virtual directory’s settings should include the update operation node:

<packet>
<virtdir>
   <update>
   ...
   </update>
</virtdir>
</packet>

The update node is presented by type UpdateVDirInputType (virtdir.xsd). Its graphical representation is as follows:

image 72554

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 site-id node is required. It holds the identifier of the site that owns the virtual directory. Data type: integer.
  • The subdomain-id node is required. it holds the identifier of the subdomain that owns the virtual directory. Data type: integer.
  • The name node is required. It holds the name of the virtual directory. Data type: VDirPath (common.xsd).
  • The properties node is required. It holds a collection of virtual site settings. Data type: VDirProperties (virtdir.xsd). To see the structure of this node, refer to the Virtual Directory Properties section.

Note: When creating request packets, put nodes and elements in the order they follow in the packet structure.

Response Packet Structure

The update node of the output XML packet is structured as follows:

image 72555

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 result of the create operation. Data type: resultType (common.xsd).
  • The status node is required. Specifies the execution status of the create operation. Data type: string. Allowed values: ok|error.
  • The errcode node is optional. Is required if the create operation fails. Returns the error code. Data type: unsignedInt.
  • The errtext node is optional. Can be returned if the create operation fails. Returns the error message. Data type: string.

Samples

The following request packet updates a virtual directory on the specified site:

<packet>
<virtdir>
<update>
   <site-id>1</site-id>
   <name>/</name>
   <properties>
         <access-source>false</access-source>
          <access-read>true</access-read>
          <access-write>true</access-write>
          <dir-browsing>true</dir-browsing>
          <log-visits>true</log-visits>
          <default-doc>
            <enabled/>
            <search>Index.swf</search>
            <search>Index.html</search>
            <search>Index.htm</search>
            <search>Index.cfm</search>
            <search>Index.shtml</search>
            <search>Index.shtm</search>
            <search>Index.stm</search>
            <search>Index.php</search>
            <search>Index.php3</search>
            <search>Index.asp</search>
            <search>Index.aspx</search>
            <search>Default.htm</search>
            <search>Default.asp</search>
            <search>Default.aspx</search>
          </default-doc>
          <access-anonymous>true</access-anonymous>
          <require-ssl>false</require-ssl>
          <ip-allow>123.123.123.123 10.10.10.10</ip-allow>
          <ip-deny>10.10.10.10/16</ip-deny>
          <is-deny-by-concurrent-requests>true</is-deny-by-concurrent-requests>
          <max-concurrent-requests>4</max-concurrent-requests>
          <is-deny-by-request-rate>true</is-deny-by-request-rate>
          <max-requests>33</max-requests>
          <request-interval>333</request-interval>
   </properties>
</update>
</virtdir>
</packet>

Response:

<packet>
  <virtdir>
    <update>
      <result>
        <status>ok</status>
      </result>
    </update>
  </virtdir>
</packet>