Previous page

Next page

Locate page in Contents

Print this page

add_user

Summary:

Adds a new user to a server.

Request specification:

Name

Min/Max

Type

Description

add_user

0..[]

 

 

{

 

 

 

user

1..1

userType

The new user information.

min_uid

0..1

int

Linux Lower bound of the UID (user ID) range.

This element, together with the max_uid element (below), specifies the UID range. If there is an unused ID in the range then it will be used for the new user.

max_uid

0..1

int

Linux Upper bound of the UID range.

create_home_dir

0..1

boolean

Specifies whether a home directory should be created for the user. Possible values:

true -- Create home directory.

false -- Do not create the directory.

If the parameter is omitted, the decision whether to create a directory or not will be made automatically based on the OS template used (some OS templates imply the creation of home directories while others don't). If the parameter is included, the default template behaviour is ignored.

create_initial_group

0..1

 

Linux Specifies whether to create an initial group for the user. In order to create the initial group, include this element and the user/initial_group/name element containing the name of group.

Some Linux distributions will create the initial group with the same name as the user name by default. Other distributions will add a new user to a predefined group. You can use this field, together with the user/initial_group/name field, to override this default behaviour.

}

 

 

 

Returns:

Name

Min/Max

Type

Description

user

0..[]

userType

The new user information.

Example:

Adding a new user named "TestUser" to the specified server. The Server ID is specified using the dst element of the packet header. Also creating an initial group named "InitGroup" and adding the user to it. The user ID will be selected from the range 100-200.

Linux Input

<packet version="4.0.0">

<dst>

<host>9bafbeb7-85f7-499e-a210-40e00850a5f3</host>

</dst>

<target>userm</target>

<data>

<userm>

<add_user>

<user>

<initial_group>

<name>InitGroup</name>

</initial_group>

<name>TestUser</name>

<shell>/bin/bash</shell>

</user>

<min_uid>100</min_uid>

<max_uid>200</max_uid>

<create_initial_group/>

</add_user>

</userm>

</data>

</packet>

Output

<ns1:packet xmlns:ns2="http://www.swsoft.com/webservices/vzl/4.0.0/userm" xmlns:ns3="http://www.swsoft.com/webservices/vzl/4.0.0/types" xmlns:ns1="http://www.swsoft.com/webservices/vzl/4.0.0/protocol" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" type="0" id="1dc45eee46at4db7rdfc" time="2007-03-07T11:53:52+0000" priority="0" version="4.0.0">

<ns1:origin>9bafbeb7-85f7-499e-a210-40e00850a5f3</ns1:origin>

<ns1:dst>

<director>gend</director>

<target>vzclient3</target>

</ns1:dst>

<ns1:data>

<ns2:userm>

<ns2:user xsi:type="ns3:userType">

<ns3:uid>101</ns3:uid>

<ns3:name>TestUser</ns3:name>

<ns3:initial_group>

<ns3:gid>500</ns3:gid>

<ns3:name>InitGroup</ns3:name>

</ns3:initial_group>

<ns3:shell>/bin/bash</ns3:shell>

<ns3:home_dir>/home/TestUser</ns3:home_dir>

</ns2:user>

</ns2:userm>

</ns1:data>

<ns1:src>

<ns1:director>vpsd</ns1:director>

<ns1:target>userm</ns1:target>

</ns1:src>

<ns1:target>vzclient3</ns1:target>

</ns1:packet>

Please send us your feedback on this help page