2.3.3. 如何删除池?

本节介绍如何使用 RESTful 插件删除池。

此请求默认为禁止。若要允许,可添加下列参数到 Ceph 配置指南中:

mon_allow_pool_delete = true
curl 命令

在命令行中使用:

curl --request DELETE --silent --user <user> 'https://<ceph-mgr>:8003/pool/<id>'

替换:

  • <user> with user name
  • <ceph-mgr>,带有活跃的 ceph-mgr 实例,节点的 IP 地址或短主机名
  • <id> 带有在 pool 字段中列出的池的 ID

出现提示时,输入用户的密码。

如果您使用自签名证书,请使用 --insecure 选项:

curl --request DELETE --silent --insecure --user <user> 'https://<ceph-mgr>:8003/pool/<id>'
Python

在 Python 解释器中输入:

$ python
>> import requests
>> result = requests.delete('https://<ceph-mgr>:8003/pool/<id>', auth=("<user>", "<password>"))
>> print result.json()

替换:

  • <ceph-mgr>,带有活跃的 ceph-mgr 实例,节点的 IP 地址或短主机名
  • <id> 带有在 pool 字段中列出的池的 ID
  • <user> with user name
  • <password> 和用户的密码

如果您使用自签名证书,请使用 verify=False 选项:

$ python
>> import requests
>> result = requests.delete('https://<ceph-mgr>:8003/pool/<id>', auth=("<user>", "<password>"), verify=False)
>> print result.json()