Renaming Site Aliases

The rename operation is used to rename the specified site alias. The site alias can be specified either by ID, or by name.

In this chapter:

Request Packet Structure

Response Packet Structure

Samples

 

Request Packet Structure

A request XML packet renaming the site alias in Plesk database includes the rename operation node:

<packet>
<site-alias>
<rename>
...
</rename>
</site-alias>
</packet>

 

The rename node graphical representation is as follows:

  • The id node is required. It specifies the site alias by ID. Data type: integer.
  • The name node is required. It specifies the site alias by name. Data type: string (Unicode).
  • The new_name node is required. It is used to assign a new site alias name. Data type: string (Unicode).

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:

  • The result node is required. It wraps the response retrieved from the server. Data type: resultType (common.xsd).
  • The status node is required. Specifies the execution status of the rename operation. Data type: string. Allowed values: ok | error.
  • The errcode node is optional. Is used to return the error code when the rename operation fails. Data type: unsignedInt.
  • The errtext node is optional. Can be used to return the error message if the rename operation fails. Data type: string.
 

Samples

The following XML packet renames the MyAlias.com site alias to MyNewAlias.com:

<packet>
<site-alias>
   <rename>
      <name>MyAlias.com</name>
      <new_name>MyNewAlias.com</new_name>
   </rename>
</site-alias>
</packet>

Response:

<packet>
<site-alias>
<rename>
   <result>
      <status>ok</status>
   </result>
</rename>
</site-alias>
</packet>

The following XML packet is not valid because it specifies both alias name and id.

<packet>
<site-alias>
   <rename>
      <id>15</id>
      <name>MyAlias.com</name>
   </rename>
</site-alias>
</packet>
 

Leave your comments on this page

Leave your feedback or question on this documentation topic below. For technical assistance, contact your hosting service provider or submit a request to Plesk support. Suggest new features for Plesk here. Discuss general questions on the Plesk forum. All offtopic comments will be removed.