How to give a user permissions on a supervisor namespace? #3623
-
I've looked in the help output and online, and haven't found an answer yet: How can I use I can use |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
There isn't a specific govc command, but you can send any authenticated API request using the session.login command. Looks like the API for this is: https://developer.broadcom.com/xapis/vsphere-automation-api/latest/vcenter/access/ Here's some examples from what I just tried: # Example vars
% ns=dev; user=dougm; domain=vsphere.local
# Create access
% govc session.login -r -X POST /api/vcenter/namespaces/instances/$ns/access/$domain/$user?type=USER <<<'{"role": "OWNER"}'
# Get
% govc session.login -r -X GET /api/vcenter/namespaces/instances/$ns/access/$domain/$user?type=USER
| jq .
{
"role": "OWNER",
"inherited": false
}
% govc session.login -r -X GET /api/vcenter/namespaces/instances/$ns | jq .access_list
[
{
"role": "OWNER",
"subject_type": "USER",
"subject": "dougm",
"domain": "vsphere.local"
}
]
# Update
% govc session.login -r -X PUT /api/vcenter/namespaces/instances/$ns/access/$domain/$user?type=USER <<<'{"role": "VIEW"}'
# Delete
% govc session.login -r -X DELETE /api/vcenter/namespaces/instances/$ns/access/$domain/$user?type=USER |
Beta Was this translation helpful? Give feedback.
There isn't a specific govc command, but you can send any authenticated API request using the session.login command.
Looks like the API for this is: https://developer.broadcom.com/xapis/vsphere-automation-api/latest/vcenter/access/
Here's some examples from what I just tried: