Changing pool information
Understand how to use the RESTful plug-in to change pool information.
Changing pool information using the curl command
On the command line, run the following command:
echo -En '{"=OPTION": VALUE}' | curl --request PATCH --data @- --silent --user USER 'https://CEPH_MANAGER:8080/api/pool/ID'Replace:- OPTION with the option to modify.
- VALUE with the new value of the option.
- USER with the username.
- CEPH_MANAGER with the IP address or short hostname of the node with the
active
ceph-mgrinstance. - ID with the ID of the pool listed in the
poolfield.
Enter the user’s password when prompted.
Note: If using a self-signed certificate, use the
--insecure
option.
echo -En '{"=OPTION": VALUE}' | curl --request PATCH --data @- --silent --insecure --user USER 'https://CEPH_MANAGER:8080/api/pool/ID'Changing pool information using Python
In the Python interpreter, enter the following:
$ python
>> import requests
>> result = requests.patch('https://CEPH_MANAGER:8080/api/pool/ID', json={"OPTION": VALUE}, auth=("USER", "PASSWORD"))
>> print result.json()Replace:- CEPH_MANAGER with the IP address or short hostname of the node with the
active
ceph-mgrinstance. - ID with the ID of the pool listed in the
poolfield. - OPTION with one of the modifying options: pause, noup, nodown, noout, noin, nobackfill, norecover, noscrub, or nodeep-scrub.
- VALUE with true or false.
- USER with the username.
- PASSWORD with the user’s password.
Note: If using a self-signed certificate, use
verify=False.$ python
>> import requests
>> result = requests.patch('https://CEPH_MANAGER:8080/api/pool/ID', json={"OPTION": VALUE}, auth=("USER", "PASSWORD"), verify=False)
>> print result.json()