Create a User
To create a new user, you must provide at least a username
(logname). If you do not specify a type, then the new user will be
type local. Other properties are required depending on the type of
the user, as described in the following list of user types:
-
directory– The username must be an existing NIS, LDAP, or AD user. The UID, password, and full name are managed automatically by the directory service. -
localanddata– Specify username and password. You can specify the UID, or a UID will be automatically assigned. -
nologin– Specify a username. You can specify the UID, or a UID will be automatically assigned.
To understand more about users and user types, see Understanding Users and Roles in Oracle ZFS Storage Appliance Administration Guide, Release OS8.8.x.
Example 16-1 Creating a Local User
Example Request:
POST /api/user/v1/users HTTP/1.1
{
"logname": "test_user",
"initial_password": "password"
}
Example Result:
{
"user":
{
"href": "/api/user/v1/users/test_user",
"logname": "test_user",
"type": "local",
"uid": 2000000002,
"fullname": "test_user",
"initial_password": true,
"require_annotation": false,
"roles": ["basic"],
"kiosk_mode": false,
"kiosk_screen": "status/dashboard",
"exceptions": [],
"preferences": {
"href": "/api/user/v1/users/test_user/preferences",
"locale": "C",
"login_screen": "status/dashboard",
"session_timeout": 15,
"cli_idle_timeout": -1,
"advanced_analytics": false,
"keys": [],
"tokens": []
}
}
}
Example 16-2 Cloning a User
To create a new user of the same type as an existing user and with the same roles and authorizations assigned, specify the following properties:
-
user– Username of the user that you are cloning -
clonename– Username of the new cloned user -
password– Initial password of the new cloned user
Example Request:
POST /api/user/v1/users HTTP/1.1
{
"user": "test_user",
"clonename": "clone_user",
"password": "password"
}
Example Result:
{
"user":
{
"href": "/api/user/v1/users/clone_user",
"logname": "clone_user",
"type": "local",
"uid": 2000000003,
"fullname": "clone_user",
"initial_password": true,
"require_annotation": false,
"roles": ["basic"],
"kiosk_mode": false,
"kiosk_screen": "status/dashboard",
"exceptions": [],
"preferences": {
"href": "/api/user/v1/users/clone_user/preferences",
"locale": "C",
"login_screen": "status/dashboard",
"session_timeout": 15,
"cli_idle_timeout": -1,
"advanced_analytics": false,
"keys": [],
"tokens": []
}
}
}