10.3. Managing Volumes
The API starts, stops, re-balances, and set volume option of your volume in your cluster by issuing a
POST
request to the URI
.
10.3.1. Starting a Volume Copy linkLink copied to clipboard!
Copy linkLink copied to clipboard!
The API starts a volume with a
POST
request to the volumes
URI.
Example 10.4. Starting a Volume
cURL command:
curl -X POST -H "Accept: application/xml" -H "Content-Type: application/xml" -u [USER:PASS] https://[RHGSC-Host]/api/clusters/99408929-82cf-4dc7-a532-9d998063fa95/glustervolumes/83101900-2f12-4855-838e-36b8a9e04554/start -d "<action/>
"
The API returns the following representation:
<action> <status> <state>complete</state> </status> </action>
<action>
<status>
<state>complete</state>
</status>
</action>
10.3.2. Stopping a Volume Copy linkLink copied to clipboard!
Copy linkLink copied to clipboard!
Stopping of a volume requires a
POST
request.
Example 10.5. Stopping a Volume
cURL command:
curl -X POST -H "Accept: application/xml" -H "Content-Type: application/xml" -u [USER:PASS] https://[RHGSC-Host]/api/clusters/99408929-82cf-4dc7-a532-9d998063fa95/glustervolumes/83101900-2f12-4855-838e-36b8a9e04554/stop -d "<action/>
"
The API returns the following representation:
<action> <status> <state>complete</state> </status> </action>
<action>
<status>
<state>complete</state>
</status>
</action>
10.3.3. Removing a Volume Copy linkLink copied to clipboard!
Copy linkLink copied to clipboard!
Removal of a volume requires a
DELETE
request.
Example 10.6. Removing a Volume
DELETE /api/clusters/99408929-82cf-4dc7-a532-9d998063fa95/glustervolumes/ceb59bbb-173d-4a5a-9b92-0189a17eae27 HTTP/1.1 HTTP/1.1 204 No Content
DELETE /api/clusters/99408929-82cf-4dc7-a532-9d998063fa95/glustervolumes/ceb59bbb-173d-4a5a-9b92-0189a17eae27 HTTP/1.1
HTTP/1.1 204 No Content
cURL command:
curl -X DELETE -H "Accept: application/xml" -H "Content-Type: application/xml" -u [USER:PASS] https://[RHGSC-Host]/api/clusters/99408929-82cf-4dc7-a532-9d998063fa95/glustervolumes/83101900-2f12-4855-838e-36b8a9e04554
"
10.3.4. Setting a Volume Option Copy linkLink copied to clipboard!
Copy linkLink copied to clipboard!
The API sets a volume option with a
POST
request to the volume URI
.
Example 10.7. Setting a Volume Option
cURL command:
curl -X POST -H "Accept: application/xml" -H "Content-Type: application/xml" -u [USER:PASS]https://[RHGSC-Host]/api/clusters/99408929-82cf-4dc7-a532-9d998063fa95/glustervolumes/83101900-2f12-4855-838e-36b8a9e04554/setOption -d "<action><option name="key" value="value" /></action>"
10.3.5. Resetting a Volume Option Copy linkLink copied to clipboard!
Copy linkLink copied to clipboard!
Resetting volume options requires a
POST
request.
Example 10.8. Resetting a Volume Option
cURL command:
curl -X POST -H "Accept: application/xml" -H "Content-Type: application/xml" -u [USER:PASS] https://[RHGSC-Host]/api/clusters/99408929-82cf-4dc7-a532- 9d998063fa95/glustervolumes/83101900-2f12-4855-838e-36b8a9e04554/resetOption -d "<action><option name="key" value="value"/><force>true</force></action>"
The API returns the following representation:
<action> <status> <state>complete</state> </status> </action>
<action>
<status>
<state>complete</state>
</status>
</action>
10.3.6. Resetting all Volume Options Copy linkLink copied to clipboard!
Copy linkLink copied to clipboard!
You can reset all volume options with a single
POST
request.
POST /api/clusters/99408929-82cf-4dc7-a532-9d998063fa95/glustervolumes/ceb59bbb-173d-4a5a-9b92-0189a17eae27/resetAllOptions HTTP/1.1 Accept: application/xml Content-type: application/xml
POST /api/clusters/99408929-82cf-4dc7-a532-9d998063fa95/glustervolumes/ceb59bbb-173d-4a5a-9b92-0189a17eae27/resetAllOptions HTTP/1.1
Accept: application/xml
Content-type: application/xml
cURL command:
curl -X POST -H "Accept: application/xml" -H "Content-Type: application/xml" -u [USER:PASS] https://[RHGSC-Host]/api/clusters/99408929-82cf-4dc7-a532-9d998063fa95/glustervolumes/83101900-2f12-4855-838e-36b8a9e04554/resetAllOptions -d "<action/>
"
The API returns the following representation:
<action> <status> <state>complete</state> </status> </action>
<action>
<status>
<state>complete</state>
</status>
</action>
10.3.7. Rebalancing Volume Copy linkLink copied to clipboard!
Copy linkLink copied to clipboard!
You can rebalance the volume by issuing a
POST
request. The status of rebalance operation can be monitored by job id returned by this API.
POST /api/clusters/99408929-82cf-4dc7-a532-9d998063fa95/glustervolumes/ceb59bbb-173d-4a5a-9b92-0189a17eae27/rebalance -d "<action/>" HTTP/1.1 Accept: application/xml Content-type: application/xml
POST /api/clusters/99408929-82cf-4dc7-a532-9d998063fa95/glustervolumes/ceb59bbb-173d-4a5a-9b92-0189a17eae27/rebalance -d "<action/>"
HTTP/1.1
Accept: application/xml
Content-type: application/xml
cURL command:
curl -X POST -H "Accept: application/xml" -H "Content-Type: application/xml" -u [USER:PASS] https://[RHGSC-Host]/api/clusters/44571c63-a110-4fba-9a8c-7b30446ba8bf/glustervolumes/380474af-360b-48fa-a210-9c08b913ffa3/rebalance -d "<action/>"
The API returns the following representation:
The status of rebalance is monitored using the job ID and its corresponding step ID by looking at the re-balancing step.
/api/jobs/<job_id>/steps /api/jobs/<job_id>/steps/<step_id> --for step type rebalance /api/jobs/<job_id>/steps/<step_id>/statistics -- for detail information of rebalance status per node
/api/jobs/<job_id>/steps
/api/jobs/<job_id>/steps/<step_id> --for step type rebalance
/api/jobs/<job_id>/steps/<step_id>/statistics -- for detail information of rebalance status per node
Example 10.9. Monitoring Rebalance
You can stop a rebalance operation by issuing a POST request.
curl -X POST -H "Accept: application/xml" -H "Content-Type: application/xml" -u [USER:PASS] https://[RHGSC-Host]/api/clusters/44571c63-a110-4fba-9a8c-7b30446ba8bf/glustervolumes/380474af-360b-48fa-a210-9c08b913ffa3/stoprebalance -d "<action/>"