Replication actions define the rules for replicating data to replication targets. The following commands manage the replication actions.
Requests to manage replication actions can be made directly to an appliance, without specifying a project or share.
The following table lists the base commands for managing replication actions.
|
The following table lists the commands for managing replication action schedules.
|
The following table lists the commands for replication automatic snapshot management.
|
The following table lists the command for Replication Statistics.
|
Requests to manage replication actions can also be made in the context of a specific Project, Filesystem, or LUN.
The following table lists the base commands for managing replication actions.
The URI for all project-based operations begins with: /api/storage/v1/pools/<pool>/projects /<project>
The URI for all filesystem-based operations begins with: /api/storage/v1/pools/<pool>/projects /<project>/filesystems /<filesystem>
The URI for all LUN-based operations begins with: /api/storage/v1/pools/<pool>/projects /<project>/luns/<lun>
Append the following base commands to the desired context URI listed above to manage replication actions.
|
The following table lists the commands for managing replication action schedules.
The URI for all project-based operations begins with: /api/storage/v1/pools/<pool>/projects /<project>
The URI for all filesystem-based operations begins with: /api/storage/v1/pools/<pool>/projects /<project>/filesystems /<filesystem>
The URI for all LUN-based operations begins with: /api/storage/v1/pools/<pool>/projects /<project>/luns/<lun>
Append the following base commands to the desired context URI listed above to manage replication actions.
|
The following table lists the commands for replication automatic snapshot management.
The URI for all project-based operations begins with: /api/storage/v1/pools/<pool>/projects /<project>
The URI for all filesystem-based operations begins with: /api/storage/v1/pools/<pool>/projects /<project>/filesystems /<filesystem>
The URI for all LUN-based operations begins with: /api/storage/v1/pools/<pool>/projects /<project>/luns/<lun>
Append the following base commands to the desired context URI listed above to manage replication actions.
|
The following table lists the command for Replication Statistics.
The URI for all project-based operations begins with: /api/storage/v1/pools/<pool>/projects /<project>
The URI for all filesystem-based operations begins with: /api/storage/v1/pools/<pool>/projects /<project>/filesystems /<filesystem>
The URI for all LUN-based operations begins with: /api/storage/v1/pools/<pool>/projects /<project>/luns/<lun>
Append the following base commands to the desired context URI listed above to manage replication actions.
|
Gets a list of all available replication actions.
Example Request:
GET /api/storage/v1/replication/actions HTTP/1.1 Authorization: Basic ab6rt4psMWE= Accept: application/json
Example Response:
HTTP/1.1 200 OK
X-Zfssa-Replication-Api: 1.0
Content-Type: application/json
Content-Length: 529
{
"actions": [{
"href": ""
...
}, {
"href": "",
...
}]
}
The get replication action status command returns the status of a single replication action given by its ID.
Example Request:
GET /api/storage/v1/replication/actions/1438ed7f-aad3-c631-d869-9e85cd7f15b4 HTTP/1.1 Authorization: Basic ab6rt4psMWE= Accept: application/json
Example Response:
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",
"compression": true,
"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_clone_origin_as_data": false,
"include_snaps": true,
"last_sync": "20130916T21:36:50",
"last_try": "20130916T21:36:50",
"max_bandwidth": 0,
"pool": "gold",
"project": "blah1",
"retain_user_snaps_on_target": false,
"share": "fs1",
"state": "sending",
"target": "38094753-6c90-49ed-aa92-995a296d432a",
"use_ssl": true
}
}
Example Request:
The following replication action response shows an example recovery point objective (RPO) and related replica lag warning and alerts.
GET /api/storage/v1/replication/actions HTTP/1.1 Authorization: Basic ab6rt4psMWE= Content-Type:application/json
Example Response:
HTTP/1.1 200 OK
X-Zfssa-Replication-Api: 1.0
Content-Type: application/json
Content-Length: 529
{
"action": {"id": "12d981c3-b098-c65a-e1e9-a6b8263a0f6a",
"target_id": "4fd305ac-4af5-c34a-87c3-88203207305b",
. . .
"replica_lag": "42:25:31",
"recovery_point_objective": 0,
"replica_lag_warning_alert": 0,
"replica_lag_error_alert": 0,
"replica_lag_over_warning_limit": false,
"replica_lag_over_error_limit": false,
"project": "default"}]}
Creates a new replication action.
Create Properties:
Initial values:
target = cleo
enabled = true
continuous = false
include_snaps = true
retain_user_snaps_on_target = false
dedup = true
include_clone_origin_as_data = false
max_bandwidth = unlimited
bytes_sent = 0
estimated_size = 0
estimated_time_left = 0
average_throughput = 0
use_ssl = true
compression = on
Example Request:
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"
}
Example Response:
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,
"compression": true,
"continuous": false,
"enabled": true,
"dedup": false,
"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,
"retain_user_snaps_on_target": false,
"share": "fs1",
"id": "8373d331-de60-e590-90e8-9ad69fcb4aec",
"pool": "gold",
"include_clone_origin_as_data": false,
"include_snaps": true
}
}
Creates a schedule for a replication action.
Example Request:
POST /api/storage/v1/replication/actions/b77bd8cd-17ed-69da-9e4b-aebe3cc63755/schedules HTTP/1.1
Host: emperor:215
Authorization: Basic cm9vdDpsMWE=
Accept: */*
Content-Type:application/json
Content-Length: 65
{"frequency":"month","day":"5th", "hour":"auto", "minute":"auto"}
Example Response:
HTTP/1.1 201 Created Date: Thu, 12 Jan 2017 17:35:48 GMT Server: TwistedWeb/10.1.0 Content-Length: 0 X-Zfssa-Storage-Api: 1.1 Content-Type: application/json; charset=utf-8 X-Zfssa-Api-Version: 1.0 X-Zfssa-Version: ak2013r/generic@2016.12.08,1-0
Modifies an existing replication action.
Example Request:
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}
Example Response:
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",
"compression": true,
"continuous": false,
"enabled": true,
"max_bandwidth": 0,
"dedup": false,
"retain_user_snaps_on_target": false,
"use_ssl": false,
"id": "c141d88d-ffd2-6730-d489-b71905f340cc",
"include_clone_origin_as_data": false,
"include_snaps": true
}
}
Example Request:
PUT /api/storage/v1/replication/actions/<action_id> -d '{"recovery_point_objective": 60}HTTP/1.1
Host: zfs-storage.example.com:215
Authorization: Basic ab6rt4psMWE=
Content-Type: application/json'
Example Response:
X-Zfssa-Replication-Api: 1.0
Content-Type: application/json
Content-Length: 620
{"action": {
"state_description": "Idle (no update in progress)",
"recovery_point_objective": 60,
"replica_lag_over_warning_limit": false,
"bytes_sent": "0",
"last_try": "Mon Nov 21 2016 23:25:59 GMT+0000 (UTC)",
"max_bandwidth": 0,
"estimated_size": "0",
"href": "/api/storage/v1/replication/actions/12d981c3-b098-c65a-e1e9-a6b8263a0f6a",
"estimated_time_left": 0,
"use_ssl": true,
"id": "12d981c3-b098-c65a-e1e9-a6b8263a0f6a",
"stats": {"total_logical_bytes": 40656,
"last_dd_table_build": 9169029,
"total_after_dedup": 18476,
"last_try": "Mon Nov 21 2016 23:25:59 GMT+0000 (UTC)",
"dd_total_updates": 1,
"href": "/api/storage/v1/replication/actions/12d981c3-b098-c65a-e1e9-a6b8263a0f6a/stats",
"dd_total_duration": 47149245470,
"last_logical_bytes": 40656,
"dd_total_table_mem": 2097152,
"last_result": "success",
"last_after_dedup": 18476,
"last_duration": 47149245470,
{"dd_total_logical_bytes": 40656,
"total_updates": 1,
"total_duration": 47149245470,
"replica_data_timestamp": "Mon Nov 21 2016 23:25:12 GMT+0000 (UTC)",
"total_to_network": 9623,
"dd_total_table_build": 9169029,
"dd_total_phys_bytes": 16800,
"last_to_network": 9623,
"total_phys_bytes": 16800,
"last_phys_bytes": 16800,
"last_sync": "Mon Nov 21 2016 23:25:59 GMT+0000 (UTC)",
"last_dd_table_mem": 2097152,
"dd_total_after_dedup": 18476,
"dd_total_to_network": 9623},
"compression": "on",
"dedup": true,
"replica_lag_warning_alert": 0,
"last_result": "success",
"include_clone_origin_as_data": false,
"state": "idle",
"offline": false,
"export_path": "",
"export_pending": false,
"autosnaps": {"autosnaps_retention_policies":
"synchronized",
"href": "/api/storage/v1/replication/actions/12d981c3-b098-c65a-e1e9-a6b8263a0f6a/autosnaps"},
"replica_data_timestamp": "Mon Nov 21 2016 23:25:12 GMT+0000 (UTC)",
"continuous": false,
"target_id": "4fd305ac-4af5-c34a-87c3-88203207305b",
{"average_throughput": "0B/s",
"next_update": "Sync now",
"pool": "G",
"replica_lag_over_error_limit": false,
"target": "goby",
"replica_lag": "42:28:24",
"retain_user_snaps_on_target": false,
.......
The get replication action status command returns the status of a single replication action given by its ID. Examine state and state_description to determine replication progress.
state property values:
sending
idle
state_description property values:
Connecting to replication target
Receiving checkpoint from target
Estimating size of update
Building deduplication tables (Only for deduplicated replication streams)
Example Request:
GET /api/storage/v1/replication/actions/1438ed7f-aad3-c631-d869-9e85cd7f15b4 HTTP/1.1 Authorization: Basic ab6rt4psMWE= Accept: application/json
Example Response:
HTTP/1.1 200 OK
X-Zfssa-Replication-Api: 1.0
Content-Type: application/json
Content-Length: 529
{
"action": {
"id": "1438ed7f-aad3-c631-d869-9e85cd7f15b4",
"target_id": "4fd3483e-b1f5-4bdc-9be3-b3a4becd0c42",
"target": "cleo",
"pool": "p0",
"replication_of": "testproj",
"enabled": true,
"continuous": false,
"include_snaps": true,
"retain_user_snaps_on_target": false,
"dedup": true,
"include_clone_origin_as_data": false,
"max_bandwidth": -1,
"bytes_sent": 0,
"estimated_size": 0,
"estimated_time_left": 0,
"average_throughput": 0,
"use_ssl": true,
"compression": "on",
"export_path": "",
"state": "sending",
"state_description": "Receiving checkpoint from target",
"export_pending": false,
"offline": false,
"next_update": "Sync now",
"replica_data_timestamp": "Thu Apr 28 2016 22:38:03 GMT+0000 (UTC)",
"last_sync": "<unknown>",
"last_try": "<unknown>",
"last_result": "<unknown>",
"replica_lag": "00:00:18",
"recovery_point_objective": 0,
"replica_lag_warning_alert": 0,
"replica_lag_error_alert": 0,
"replica_lag_over_warning_limit": false,
"replica_lag_over_error_limit": false,
"project": "testproj"
}
}
Cancels an in-progress replication update.
Example Request:
PUT /api/storage/v1/replication/actions/c141d88d-ffd2-6730-d489-b71905f340cc/cancelupdate HTTP/1.1 Host: zfs-storage.example.com Authorization: Basic ab6rt4psMWE=
Example Response:
HTTP/1.1 202 Accepted X-Zfssa-Replication-Api: 1.0
Schedules a replication update to start as soon as possible.
Example Request:
PUT /api/storage/v1/replication/actions/c141d88d-ffd2-6730-d489-b71905f340cc/sendupdate HTTP/1.1 Authorization: Basic ab6rt4psMWE=
Example Response:
HTTP/1.1 202 Accepted X-Zfssa-Replication-Api: 1.0
Deletes an existing replication action.
Example Request:
DELETE /api/storage/v1/replication/actions/e7e688b1-ff07-474f-d5cd-cac08293506e
HTTP/1.1
Host: zfs-storage.example.com
Authorization: Basic ab6rt4psMWE=
Successful delete returns HTTP Status 204 (No Content).
Example Response:
HTTP/1.1 204 No-Content X-Zfssa-Replication-Api: 1.0