ceph-rest-api 的文档
dmsimard
我了解到 Ceph 有一个 REST API,并且我 尝试 使用它。
我说文档不足,现在我收回这句话,我没有注意到 API 文档已经内置在应用程序中。我提交了一个拉取请求,让文档对此更明确一些:https://github.com/ceph/ceph/pull/1026
这是目前 API 文档的样子
| 可能的命令 | 方法 | 描述 |
|---|---|---|
| auth/add?entity=entity( | ||
| aps( | PUT | 添加 auth 信息,用于 |
| auth/caps?entity=entity( | ||
| aps( | PUT | 更新权限,用于 |
| auth/del?entity=entity( | PUT | 删除所有权限,用于 |
| auth/export?entity={entity( | GET | 为请求的实体写入密钥环,如果未给定实体则写入主密钥环 |
| auth/get?entity=entity( | GET | 写入包含请求密钥的密钥环文件 |
| auth/get-key?entity=entity( | GET | 显示请求的密钥 |
| auth/get-or-create?entity=entity(<string | ||
| >)&caps={caps( | PUT | 添加 auth 信息,用于 |
| auth/get-or-create-key?entity=entity(<st | ||
| ring>)&caps={caps( | ||
| [ | PUT | 获取或添加密钥,用于 |
| auth/import | PUT | auth 导入:从 -i 读取密钥环文件 |
| auth/list | GET | 列出认证状态 |
| auth/print-key?entity=entity( | GET | 显示请求的密钥 |
| auth/print_key?entity=entity( | GET | 显示请求的密钥 |
| tell/ | ||
| PUT | OSD 基准测试:写入 | |
| compact | PUT | 导致监视器的 leveldb 存储进行压缩 |
| config-key/del?key=key( | PUT | 删除 |
| config-key/exists?key=key( | GET | 检查 |
| config-key/get?key=key( | GET | 获取 |
| config-key/list | GET | 列出密钥 |
| config-key/put?key=key( | ||
| l( | PUT | 放入 |
| tell/<osdid-or- | ||
| pgid>/cpu_profiler?arg=arg(status | flush) | PUT |
| tell/ | ||
| _wq?delay=delay(<int[0-]>) | PUT | 将 osd_recovery_delay_start 设置为 |
| tell/ | ||
| filename=filename( | GET | 将缺失对象转储到指定文件 |
| df?detail={detail} | GET | 显示集群可用空间统计信息 |
| tell/<osdid-or- | ||
| pgid>/dump_pg_recovery_stats | GET | 转储 pg 恢复统计信息 |
| tell/ | PUT | 刷新 pg 统计信息 |
| fsid | GET | 显示集群 FSID/UUID |
| health?detail={detail} | GET | 显示集群健康状况 |
| tell/ | ||
| d(dump | start_profiler | stop_profiler |
| ase | stats) | PUT |
| heap?heapcmd=heapcmd(dump | start_profiler | |
| stop_profiler | 发布 | stats) |
| tell/ | ||
| _args=injected_args( | ||
| [ | PUT | 将配置参数注入正在运行的 OSD |
| injectargs?injected_args=injected_args(< | ||
| string>) [ | PUT | 将配置参数注入监视器 |
| tell/ | ||
| ={offset( | GET | 列出此 pg 上缺失的对象,可能从 JSON 中给定的偏移量开始 |
| tell/ | ||
| ={offset( | PUT | 列出此 pg 上缺失的对象,可能从 JSON 中给定的偏移量开始 |
| log?logtext=logtext( | ||
| [ | PUT | 将提供的文本记录到监视器日志中 |
| tell/<osdid-or- | ||
| pgid>/mark_unfound_lost?mulcmd=revert | PUT | 将此 pg 中所有未找到的对象标记为丢失,如果存在先前版本则删除或还原到该版本 |
| tell/ | ||
| evert?mulcmd=revert | PUT | 将此 pg 中所有未找到的对象标记为丢失,如果存在先前版本则删除或还原到该版本 |
| mds/add_data_pool?pool=pool( | PUT | 添加数据池 |
| mds/cluster_down | PUT | 关闭 MDS 集群 |
| mds/cluster_up | PUT | 启动 MDS 集群 |
| mds/compat/rm_compat?feature=feature(<in | ||
| t[0-]>) | PUT | 删除兼容功能 |
| mds/compat/rm_incompat?feature=feature(< | ||
| int[0-]>) | PUT | 删除不兼容功能 |
| mds/compat/show | GET | 显示 mds 兼容性设置 |
| mds/deactivate?who=who( | PUT | 停止 mds |
| mds/dump?epoch={epoch(<int[0-]>)} | GET | 转储信息,可选地从 epoch |
| mds/fail?who=who( | PUT | 强制 mds 进入失败状态 |
| mds/getmap?epoch={epoch(<int[0-]>)} | GET | 获取 MDS 映射,可选地从 epoch |
| mds/newfs?metadata=metadata(<int[0-]>)&d | ||
| ata=data(<int[0-]>)&sure={--yes-i | ||
| -really-mean-it} | PUT | 使用池创建新文件系统 |
| mds/remove_data_pool?pool=pool( | PUT | 移除数据池 |
| mds/rm?gid=gid(<int[0-]>)&who=who(<name | ||
| (type.id)>) | PUT | 移除非活跃 mds |
| mds/rmfailed?who=who(<int[0-]>) | PUT | 移除失败的 mds |
| mds/set?key=allow_new_snaps&sure={sure(< | ||
| string>)} | 未知 | 设置 |
| mds/set_max_mds?maxmds=maxmds(<int[0-]>) | PUT | 设置最大 MDS 索引 |
| mds/set_state?gid=gid(<int[0-]>)&state=s | ||
| tate(<int[0-20]>) | PUT | 设置 mds 状态,用于 |
| mds/setmap?epoch=epoch(<int[0-]>) | PUT | 设置 mds 映射;必须提供正确的 epoch 号 |
| mds/stat | GET | 显示 MDS 状态 |
| mds/stop?who=who( | PUT | 停止 mds |
| mds/tell?who=who( | ||
| ring>) [ | PUT | 向特定的 mds 发送命令 |
| mds/unset?key=allow_new_snaps&sure={sure | ||
| ( | 未知 | 取消设置 |
| mon/add?name=name( | ||
| Paddr[:port]>) | PUT | 添加名为 |
| mon/dump?epoch={epoch(<int[0-]>)} | GET | 转储格式化的 monmap(可选地从 epoch) |
| mon/getmap?epoch={epoch(<int[0-]>)} | GET | 获取 monmap |
| mon/remove?name=name( | PUT | 移除名为 |
| 的监视器 | GET | mon/stat |
| 总结监视器状态 | GET | mon_status |
| 报告监视器仲裁状态 | ||
| d | osd/blacklist?blacklistop=blacklistop(ad | |
| )&expire={ex | PUT | pire(<float[0.0-]>)} |
| 从黑名单中 | GET | osd/blacklist/ls |
| 显示黑名单客户端 | PUT | osd/create?uuid={uuid( |
| 创建新 osd(带可选 UUID) | osd/crush/add?id=id(<osdname (id) | |
| osd.id | ||
| >)&weight=weight(<float[0.0-]>)&args=arg | ||
| s(<string(goodchars [A-Za-z0-9-_.=])>) | PUT | [<string(goodchars [A-Za-z0-9-_.=])>...] |
| 和位置 | ||
| osd/crush/add- | ||
| bucket?name=name(<string(goodchars | PUT | [A-Za-z0-9-_.])>)&type=type( |
| 类型为 | ||
| osd/crush/create-or-move?id=id(<osdname | (id | |
| osd.id)>)&weight=weight(<float[0.0-] | ||
| >)&args=args(<string(goodchars | ||
| [A-Za-z0-9-_.=])>) [<string(goodchars | PUT | [A-Za-z0-9-_.=])>...] |
| 在/到位置创建或移动现有条目 | GET | osd/crush/dump |
| 转储 crush 映射 | ||
| )&args= | ||
| >)&args=args(<string(goodchars | ||
| [A-Za-z0-9-_.=])>) [<string(goodchars | PUT | args(<string(goodchars |
| 在位置下 | ||
| osd/crush/move?name=name(<string(goodcha | ||
| rs [A-Za-z0-9-_.])>)&args=args(<string(g | ||
| s(<string(goodchars [A-Za-z0-9-_.=])>) | PUT | oodchars [A-Za-z0-9-_.=])>) |
| 到位置 | ||
| osd/crush/remove?name=name(<string(goodc | ||
| hars [A-Za-z0-9-_.])>)&ancestor={ancesto | PUT | r(<string(goodchars [A-Za-z0-9-_.])>)} |
| (所有地方,或仅在 | ||
| osd/crush/reweight?name=name(<string(goo | ||
| dchars [A-Za-z0-9-_.])>)&weight=weight(< | PUT | float[0.0-]>) |
| osd/crush/rm?name=name(<string(goodchars | ||
| [A-Za-z0-9-_.])>)&ancestor={ancestor(<st | ||
| ring(goodchars [A-Za-z0-9-_.])>)} | PUT | r(<string(goodchars [A-Za-z0-9-_.])>)} |
| osd/crush/rule/create- | ||
| simple?name=name(<string(goodchars [A-Za | ||
| -z0-9-_.])>)&root=root(<string(goodchars | ||
| [A-Za-z0-9-_.])>)&type=type(<string(good | ||
| chars [A-Za-z0-9-_.])>) | PUT | 在 |
| osd/crush/rule/dump | GET | 转储 crush 规则 |
| osd/crush/rule/list | GET | 列出 crush 规则 |
| osd/crush/rule/ls | GET | 列出 crush 规则 |
| osd/crush/rule/rm?name=name(<string(good | ||
| chars [A-Za-z0-9-_.])>) | PUT | 移除 crush 规则 |
| osd/crush/set | PUT | 从输入文件设置 crush 映射 |
| osd/crush/set?id=id(<osdname (id | osd/crush/add?id=id(<osdname (id) | |
| osd.id | ||
| >)&weight=weight(<float[0.0-]>)&args=arg | ||
| s(<string(goodchars [A-Za-z0-9-_.=])>) | PUT | 更新 crushmap 位置和权重,用于 |
| osd/crush/tunables?profile=profile(legac | ||
| y | argonaut | bobtail |
| osd/crush/unlink?name=name(<string(goodc | ||
| osd/crush/remove?name=name(<string(goodc | ||
| hars [A-Za-z0-9-_.])>)&ancestor={ancesto | PUT | 取消链接 |
| osd/deep-scrub?who=who( | PUT | 在 osd 上启动深度清理 |
| osd/down?ids=ids( | PUT | 设置 osd(s) |
| osd/dump?epoch={epoch(<int[0-]>)} | GET | 打印 OSD 映射摘要 |
| osd/find?id=id(<int[0-]>) | GET | 在 CRUSH 映射中查找 osd |
| osd/getcrushmap?epoch={epoch(<int[0-]>)} | GET | 获取 CRUSH 映射 |
| osd/getmap?epoch={epoch(<int[0-]>)} | GET | 获取 OSD 映射 |
| osd/getmaxosd | GET | 显示最大 OSD id |
| osd/in?ids=ids( | PUT | 设置 osd(s) |
| osd/lost?id=id(<int[0-]>)&sure={--yes-i | ||
| -really-mean-it} | PUT | 将 osd 标记为永久丢失。如果没有更多副本,这将销毁数据,请小心 |
| osd/ls?epoch={epoch(<int[0-]>)} | GET | 显示所有 OSD id |
| osd/lspools?auid={auid( | GET | 列出池 |
| osd/map?pool=pool( | ||
| ect( | GET | 为 |
| 查找 pg | PUT | 设置 osd(s) |
| ...] 下线 | PUT | osd/pause |
| 暂停 osd | GET | osd/perf |
| 打印 OSD 性能摘要统计信息 | ||
| )&pg | ||
| _num=pg_num(<int[0-]>)&pgp_num={pgp_num( | ||
| <int[0-]>)}&properties={properties(<stri | ||
| ng(goodchars [A-Za-z0-9-_.=])>) | ||
| [<string(goodchars | PUT | [A-Za-z0-9-_.=])>...]} |
| 创建池 | ||
| )&po | ||
| )}&sure={--yes-i | PUT | -really-really-mean-it} |
| 删除池 | ||
| )&var=v | ar(size | min_size |
| crash_replay_interval | g_num | pgp_num |
| crush_ruleset) | ||
| )&sn | PUT | ap=snap( |
| 创建快照 | ||
| osd/pool/rename?srcpool=srcpool(<poolnam | PUT | e>)&destpool=destpool( |
| 重命名 | ||
| )&sn | PUT | osd/pool/rmsnap?pool=pool( |
| 移除快照 | ||
| )&var=v | ar(size | min_size |
| crash_replay_interval | g_num | osd/pool/set?pool=pool( |
| crush_ruleset | PUT | val=val( |
| 设置池参数 到 | ||
| osd/pool/set-quota?pool=pool( | &field=field(max_objects | |
| max_bytes)&val= | PUT | val( |
| 设置池的对象或字节限制 | GET | osd/pool/stats?name={name( |
| 获取所有池或指定池的统计信息 | PUT | osd/repair?who=who( |
| 在 osd 上启动修复 | ||
| osd/reweight?id=id(<int[0-]>)&weight=wei | PUT | ght(<float[0.0-1.0]>) |
| 重新加权 osd 到 0.0 < | ||
| osd/reweight-by- | PUT | utilization?oload={oload(<int[100-]>)} |
| 根据利用率重新加权 OSDs [考虑的过载百分比,默认为 120] | PUT | osd/rm?ids=ids( |
| 移除 osd(s) | PUT | osd/scrub?who=who( |
| 在 osd 上启动清理 | osd/set?key=key(pause | noup |
| nodown | noin | nobackfill |
| norecover | PUT | 设置 |
| nodeep-scrub) | PUT | 从输入文件设置 crush 映射 |
| osd/setcrushmap | PUT | osd/setmaxosd?newmax=newmax(<int[0-]>) |
| 设置新的最大 osd 值 | GET | 打印 OSD 映射摘要 |
| osd/stat | ||
| ]>) | PUT | osd/thrash?num_epochs=num_epochs(<int[0- |
| 对 OSDs 进行混乱操作,持续 <num_epochs> | ||
| )&tierp | PUT | ool=tierpool( |
| 添加到基本池 | ||
| osd/tier/cache-mode?pool=pool( | 写回 | )&mode=mode(none |
| invalidate+fo | rward | PUT |
| readonly) | ||
| )&ti | PUT | erpool=tierpool( |
| osd/tier/remove- | ||
| overlay?pool=pool( | PUT | 移除基本池的覆盖池 |
| osd/tier/set-overlay?pool=pool(<poolname | ||
| >)&overlaypool=overlaypool( | PUT | 设置基本池的覆盖池 |
| osd/tree?epoch={epoch(<int[0-]>)} | GET | 打印 OSD 树 |
| osd/unpause | PUT | 取消暂停 osd |
| osd/unset?key=key(pause | osd/set?key=key(pause | noup |
| t | nodown | noin |
| norecover | PUT | 取消设置 |
| pg/debug?debugop=debugop(unfound_objects | ||
| _exist | degraded_pgs_exist) | GET |
| pg/deep-scrub?pgid=pgid( | PUT | 启动深度清理,用于 |
| pg/dump?dumpcontents={dumpcontents(all | s | |
| ummary | sum | delta |
| f) [all | summary | sum |
| pgs_brief...]} | GET | 显示 pg 映射的人类可读版本(只有 'all' 对 plain 有效) |
| pg/dump_json?dumpcontents={dumpcontents( | ||
| all | summary | sum |
| [all | summary | sum |
| pg/dump_pools_json | GET | 仅以 json 格式显示 pg 池信息 |
| pg/dump_stuck?stuckops={stuckops(inactiv | ||
| e | unclean | stale) [inactive |
| ...]}&threshold={threshold( | GET | 显示有关卡住的 pg 的信息 |
| pg/force_create_pg?pgid=pgid( | PUT | 强制创建 pg |
| pg/getmap | GET | 获取二进制 pg 映射到 -o/stdout |
| pg/map?pgid=pgid( | GET | 显示 pg 到 osds 的映射 |
| pg/repair?pgid=pgid( | PUT | 启动修复,用于 |
| pg/scrub?pgid=pgid( | PUT | 启动清理,用于 |
| pg/send_pg_creates | PUT | 触发 pg 创建 |
| pg/set_full_ratio?ratio=ratio(<float[0.0 | ||
| -1.0]>) | PUT | 设置 pg 被视为已满的比例 |
| pg/set_nearfull_ratio?ratio=ratio(<float | ||
| [0.0-1.0]>) | PUT | 设置 pg 被视为接近已满的比例 |
| pg/stat | GET | 显示放置组状态。 |
| tell/ | GET | 显示特定 pg 的详细信息 |
| tell/ | GET | 显示特定 pg 的详细信息 |
| quorum?quorumcmd=quorumcmd(enter | exit) | PUT |
| quorum_status | GET | 报告监视器仲裁状态 |
| report?tags={tags( | ||
| [ | GET | 报告集群的完整状态,可选标题标签字符串 |
| tell/<osdid-or- | ||
| pgid>/reset_pg_recovery_stats | PUT | 重置 pg 恢复统计信息 |
| scrub | PUT | 清理监视器存储 |
| status | GET | 显示集群状态 |
| sync/force?validate1={--yes-i-really- | ||
| mean-it}&validate2={--i-know-what-i-am- | ||
| doing} | PUT | 强制同步并清除监视器存储 |
| tell?target=target(<name | ||
| (type.id)>)&args=args( | ||
| [ | PUT | 向特定守护进程发送命令 |
| tell/ | GET | 报告 OSD 版本 |
享受!