Disaster Recovery Engine API
Here you can find details about the API of the Disaster Recovery Engine. You can also download the specification in YAML format.
Call syntax
API calls use the following pattern:
http://HOST:PORT/v1/CALL
HOST is the address on which the StorPool API is bound, and PORT is a port set specifically for DRE.
You can obtain them in one of the following ways:
Ask the administrator of your StorPool system.
If you have access to the configuration file of a StorPool node: use the values of the SP_API_HTTP_HOST and SP_DRE_HTTP_PORT settings.
Examples
The examples in this section show how you can perform API calls on the command line using the curl tool.
For each call there are two examples - remote and local:
Remote examples show
HOST:PORT.Use them when performing calls from a system that has network access to the StorPool cluster. You just need to enter the correct address and port, for example
10.9.8.7:55177.Local examples show
$SP_API_HTTP_HOST:$SP_DRE_HTTP_PORT.Use them when you are logged in to a StorPool node. You should do the following:
Run the
. /usr/lib/storpool/storpool_confget.shcommand; this allows you to use StorPool’s configuration settings as shell variables.Run the examples exactly as they are shown.
Consider the following:
Some operations take arguments as URL query parameters (after
?in the path).The API reference itself contains example responses.
Status
Getting the status of all DR services and VMs:
# curl -s http://HOST:PORT/v1/dreStatus
# curl -s http://$SP_API_HTTP_HOST:$SP_DRE_HTTP_PORT/v1/dreStatus
Service details
Obtain information about a service by specifying its ID:
# curl -s 'http://HOST:PORT/v1/drService?drId=42ae6a4c-e421-48b5-8e90-c6e83368037e'
# curl -s 'http://$SP_API_HTTP_HOST:$SP_DRE_HTTP_PORT/v1/drService?drId=42ae6a4c-e421-48b5-8e90-c6e83368037e'
Creating a service
You need to provide JSON body:
# curl -X POST -H 'Content-Type: application/json' \
# -d '{"vmId":"a90e2dee-fad4-405d-b75e-3ea6561d659a", \
# "locationId":"abc4","drPolicyName":"hourly-zone-b"}' \
# http://HOST:PORT/v1/drServiceCreate
#
# curl -X POST -H 'Content-Type: application/json' \
# -d '{"vmId":"a90e2dee-fad4-405d-b75e-3ea6561d659a", \
# "locationId":"abc4","drPolicyName":"hourly-zone-b"}' \
# http://$SP_API_HTTP_HOST:$SP_DRE_HTTP_PORT/v1/drServiceCreate
Deleting a service
Delete a service by specifying its ID:
# curl -X POST 'http://HOST:PORT/v1/drServiceDelete?drId=42ae6a4c-e421-48b5-8e90-c6e83368037e'
# curl -X POST 'http://$SP_API_HTTP_HOST:$SP_DRE_HTTP_PORT/v1/drServiceDelete?drId=42ae6a4c-e421-48b5-8e90-c6e83368037e'
Recovery points for a service
Obtain information about all recovery points of a DR Service by specifying its ID:
# curl -s 'http://HOST:PORT/v1/recoveryPoint?drId=42ae6a4c-e421-48b5-8e90-c6e83368037e'
# curl -s 'http://$SP_API_HTTP_HOST:$SP_DRE_HTTP_PORT/v1/recoveryPoint?drId=42ae6a4c-e421-48b5-8e90-c6e83368037e'
Deleting a recovery point
Delete a recovery point by specifying its ID:
# curl -X POST 'http://HOST:PORT/v1/recoveryPointDelete?recoveryPointId=44d4e71f-e320-4af8-a198-28a279b5994e&where=local'
# curl -X POST 'http://$SP_API_HTTP_HOST:$SP_DRE_HTTP_PORT/v1/recoveryPointDelete?recoveryPointId=44d4e71f-e320-4af8-a198-28a279b5994e&where=local'
VM metadata for a recovery point
Get VM metadata for a recovery point by specifying its ID:
# curl -s 'http://HOST:PORT/v1/metadata?recoveryPointId=44d4e71f-e320-4af8-a198-28a279b5994e'
# curl -s 'http://$SP_API_HTTP_HOST:$SP_DRE_HTTP_PORT/v1/metadata?recoveryPointId=44d4e71f-e320-4af8-a198-28a279b5994e'