Forum Discussion
MichaelatF5
Nov 03, 2015Employee
To get this to work in v12, I had to take an extra step.
$jsonuser = @"
{
"name": "xadmin",
"password": "pass@word1",
"role": "admin",
"shell": "tmsh",
"partitionaccess": [ {
"name": "all-partitions",
"role": "admin"
}
]
}
"@
$rolejson = @"
{
"partitionAccess": [
{
"name": "all-partitions",
"role": "admin"
}
]
}
"@
I could set partition with a POST, but not ROLE. So I had to use the following:
curl -sk -u "admin:admin" 'https://10.0.0.5/mgmt/tm/auth/user' -X POST -d $o -H "Content-Type: application/json"
`
curl -sk -u "admin:admin" 'https://10.0.0.5/mgmt/tm/auth/user/xadmin' -X PATCH -d $rolejson -H "Content-Type: application/json"