Go to main content

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

Exit Print View

Updated: December 2017
 
 

Schema

Manages custom schema properties.

Table 93  Schema Properties
Request
Path /api/storage/v1
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 customer int property named "priority":

{"custom:priority": 5}
Table 94  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": "boo",
        "href": "/api/storage/v1/schema/boo",
        "property": "boo",
        "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: zfssa.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

Deletes a schema property

Example Request:

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

Example Result:

HTTP/1.1 204 No Content