Running the Resiliency Platform APIs
Following are examples of running the API using the cURL syntax.
Run API to retrieve the list of all resiliency groups configured.
curl -i --insecure 'https://<RM-name>/api/rgs' -X GET -H "X-VRP-API-VERSION: LATEST" -H "Authorization: Bearer <generated-api-access-key>"
The values you need to provide:
<RM-name>: Hostname or IP of the RM.
<generated-api-access-key>: API access key for the user.
Note:
X-VRP-API-VERSION can have version as "LATEST" or specific API version number.
Run API to retrieve the asset summary.
curl -i --insecure 'https://<RM-name>/api/assets' -X GET -H "X-VRP-API-VERSION: LATEST" -H "Authorization: Bearer <generated-api-access-key>"
Similarly, you can retrieve the details of a specific resiliency group or Virtual Business Service (VBS). Following is an example for retrieving the details of a particular VBS.
curl -i --insecure 'https://<RM-name>/api/vbs' -X GET -H "X-VRP-API-VERSION: 1.0" -H "Authorization: Bearer <generated-api-access-key>"
This API returns the details of all the VBS configured in Resiliency Platform. Based on the VBS details you want to retrieve, refer to the property "id" in the items section. Use this ID of the VBS in the next call to view the details of only this VBS.
curl -i --insecure 'https://<RM-name>/api/vbs/<VBS-ID>' -X GET -H "X-VRP-API-VERSION: 1.0" -H "Authorization: Bearer <generated-api-access-key>"
The value you need to provide:
<VBS-ID>: ID of the VBS you want to retrieve.
Another example for listing specific scoped information is for retrieving activity details of a given Activity-ID.
curl -i --insecure 'https://<RM-name>/api/activities' -X GET -H "X-VRP-API-VERSION: LATEST" -H "Authorization: Bearer <generated-api-access-key>"
The results from this API have a section called "items", which is a collection of activity details. Each such collection has an "id" property. Make a note of the activity ID and use it in the next API call.
curl -i --insecure 'https://<RM-name>/api/activities/<Activity-ID>' -X GET -H "X-VRP-API-VERSION: LATEST" -H "Authorization: Bearer <generated-api-access-key>"
Provide the <Activity-ID> value in this case to retrieve details of the said activity.
You can also use the APIs in the following format to retrieve very specific details of known entities.
Analogous to one of the previous examples, run the /rgs API to retrieve the ID of the resiliency group that you want to view.
curl -i --insecure 'https://<RM-name>/api/rgs' -X GET -H "X-VRP-API-VERSION: 1.0" -H "Authorization: Bearer <generated-api-access-key>"
Use the RG-ID to retrieve only the risks for this resiliency group.
curl -i --insecure 'https://<RM-name>/api/rgs/<RG-ID>/risks' -X GET -H "X-VRP-API-VERSION: 1.0" -H "Authorization: Bearer <generated-api-access-key>"
The examples are given in the cURL perspective only as a reference. You can invoke the APIs by other HTTP clients as well.