Oracle® ZFS Storage Appliance RESTful API 指南,发行版 2013.1.5.0

退出打印视图

更新时间: 2016 年 2 月
 
 

警报操作项目

各个操作项目将被添加到每个警报操作列表中。

创建警报项目

此操作可将警报操作添加到现有警报操作组中。

请求示例:

POST /api/alert/v1/actions/actions-001 HTTP/1.1
Host: zfssa.example.com:215
X-Auth-Session: uerqghq84vbdv
Content-Type: application/json
Content-Length: 68

{"address": "Joe.Admin@acme.com", "handler": "email", "subject":"CPU Busy"}

响应示例:

HTTP/1.1 201 Created
X-Zfssa-Appliance-Api: 1.0
Content-Type: application/json
Content-Length: 177
Location: /api/alert/v1/actions/actions-001/action-001

{
    "action": {
        "href": "/api/alert/v1/actions/actions-001
                 /action-001",
        "handler": "email",
        "address": "Joe.Admin@acme.com",
        "subject": "CPU Busy"
    }
}

修改警报操作

此操作可修改现有警报操作。

请求示例:

PUT /api/alert/v1/actions/actions-001/action-000 HTTP/1.1
Host: zfssa.example.com:215
X-Auth-Session: uerqghq84vbdv
Content-Type: application/json
Content-Length: 28

{"address": "Joseph.Admin@acme.com"}

响应示例:

HTTP/1.1 202 Accepted
X-Zfssa-Appliance-Api: 1.0
Content-Type: application/json
Content-Length: 176
X-Zfssa-Version: jkremer/generic@2013.06.08,1-0

{
    "action": {
        "href": "/api/alert/v1/actions/actions-001
                 /action-000",
        "handler": "email",
        "address": "Joseph.Admin@acme.com",
        "subject": "CPU Busy"
    }
}

删除警报操作项目

对于给定的警报操作,可删除单个操作。要删除一个参数,请向此操作 href 属性发送 DELETE 请求。

删除操作的请求示例:

DELETE /api/alert/v1/actions/actions-001/action-000 HTTP/1.1
Host: zfssa.example.com:215
X-Auth-Session: uerqghq84vbdv

HTTP/1.1 204 No Content