可通过发送 PUT 请求以及在其头中定义的新属性值来修改指定服务的配置属性。一些服务可能具有子资源,您也可以根据子资源中定义的 href 来修改这些服务。
请求示例:
PUT /api/service/v1/services/sftp HTTP/1.1
Host: zfs-storage.example.com
Content-Type: application/json
{"port": 218}
            成功响应会返回 HTTP 状态 202 (Accepted):
HTTP/1.1 202 Accepted
Content-Length: 162
Content-Type: application/json; charset=utf-8
X-Zfssa-Service-Api: 1.0
{
    "service": {
        "<status>": "disabled",
        "href": "/api/service/v1/services/sftp",
        "keys": [],
        "listen_port": 218,
        "logging_verbosity": "INFO",
        "root_login": false
    }
}