Available in version 10.1 Fix Pack 1

Add a user to the database

Description

URL

scheme://domain:port/platform/ws/users

Description

Adds a user to the database.

The logged on user must have view_configure permission on the setting resource to use this API.

By default, IBM Spectrum LSF Application Center automatically loads to the database LSF users and LSF user groups that are defined in the LSF configuration file lsb.users. By default, any user who is listed in lsb.users and any operating system user that exists on the IBM Spectrum LSF Application Center server has access to IBM Spectrum LSF Application Center and is assigned the user role Normal.

To control which users can log in and use IBM Spectrum LSF Application Center, set the parameter ALLOW_UNKNOWN_USER=N in the configuration file pmc.conf. When ALLOW_UNKNOWN_USER=N, only users that you specify can log on. All other users are denied access. Also set ENABLE_USER_GROUP=N in pmc.conf so that users and user groups are not automatically loaded from LSF.

Adding users with this API is equivalent to adding a user by selecting the System & Settings tab, Settings > Users > Users & Groups, and clicking the Add button.

HTTP-Method

POST

Parameters

None

Request

Request-Method

PUT

Request-URI

/platform/ws/users

Request-Header

Name

Value

Accept

application/xml or application/json

Content-Type

application/x-www-form-urlencoded

Message-body

The XML definition of the user record.

<user name="%s" email=”%s”>
   <roles>
     <role name="%s"/>
       ...
   </roles>
</user>

OR

Add a user and assign the role Normal User by default :

<user name="%s" email=”%s”/>

Notes

The user element has the following attributes:
  • name: Required. Specify the user that is allowed to access IBM Spectrum LSF Application Center. The user account must be an operating system user on the IBM Spectrum LSF Application Center server or a user account that can be validated with the corresponding authentication mechanism such as LDAP, NIS, Active Directory.
  • email: Optional. Email address of the user.

Use the <role> element to assign roles to the user.

If you do not specify a role, the role Normal User is assigned to the user.

Use the API platform/ws/roles (GET) to get a list of user roles defined in IBM Spectrum LSF Application Center.

Response

Response

Response Information

Response Code

  • 200 Successful: Request was successful.
  • 204 Successful: Request was successful and user added to the database.
  • 403 Forbidden: The user that is logged on does not have view_configure permission on the setting resource.
  • 404 Not Found: The specified user does not exist. It is not an operating system user.
  • 500 Internal Server Error: Exception occurred

Response-Header

Name

Value

Content-Type

Application/xml or application/json

Message-body

Success Message

If successful, returns null.

  Failure Message

If not successful, returns an error message.

<error>
  <message>
     %s
  </message>
</error>

Example: Add user testUser and assign the roles roleName1 and roleName2

# Request
POST /platform/ws/users HTTP/1.1
Host: www.example.org
Request-Header: "Accept: application/xml", "Content-Type: application/x-www-form-urlencoded";

<user name="testUser" email=”testUser@example.org”>
<roles>
    <role name="roleName1" />   
    <role name="roleName2" />   
</roles>
</user>

# Response
204 Created

Related APIs

To delete a user from the database, use the API /platform/ws/users/{userName} (DELETE).

To view possible user roles, use the API /platform/ws/roles (GET).

End of change