How to Add/Modify/Remove user details using API.
Watch4Net/M&R 7.X
NOTE:
1). Before using below APIs check if APG-REST-API module is installed using the command: manage-modules.sh list installed|grep APG-REST-API
2). If APG-REST-API module is not installed, install the same using the command: manage-modules.sh install rest-api
/admin/user
username : String
password : String
title : String
firstName : String
lastName : String
emailAddress : String
roles: Array
POST /admin/user
{
"username":"username",
"password":"password",
"title":"tilte",
"firstName":"firstname",
"lastName":"lastname",
"emailAddress":"emailaddress",
"roles":[
"Full Control Users",
"Storage Administrator Users",
"Network Administrator Users",
"NOC Operator Users",
"Datacenter Administrator Users",
"Web Service Role"
]
}
curl -v -k -u admin:changeme -X POST "https://<Frontend-Server>:58443/APG-REST/admin/user" -H "accept: application/json" -H "content-type: application/json" -d '{
"username":"username",
"password":"password",
"title":"<Title should be one of Mr., Mrs., Miss., Dr.>",
"firstName":"firstname",
"lastName":"lastname",
"emailAddress":"emailaddress",
"roles":[
"Full Control Users",
"Storage Administrator Users",
"Network Administrator Users",
"NOC Operator Users",
"Datacenter Administrator Users",
"Web Service Role"
]
}'
/admin/user/{username}
username : String
password : String
roles : Array
PATCH /admin/user/{username}
{
"password":"password",
"roles":[
"Full Control Users",
"Storage Administrator Users",
"Network Administrator Users",
"NOC Operator Users",
"Datacenter Administrator Users",
"Web Service Role"
]
}
curl -v -k -u admin:changeme -X PATCH "https://<Frontend-Server>:58443/APG-REST/admin/user/<username_to_be_updated>" -H "accept: application/json" -H "content-type: application/json" -d '{
"password":"password",
"roles":[
"Full Control Users",
"Storage Administrator Users",
"Network Administrator Users",
"NOC Operator Users",
"Datacenter Administrator Users",
"Web Service Role"
]
}'
/admin/user/{username}
username : String
DELETE /admin/user/{username}
curl -v -k -u admin:changeme -X DELETE "https://<Frontend-Server>:58443/APG-REST/admin/user/<username_to_be_deleted>"