Hi,
You can use the swagger interface on your cluster via "https://<cluster>/docs/api". Here are some examples, start by querying the volume for the state and UUID. EG:
Method: Get
URI: https://cluster1.testlab.local/api/storage/volumes?svm.name=vserver1&name=volume1&fields=uuid,state
{
"records": [
{
"uuid": "ac1b73fd-ebbc-11e9-865d-005056804db6",
"name": "volume1",
"state": "offline",
"svm": {
"name": "vserver1"
}
}
],
"num_records": 1
}
Once you have the volume UUID you need to ensure the volume is in an "online" state before it can be mounted (note that in the above example the state is "offline" so you first need to invoke a Patch request to online the volume).
Method: Patch
URI: https://cluster1.testlab.local/api/storage/volumes/ac1b73fd-ebbc-11e9-865d-005056804db6
{
"name": "volume1",
"state": "online"
}
Using the volumes UUID you can then mount the volume in the vservers namespace. EG
Method: Patch
Uri: https://cluster1.testlab.local/api/storage/volumes/ac1b73fd-ebbc-11e9-865d-005056804db6
{
"name": "volume1",
"nas": {
"path": "/volume1"
}
}
The REST API will provide JSON ouput that contains the Job UUID number. EG
{
"job": {
"uuid": "b1fd3fc1-f47f-11e9-865d-005056804db6",
"_links": {
"self": {
"href": "/api/cluster/jobs/b1fd3fc1-f47f-11e9-865d-005056804db6"
}
}
}
}
You can then query the status of the job:
Method: Get
Uri: https://cluster1.testlab.local/api/cluster/jobs/b1fd3fc1-f47f-11e9-865d-005056804db6
{
"uuid": "b1fd3fc1-f47f-11e9-865d-005056804db6",
"description": "PATCH /api/storage/volumes/ac1b73fd-ebbc-11e9-865d-005056804db6",
"state": "success",
"message": "success",
"code": 0,
"start_time": "2019-10-22T14:54:49+11:00",
"end_time": "2019-10-22T14:54:59+11:00"
}
Hope that helps?
/Matt
If this post resolved your issue, help others by selecting ACCEPT AS SOLUTION or adding a KUDO.