各个操作项目将被添加到每个警报操作列表中。
此操作可将警报操作添加到现有警报操作组中。
请求示例:
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