The rename operation is used to change a subdomain name.

Request Packet Structure

A request XML packet renaming a subdomain includes the rename operation node:

<packet>
<subdomain>
<rename>
...
</rename>
</subdomain>
</packet>

The rename node is presented by the SubdomainRenameInputType (subdomain.xsd). Its graphical representation is as follows:

image 53522

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 id node is required. It specifies a subdomain ID. Data type: id_type.
  • The name node is required. It specifies a new name of the subdomain (without parent site name). Data type: string.

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

Response Packet Structure

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

image 53526

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: resultType (common.xsd).
  • The status node is required. It specifies the execution status of the rename operation. Data type: result_status (common.xsd) . Allowed values: ok|error.
  • The errcode node is required if the rename operation fails. It is used to return the error code. Data type: unsignedInt.
  • The errtext node is required if the rename operation fails. It is used to return the error message. Data type: string.

Possible Errors

  • 1007 - Subdomain with such name already exists.
  • 1013 - Subdomain with such ID is absent.
  • 1023 - Operation failed.

Samples

To rename a subdomain with ID 3 to forum:

<packet version="1.5.2.0">
<subdomain>
<rename>
   <id>3</id>
   <name>forum</name>
</rename>
</subdomain>
</packet>

Response:

<packet version="1.5.2.0">
<subdomain>
   <rename>
      <result>
         <status>ok</status>
      </result>
   </rename>
</subdomain>
</packet>