Renaming Subdomain

The rename operation is used to change a subdomain name.

In this chapter:

Request Packet Structure

Response Packet Structure

Samples

 

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:

SubdomainRenameInputType

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.

Important: 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:

SubdomainRenameOutputType

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>
 

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.