User Management API reference

This section describes user management-related requests.

All database examples provided in this guide are specific to MySQL. If you use a different database, use syntax that is appropriate for your respective database.

addGroupMember

Adds a user name to the member list for a specific group.

Required Arguments

groupName

Description: The unique name of the group.

userName

Description: The unique name of the user.

Optional Arguments

None

Syntax

cmtool addGroupMember <groupName> <userName>

Example

cmtool addGroupMember DevGroupA ec123

Adds user ’ec123’ to group DevGroupA.

changeOwnUser

Modifies the settings for the currently logged-in user.

Required Arguments

userName

Description: The unique name of the user.

Optional Arguments

fullUserName

Description: The real world name of the user.

email

Description: The associated user email address.

password

Description: The password for a particular user.

passwordFile

Description: The path to a password file. If `--password ` is also specified, `--passwordFile ` overrides its value in the command line.

Syntax

cmtool changeOwnUser <userName> [optionals...]

Example

cmtool changeOwnUser ec123 --fullUserName "Mary Smith"

createGroup

Creates a new local group.

Required Arguments

groupName

Description: The unique name of the group to create.

Optional Arguments

None

Syntax

cmtool createGroup <groupName>

Example

cmtool createGroup DevGroupA

createUser

Creates a new local user.

Required Arguments

userName

Description: The unique name of the user.

password

Description: The password for a particular user.

Optional Arguments

fullUserName

Description: The real world name of the user.

email

Description: The associated user email address.

passwordFile

Description: The path to a password file. If `--password ` is also specified, `--passwordFile ` overrides its value in the command line.

Syntax

cmtool createUser <userName> <password> [optionals...]

Example

cmtool createUser ec123 psword --fullUserName "Bob Smith" --email "ec123@ourhost.com"

Creates a new user named “ec123” whose real-world name is Bob Smith; with “psword” as his password.

If you do not wish to expose passwords on the command line, you can omit the password from the example above. Press the Enter key after typing the command string (without the password) and you will be prompted for the password.

deleteGroup

Deletes a local group.

Required Arguments

groupName

Description: The unique name of the group.

Optional Arguments

None

Syntax

cmtool deleteGroup <groupName>

Example

cmtool deleteGroup DevGroupA

Removes the ’DevGroupA’ group from the Cluster Manager.

deleteUser

Deletes a local user.

Required Arguments

userName

Description: The unique name of the user.

Optional Arguments

None

Syntax

cmtool deleteUser <userName>

Example

cmtool deleteUser ec123

getAccessEntries

Retrieves permissions for all users and groups that were granted server access.

Required Arguments

None

Optional Arguments

None

Result Tags

entityName

Description: A user or group name in an access entry.

permissions

Description: The list of permission flags for a particular entity.

Example

cmtool getAccessEntries

getGroupMembers

Retrieves a list of users in a specific group.

Required Arguments

groupName

Description: The unique name of the group.

Optional Arguments

None

Result Tags

userName

Description: The unique name of the user.

Example

cmtool getGroupMembers

Retrieves a list of user name elements.

getGroups

Finds all groups known to the server. If “local” is true, returns local groups only.

Required Arguments

userName

Description: The unique name of the user.

Optional Arguments

local

Description: Can be true or false. If true, returns local users only.

Result Tags

groupName

Description: The unique name of the group.

mutable

Description: True if the associated user or group record is modifiable.

providerName

Description: The human-readable name configured for the directory provider of a specific user or group.

Syntax

cmtool getGroups [optionals...]

Example

cmtool getGroups

Returns a list of groupInfo elements.

getEffectivePermissions

Retrieves the permissions for the currently logged-in user.

Required Arguments

None

Optional Arguments

None

Result Tags

permissions

Description: The list of permission flags for a particular entity.

Possible Results

`AgentsDelete ` `AgentsRead ` `AgentsWrite ` `BuildsDelete ` `BuildsRead ` `BuildsWrite ` `ClassesDelete ` `ClassesRead ` `ClassesWrite ` `EMakeImpersonate ` `EMakeInvoke ` `MaintenanceDelete ` `MaintenanceRead `

MaintenanceWrite MessageLogDelete ` `MessageLogRead ` `MessageLogWrite ` `ReportsDelete ` `ReportsRead ` `ReportsWrite ResourcesDelete ` `ResourcesRead ` `ResourcesWrite `ServerAccess ` `UserModify `

Example

cmtool getEffectivePermissions

Retrieves the permissions for the currently logged-in user.

getPermissions

Retrieves permissions for a particular user or group.

Required Arguments

principalType

Description: Can be user or group.

entityName

Description: A user or group name in an access entry.

Optional Arguments

None

Result Tags

permissions

Description: The list of permission flags for a particular entity.

Possible Results

`AgentsDelete ` `AgentsRead ` `AgentsWrite ` `BuildsDelete ` `BuildsRead ` `BuildsWrite ` `ClassesDelete ` `ClassesRead ` `ClassesWrite ` `EMakeImpersonate ` `EMakeInvoke ` `MaintenanceDelete ` `MaintenanceRead `

MaintenanceWrite MessageLogDelete MessageLogRead ` `MessageLogWrite ` `ReportsDelete ` `ReportsRead ` `ReportsWrite ResourcesDelete ` `ResourcesRead ` `ResourcesWrite `ServerAccess ` `UserModify `

Syntax

