复制操作可定义将数据复制到复制目标的规则。以下命令可管理复制操作。
| 
 | 
获取所有可用复制操作的列表。
请求示例:
GET /api/storage/v1/replication/actions HTTP/1.1 Authorization: Basic ab6rt4psMWE= Accept: application/json
响应示例:
HTTP/1.1 200 OK
X-Zfssa-Replication-Api: 1.0
Content-Type: application/json
Content-Length: 529
{
    "actions": [{
        "href": ""
        ...
    }, {
        "href": "",
        ...
    }]
}
            
            
                获取复制操作状态命令会返回单个复制操作 ID 所指定的单个复制操作的状态。
请求示例:
GET /api/storage/v1/replication/actions/1438ed7f-aad3-c631-d869-9e85cd7f15b4 HTTP/1.1 Authorization: Basic ab6rt4psMWE= Accept: application/json
响应示例:
HTTP/1.1 200 OK
X-Zfssa-Replication-Api: 1.0
Content-Type: application/json
Content-Length: 529
{
    "action": {
        "average_throughput": 0.0,
        "bytes_sent": 0.0,
        "collection": "local",
        "continuous": false,
        "enabled": true,
        "estimated_size": 0.0,
        "estimated_time_left": 0.0,
        "href": "/api/storage/v1/replication/actions",
        "id": "8373d331-de60-e590-90e8-9ad69fcb4aec",
        "include_snaps": true,
        "last_sync": "20130916T21:36:50",
        "last_try": "20130916T21:36:50",
        "max_bandwidth": 0,
        "pool": "gold",
        "project": "blah1",
        "share": "fs1",
        "state": "sending",
        "target": "38094753-6c90-49ed-aa92-995a296d432a",
        "use_ssl": true
    }
}
            
            
                创建新的复制操作。
创建属性:
Initial values:
                   target = (unset)
                     pool = (unset)
                  enabled = true
               continuous = false
            include_snaps = true
            max_bandwidth = unlimited
               bytes_sent = 0
           estimated_size = 0
      estimated_time_left = 0
       average_throughput = 0
                  use_ssl = true
                请求示例:
POST /api/storage/v1/replication/actions HTTP/1.1
Host: zfs-storage.example.com:215
Authorization: Basic ab6rt4psMWE=
Content-Type: application/json
Content-Length: 121
Accept: application/json
{
    "pool": "gold",
    "project": "blue1",
    "share": "fs1",
    "target_pool": "pool1",
    "target": "38094753-6c90-49ed-aa92-995a296d432a"
}
                响应示例:
HTTP/1.1 201 Created
Content-Length: 506
Content-Type: application/json
Location: /api/storage/v1/replication/action/8373d331-de60-e590-90e8-9ad69fcb4aec
X-Zfssa-Replication-Api: 1.0
{
    "action": {
        "project": "blue1",
        "target": "38094753-6c90-49ed-aa92-995a296d432a",
        "bytes_sent": 0.0,
        "continuous": false,
        "enabled": true,
        "max_bandwidth": 0,
        "collection": "local",
        "estimated_size": 0.0,
        "state": "idle",
        "href": "/api/storage/v1/replication/pools/gold/projects/blah1/shares/fs1/
                  actions/8373d331-de60-e590-90e8-9ad69fcb4aec",
        "average_throughput": 0.0,
        "use_ssl": true,
        "estimated_time_left": 0.0,
        "share": "fs1",
        "id": "8373d331-de60-e590-90e8-9ad69fcb4aec",
        "pool": "gold",
        "include_snaps": true
    }
}
            
            
                修改现有复制操作。
请求示例:
PUT /api/storage/v1/replication/actions/c141d88d-ffd2-6730-d489-b71905f340cc HTTP/1.1
Host: zfs-storage.example.com:215
Authorization: Basic ab6rt4psMWE=
Content-Type: application/json
{"use_ssl": false}
                响应示例:
HTTP/1.1 202 Accepted
X-Zfssa-Replication-Api: 1.0
Content-Type: application/json
Content-Length: 620
{
    "action": {
        "target_id": "407642ae-91b5-681c-de5e-afcd5cbf2974",
        "continuous": false,
        "enabled": true,
        "max_bandwidth": 0,
        "dedup": false,
        "use_ssl": false,
        "id": "c141d88d-ffd2-6730-d489-b71905f340cc",
        "include_snaps": true
    }
}
            
            
                取消正在进行的复制更新。
请求示例:
PUT /api/storage/v1/replication/actions/c141d88d-ffd2-6730-d489-b71905f340cc/cancelupdate HTTP/1.1 Host: zfs-storage.example.com Authorization: Basic ab6rt4psMWE=
响应示例:
HTTP/1.1 202 Accepted X-Zfssa-Replication-Api: 1.0
调度复制更新以尽快开始更新。
请求示例:
PUT /api/storage/v1/replication/actions/c141d88d-ffd2-6730-d489-b71905f340cc/sendupdate HTTP/1.1 Authorization: Basic ab6rt4psMWE=
响应示例:
HTTP/1.1 202 Accepted X-Zfssa-Replication-Api: 1.0
删除现有复制操作。
请求示例:
DELETE /api/storage/v1/replication/actions/e7e688b1-ff07-474f-d5cd-cac08293506e
       HTTP/1.1
Host: zfs-storage.example.com
Authorization: Basic ab6rt4psMWE=
                成功删除后将返回 HTTP 状态 204 (No Content)。
响应示例:
HTTP/1.1 204 No-Content X-Zfssa-Replication-Api: 1.0