Security roles owner.uuid name privileges endpoint overview
- PDF of this doc site
Collection of separate PDF docs
Creating your file...
Overview
This API is used to configure the role privileges (tuples of REST URI path and its access levels). It also retrieves all of the privilege tuples for a role and can add a tuple to an existing role. The REST URI path can be a resource-qualified endpoint. Currently, the only supported resource-qualified endpoints are /api/storage/volumes/{volume.uuid}/snapshots and /api/storage/volumes//snapshots. "" is a wildcard character denoting "all" volumes.
The role can be SVM-scoped or cluster-scoped.
Specify the owner UUID and the role name in the URI path. The owner UUID corresponds to the UUID of the SVM for which the role has been created and can be obtained from the response body of a GET request performed on one of the following APIs:
/api/security/roles for all the roles
/api/security/roles/?scope=svm for SVM-scoped roles
/api/security/roles/?owner.name=
The pre-defined roles can be retrieved but cannot be updated. |
Examples
Adding a privilege tuple for an existing custom role
# The API: POST "/security/roles/{owner.uuid}/{name}/privileges" # The call: curl -X POST "https://<mgmt-ip>/api/security/roles/aaef7c38-4bd3-11e9-b238-0050568e2e25/svm_role1/privileges" -d '{"access":"readonly","path":"/api/protocols"}'
Retrieving all the privilege tuples for a role
# The API: GET "/api/security/roles/{owner.uuid}/{name}/privileges" # The call: curl -X GET "https://<mgmt-ip>/api/security/roles/aaef7c38-4bd3-11e9-b238-0050568e2e25/svm_role1/privileges" # The response: { "records": [ { "path": "/api/application", "access": "all", "_links": { "self": { "href": "/api/security/roles/aaef7c38-4bd3-11e9-b238-0050568e2e25/svm_role1/privileges/%2Fapi%2Fapplication" } } }, { "path": "/api/protocols", "access": "readonly", "_links": { "self": { "href": "/api/security/roles/aaef7c38-4bd3-11e9-b238-0050568e2e25/svm_role1/privileges/%2Fapi%2Fprotocols" } } }, { "path": "/api/storage/volumes/1385d680-74fc-4adb-a348-9a740e83702a/snapshots", "access": "all", "_links": { "self": { "href": "/api/security/roles/aaef7c38-4bd3-11e9-b238-0050568e2e25/svm_role1/privileges/%2Fapi%2Fstorage%2Fvolumes%2F1385d680-74fc-4adb-a348-9a740e83702a%2Fsnapshots" } } } ], "num_records": 3, "_links": { "self": { "href": "/api/security/roles/aaef7c38-4bd3-11e9-b238-0050568e2e25/svm_role1/privileges" } } }