Schema

Manages custom schema properties.

Table 13-12 Schema Commands

Request Append to Path /api/storage/v{1|2} Description

GET

/schema

List all NAS schema property objects

GET

/schema/property

Get the specified NAS schema property properties

POST

/schema

Create a new NAS schema property

PUT

/schema/property

Modify the specified NAS schema property object

DELETE

/schema/property

Delete the specified NAS schema property object

Each custom schema property can be set on projects, filesystems, and LUNs by adding the prefix custom: to the custom property name.

For example, the following PUT body modifies a custom int property named priority:

{"custom:priority": 5}

Table 13-13 Schema Parameters

Parameter Description

property

Name of property (immutable)

description

Property description (for browser interface)

type

Type (“String”, “Integer”, “PositiveInteger”, “Boolean”, “EmailAddress”, “Host”)

List Properties

Lists schema properties.

Example Request:

GET /api/storage/v1/schema

Example Result:

{
    "properties": [{
        "description": "bob",
        "href": "/api/storage/v1/schema/bob",
        "property": "bob",
        "type": "String"
    },{
        "description": "pat",
        "href": "/api/storage/v1/schema/pat",
        "property": "pat",
        "type": "String"
    }]
}

Get Property

Gets a schema property.

Example Request:

GET /api/storage/v1/schema/priority

Example Result:

{
    "property": {
        "description": "priority",
        "href": "/api/storage/v1/schema/priority",
        "property": "bob",
        "type": "Integer"
    }
}

Create Property

Creates a new schema property.

Example Request:

POST /api/storage/v1/schema HTTP/1.1
Host: zfs-storage.example.com:215
Content-Type: application/json
Content-Length: 64

{"property":"priority", "type":"Integer", "description":"Oh my"}

Example Result:

HTTP/1.1 201 Created
Content-Length: 89
X-Zfssa-Nas-Api: 1.0
Content-Type: application/json
Location: /api/storage/v1/schema/priority

{
    "property": {
        "href": "/api/storage/v1/schema",
        "type": "Integer",
        "description": "Oh my"
    }
}

Modify Property

Modifies a schema property.

Example Request:

PUT /api/storage/v1/schema/priority

{"description":"My custom priority level"}

Example Result:

HTTP/1.1 202 Accepted
X-Zfssa-Nas-Api: 1.0
Content-Type: application/json
Content-Length: 90

{
    "property": {
        "href": "//api/storage/v1/schema/priority",
        "type": "Integer",
        "description": "My custom priority level"
    }
}

Delete Property

This command deletes a schema property.

Example Request:

DELETE /api/storage/v1/schema/me HTTP/1.1

Example Result:

HTTP/1.1 204 No Content