Creating a Role

Use the add operation to create a role.

In this chapter:

Request Packet Structure

Response Packet Structure

Samples

 

Request Packet Structure

A request XML packet adding a new webspace to Plesk database includes the add operation node:

<packet>
<role>
   <add>
   ...
   </add>
</role>
</packet>

 

The add node is nested within the RoleAddInput type (role.xsd). The add node has the following graphics representation:

role-add-rps.gif

  • name, required

    It defines a role name. Data type: string.

  • owner-guid, optional

    It specifies the GUID of a role owner (a customer or the Administrator). If you do not specify this node, the role owner will be the request packet sender. Data type: string. For details on how to get a customer GUID, see the Getting Information About Client Accounts section.

  • permissions, optional

    It specifies a collection of permissions granted to a role. Data type: RolePermissions (role.xsd). See the structure of this node in the Permissions Granted to Roles section.

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

 

Response Packet Structure

The add node of the response packet is structured as follows:

role-add-reps.gif

  • result, required

    It wraps the result of the requested operation. Data type: resultType (common.xsd).

  • status, required

    It returns the execution status of the operation. Data type: string. Allowed values: ok | error.

  • errcode, optional

    Is used to return the error code when the operation fails. Data type: unsignedInt.

  • errtext, optional

    Can be used to return an error message if the operation fails. Data type: string.

  • id, optional

    It is required If the operation succeeds. Returns the ID of a new role. Data type: integer.

 

Samples

The following packet adds a role to the customer with GUID ff5e2685-6f44-490f-bdc8-9a46fb2f0308:

<packet version="1.6.3.0">
  <role>
    <add>
    <name>GalaxySpy</name>
    <owner-guid>ff5e2685-6f44-490f-bdc8-9a46fb2f0308</owner-guid>
    </add>
  </role>
</packet>

Reponse:

<packet version="1.6.3.0">
  <role>
    <add>
      <result>
        <status>ok</status>
        <id>61</id>
      </result>
    </add>
  </role>
</packet>