cmtool getPermissions <principalType> <entityName>

Example

cmtool getPermissions group DevGroupA

Retrieves permissions for group DevGroupA.

getUser

Finds a specific user known to the server.

Required Arguments

userName

Description: The unique name of the user.

Optional Arguments

None

Result Tags

email

Description: The associated user email address.

fullUserName

Description: The real world name of the user.

groupName

Description: The unique name of the group.

mutable

Description: True if the associated user or group record is modifiable.

providerName

Description: The human-readable name configured for the directory provider of a specific user or group.

userName

Description: The unique name of the user.

Syntax

cmtool getUser <userName> [optionals...]

Example

cmtool getUser ec123

Retrieves the attributes for user ec123.

getUsers

Finds all users known to the server. If “local” is true, returns local users only.

Required Arguments

None

Optional Arguments

pattern

Description: A wildcard pattern for a user name where “*” matches any character or SQL “like” string. If LDAP is set up for getting users, the * is the preferred wildcard, as % is not understood by LDAP (this limits the result set to records in the local database).

local

Description: Can be true or false. If true, returns local users only.

Result Tags

See the getUser command for descriptions.

email
fullUserNamemutable
providerName
userName

Syntax

cmtool getUsers [optionals...]

Example

cmtool getUsers --pattern ec*

Retrieves information on all user IDs that begin with ’ec’.

getUserSettings

Retrieves settings for the currently logged-in user.

Required Arguments

None

Optional Arguments

None

Example

cmtool getUserSettings

login

Logs in to the client with the appropriate credentials and creates a session file in the users home directory, which allows subsequent calls to cmtool to connect to the Cluster Manager.

Required Arguments

userName

Description: The unique name of the user.

password

Description: The password for a particular user.

Optional Arguments

passwordFile

Description: The path to a password file. If `--password ` is also specified, `--passwordFile ` overrides its value in the command line.

Result Tags

sessionId

Description: This is a session "cookie."

Syntax

cmtool login <userName> <password> [optionals...]

Example

cmtool login ec123 bobs

Logs in a user named “ec123” whose password is “bobs”.

If you do not wish to expose passwords on the command line, you can omit the password from the example above. Press the Enter key after typing the command string (without the password) and you will be prompted for the password.

logout

Logs out of the client session.

Required Arguments

None

Optional Arguments

None

modifyGroup

Modifies a local group.

Required Arguments

groupName

Description: The unique name of the group.

Optional Arguments

newName

Description: The new group name.

Syntax

cmtool modifyGroup <groupName> [optionals...]

Example

cmtool modifyGroup DevGroupA --newName GroupDevA

modifyUser

Modifies a local user.

Required Arguments

userName

Description: The unique name of the user.

Optional Arguments

fullUserName

Description: The real world name of the user.

email

Description: The associated user email address.

password

Description: The password for a particular user.

passwordFile

Description: The path to a password file. If `--password ` is also specified, `--passwordFile ` overrides its value in the command line.

Syntax

cmtool modifyUser <userName> [optionals...]

Example

cmtool modifyUser ec123 --fullUserName "Mary Smith"

removeGroupMember

Deletes a user name from a specific group member list.

Required Arguments

groupName

Description: The unique name of the group.

userName

Description: The unique name of the user.

Optional Arguments

None

Syntax

cmtool removeGroupMember <groupName> <userName>

Example

cmtool removeGroupMember DevGroupA ec123

setBuildEndNotification

Enables/disables notification when builds of this class end for the currently logged-in user.

Required Arguments

buildClassId

Description: A unique number assigned by the Cluster Manager for each build class. Use getBuildClasses to retrieve a list of build class IDs.

enabled

Description: Set this to true to enable notification and to false to disable it.

Optional Arguments

None

Syntax

cmtool setBuildEndNotification <buildClassId> <enabled>

Example

cmtool setBuildEndNotification 1 true

Enables build ’end notification’ for build class 1.

setPermissions

Creates or modifies permissions for a user or group. The permissions are a space-separated list of permission names.

Required Arguments

principalType

Description: Can be user or group.

entityName

Description: A user or group name in an access entry.

permissions

Description: The list of permission flags for a particular entity. See the available permissions flags below.

AgentsDelete AgentsRead AgentsWrite BuildsDelete BuildsRead BuildsWrite ClassesDelete ClassesRead ClassesWrite EMakeImpersonate EMakeInvoke MaintenanceDelete MaintenanceRead

MaintenanceWrite MessageLogDelete MessageLogRead MessageLogWrite ReportsDelete ReportsRead ReportsWrite ResourcesDelete ResourcesRead ResourcesWrite ServerAccess `UserModify `

Optional Arguments

None

Available Permission Flags

Syntax

cmtool setPermissions <principalType> <entityName> <permissions>

Example

cmtool setPermissions user ec123 "BuildsRead AgentsRead"

Restricts user ec123 to read-only privileges for builds and agents.

setUserSettings

Updates settings for the currently logged-in user.

Required Arguments

watchMessages

Description: Indicates whether you want to receive notifications when messages of the specified notification level arrive. Can be Y, N, y, n, yes, no, Yes, or No.

Optional Arguments

notificationLevel

Description: Can be Info, Warning, or Error.

Syntax

cmtool setUserSettings <watchMessages> [optionals...]

Example

cmtool setUserSettings yes --notificationLevel Info

Sets the current user to receive notifications for ’Info’ level messages.