Name-services unix-groups svm.uuid unix_group.name users endpoint overview
Contributors
Suggest changes
- PDF of this doc site
Collection of separate PDF docs
Creating your file...
This may take a few minutes. Thanks for your patience.
Your file is ready
Overview
You can use this API to retrieve, add or delete UNIX users for an SVM's UNIX group.
Retrieving UNIX users from an SVM's UNIX group
The UNIX group users GET endpoint retrieves UNIX users of the specified UNIX group and the SVM.
Examples
Retrieving all users from the group 'pcuser'
# The API: /api/name-services/unix-groups/{svm.uuid}/{unix_group.name}/users # The call: curl -X GET "https://<mgmt-ip>/api/name-services/unix-groups/f06686a2-c901-11eb-94b4-0050568e9f2c/pcuser/users" -H "accept: application/hal+json" # The response: { "records": [ { "svm": { "uuid": "f06686a2-c901-11eb-94b4-0050568e9f2c", "name": "svm1" }, "unix_group": { "name": "pcuser" }, "name": "user1", "_links": { "self": { "href": "/api/name-services/unix-groups/f06686a2-c901-11eb-94b4-0050568e9f2c/pcuser/users/user1" } } } ], "num_records": 1, "_links": { "self": { "href": "/api/name-services/unix-groups/f06686a2-c901-11eb-94b4-0050568e9f2c/pcuser/users/?fields=*" } } }
Retrieving user 'user1' from the group 'pcuser'
# The API: /api/name-services/unix-groups/{svm.uuid}/{unix_group.name}/users/{name} # The call: curl -X GET "https://<mgmt-ip>/api/name-services/unix-groups/f06686a2-c901-11eb-94b4-0050568e9f2c/pcuser/users/user1" -H "accept: application/hal+json" # The response: { "svm": { "uuid": "f06686a2-c901-11eb-94b4-0050568e9f2c", "name": "svm1" }, "unix_group": { "name": "pcuser" }, "name": "user1", "_links": { "self": { "href": "/api/name-services/unix-groups/f06686a2-c901-11eb-94b4-0050568e9f2c/pcuser/users/user1" } } }
Adding users to a UNIX group
The UNIX group users POST endpoint adds UNIX users to the specified UNIX group and the SVM. Multiple users can be added in a single call using the "records" parameter.
Examples
Adding a single user to the group 'group1'
# The API: /api/name-services/unix-groups/{svm.uuid}/{unix_group.name}/users # The call: curl -X POST "https://<mgmt-ip>/api/name-services/unix-groups/179d3c85-7053-11e8-b9b8-005056b41bd1/group1/users" -H "accept: application/hal+json" -H "Content-Type: application/json" -d '{ "name": "user4" }'
Adding multiple users to the group 'group1' in a single REST call
# The API: /api/name-services/unix-groups/{svm.uuid}/{unix_group.name}/users # The call: curl -X POST "https://<mgmt-ip>/api/name-services/unix-groups/179d3c85-7053-11e8-b9b8-005056b41bd1/group1/users" -H "accept: application/hal+json" -H "Content-Type: application/json" -d '{ "records": [{"name":"user1"}, {"name":"user2"}, {"name":"user3"}]}'
Deleting a user from a group of a specific SVM
Example
Delete the user 'user1' from group 'group1' in SVM 'vs1'
# The API: /api/name-services/unix-groups/{svm.uuid}/{unix_group.name}/users/{name} # The call: curl -X DELETE "https://<mgmt-ip>/api/name-services/unix-groups/179d3c85-7053-11e8-b9b8-005056b41bd1/group1/users/user1" -H "accept: application/hal+json"