Name-services unix-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 display local UNIX user information and to control UNIX user configurations.
Retrieving UNIX user information
You can use the UNIX user GET endpoint to retrieve all of the local UNIX user configurations for data SVMs.
Examples
Retrieving all of the fields for UNIX user configurations for all SVMs
# The API: /api/name-services/unix-users # The call: curl -X GET "https://<mgmt-ip>/api/name-services/unix-users?fields=*" -H "accept: application/json" # The response: { "records": [ { "svm": { "uuid": "25b363a6-2971-11eb-88e1-0050568eefd4", "name": "vs1" }, "name": "string", "id": 7, "primary_gid": 0, "full_name": "string" }, { "svm": { "uuid": "3f479a01-2971-11eb-88e1-0050568eefd4", "name": "vs2" }, "name": "nobody", "id": 65535, "primary_gid": 65535, "full_name": "" }, { "svm": { "uuid": "3f479a01-2971-11eb-88e1-0050568eefd4", "name": "vs2" }, "name": "pcuser", "id": 65534, "primary_gid": 65534, "full_name": "" }, { "svm": { "uuid": "3f479a01-2971-11eb-88e1-0050568eefd4", "name": "vs2" }, "name": "root", "id": 0, "primary_gid": 1, "full_name": "" } ], "num_records": 4 }
Retrieving the UNIX user configuration of a specific SVM
# The API: /api/name-services/unix-users # The call: curl -X GET "https://<mgmt-ip>/api/name-services/unix-users?svm.uuid=25b363a6-2971-11eb-88e1-0050568eefd4&fields=*" -H "accept: application/json" # The response: { "records": [ { "svm": { "uuid": "25b363a6-2971-11eb-88e1-0050568eefd4", "name": "vs1" }, "name": "user1", "id": 1, "primary_gid": 1, "full_name": "Full User Name for user1" } ], "num_records": 1 }
Retrieving a UNIX user configuration of a specific SVM and user
# The API: /api/name-services/unix-users/{svm.uuid}/{name} # The call: curl -X GET "https://<mgmt-ip>/api/name-services/unix-users/25b363a6-2971-11eb-88e1-0050568eefd4/user1" -H "accept: application/json" # The response: { "svm": { "uuid": "25b363a6-2971-11eb-88e1-0050568eefd4", "name": "vs1" }, "name": "user1", "id": 1, "primary_gid": 1, "full_name": "Full User Name for user1" }
Creating a UNIX user configuration
The UNIX user POST endpoint creates a UNIX user configuration for the specified SVM.
Examples
Creating a UNIX user configuration with all fields specified
# The API: /api/name-services/unix-users # The call: curl -X POST "https://<mgmt-ip>/api/name-services/unix-users" -H "accept: application/json" -d "{ \"full_name\": \"Full user name\", \"id\": 7, \"name\": \"user2\", \"primary_gid\": 10, \"skip_name_validation\": false, \"svm\": { \"name\": \"vs1\", \"uuid\": \"25b363a6-2971-11eb-88e1-0050568eefd4\" }}"
Creating a UNIX user configuration with only mandatory fields specified
# The API: /api/name-services/unix-users # The call: curl -X POST "https://<mgmt-ip>/api/name-services/unix-users" -H "accept: application/json" -d "{ \"id\": 8, \"name\": \"user9\", \"primary_gid\": 10, \"svm\": { \"name\": \"vs1\", \"uuid\": \"25b363a6-2971-11eb-88e1-0050568eefd4\" }}"
Updating a UNIX user configuration
The UNIX user PATCH endpoint updates the UNIX user configuration for the specified user and SVM. The following example shows a PATCH operation:
# The API: /api/name-services/unix-users/{svm.uuid}/{name} # The call: curl -X PATCH "https://<mgmt-ip>/api/name-services/unix-users/25b363a6-2971-11eb-88e1-0050568eefd4/user1" -H "accept: application/json" -d "{ \"full_name\": \"Full name\", \"id\": 7, \"primary_gid\": 10 }"
Deleting a UNIX user configuration
The UNIX user DELETE endpoint deletes the specified UNIX user for the specified SVM. The following example shows a DELETE operation:
# The API: /api/name-services/unix-users/{svm.uuid}/{name} # The call: curl -X DELETE "https://<mgmt-ip>/api/name-services/unix-users/25b363a6-2971-11eb-88e1-0050568eefd4/user1" -H "accept: application/json"