Details
-
Type: Sub-task
-
Status: Closed
-
Priority: Major
-
Resolution: Fixed
-
Affects Version/s: Aquidneck
-
Fix Version/s: 2.0.0, sprint 16: 12-19-2012, Aquidneck
-
Component/s: None
-
Labels:None
-
Sprint:Sprint 13, Sprint 14, Sprint 15, Sprint 1 - Matunuck
Description
Script to add a new user. This script is also found on github in saas/system/scripts.
Must provide:
ah : the API Host - for example, dev would be http://tsa-chef-qa1:8080/sapi/rest/
u : username - Must pass email validation
ra : realm alias - To be clear, this would be 'reseller1' NOT 'com.reseller1'
d : display name - Required by the service, if the display name is more than one word, put it in double quotes
r : role - Must be one of the roles we have in the database)
Optional:
p : password - You will get a default password if you don't provide this
a : active - true or false
g : gender - M or F
hp : home phone - Must pass phone number validation
wp : work phone - Must pass phone number validation
wpe : work phone extension - Must pass phone extension validation (Extensions can only contain one "x" or "X" and only digits)
mp : mobile phone - Must pass phone number validation
b : birthday
l : language - Must pass language validation (either an ISO 639-2 or ISO 639-1 language code)
fn : first name
ln : last name
desc : description
Valid Roles:
admin, customer_services, fulfillment, guest, merchant, reseller, sales, technical_support, tsa_account_manager, tsa_operations_admin, user (Authenticated user)
To run:
groovy create-user.groovy -u user@username.com -p somepassword -r aValidRole -ra aRealmAlias -d "Display Name" -ah URLtoYourAPIHost
NOTE:
I am not positive what the validation is for a birthday. I would say any String that is in the correct format for a date (because it is stored as a date object in the system). Also, I like to store what I'm setting the password to be in the user's description.