Go to main content
Oracle® ZFS Storage Appliance RESTful API Guide, Release OS8.7.0

Exit Print View

Updated: July 2017
 
 

Create User

To understand more about users and user types, see Understanding Users and Roles in Oracle ZFS Storage Appliance Administration Guide, Release OS8.7.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.

Create New User Properties

Table 118  Create New User Properties
Type
Property Name
Description
string
logname
New user’s login name (required)
number
uid
Optional user ID
string
fullname
New user's full name (required)
string
type
"Local", "Data", "No-login" (defaults to "Local")
string
initial_password
Initial user password ("Local and "Data" only)
boolean
require_annotation
Optional flag to require session annotation ("Local" only)

Clone User Properties

Table 119  Clone User Properties
Type
Property Name
Description
string
user
Source user name
number
uid
User ID, not enabled for Directory users
string
clonename
New clone's login name
string
fullname
New clone user’s full name (not for Directory users)
string
password
New clone user's password (not for Directory or No-login users)

Add Administrator Properties

Table 120  Add Administrator Properties
Type
Property Name
Description
string
type
Directory users
string
logname
Directory user login name
Example 1  Creating a Local User

Example Request:

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

{
    "type": "local",
    "logname": "john",
    "initial_password": "DummyPassword",
    "fullname": "John Doe"
}

Example Result:

  
{
    "user":
    {
        "href": "/api/user/v1/users/john",
        "logname": "john",
        "type": "local",
        "uid": 2000000002,
        "fullname": "John Doe",
        "initial_password": "DummyPassword",
        "require_annotation": false,
        "roles": [
            "basic"
        ],
        "kiosk_mode": false,
        "kiosk_screen": "status/dashboard",
        "exceptions": [
        ],
        "preferences": {
            "href": "/api/user/v1/users/john/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": "john" 
}

Example Result:

 
{
    "user": 
    {
        "href": "/api/user/v1/users/john",
        "logname": "john",
        "type": "directory",
        "uid": 26718,
        "fullname": "John Doe",
        "require_annotation": false,
        "roles": [
            "basic"
        ],
        "kiosk_mode": false,
        "kiosk_screen": "status/dashboard",
        "exceptions": [
        ],
        "preferences": {
            "href": "/api/user/v1/users/john/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": "john",
    "initial_password": "password",
    "fullname": "John Doe",
    "uid": 5000000
}

Example Result:

{
    "user": 
    {
        "href": "/api/user/v1/users/data",
        "logname": "john",
        "type": "data",
        "uid": 5000000,
        "fullname": "John Doe",
        "initial_password": "DummyPassword"
    }
}
Example 4  Creating a No-login User

Example Request:

 
POST /api/user/v1/users
{
    "type": "nologin",
    "logname": "john",
    "fullname": "John Doe",
    "uid": 5000001
}

Example Result:

{
    "user": 
    {
        "href": "/api/user/v1/users/john",
        "logname": "john",
        "type": "nologin",
        "uid": 5000001,
        "fullname": "John Doe"
    }
}