Chapter 1. Ceph RESTful API
As a storage administrator, you can use the Ceph RESTful API, or simply the Ceph API, provided by the Red Hat Ceph Storage Dashboard to interact with the Red Hat Ceph Storage cluster. You can display information about the Ceph Monitors and OSDs, along with their respective configuration options. You can even create or edit Ceph pools.
The Ceph API uses the following standards:
- HTTP 1.1
- JSON
- MIME and HTTP Content Negotiation
- JWT
These standards are OpenAPI 3.0 compliant, regulating the API syntax, semantics, content encoding, versioning, authentication, and authorization.
Prerequisites
- A healthy running Red Hat Ceph Storage cluster.
- Access to the node running the Ceph Manager.
1.1. Versioning for the Ceph API Copy linkLink copied to clipboard!
A main goal for the Ceph RESTful API, is to provide a stable interface. To achieve a stable interface, the Ceph API is built on the following principles:
- A mandatory explicit default version for all endpoints to avoid implicit defaults.
Fine-grain change control per-endpoint.
The expected version from a specific endpoint is stated in the HTTP header.
Syntax
Accept: application/vnd.ceph.api.vMAJOR.MINOR+json
Accept: application/vnd.ceph.api.vMAJOR.MINOR+json
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Example
Accept: application/vnd.ceph.api.v1.0+json
Accept: application/vnd.ceph.api.v1.0+json
Copy to Clipboard Copied! Toggle word wrap Toggle overflow If the current Ceph API server is not able to address that specific version, a
415 - Unsupported Media Type
response will be returned.
Using semantic versioning.
- Major changes are backwards incompatible. Changes might result in non-additive changes to the request, and to the response formats for a specific endpoint.
- Minor changes are backwards and forwards compatible. Changes consist of additive changes to the request or response formats for a specific endpoint.
1.2. Authentication and authorization for the Ceph API Copy linkLink copied to clipboard!
Access to the Ceph RESTful API goes through two checkpoints. The first is authenticating that the request is done on the behalf of a valid, and existing user. Secondly, is authorizing the previously authenticated user can do a specific action, such as creating, reading, updating, or deleting, on the target end point.
Before users start using the Ceph API, they need a valid JSON Web Token (JWT). The /api/auth
endpoint allows you to retrieve this token.
Example
curl -X POST "https://example.com:8443/api/auth" \ -H "Accept: application/vnd.ceph.api.v1.0+json" \ -H "Content-Type: application/json" \ -d '{"username": user1, "password": password1}'
[root@mon ~]# curl -X POST "https://example.com:8443/api/auth" \
-H "Accept: application/vnd.ceph.api.v1.0+json" \
-H "Content-Type: application/json" \
-d '{"username": user1, "password": password1}'
This token must be used together with every API request by placing it within the Authorization
HTTP header.
Syntax
curl -H "Authorization: Bearer TOKEN" ...
curl -H "Authorization: Bearer TOKEN" ...
1.3. Enabling and Securing the Ceph API module Copy linkLink copied to clipboard!
The Red Hat Ceph Storage Dashboard module offers the RESTful API access to the storage cluster over an SSL-secured connection.
If disabling SSL, then user names and passwords are sent unencrypted to the Red Hat Ceph Storage Dashboard.
Prerequisites
- Root-level access to a Ceph Monitor node.
-
Ensure that you have at least one
ceph-mgr
daemon active. -
If you use a firewall, ensure that TCP port
8443
, for SSL, and TCP port8080
, without SSL, are open on the node with the activeceph-mgr
daemon.
Procedure
Log into the Cephadm shell:
Example
root@host01 ~]# cephadm shell
root@host01 ~]# cephadm shell
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Enable the RESTful plug-in:
[ceph: root@host01 /]# ceph mgr module enable dashboard
[ceph: root@host01 /]# ceph mgr module enable dashboard
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Configure an SSL certificate.
If your organization’s certificate authority (CA) provides a certificate, then set using the certificate files:
Syntax
ceph dashboard set-ssl-certificate HOST_NAME -i CERT_FILE ceph dashboard set-ssl-certificate-key HOST_NAME -i KEY_FILE
ceph dashboard set-ssl-certificate HOST_NAME -i CERT_FILE ceph dashboard set-ssl-certificate-key HOST_NAME -i KEY_FILE
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Example
[ceph: root@host01 /]# ceph dashboard set-ssl-certificate -i dashboard.crt [ceph: root@host01 /]# ceph dashboard set-ssl-certificate-key -i dashboard.key
[ceph: root@host01 /]# ceph dashboard set-ssl-certificate -i dashboard.crt [ceph: root@host01 /]# ceph dashboard set-ssl-certificate-key -i dashboard.key
Copy to Clipboard Copied! Toggle word wrap Toggle overflow If you want to set unique node-based certificates, then add a HOST_NAME to the commands:
Example
[ceph: root@host01 /]# ceph dashboard set-ssl-certificate host01 -i dashboard.crt [ceph: root@host01 /]# ceph dashboard set-ssl-certificate-key host01 -i dashboard.key
[ceph: root@host01 /]# ceph dashboard set-ssl-certificate host01 -i dashboard.crt [ceph: root@host01 /]# ceph dashboard set-ssl-certificate-key host01 -i dashboard.key
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Alternatively, you can generate a self-signed certificate. However, using a self-signed certificate does not provide full security benefits of the HTTPS protocol:
[ceph: root@host01 /]# ceph dashboard create-self-signed-cert
[ceph: root@host01 /]# ceph dashboard create-self-signed-cert
Copy to Clipboard Copied! Toggle word wrap Toggle overflow WarningMost modern web browsers will complain about self-signed certificates, which require you to confirm before establishing a secure connection.
Create a user, set the password, and set the role:
Syntax
echo -n "PASSWORD" > PATH_TO_FILE/PASSWORD_FILE ceph dashboard ac-user-create USER_NAME -i PASSWORD_FILE ROLE
echo -n "PASSWORD" > PATH_TO_FILE/PASSWORD_FILE ceph dashboard ac-user-create USER_NAME -i PASSWORD_FILE ROLE
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Example
[ceph: root@host01 /]# echo -n "p@ssw0rd" > /root/dash-password.txt [ceph: root@host01 /]# ceph dashboard ac-user-create user1 -i /root/dash-password.txt administrator
[ceph: root@host01 /]# echo -n "p@ssw0rd" > /root/dash-password.txt [ceph: root@host01 /]# ceph dashboard ac-user-create user1 -i /root/dash-password.txt administrator
Copy to Clipboard Copied! Toggle word wrap Toggle overflow This example creates a user named
user1
with theadministrator
role.Connect to the RESTful plug-in web page. Open a web browser and enter the following URL:
Syntax
https://HOST_NAME:8443
https://HOST_NAME:8443
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Example
https://host01:8443
https://host01:8443
Copy to Clipboard Copied! Toggle word wrap Toggle overflow If you used a self-signed certificate, confirm a security exception.
Additional Resources
-
The
ceph dashboard --help
command. -
The
https://HOST_NAME:8443/doc
page, where HOST_NAME is the IP address or name of the node with the runningceph-mgr
instance. - For more information, see the Security Hardening guide within the Product Documentation for Red Hat Enterprise Linux for your OS version, on the Red Hat Customer Portal.
1.4. Questions and Answers Copy linkLink copied to clipboard!
1.4.1. Getting information Copy linkLink copied to clipboard!
This section describes how to use the Ceph API to view information about the storage cluster, Ceph Monitors, OSDs, pools, and hosts.
1.4.1.1. How Can I View All Cluster Configuration Options? Copy linkLink copied to clipboard!
This section describes how to use the RESTful plug-in to view cluster configuration options and their values.
The curl
Command
On the command line, use:
curl --silent --user USER 'https://CEPH_MANAGER:CEPH_MANAGER_PORT/api/cluster_conf'
curl --silent --user USER 'https://CEPH_MANAGER:CEPH_MANAGER_PORT/api/cluster_conf'
Replace:
-
USER
with the user name -
CEPH_MANAGER
with the IP address or short host name of the node with the activeceph-mgr
instance -
CEPH_MANAGER_PORT
with the TCP port number. The default TCP port number is 8443.
Enter the user’s password when prompted.
If you used a self-signed certificate, use the --insecure
option:
curl --silent --insecure --user USER 'https://CEPH_MANAGER:8080/api/cluster_conf'
curl --silent --insecure --user USER 'https://CEPH_MANAGER:8080/api/cluster_conf'
Python
In the Python interpreter, enter:
python > import requests > result = requests.get('https://CEPH_MANAGER:8080/api/cluster_conf', auth=("USER", "PASSWORD")) > print result.json()
$ python
>> import requests
>> result = requests.get('https://CEPH_MANAGER:8080/api/cluster_conf', auth=("USER", "PASSWORD"))
>> print result.json()
Replace:
-
CEPH_MANAGER
with the IP address or short host name of the node with the activeceph-mgr
instance -
USER
with the user name -
PASSWORD
with the user’s password
If you used a self-signed certificate, use the verify=False
option:
python > import requests > result = requests.get('https://CEPH_MANAGER:8080/api/cluster_conf', auth=("USER", "PASSWORD"), verify=False) > print result.json()
$ python
>> import requests
>> result = requests.get('https://CEPH_MANAGER:8080/api/cluster_conf', auth=("USER", "PASSWORD"), verify=False)
>> print result.json()
Web Browser
In the web browser, enter:
https://CEPH_MANAGER:8080/api/cluster_conf
https://CEPH_MANAGER:8080/api/cluster_conf
Replace:
-
CEPH_MANAGER
with the IP address or short host name of the node with the activeceph-mgr
instance
Enter the user name and password when prompted.
Additional Resources
- The Configuration Guide for Red Hat Ceph Storage 8
1.4.1.2. How Can I View a Particular Cluster Configuration Option? Copy linkLink copied to clipboard!
This section describes how to view a particular cluster option and its value.
The curl
Command
On the command line, use:
curl --silent --user USER 'https://CEPH_MANAGER:8080/api/cluster_conf/ARGUMENT'
curl --silent --user USER 'https://CEPH_MANAGER:8080/api/cluster_conf/ARGUMENT'
Replace:
-
USER
with the user name -
CEPH_MANAGER
with the IP address or short host name of the node with the activeceph-mgr
instance -
ARGUMENT
with the configuration option you want to view
Enter the user’s password when prompted.
If you used a self-signed certificate, use the --insecure
option:
curl --silent --insecure --user USER 'https://CEPH_MANAGER:8080/api/cluster_conf/ARGUMENT'
curl --silent --insecure --user USER 'https://CEPH_MANAGER:8080/api/cluster_conf/ARGUMENT'
Python
In the Python interpreter, enter:
python > import requests > result = requests.get('https://CEPH_MANAGER:8080/api/cluster_conf/ARGUMENT', auth=("USER", "PASSWORD")) > print result.json()
$ python
>> import requests
>> result = requests.get('https://CEPH_MANAGER:8080/api/cluster_conf/ARGUMENT', auth=("USER", "PASSWORD"))
>> print result.json()
Replace:
-
CEPH_MANAGER
with the IP address or short host name of the node with the activeceph-mgr
instance -
ARGUMENT
with the configuration option you want to view -
USER
with the user name -
PASSWORD
with the user’s password
If you used a self-signed certificate, use the verify=False
option:
python > import requests > result = requests.get('https://CEPH_MANAGER:8080/api/cluster_conf/ARGUMENT', auth=("USER", "PASSWORD"), verify=False) > print result.json()
$ python
>> import requests
>> result = requests.get('https://CEPH_MANAGER:8080/api/cluster_conf/ARGUMENT', auth=("USER", "PASSWORD"), verify=False)
>> print result.json()
Web Browser
In the web browser, enter:
https://CEPH_MANAGER:8080/api/cluster_conf/ARGUMENT
https://CEPH_MANAGER:8080/api/cluster_conf/ARGUMENT
Replace:
-
CEPH_MANAGER
with the IP address or short host name of the node with the activeceph-mgr
instance -
ARGUMENT
with the configuration option you want to view
Enter the user name and password when prompted.
Additional Resources
- The Configuration Guide for Red Hat Ceph Storage 8
1.4.1.3. How Can I View All Configuration Options for OSDs? Copy linkLink copied to clipboard!
This section describes how to view all configuration options and their values for OSDs.
The curl
Command
On the command line, use:
curl --silent --user USER 'https://CEPH_MANAGER:8080/api/osd/flags'
curl --silent --user USER 'https://CEPH_MANAGER:8080/api/osd/flags'
Replace:
-
USER
with the user name -
CEPH_MANAGER
with the IP address or short host name of the node with the activeceph-mgr
instance
Enter the user’s password when prompted.
If you used a self-signed certificate, use the --insecure
option:
curl --silent --insecure --user USER 'https://CEPH_MANAGER:8080/api/osd/flags'
curl --silent --insecure --user USER 'https://CEPH_MANAGER:8080/api/osd/flags'
Python
In the Python interpreter, enter:
python > import requests > result = requests.get('https://CEPH_MANAGER:8080/api/osd/flags', auth=("USER", "PASSWORD")) > print result.json()
$ python
>> import requests
>> result = requests.get('https://CEPH_MANAGER:8080/api/osd/flags', auth=("USER", "PASSWORD"))
>> print result.json()
Replace:
-
CEPH_MANAGER
with the IP address or short host name of the node with the activeceph-mgr
instance -
USER
with the user name -
PASSWORD
with the user’s password
If you used a self-signed certificate, use the verify=False
option:
python > import requests > result = requests.get('https://CEPH_MANAGER:8080/api/osd/flags', auth=("USER", "PASSWORD"), verify=False) > print result.json()
$ python
>> import requests
>> result = requests.get('https://CEPH_MANAGER:8080/api/osd/flags', auth=("USER", "PASSWORD"), verify=False)
>> print result.json()
Web Browser
In the web browser, enter:
https://CEPH_MANAGER:8080/api/osd/flags
https://CEPH_MANAGER:8080/api/osd/flags
Replace:
-
CEPH_MANAGER
with the IP address or short host name of the node with the activeceph-mgr
instance
Enter the user name and password when prompted.
Additional Resources
- The Configuration Guide for Red Hat Ceph Storage 8
1.4.1.4. How Can I View CRUSH Rules? Copy linkLink copied to clipboard!
This section describes how to view CRUSH rules.
The curl
Command
On the command line, use:
curl --silent --user USER 'https://CEPH_MANAGER:8080/api/crush_rule'
curl --silent --user USER 'https://CEPH_MANAGER:8080/api/crush_rule'
Replace:
-
USER
with the user name -
CEPH_MANAGER
with the IP address or short host name of the node with the activeceph-mgr
instance
Enter the user’s password when prompted.
If you used a self-signed certificate, use the --insecure
option:
curl --silent --insecure --user USER 'https://CEPH_MANAGER:8080/api/crush_rule'
curl --silent --insecure --user USER 'https://CEPH_MANAGER:8080/api/crush_rule'
Python
In the Python interpreter, enter:
python > import requests > result = requests.get('https://CEPH_MANAGER:8080/api/crush_rule', auth=("USER", "PASSWORD")) > print result.json()
$ python
>> import requests
>> result = requests.get('https://CEPH_MANAGER:8080/api/crush_rule', auth=("USER", "PASSWORD"))
>> print result.json()
Replace:
-
CEPH_MANAGER
with the IP address or short host name of the node with the activeceph-mgr
instance -
USER
with the user name -
PASSWORD
with the user’s password
If you used a self-signed certificate, use the verify=False
option:
python > import requests > result = requests.get('https://CEPH_MANAGER:8080/api/crush_rule', auth=("USER", "PASSWORD"), verify=False) > print result.json()
$ python
>> import requests
>> result = requests.get('https://CEPH_MANAGER:8080/api/crush_rule', auth=("USER", "PASSWORD"), verify=False)
>> print result.json()
Web Browser
In the web browser, enter:
https://CEPH_MANAGER:8080/api/crush_rule
https://CEPH_MANAGER:8080/api/crush_rule
Replace:
-
CEPH_MANAGER
with the IP address or short host name of the node with the activeceph-mgr
instance
Enter the user name and password when prompted.
Additional Resources
- The CRUSH Rules section in the Administration Guide for Red Hat Ceph Storage 8.
1.4.1.5. How Can I View Information about Monitors? Copy linkLink copied to clipboard!
This section describes how to view information about a particular Monitor, such as:
- IP address
- Name
- Quorum status
The curl
Command
On the command line, use:
curl --silent --user USER 'https://CEPH_MANAGER:8080/api/monitor'
curl --silent --user USER 'https://CEPH_MANAGER:8080/api/monitor'
Replace:
-
USER
with the user name -
CEPH_MANAGER
with the IP address or short host name of the node with the activeceph-mgr
instance
Enter the user’s password when prompted.
If you used a self-signed certificate, use the --insecure
option:
curl --silent --insecure --user USER 'https://CEPH_MANAGER:8080/api/monitor'
curl --silent --insecure --user USER 'https://CEPH_MANAGER:8080/api/monitor'
Python
In the Python interpreter, enter:
python > import requests > result = requests.get('https://CEPH_MANAGER:8080/api/monitor', auth=("USER", "PASSWORD")) > print result.json()
$ python
>> import requests
>> result = requests.get('https://CEPH_MANAGER:8080/api/monitor', auth=("USER", "PASSWORD"))
>> print result.json()
Replace:
-
CEPH_MANAGER
with the IP address or short host name of the node with the activeceph-mgr
instance -
USER
with the user name -
PASSWORD
with the user’s password
If you used a self-signed certificate, use the verify=False
option:
python > import requests > result = requests.get('https://CEPH_MANAGER:8080/api/monitor', auth=("USER", "PASSWORD"), verify=False) > print result.json()
$ python
>> import requests
>> result = requests.get('https://CEPH_MANAGER:8080/api/monitor', auth=("USER", "PASSWORD"), verify=False)
>> print result.json()
Web Browser
In the web browser, enter:
https://CEPH_MANAGER:8080/api/monitor
https://CEPH_MANAGER:8080/api/monitor
Replace:
-
CEPH_MANAGER
with the IP address or short host name of the node with the activeceph-mgr
instance
Enter the user name and password when prompted.
1.4.1.6. How Can I View Information About a Particular Monitor? Copy linkLink copied to clipboard!
This section describes how to view information about a particular Monitor, such as:
- IP address
- Name
- Quorum status
The curl
Command
On the command line, use:
curl --silent --user USER 'https://CEPH_MANAGER:8080/api/monitor/NAME'
curl --silent --user USER 'https://CEPH_MANAGER:8080/api/monitor/NAME'
Replace:
-
USER
with the user name -
CEPH_MANAGER
with the IP address or short host name of the node with the activeceph-mgr
instance -
NAME
with the short host name of the Monitor
Enter the user’s password when prompted.
If you used a self-signed certificate, use the --insecure
option:
curl --silent --insecure --user USER 'https://CEPH_MANAGER:8080/api/monitor/NAME'
curl --silent --insecure --user USER 'https://CEPH_MANAGER:8080/api/monitor/NAME'
Python
In the Python interpreter, enter:
python > import requests > result = requests.get('https://CEPH_MANAGER:8080/api/monitor/NAME', auth=("USER", "PASSWORD")) > print result.json()
$ python
>> import requests
>> result = requests.get('https://CEPH_MANAGER:8080/api/monitor/NAME', auth=("USER", "PASSWORD"))
>> print result.json()
Replace:
-
CEPH_MANAGER
with the IP address or short host name of the node with the activeceph-mgr
instance -
NAME
with the short host name of the Monitor -
USER
with the user name -
PASSWORD
with the user’s password
If you used a self-signed certificate, use the verify=False
option:
python > import requests > result = requests.get('https://CEPH_MANAGER:8080/api/monitor/NAME', auth=("USER", "PASSWORD"), verify=False) > print result.json()
$ python
>> import requests
>> result = requests.get('https://CEPH_MANAGER:8080/api/monitor/NAME', auth=("USER", "PASSWORD"), verify=False)
>> print result.json()
Web Browser
In the web browser, enter:
https://CEPH_MANAGER:8080/api/monitor/NAME
https://CEPH_MANAGER:8080/api/monitor/NAME
Replace:
-
CEPH_MANAGER
with the IP address or short host name of the node with the activeceph-mgr
instance -
NAME
with the short host name of the Monitor
Enter the user name and password when prompted.
1.4.1.7. How Can I View Information about OSDs? Copy linkLink copied to clipboard!
This section describes how to view information about OSDs, such as:
- IP address
- Its pools
- Affinity
- Weight
The curl
Command
On the command line, use:
curl --silent --user USER 'https://CEPH_MANAGER:8080/api/osd'
curl --silent --user USER 'https://CEPH_MANAGER:8080/api/osd'
Replace:
-
USER
with the user name -
CEPH_MANAGER
with the IP address or short host name of the node with the activeceph-mgr
instance
Enter the user’s password when prompted.
If you used a self-signed certificate, use the --insecure
option:
curl --silent --insecure --user USER 'https://CEPH_MANAGER:8080/api/osd'
curl --silent --insecure --user USER 'https://CEPH_MANAGER:8080/api/osd'
Python
In the Python interpreter, enter:
python > import requests > result = requests.get('https://CEPH_MANAGER:8080/api/osd/', auth=("USER", "PASSWORD")) > print result.json()
$ python
>> import requests
>> result = requests.get('https://CEPH_MANAGER:8080/api/osd/', auth=("USER", "PASSWORD"))
>> print result.json()
Replace:
-
CEPH_MANAGER
with the IP address or short host name of the node with the activeceph-mgr
instance -
USER
with the user name -
PASSWORD
with the user’s password
If you used a self-signed certificate, use the verify=False
option:
python > import requests > result = requests.get('https://CEPH_MANAGER:8080/api/osd/', auth=("USER", "PASSWORD"), verify=False) > print result.json()
$ python
>> import requests
>> result = requests.get('https://CEPH_MANAGER:8080/api/osd/', auth=("USER", "PASSWORD"), verify=False)
>> print result.json()
Web Browser
In the web browser, enter:
https://CEPH_MANAGER:8080/api/osd
https://CEPH_MANAGER:8080/api/osd
Replace:
-
CEPH_MANAGER
with the IP address or short host name of the node with the activeceph-mgr
instance
Enter the user name and password when prompted.
1.4.1.8. How Can I View Information about a Particular OSD? Copy linkLink copied to clipboard!
This section describes how to view information about a particular OSD, such as:
- IP address
- Its pools
- Affinity
- Weight
The curl
Command
On the command line, use:
curl --silent --user USER 'https://CEPH_MANAGER:8080/api/osd/ID'
curl --silent --user USER 'https://CEPH_MANAGER:8080/api/osd/ID'
Replace:
-
USER
with the user name -
CEPH_MANAGER
with the IP address or short host name of the node with the activeceph-mgr
instance -
ID
with the ID of the OSD listed in theosd
field
Enter the user’s password when prompted.
If you used a self-signed certificate, use the --insecure
option:
curl --silent --insecure --user USER 'https://CEPH_MANAGER:8080/api/osd/ID'
curl --silent --insecure --user USER 'https://CEPH_MANAGER:8080/api/osd/ID'
Python
In the Python interpreter, enter:
python > import requests > result = requests.get('https://CEPH_MANAGER:8080/api/osd/ID', auth=("USER", "PASSWORD")) > print result.json()
$ python
>> import requests
>> result = requests.get('https://CEPH_MANAGER:8080/api/osd/ID', auth=("USER", "PASSWORD"))
>> print result.json()
Replace:
-
CEPH_MANAGER
with the IP address or short host name of the node with the activeceph-mgr
instance -
ID
with the ID of the OSD listed in theosd
field -
USER
with the user name -
PASSWORD
with the user’s password
If you used a self-signed certificate, use the verify=False
option:
python > import requests > result = requests.get('https://CEPH_MANAGER:8080/api/osd/ID', auth=("USER", "PASSWORD"), verify=False) > print result.json()
$ python
>> import requests
>> result = requests.get('https://CEPH_MANAGER:8080/api/osd/ID', auth=("USER", "PASSWORD"), verify=False)
>> print result.json()
Web Browser
In the web browser, enter:
https://CEPH_MANAGER:8080/api/osd/ID
https://CEPH_MANAGER:8080/api/osd/ID
Replace:
-
CEPH_MANAGER
with the IP address or short host name of the node with the activeceph-mgr
instance -
ID
with the ID of the OSD listed in theosd
field
Enter the user name and password when prompted.
1.4.1.9. How Can I Determine What Processes Can Be Scheduled on an OSD? Copy linkLink copied to clipboard!
This section describes how to use the RESTful plug-in to view what processes, such as scrubbing or deep scrubbing, can be scheduled on an OSD.
The curl
Command
On the command line, use:
curl --silent --user USER 'https://CEPH_MANAGER:8080/api/osd/ID/command'
curl --silent --user USER 'https://CEPH_MANAGER:8080/api/osd/ID/command'
Replace:
-
USER
with the user name -
CEPH_MANAGER
with the IP address or short host name of the node with the activeceph-mgr
instance -
ID
with the ID of the OSD listed in theosd
field
Enter the user’s password when prompted.
If you used a self-signed certificate, use the --insecure
option:
curl --silent --insecure --user USER 'https://CEPH_MANAGER:8080/api/osd/ID/command'
curl --silent --insecure --user USER 'https://CEPH_MANAGER:8080/api/osd/ID/command'
Python
In the Python interpreter, enter:
python > import requests > result = requests.get('https://CEPH_MANAGER:8080/api/osd/ID/command', auth=("USER", "PASSWORD")) > print result.json()
$ python
>> import requests
>> result = requests.get('https://CEPH_MANAGER:8080/api/osd/ID/command', auth=("USER", "PASSWORD"))
>> print result.json()
Replace:
-
CEPH_MANAGER
with the IP address or short host name of the node with the activeceph-mgr
instance -
ID
with the ID of the OSD listed in theosd
field -
USER
with the user name -
PASSWORD
with the user’s password
If you used a self-signed certificate, use the verify=False
option:
python > import requests > result = requests.get('https://CEPH_MANAGER:8080/api/osd/ID/command', auth=("USER", "PASSWORD"), verify=False) > print result.json()
$ python
>> import requests
>> result = requests.get('https://CEPH_MANAGER:8080/api/osd/ID/command', auth=("USER", "PASSWORD"), verify=False)
>> print result.json()
Web Browser
In the web browser, enter:
https://CEPH_MANAGER:8080/api/osd/ID/command
https://CEPH_MANAGER:8080/api/osd/ID/command
Replace:
-
CEPH_MANAGER
with the IP address or short host name of the node with the activeceph-mgr
instance -
ID
with the ID of the OSD listed in theosd
field
Enter the user name and password when prompted.
1.4.1.10. How Can I View Information About Pools? Copy linkLink copied to clipboard!
This section describes how to view information about pools, such as:
- Flags
- Size
- Number of placement groups
The curl
Command
On the command line, use:
curl --silent --user USER 'https://CEPH_MANAGER:8080/api/pool'
curl --silent --user USER 'https://CEPH_MANAGER:8080/api/pool'
Replace:
-
USER
with the user name -
CEPH_MANAGER
with the IP address or short host name of the node with the activeceph-mgr
instance
Enter the user’s password when prompted.
If you used a self-signed certificate, use the --insecure
option:
curl --silent --insecure --user USER 'https://CEPH_MANAGER:8080/api/pool'
curl --silent --insecure --user USER 'https://CEPH_MANAGER:8080/api/pool'
Python
In the Python interpreter, enter:
python > import requests > result = requests.get('https://CEPH_MANAGER:8080/api/pool', auth=("USER", "PASSWORD")) > print result.json()
$ python
>> import requests
>> result = requests.get('https://CEPH_MANAGER:8080/api/pool', auth=("USER", "PASSWORD"))
>> print result.json()
Replace:
-
CEPH_MANAGER
with the IP address or short host name of the node with the activeceph-mgr
instance -
USER
with the user name -
PASSWORD
with the user’s password
If you used a self-signed certificate, use the verify=False
option:
python > import requests > result = requests.get('https://CEPH_MANAGER:8080/api/pool', auth=("USER", "PASSWORD"), verify=False) > print result.json()
$ python
>> import requests
>> result = requests.get('https://CEPH_MANAGER:8080/api/pool', auth=("USER", "PASSWORD"), verify=False)
>> print result.json()
Web Browser
In the web browser, enter:
https://CEPH_MANAGER:8080/api/pool
https://CEPH_MANAGER:8080/api/pool
Replace:
-
CEPH_MANAGER
with the IP address or short host name of the node with the activeceph-mgr
instance
Enter the user name and password when prompted.
1.4.1.11. How Can I View Information About a Particular Pool? Copy linkLink copied to clipboard!
This section describes how to view information about a particular pool, such as:
- Flags
- Size
- Number of placement groups
The curl
Command
On the command line, use:
curl --silent --user USER 'https://CEPH_MANAGER:8080/api/pool/ID'
curl --silent --user USER 'https://CEPH_MANAGER:8080/api/pool/ID'
Replace:
-
USER
with the user name -
CEPH_MANAGER
with the IP address or short host name of the node with the activeceph-mgr
instance -
ID
with the ID of the pool listed in thepool
field
Enter the user’s password when prompted.
If you used a self-signed certificate, use the --insecure
option:
curl --silent --insecure --user USER 'https://CEPH_MANAGER:8080/api/pool/ID'
curl --silent --insecure --user USER 'https://CEPH_MANAGER:8080/api/pool/ID'
Python
In the Python interpreter, enter:
python > import requests > result = requests.get('https://CEPH_MANAGER:8080/api/pool/ID', auth=("USER", "PASSWORD")) > print result.json()
$ python
>> import requests
>> result = requests.get('https://CEPH_MANAGER:8080/api/pool/ID', auth=("USER", "PASSWORD"))
>> print result.json()
Replace:
-
CEPH_MANAGER
with the IP address or short host name of the node with the activeceph-mgr
instance -
ID
with the ID of the pool listed in thepool
field -
USER
with the user name -
PASSWORD
with the user’s password
If you used a self-signed certificate, use the verify=False
option:
python > import requests > result = requests.get('https://CEPH_MANAGER:8080/api/pool/ID', auth=("USER", "PASSWORD"), verify=False) > print result.json()
$ python
>> import requests
>> result = requests.get('https://CEPH_MANAGER:8080/api/pool/ID', auth=("USER", "PASSWORD"), verify=False)
>> print result.json()
Web Browser
In the web browser, enter:
https://CEPH_MANAGER:8080/api/pool/ID
https://CEPH_MANAGER:8080/api/pool/ID
Replace:
-
CEPH_MANAGER
with the IP address or short host name of the node with the activeceph-mgr
instance -
ID
with the ID of the pool listed in thepool
field
Enter the user name and password when prompted.
1.4.1.12. How Can I View Information About Hosts? Copy linkLink copied to clipboard!
This section describes how to view information about hosts, such as:
- Host names
- Ceph daemons and their IDs
- Ceph version
The curl
Command
On the command line, use:
curl --silent --user USER 'https://CEPH_MANAGER:8080/api/host'
curl --silent --user USER 'https://CEPH_MANAGER:8080/api/host'
Replace:
-
USER
with the user name -
CEPH_MANAGER
with the IP address or short host name of the node with the activeceph-mgr
instance
Enter the user’s password when prompted.
If you used a self-signed certificate, use the --insecure
option:
curl --silent --insecure --user USER 'https://CEPH_MANAGER:8080/api/host'
curl --silent --insecure --user USER 'https://CEPH_MANAGER:8080/api/host'
Python
In the Python interpreter, enter:
python > import requests > result = requests.get('https://CEPH_MANAGER:8080/api/host', auth=("USER", "PASSWORD")) > print result.json()
$ python
>> import requests
>> result = requests.get('https://CEPH_MANAGER:8080/api/host', auth=("USER", "PASSWORD"))
>> print result.json()
Replace:
-
CEPH_MANAGER
with the IP address or short host name of the node with the activeceph-mgr
instance -
USER
with the user name -
PASSWORD
with the user’s password
If you used a self-signed certificate, use the verify=False
option:
python > import requests > result = requests.get('https://CEPH_MANAGER:8080/api/host', auth=("USER", "PASSWORD"), verify=False) > print result.json()
$ python
>> import requests
>> result = requests.get('https://CEPH_MANAGER:8080/api/host', auth=("USER", "PASSWORD"), verify=False)
>> print result.json()
Web Browser
In the web browser, enter:
https://CEPH_MANAGER:8080/api/host
https://CEPH_MANAGER:8080/api/host
Replace:
-
CEPH_MANAGER
with the IP address or short host name of the node with the activeceph-mgr
instance
Enter the user name and password when prompted.
1.4.1.13. How Can I View Information About a Particular Host? Copy linkLink copied to clipboard!
This section describes how to view information about a particular host, such as:
- Host names
- Ceph daemons and their IDs
- Ceph version
The curl
Command
On the command line, use:
curl --silent --user USER 'https://CEPH_MANAGER:8080/api/host/HOST_NAME'
curl --silent --user USER 'https://CEPH_MANAGER:8080/api/host/HOST_NAME'
Replace:
-
USER
with the user name -
CEPH_MANAGER
with the IP address or short host name of the node with the activeceph-mgr
instance -
HOST_NAME
with the host name of the host listed in thehostname
field
Enter the user’s password when prompted.
If you used a self-signed certificate, use the --insecure
option:
curl --silent --insecure --user USER 'https://CEPH_MANAGER:8080/api/host/HOST_NAME'
curl --silent --insecure --user USER 'https://CEPH_MANAGER:8080/api/host/HOST_NAME'
Python
In the Python interpreter, enter:
python > import requests > result = requests.get('https://CEPH_MANAGER:8080/api/host/HOST_NAME', auth=("USER", "PASSWORD")) > print result.json()
$ python
>> import requests
>> result = requests.get('https://CEPH_MANAGER:8080/api/host/HOST_NAME', auth=("USER", "PASSWORD"))
>> print result.json()
Replace:
-
CEPH_MANAGER
with the IP address or short host name of the node with the activeceph-mgr
instance -
HOST_NAME
with the host name of the host listed in thehostname
field -
USER
with the user name -
PASSWORD
with the user’s password
If you used a self-signed certificate, use the verify=False
option:
python > import requests > result = requests.get('https://CEPH_MANAGER:8080/api/host/HOST_NAME', auth=("USER", "PASSWORD"), verify=False) > print result.json()
$ python
>> import requests
>> result = requests.get('https://CEPH_MANAGER:8080/api/host/HOST_NAME', auth=("USER", "PASSWORD"), verify=False)
>> print result.json()
Web Browser
In the web browser, enter:
https://CEPH_MANAGER:8080/api/host/HOST_NAME
https://CEPH_MANAGER:8080/api/host/HOST_NAME
Replace:
-
CEPH_MANAGER
with the IP address or short host name of the node with the activeceph-mgr
instance -
HOST_NAME
with the host name of the host listed in thehostname
field
Enter the user name and password when prompted.
1.4.2. Changing Configuration Copy linkLink copied to clipboard!
This section describes how to use the Ceph API to change OSD configuration options, the state of an OSD, and information about pools.
1.4.2.1. How Can I Change OSD Configuration Options? Copy linkLink copied to clipboard!
This section describes how to use the RESTful plug-in to change OSD configuration options.
The curl
Command
On the command line, use:
echo -En '{"OPTION": VALUE}' | curl --request PATCH --data @- --silent --user USER 'https://CEPH_MANAGER:8080/api/osd/flags'
echo -En '{"OPTION": VALUE}' | curl --request PATCH --data @- --silent --user USER 'https://CEPH_MANAGER:8080/api/osd/flags'
Replace:
-
OPTION
with the option to modify;pause
,noup
,nodown
,noout
,noin
,nobackfill
,norecover
,noscrub
,nodeep-scrub
-
VALUE
withtrue
orfalse
-
USER
with the user name -
CEPH_MANAGER
with the IP address or short host name of the node with the activeceph-mgr
instance
Enter the user’s password when prompted.
If you used 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/osd/flags'
echo -En '{"OPTION": VALUE}' | curl --request PATCH --data @- --silent --insecure --user USER 'https://CEPH_MANAGER:8080/api/osd/flags'
Python
In the Python interpreter, enter:
python > import requests > result = requests.patch('https://CEPH_MANAGER:8080/api/osd/flags', json={"OPTION": VALUE}, auth=("USER", "PASSWORD")) > print result.json()
$ python
>> import requests
>> result = requests.patch('https://CEPH_MANAGER:8080/api/osd/flags', json={"OPTION": VALUE}, auth=("USER", "PASSWORD"))
>> print result.json()
Replace:
-
CEPH_MANAGER
with the IP address or short host name of the node with the activeceph-mgr
instance -
OPTION
with the option to modify;pause
,noup
,nodown
,noout
,noin
,nobackfill
,norecover
,noscrub
,nodeep-scrub
-
VALUE
withTrue
orFalse
-
USER
with the user name -
PASSWORD
with the user’s password
If you used a self-signed certificate, use the verify=False
option:
python > import requests > result = requests.patch('https://CEPH_MANAGER:8080/api/osd/flags', json={"OPTION": VALUE}, auth=("USER", "PASSWORD"), verify=False) > print result.json()
$ python
>> import requests
>> result = requests.patch('https://CEPH_MANAGER:8080/api/osd/flags', json={"OPTION": VALUE}, auth=("USER", "PASSWORD"), verify=False)
>> print result.json()
1.4.2.2. How Can I Change the OSD State? Copy linkLink copied to clipboard!
This section describes how to use the RESTful plug-in to change the state of an OSD.
The curl
Command
On the command line, use:
echo -En '{"STATE": VALUE}' | curl --request PATCH --data @- --silent --user USER 'https://CEPH_MANAGER:8080/api/osd/ID'
echo -En '{"STATE": VALUE}' | curl --request PATCH --data @- --silent --user USER 'https://CEPH_MANAGER:8080/api/osd/ID'
Replace:
-
STATE
with the state to change (in
orup
) -
VALUE
withtrue
orfalse
-
USER
with the user name -
CEPH_MANAGER
with the IP address or short host name of the node with the activeceph-mgr
instance -
ID
with the ID of the OSD listed in theosd
field
Enter the user’s password when prompted.
If you used a self-signed certificate, use the --insecure
option:
echo -En '{"STATE": VALUE}' | curl --request PATCH --data @- --silent --insecure --user USER 'https://CEPH_MANAGER:8080/api/osd/ID'
echo -En '{"STATE": VALUE}' | curl --request PATCH --data @- --silent --insecure --user USER 'https://CEPH_MANAGER:8080/api/osd/ID'
Python
In the Python interpreter, enter:
python > import requests > result = requests.patch('https://CEPH_MANAGER:8080/api/osd/ID', json={"STATE": VALUE}, auth=("USER", "PASSWORD")) > print result.json()
$ python
>> import requests
>> result = requests.patch('https://CEPH_MANAGER:8080/api/osd/ID', json={"STATE": VALUE}, auth=("USER", "PASSWORD"))
>> print result.json()
Replace:
-
CEPH_MANAGER
with the IP address or short host name of the node with the activeceph-mgr
instance -
ID
with the ID of the OSD listed in theosd
field -
STATE
with the state to change (in
orup
) -
VALUE
withTrue
orFalse
-
USER
with the user name -
PASSWORD
with the user’s password
If you used a self-signed certificate, use the verify=False
option:
python > import requests > result = requests.patch('https://CEPH_MANAGER:8080/api/osd/ID', json={"STATE": VALUE}, auth=("USER", "PASSWORD"), verify=False) > print result.json()
$ python
>> import requests
>> result = requests.patch('https://CEPH_MANAGER:8080/api/osd/ID', json={"STATE": VALUE}, auth=("USER", "PASSWORD"), verify=False)
>> print result.json()
1.4.2.3. How Can I Reweight an OSD? Copy linkLink copied to clipboard!
This section describes how to change the weight of an OSD.
The curl
Command
On the command line, use:
echo -En '{"reweight": VALUE}' | curl --request PATCH --data @- --silent --user USER 'https://CEPH_MANAGER:8080/api/osd/ID'
echo -En '{"reweight": VALUE}' | curl --request PATCH --data @- --silent --user USER 'https://CEPH_MANAGER:8080/api/osd/ID'
Replace:
-
VALUE
with the new weight -
USER
with the user name -
CEPH_MANAGER
with the IP address or short host name of the node with the activeceph-mgr
instance -
ID
with the ID of the OSD listed in theosd
field
Enter the user’s password when prompted.
If you used a self-signed certificate, use the --insecure
option:
echo -En '{"reweight": VALUE}' | curl --request PATCH --data @- --silent --insecure --user USER 'https://CEPH_MANAGER:8080/api/osd/ID'
echo -En '{"reweight": VALUE}' | curl --request PATCH --data @- --silent --insecure --user USER 'https://CEPH_MANAGER:8080/api/osd/ID'
Python
In the Python interpreter, enter:
python > import requests > result = requests.patch('https://CEPH_MANAGER:8080/osd/ID', json={"reweight": VALUE}, auth=("USER", "PASSWORD")) > print result.json()
$ python
>> import requests
>> result = requests.patch('https://CEPH_MANAGER:8080/osd/ID', json={"reweight": VALUE}, auth=("USER", "PASSWORD"))
>> print result.json()
Replace:
-
CEPH_MANAGER
with the IP address or short host name of the node with the activeceph-mgr
instance -
ID
with the ID of the OSD listed in theosd
field -
VALUE
with the new weight -
USER
with the user name -
PASSWORD
with the user’s password
If you used a self-signed certificate, use the verify=False
option:
python > import requests > result = requests.patch('https://CEPH_MANAGER:8080/api/osd/ID', json={"reweight": VALUE}, auth=("USER", "PASSWORD"), verify=False) > print result.json()
$ python
>> import requests
>> result = requests.patch('https://CEPH_MANAGER:8080/api/osd/ID', json={"reweight": VALUE}, auth=("USER", "PASSWORD"), verify=False)
>> print result.json()
1.4.2.4. How Can I Change Information for a Pool? Copy linkLink copied to clipboard!
This section describes how to use the RESTful plug-in to change information for a particular pool.
The curl
Command
On the command line, use:
echo -En '{"OPTION": VALUE}' | curl --request PATCH --data @- --silent --user USER 'https://CEPH_MANAGER:8080/api/pool/ID'
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 user name -
CEPH_MANAGER
with the IP address or short host name of the node with the activeceph-mgr
instance -
ID
with the ID of the pool listed in thepool
field
Enter the user’s password when prompted.
If you used 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'
echo -En '{"OPTION": VALUE}' | curl --request PATCH --data @- --silent --insecure --user USER 'https://CEPH_MANAGER:8080/api/pool/ID'
Python
In the Python interpreter, enter:
python > import requests > result = requests.patch('https://CEPH_MANAGER:8080/api/pool/ID', json={"OPTION": VALUE}, auth=("USER, "PASSWORD")) > print result.json()
$ 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 host name of the node with the activeceph-mgr
instance -
ID
with the ID of the pool listed in thepool
field -
OPTION
with the option to modify -
VALUE
with the new value of the option -
USER
with the user name -
PASSWORD
with the user’s password
If you used a self-signed certificate, use the verify=False
option:
python > import requests > result = requests.patch('https://CEPH_MANAGER:8080/api/pool/ID', json={"OPTION": VALUE}, auth=("USER, "PASSWORD"), verify=False) > print result.json()
$ python
>> import requests
>> result = requests.patch('https://CEPH_MANAGER:8080/api/pool/ID', json={"OPTION": VALUE}, auth=("USER, "PASSWORD"), verify=False)
>> print result.json()
1.4.3. Administering the Cluster Copy linkLink copied to clipboard!
This section describes how to use the Ceph API to initialize scrubbing or deep scrubbing on an OSD, create a pool or remove data from a pool, remove requests, or create a request.
1.4.3.1. How Can I Run a Scheduled Process on an OSD? Copy linkLink copied to clipboard!
This section describes how to use the RESTful API to run scheduled processes, such as scrubbing or deep scrubbing, on an OSD.
The curl
Command
On the command line, use:
echo -En '{"command": "COMMAND"}' | curl --request POST --data @- --silent --user USER 'https://CEPH_MANAGER:8080/api/osd/ID/command'
echo -En '{"command": "COMMAND"}' | curl --request POST --data @- --silent --user USER 'https://CEPH_MANAGER:8080/api/osd/ID/command'
Replace:
-
COMMAND
with the process (scrub
,deep-scrub
, orrepair
) you want to start. Verify it the process is supported on the OSD. See Section 1.4.1.9, “How Can I Determine What Processes Can Be Scheduled on an OSD?” for details. -
USER
with the user name -
CEPH_MANAGER
with the IP address or short host name of the node with the activeceph-mgr
instance -
ID
with the ID of the OSD listed in theosd
field
Enter the user’s password when prompted.
If you used a self-signed certificate, use the --insecure
option:
echo -En '{"command": "COMMAND"}' | curl --request POST --data @- --silent --insecure --user USER 'https://CEPH_MANAGER:8080/api/osd/ID/command'
echo -En '{"command": "COMMAND"}' | curl --request POST --data @- --silent --insecure --user USER 'https://CEPH_MANAGER:8080/api/osd/ID/command'
Python
In the Python interpreter, enter:
python > import requests > result = requests.post('https://CEPH_MANAGER:8080/api/osd/ID/command', json={"command": "COMMAND"}, auth=("USER", "PASSWORD")) > print result.json()
$ python
>> import requests
>> result = requests.post('https://CEPH_MANAGER:8080/api/osd/ID/command', json={"command": "COMMAND"}, auth=("USER", "PASSWORD"))
>> print result.json()
Replace:
-
CEPH_MANAGER
with the IP address or short host name of the node with the activeceph-mgr
instance -
ID
with the ID of the OSD listed in theosd
field -
COMMAND
with the process (scrub
,deep-scrub
, orrepair
) you want to start. Verify it the process is supported on the OSD. See Section 1.4.1.9, “How Can I Determine What Processes Can Be Scheduled on an OSD?” for details. -
USER
with the user name -
PASSWORD
with the user’s password
If you used a self-signed certificate, use the verify=False
option:
python > import requests > result = requests.post('https://CEPH_MANAGER:8080/api/osd/ID/command', json={"command": "COMMAND"}, auth=("USER", "PASSWORD"), verify=False) > print result.json()
$ python
>> import requests
>> result = requests.post('https://CEPH_MANAGER:8080/api/osd/ID/command', json={"command": "COMMAND"}, auth=("USER", "PASSWORD"), verify=False)
>> print result.json()
1.4.3.2. How Can I Create a New Pool? Copy linkLink copied to clipboard!
This section describes how to use the RESTful plug-in to create a new pool.
The curl
Command
On the command line, use:
echo -En '{"name": "NAME", "pg_num": NUMBER}' | curl --request POST --data @- --silent --user USER 'https://CEPH_MANAGER:8080/api/pool'
echo -En '{"name": "NAME", "pg_num": NUMBER}' | curl --request POST --data @- --silent --user USER 'https://CEPH_MANAGER:8080/api/pool'
Replace:
-
NAME
with the name of the new pool -
NUMBER
with the number of the placement groups -
USER
with the user name -
CEPH_MANAGER
with the IP address or short host name of the node with the activeceph-mgr
instance
Enter the user’s password when prompted.
If you used a self-signed certificate, use the --insecure
option:
echo -En '{"name": "NAME", "pg_num": NUMBER}' | curl --request POST --data @- --silent --insecure --user USER 'https://CEPH_MANAGER:8080/api/pool'
echo -En '{"name": "NAME", "pg_num": NUMBER}' | curl --request POST --data @- --silent --insecure --user USER 'https://CEPH_MANAGER:8080/api/pool'
Python
In the Python interpreter, enter:
python > import requests > result = requests.post('https://CEPH_MANAGER:8080/api/pool', json={"name": "NAME", "pg_num": NUMBER}, auth=("USER", "PASSWORD")) > print result.json()
$ python
>> import requests
>> result = requests.post('https://CEPH_MANAGER:8080/api/pool', json={"name": "NAME", "pg_num": NUMBER}, auth=("USER", "PASSWORD"))
>> print result.json()
Replace:
-
CEPH_MANAGER
with the IP address or short host name of the node with the activeceph-mgr
instance -
NAME
with the name of the new pool -
NUMBER
with the number of the placement groups -
USER
with the user name -
PASSWORD
with the user’s password
If you used a self-signed certificate, use the verify=False
option:
python > import requests > result = requests.post('https://CEPH_MANAGER:8080/api/pool', json={"name": "NAME", "pg_num": NUMBER}, auth=("USER", "PASSWORD"), verify=False) > print result.json()
$ python
>> import requests
>> result = requests.post('https://CEPH_MANAGER:8080/api/pool', json={"name": "NAME", "pg_num": NUMBER}, auth=("USER", "PASSWORD"), verify=False)
>> print result.json()
1.4.3.3. How Can I Remove Pools? Copy linkLink copied to clipboard!
This section describes how to use the RESTful plug-in to remove a pool.
This request is by default forbidden. To allow it, add the following parameter to the Ceph configuration guide.
mon_allow_pool_delete = true
mon_allow_pool_delete = true
The curl
Command
On the command line, use:
curl --request DELETE --silent --user USER 'https://CEPH_MANAGER:8080/api/pool/ID'
curl --request DELETE --silent --user USER 'https://CEPH_MANAGER:8080/api/pool/ID'
Replace:
-
USER
with the user name -
CEPH_MANAGER
with the IP address or short host name of the node with the activeceph-mgr
instance -
ID
with the ID of the pool listed in thepool
field
Enter the user’s password when prompted.
If you used a self-signed certificate, use the --insecure
option:
curl --request DELETE --silent --insecure --user USER 'https://CEPH_MANAGER:8080/api/pool/ID'
curl --request DELETE --silent --insecure --user USER 'https://CEPH_MANAGER:8080/api/pool/ID'
Python
In the Python interpreter, enter:
python > import requests > result = requests.delete('https://CEPH_MANAGER:8080/api/pool/ID', auth=("USER", "PASSWORD")) > print result.json()
$ python
>> import requests
>> result = requests.delete('https://CEPH_MANAGER:8080/api/pool/ID', auth=("USER", "PASSWORD"))
>> print result.json()
Replace:
-
CEPH_MANAGER
with the IP address or short host name of the node with the activeceph-mgr
instance -
ID
with the ID of the pool listed in thepool
field -
USER
with the user name -
PASSWORD
with the user’s password
If you used a self-signed certificate, use the verify=False
option:
python > import requests > result = requests.delete('https://CEPH_MANAGER:8080/api/pool/ID', auth=("USER", "PASSWORD"), verify=False) > print result.json()
$ python
>> import requests
>> result = requests.delete('https://CEPH_MANAGER:8080/api/pool/ID', auth=("USER", "PASSWORD"), verify=False)
>> print result.json()