From 9f2dfc91a9c72a402b81860221a81e5318faa67a Mon Sep 17 00:00:00 2001 From: dlavigne Date: Wed, 13 Jan 2016 10:01:41 -0500 Subject: [PATCH] Doc addreplication action. --- api/classes/lifepreserver.rst | 110 +++++++++++++++++++++++++++++++++- 1 file changed, 109 insertions(+), 1 deletion(-) diff --git a/api/classes/lifepreserver.rst b/api/classes/lifepreserver.rst index 39b1cc4..a601378 100644 --- a/api/classes/lifepreserver.rst +++ b/api/classes/lifepreserver.rst @@ -21,7 +21,7 @@ Every lifepreserver class request contains the following parameters: | | | | +---------------------------------+---------------+----------------------------------------------------------------------------------------------------------------------+ | action | | supported actions include "listcron", "cronsnap", "cronscrub", "listsnap", "revertsnap", "removesnap", | -| | | "settings", and "savesettings" | +| | | "addreplication", "settings", and "savesettings" | | | | | +---------------------------------+---------------+----------------------------------------------------------------------------------------------------------------------+ @@ -456,6 +456,114 @@ The "removesnap" action is used to remove a ZFS snapshot from the specified data "namespace": "sysadm" } +.. _Add Replication: + +Add Replication +=============== + +The "addreplication" action is used to create a replication task in Life Preserver. This action supports the following parameters: + ++---------------------------------+----------------------------------------------------------------------------------------------------------------------+ +| **Parameter** | **Description** | +| | | ++=================================+======================================================================================================================+ +| host | remote hostname or IP address | +| | | ++---------------------------------+----------------------------------------------------------------------------------------------------------------------+ +| port | SSH port number on remote system | +| | | ++---------------------------------+----------------------------------------------------------------------------------------------------------------------+ +| user | user must exist on remote system | +| | | ++---------------------------------+----------------------------------------------------------------------------------------------------------------------+ +| password | the password for *user* on remote system | +| | | ++---------------------------------+----------------------------------------------------------------------------------------------------------------------+ +| dataset | name of local dataset to replicate | +| | | ++---------------------------------+----------------------------------------------------------------------------------------------------------------------+ +| remotedataset | path to dataset on remote system | +| | | ++---------------------------------+----------------------------------------------------------------------------------------------------------------------+ +| frequency | when to replicate; supported times are "XX" (hour), "sync" (as snapshot is created, not recommended for frequent | +| | snapshots), "hour" (hourly), "30min" (every 30 minutes), "10min" (every 10 minutes), or "manual" (only when | +| | requested by user) | +| | | ++---------------------------------+----------------------------------------------------------------------------------------------------------------------+ + +**REST Request** + +.. code-block:: json + + PUT /sysadm/lifepreserver + { + "action" : "addreplication", + "password" : "mypass", + "dataset" : "tank1", + "remotedataset" : "tank/backups", + "user" : "backupuser", + "frequency" : "22", + "port" : "22", + "host" : "192.168.0.10" + } + +**REST Response** + +.. code-block:: json + + { + "args": { + "addreplication": { + "frequency": "22", + "host": "192.168.0.10", + "ldataset": "tank1", + "port": "22", + "rdataset": "tank/backups", + "user": "backupuser" + } + } + } + +**WebSocket Request** + +.. code-block:: json + + { + "namespace" : "sysadm", + "name" : "lifepreserver", + "args" : { + "action" : "addreplication", + "user" : "backupuser", + "dataset" : "tank1", + "frequency" : "22", + "port" : "22", + "password" : "mypass", + "host" : "192.168.0.10", + "remotedataset" : "tank/backups" + }, + "id" : "fooid" + } + +**WebSocket Response** + +.. code-block:: json + + { + "args": { + "addreplication": { + "frequency": "22", + "host": "192.168.0.10", + "ldataset": "tank1", + "port": "22", + "rdataset": "tank/backups", + "user": "backupuser" + } + }, + "id": "fooid", + "name": "response", + "namespace": "sysadm" + } + .. _View Settings: