Go to main content

Oracle® ZFS Storage Appliance RESTful API Guide, Release OS8.8.0

Exit Print View

Updated: November 2018
 
 

Create User

To understand more about users and user types, see Understanding Users and Roles in Oracle ZFS Storage Appliance Administration Guide, Release OS8.8.0.

This command uses three forms:

  • Create a new user – Creates a new user

  • Clone an existing user – Clones a new user from an existing user

  • Add an administrator – Allows a user defined in an enterprise directory to administer the appliance.

In all three cases, a POST request to users with JSON-formatted properties in the body is sent.

Table 92  Create New User Properties
Property
Type
Description
logname
string
New user's login name (required)
uid
number
Optional user ID
fullname
string
New user's full name (required)
type
string
"local", "data", "nologin" (defaults to "local")
initial_password
string
Initial user password ("local" and "data" only)
require_annotation
boolean
Optional flag to require session annotation ("local" only)
Table 93  Clone User Properties
Property
Type
Description
user
string
Source user name
uid
number
User ID, not enabled for Directory users
clonename
string
New clone's login name
fullname
string
New clone user's full name (not for Directory users)
password
string
New clone user's password (not for Directory or No-login users)
Table 94  Add Administrator Properties
Property
Type
Description
type
string
Directory users
logname
string
Directory user login name
Example 1  Creating a Local User

Example Request:

POST /api/user/v1/users HTTP/1.1
Host: zfs-storage.example.com:215
Authorization: Basic abcdefghijklmnop
Content-type: application/json

{
    "type": "local",
    "logname": "admin3",
    "initial_password": "password",
    "fullname": "Administrator"
}

Example Result:

{
    "user":
    {
        "href": "/api/user/v1/users/admin3",
        "logname": "admin3",
        "type": "local",
        "uid": 2000000002,
        "fullname": "Administrator",
        "initial_password": "password",
        "require_annotation": false,
        "roles": [
            "basic"
        ],
        "kiosk_mode": false,
        "kiosk_screen": "status/dashboard",
        "exceptions": [
        ],
        "preferences": {
            "href": "/api/user/v1/users/admin3/preferences",
            "locale": "C",
            "login_screen": "status/dashboard",
            "session_timeout": 15,
            "advanced_analytics": false,
            "keys": [
            ]
        }
    }
}
Example 2  Creating a Directory User

Example Request:

POST /api/user/v1/users
{
    "type": "directory",    
    "logname": "admin3" 
}

Example Result:

{
    "user":
    {
        "href": "/api/user/v1/users/admin3",
        "logname": "admin3",
        "type": "directory",
        "uid": 26718,
        "fullname": "Administrator",
        "require_annotation": false,
        "roles": [
            "basic"
        ],
        "kiosk_mode": false,
        "kiosk_screen": "status/dashboard",
        "exceptions": [
        ],
        "preferences": {
            "href": "/api/user/v1/users/admin3/preferences",
            "locale": "C",
            "login_screen": "status/dashboard",
            "session_timeout": 15,
            "advanced_analytics": false,
            "keys": [
            ]
        }
    }
}
Example 3  Creating a Data-only User

Example Request:

POST /api/user/v1/users
{
    "type": "data",
    "logname": "admin3",
    "initial_password": "password",
    "fullname": "Administrator",
    "uid": 5000000
}

Example Result:

{
    "user": 
    {
        "href": "/api/user/v1/users/data",
        "logname": "admin3",
        "type": "data",
        "uid": 5000000,
        "fullname": "Administrator",
        "initial_password": "password"
    }
}
Example 4  Creating a No-login User

Example Request:

POST /api/user/v1/users
{
    "type": "nologin",
    "logname": "admin3",
    "fullname": "Administrator",
    "uid": 5000001
}

Example Result:

{
    "user": 
    {
        "href": "/api/user/v1/users/admin3",
        "logname": "admin3",
        "type": "nologin",
        "uid": 5000001,
        "fullname": "Administrator"
    }
}