Go to main content

Oracle® ZFS Storage Appliance RESTful API ガイド、Release OS8.8.x

印刷ビューの終了

更新: 2021 年 8 月
 
 

スキーマ

カスタムのスキーマプロパティーを管理します。

表 53  スキーマコマンド
リクエスト
パス /api/storage/v{1|2} の後ろに追加
説明
GET
/schema
すべての NAS スキーマプロパティーオブジェクトを一覧表示します
GET
/schema/property
指定された NAS スキーマプロパティーのプロパティーを取得します
POST
/schema
新しい NAS スキーマプロパティーを作成します
PUT
/schema/property
指定された NAS スキーマプロパティーオブジェクトを変更します
DELETE
/schema/property
指定された NAS スキーマプロパティーオブジェクトを削除します

カスタムプロパティー名に接頭辞 custom: を追加すると、プロジェクト、ファイルシステム、および LUN に各カスタムのスキーマプロパティーを設定できます。

たとえば、次の PUT 本文は、priority というカスタムの int プロパティーを変更します。

{"custom:priority": 5}
表 54  スキーマパラメータ
パラメータ
説明
property
プロパティーの名前 (変更不可)
description
プロパティーの説明 (ブラウザインタフェースの場合)
type
型 (「String」、「Integer」、「PositiveInteger」、「Boolean」、「EmailAddress」、「Host」)

プロパティーの一覧表示

スキーマプロパティーを一覧表示します。

リクエストの例:

GET /api/storage/v1/schema

結果例:

{
    "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 /api/storage/v1/schema/priority

結果例:

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

プロパティーの作成

新しいスキーマプロパティーを作成します。

リクエストの例:

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"}

結果例:

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"
    }
}

プロパティーの変更

スキーマプロパティーを変更します。

リクエストの例:

PUT /api/storage/v1/schema/priority

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

結果例:

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 /api/storage/v1/schema/me HTTP/1.1

結果例:

HTTP/1.1 204 No Content