此命令返回用于指定服务的操作(方法)的列表。如果适用,此命令返回有关指定服务的资源的信息。在以下示例中,群集硬件组件具有可以进一步检查和配置的资源。
请求示例。请注意,此请求使用验证令牌。请参见验证令牌:
GET /api/hardware/v1 HTTP/1.1 Host: zfs-storage.example.com:215 X-Auth-Session: puPnHZKgSrUmXqYzOwFCrGcLOGwPODj
结果示例。为简洁起见,省略了此输出中的大部分内容:
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 204
X-Zfssa-Access-Api: 1.0
{
"service": {
"methods": [
{
"path": "",
"href": "/api/hardware/v1",
"request": "GET",
"description": "List the hardware service commands."
},
{
"path": "/cluster",
"href": "/api/hardware/v1/cluster",
"request": "GET",
"description": "Get cluster properties and cluster resource list"
},
{
"path": "/cluster/resources/<resource:path>",
"href": "/api/hardware/v1/cluster/resources/<resource:path>",
"request": "GET",
"description": "Get properties for the specified cluster resource"
},
{
"path": "/cluster/resources/<resource:path>",
"href": "/api/hardware/v1/cluster/resources/<resource:path>",
"request": "PUT",
"description": "Modify the specified cluster resource"
},
{
"path": "/chassis",
"href": "/api/hardware/v1/chassis",
"request": "GET",
"description": "List hardware chassis"
}
],
"version": "1.1",
"name": "hardware",
"uri": "https://hostname:215/api/hardware/v1"
}
}