当您创建一个包含 JSON 对象的警报操作 POST 请求时,必须向 /api/alert/v1/alerts/actions 发送操作属性。必须设置类别属性以选择要创建的操作类型。有关给定系统上的所有可用类别值,请参见 CLI 文档。
类别值通常包括:
"ad", "all", "appliance_software", "backup", "cluster", "custom", "hardware", "hardware_faults", "ndmp", "network", "replication", "replication_source", "replication_target", "restore", "scrk", "shadow", "smf", "thresholds" or "zfs_pool"
请求示例:
POST /api/alert/v1/actions HTTP/1.1 Host: zfssa.example.com:215 X-Auth-Session: uerqghq84vbdv Content-Type: application/json Content-Length: 30 {"category": "hardware_faults"}
响应示例:
HTTP/1.1 201 Created X-Zfssa-Appliance-Api: 1.0 Content-Type: application/json Content-Length: 118 Location: /api/alert/v1/actions/actions-006 { "action": { "href": "/api/alert/v1/actions/actions-006", "category": "hardware_faults", "all_hardware_faults": true } }