ONTAP Rest API Discussions

Volume create with Rest API

STORAGE_CIT
1,488 Views

Hi,

 

i just to add a new volume with the rest API. 

With a simple call (only aggr, svm and volume ) it works fine. 

 

But when i use a call with more extensive arguments, i will get the return code 202 and also the return records of the volume  data but the volume does not exists on the filer! 

This is the call that i use:


curl --location --request POST 'https://1.2.3.4/api/storage/volumes?return_records=true' \
--header 'Authorization: Basic 12345' \
--header 'Content-Type: application/json' \
--data-raw '{
"aggregates": [
{
"name": "data2_sas_n01"
}
],
"comment": "test_comment",
"encryption": {
"enabled": "true"
},
"guarantee": {
"type": "none"
},
"language": "de.UTF-8",
"name": "vs9910_rest_test_13",
"nas": {
"export_policy": {
"name": "vs9910_rest_test_complete6"
},
"gid": "0",
"path": "/vs9910_rest_test_13",
"security_style": "unix",
"uid": "0"
},
"size": "50g",
"snapshot_policy": {
"name": "none"
},
"space": {
"logical_space": {
"enforcement": "true",
"reporting": "true"
},
"snapshot": {
"reserve_percent": 0
}
},
"svm": {
"name": "vs9910"
},
"type": "RW"
}'

 

 

Any ideas what the reason is for it?

 

Regards Tino

 

1 REPLY 1

degraaf
1,379 Views

A 202 is the documented and expected HTTP status for this API call. You must wait until the returned job is complete before you can be sure that a GET for the created volume will succeed.

Public