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, , 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.
OR Add a user and assign the role Normal User by default :
|
Notes |
The user element has the following attributes:
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 |
|
|
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.
|
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).