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

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:

image 34069

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 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).

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 34008

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. 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>