Creating multiple users with REST in CA Performance Management

Document ID : KB000124913
Last Modified Date : 17/01/2019
Show Technical Document Details
Introduction:
When implementing a new environment there is often a need to create many new users.

An example of this effort might be migration from older eHealth installations, driving a need to duplicate users between environments.
Question:
How can the REST API be leveraged to create more than one new user account at a time?
Environment:
All supported Performance Management releases.
Answer:
Current product REST capabilities are limited to creation of one user per REST call for user creation.

The best case for repetitive REST calls that can only be done one at a time is via scripting. The script calls curl statements for a set of values preset in a file used by the script.

A simple, and not syntactically correct, sample of what needs to be done is something like the following.
 
userNames=`cat /tmp/inputFile.txt` 

for i in $userNames; do 
curl --header "Content-Type: application/xml" --request PUT --data '<user><name>$i</name><description>$i</description><enabled>true</enabled><removable>true</removable><timezone>UTC</timezone><culture>en-US</culture></user>' --url http://$DAhostname:$port/rest/........ 

done; 
 
Where the inputFile has a username on each line. It can get as complex as scripting skills allow.