Go to main content
Oracle® ZFS Storage Appliance RESTful API Guide, Release OS8.7.0

Exit Print View

Updated: July 2017
 
 

Replication Targets

The following table shows the available replication target commands.

Table 96  Replication Target Commands
Request
Path /api/storage/v1
Description
POST
/replication/targets
Create a new replication target
GET
/replication/targets/<target>
Get the specified replication target properties
GET
/replication/targets
List all replication target objects
PUT
/replication/targets/<target>
Modify the specified replication target object
DELETE
/replication/targets/<target>
Destroy the specified target object

List Replication Targets

Lists all of the available replication targets on a system.

Example Request:

GET /api/storage/v1/replication/targets HTTP/1.1
Host: zfssa-storage.example.com:215
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

{ 
        "targets": [{     
            "address": "10.133.64.44:216", 
            "label": "chum", 
            "hostname": "10.133.64.44", 
            "asn": "9d7a7543-ca83-68f5-a8fc-f818f65e1cfc", 
            "actions": 0, 
            "target": "target-000", 
            "href": "/api/storage/v1/replication/targets/chum" 
        }, { 
            "address": "10.153.34.165:216", 
            "label": "oakmeal-7320-165", 
            "hostname": "10.153.34.165", 
            "asn": "16a4c82c-26c1-4a50-e317-ac53181f2e86", 
            "actions": 0, 
            "target": "target-001", 
            "href": "/api/storage/v1/replication/targets/oakmeal-7320-165" 
        }] 
} 

Get Replication Target

This command lists the details of a single replication target. The target is accessed by its hostname.

Example Request:

GET /api/storage/v1/replication/targets/chum HTTP/1.1
Authorization: Basic ab6rt4psMWE=
Host: zfs-storage.example.com:215
Accept: application/json

Example Response:

HTTP/1.1 200 OK
X-Zfssa-Replication-Api: 1.0
Content-Type: application/json
Content-Length: 337

{ 
        "target": { 
            "href": "/api/storage/v1/replication/targets/chum", 
            "address": "10.133.64.44:216", 
            "label": "chum", 
            "hostname": "10.133.64.44", 
            "asn": "9d7a7543-ca83-68f5-a8fc-f818f65e1cfc", 
            "actions": 0 
        } 
}

Create Replication Target

Creates a new replication target for remote replication.

Example Request:

POST /api/replication/v1/targets HTTP/1.1
Authorization: Basic ab6rt4psMWE=
Host: example.zfssa.com:215
Accept: application/json
Content-Type: application/json
Content-Length: 54

{"hostname":"example", “root_password”:”letmein”, “label”:”east”}

Example Response:

HTTP/1.1 201 Created
Content-Length: 135
Content-Type: application/json
Location: /service/v1/services/replication/targets/target-000
X-Zfssa-Replication-Api: 1.0

{
    "target": {
        "actions": 0,
        "address": "123.45.78.9:216",
        "asn": "fa5bf303-0dcb-e20d-ac92-cd129ccd2c81",
        "hostname": "example",
        "href": "/service/v1/services/replication/targets/target-000",
        "label": "east"
    }
}

Delete Replication Target

This command deletes an existing replication target.

Example Request:

DELETE /service/v1/services/replication/targets/target-000 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