Usage examples in CURL
The following examples show how to use CURL for authentication and user management.
For usage examples made by using the Python 3 language, see Getting started. For examples that use the Perl programming language, see RESTful API usage examples in Perl. The following usage examples do not include all actions that might be taken on system objects.
curl -k -X POST -H header_1 -H header_2... -d
'JSON' https://system_ip:7443/rest/command/target
Where the following definitions apply:
Authentication
The following is an example of the correct procedure for authenticating. You authenticate by first creating an authentication token and then using that token in all future commands until the session ends. For more information on authentication, see Authentication overview.
curl -k -X POST -H 'Content-Type: application/json' -H 'X-Auth-Username:
superuser' -H 'X-Auth-Password: passw0rd'
https://192.168.10.109:7443/rest/v1/auth
{"token": "38823f60c758dca26f3eaa17dc4664964905a6f058ae2ec92e0f0b63fcf08a3e"}
Making an array
curl -k -X POST -H 'Content-Type: application/json' -H 'X-Auth-Token:
38823f60c758dca26f3eaa17dc4664964905a6f058ae2ec92e0f0b63fcf08a3e'
-d '{"level": "draid6", "drive": "6:7:8:9:10"}'
https://192.168.10.109:7443/rest/mkarray/draid6grp
Changing array settings
24
for new drive 15
by using a distributed rebuild to a rebuild
area:curl -k -X POST -H 'Content-Type: application/json' -H 'X-Auth-Token:
38823f60c758dca26f3eaa17dc4664964905a6f058ae2ec92e0f0b63fcf08a3e'
-d '{"member": "24", "newdrive": "15",
"immediate": "0"}' https://192.168.10.109:7443/rest/charraymember
Removing the array
The final example shows how to remove an array MDisk from the storage pool. For more information on managing the array, see rmarray.
curl -k -X POST -H 'Content-Type: application/json' -H 'X-Auth-Token:
8b5de3ba52c19cc1b213c84a95213bc92733eb006d1f55a7351f3e36b6a2e2a0'
-d '{"force": true, "mdisk" : 0}' https://mcr-fab3-cluster-21.stglab.manchester.uk.ibm.com:7443/rest/rmarray/0
CMMVC5860E The action failed because there were not enough extents in the storage pool.