Friday, January 3, 2014

Documentation for ceph-rest-api [feedly]

Documentation for ceph-rest-api
http://feedly.com/e/6TTrUIxp

I learned that there was a Ceph REST API and I experimented with it a bit.

I said the documentation was lacking and I take that back, I didn't catch on that the API documentation was built into the application. I opened a pull request to make the documentation a bit more explicit about that: https://github.com/ceph/ceph/pull/1026

Here's what the API documentation currently looks like:
http://apiserver:5000/api/v0.1/mon

Possible commands:MethodDescription
mon/add?name=name(<string>)&addr=addr(<I
Paddr[:port]>)
PUTadd new monitor named <name> at <addr>
mon/dump?epoch={epoch(<int[0-]>)}GETdump formatted monmap (optionally from epoch)
mon/getmap?epoch={epoch(<int[0-]>)}GETget monmap
mon/remove?name=name(<string>)PUTremove monitor named <name>
mon/stat GETsummarize monitor status
mon_statusGETreport status of monitors

http://apiserver:5000/api/v0.1/osd

Possible commands:MethodDescription
osd/blacklist?blacklistop=blacklistop(ad
d|rm)&addr=addr(<EntityAddr>)&expire={ex
pire(<float[0.0-]>)}
PUTadd (optionally until <expire> seconds from now) or remove <addr> from blacklist
osd/blacklist/lsGETshow blacklisted clients
osd/create?uuid={uuid(<uuid>)} PUTcreate new osd (with optional UUID)
osd/crush/add?id=id(<osdname (id|osd.id)
>)&weight=weight(<float[0.0-]>)&args=arg
s(<string(goodchars [A-Za-z0-9-_.=])>)
[<string(goodchars [A-Za-z0-9-_.=])>...]
PUTadd or update crushmap position and weight for <name> with <weight> and location <args>
osd/crush/add-
bucket?name=name(<string(goodchars
[A-Za-z0-9-_.])>)&type=type(<string>)
PUTadd no-parent (probably root) crush bucket <name> of 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
[A-Za-z0-9-_.=])>...]
PUTcreate entry or move existing entry for <name> <weight> at/to location <args>
osd/crush/dumpGETdump crush map
osd/crush/link?name=name(<string>)&args=
args(<string(goodchars
[A-Za-z0-9-_.=])>) [<string(goodchars
[A-Za-z0-9-_.=])>...]
PUTlink existing entry for <name> under location <args>
osd/crush/move?name=name(<string(goodcha
rs [A-Za-z0-9-_.])>)&args=args(<string(g
oodchars [A-Za-z0-9-_.=])>)
[<string(goodchars [A-Za-z0-9-_.=])>...]
PUTmove existing entry for <name> to location <args>
osd/crush/remove?name=name(<string(goodc
hars [A-Za-z0-9-_.])>)&ancestor={ancesto
r(<string(goodchars [A-Za-z0-9-_.])>)}
PUTremove <name> from crush map (everywhere, or just at <ancestor>
osd/crush/reweight?name=name(<string(goo
dchars [A-Za-z0-9-_.])>)&weight=weight(<
float[0.0-]>)
PUTchange <name>'s weight to <weight> in crush map
osd/crush/rm?name=name(<string(goodchars
[A-Za-z0-9-_.])>)&ancestor={ancestor(<st
ring(goodchars [A-Za-z0-9-_.])>)}
PUTremove <name> from crush map (everywhere, or just at <ancestor>
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-_.])>)
PUTcreate crush rule <name> in <root> of type <type>
osd/crush/rule/dumpGETdump crush rules
osd/crush/rule/listGETlist crush rules
osd/crush/rule/lsGETlist crush rules
osd/crush/rule/rm?name=name(<string(good
chars [A-Za-z0-9-_.])>)
PUTremove crush rule <name>
osd/crush/setPUTset crush map from input file
osd/crush/set?id=id(<osdname (id|osd.id)
>)&weight=weight(<float[0.0-]>)&args=arg
s(<string(goodchars [A-Za-z0-9-_.=])>)
[<string(goodchars [A-Za-z0-9-_.=])>...]
PUTupdate crushmap position and weight for <name> to <weight> with location <args>
osd/crush/tunables?profile=profile(legac
y|argonaut|bobtail|optimal|default)
PUT set crush tunables values to <profile>
osd/crush/unlink?name=name(<string(goodc
hars [A-Za-z0-9-_.])>)&ancestor={ancesto
r(<string(goodchars [A-Za-z0-9-_.])>)}
PUT unlink <name> from crush map (everywhere, or just at <ancestor>
osd/deep-scrub?who=who(<string>)PUTinitiate deep scrub on osd <who>
osd/down?ids=ids(<string>) [<string>...] PUTset osd(s) <id> [<id>...] down
osd/dump?epoch={epoch(<int[0-]>)}GETprint summary of OSD map
osd/find?id=id(<int[0-]>)GET find osd <id> in the CRUSH map and show its location
osd/getcrushmap?epoch={epoch(<int[0-]>)}GETget CRUSH map
osd/getmap?epoch={epoch(<int[0-]>)} GETget OSD map
osd/getmaxosdGETshow largest OSD id
osd/in?ids=ids(<string>) [<string>...]PUTset osd(s) <id> [<id>...] in
osd/lost?id=id(<int[0-]>)&sure={--yes-i
-really-mean-it}
PUTmark osd as permanently lost. THIS DESTROYS DATA IF NO MORE REPLICAS EXIST, BE CAREFUL
osd/ls?epoch={epoch(<int[0-]>)} GETshow all OSD ids
osd/lspools?auid={auid(<int>)}GETlist pools
osd/map?pool=pool(<poolname>)&object=obj
ect(<objectname>)
GETfind pg for <object> in <pool>
osd/out?ids=ids(<string>) [<string>...]PUTset osd(s) <id> [<id>...] out
osd/pause PUTpause osd
osd/perfGETprint dump of OSD perf summary stats
osd/pool/create?pool=pool(<poolname>)&pg
_num=pg_num(<int[0-]>)&pgp_num={pgp_num(
<int[0-]>)}&properties={properties(<stri
ng(goodchars [A-Za-z0-9-_.=])>)
[<string(goodchars
[A-Za-z0-9-_.=])>...]}
PUTcreate pool
osd/pool/delete?pool=pool(<poolname>)&po
ol2={pool2(<poolname>)}&sure={--yes-i
-really-really-mean-it}
PUTdelete pool
osd/pool/get?pool=pool(<poolname>)&var=v
ar(size|min_size|crash_replay_interval|p
g_num|pgp_num|crush_ruleset)
GETget pool parameter <var>
osd/pool/mksnap?pool=pool(<poolname>)&sn
ap=snap(<string>)
PUTmake snapshot <snap> in <pool>
osd/pool/rename?srcpool=srcpool(<poolnam
e>)&destpool=destpool(<poolname>)
PUTrename <srcpool> to <destpool>
osd/pool/rmsnap?pool=pool(<poolname>)&sn
ap=snap(<string>)
PUTremove snapshot <snap> from <pool>
osd/pool/set?pool=pool(<poolname>)&var=v
ar(size|min_size|crash_replay_interval|p
g_num|pgp_num|crush_ruleset|hashpspool)&
val=val(<int>)
PUTset pool parameter <var> to <val>
osd/pool/set-quota?pool=pool(<poolname>)
&field=field(max_objects|max_bytes)&val=
val(<string>)
PUTset object or byte limit on pool
osd/pool/stats?name={name(<string>)}GETobtain stats from all pools, or from specified pool
osd/repair?who=who(<string>) PUTinitiate repair on osd <who>
osd/reweight?id=id(<int[0-]>)&weight=wei
ght(<float[0.0-1.0]>)
PUTreweight osd to 0.0 < <weight> < 1.0
osd/reweight-by-
utilization?oload={oload(<int[100-]>)}
PUTreweight OSDs by utilization [overload-percentage-for-consideration, default 120]
osd/rm?ids=ids(<string>) [<string>...] PUTremove osd(s) <id> [<id>...] in
osd/scrub?who=who(<string>)PUTinitiate scrub on osd <who>
osd/set?key=key(pause|noup|nodown|noout|
noin|nobackfill|norecover|noscrub
|nodeep-scrub)
PUTset <key>
osd/setcrushmapPUTset crush map from input file
osd/setmaxosd?newmax=newmax(<int[0-]>) PUTset new maximum osd value
osd/statGETprint summary of OSD map
osd/thrash?num_epochs=num_epochs(<int[0-
]>)
PUTthrash OSDs for <num_epochs>
osd/tier/add?pool=pool(<poolname>)&tierp
ool=tierpool(<poolname>)
PUTadd the tier <tierpool> to base pool <pool>
osd/tier/cache-mode?pool=pool(<poolname>
)&mode=mode(none|writeback|invalidate+fo
rward|readonly)
PUTspecify the caching mode for cache tier <pool>
osd/tier/remove?pool=pool(<poolname>)&ti
erpool=tierpool(<poolname>)
PUTremove the tier <tierpool> from base pool <pool>
osd/tier/remove-
overlay?pool=pool(<poolname>)
PUTremove the overlay pool for base pool <pool>
osd/tier/set-overlay?pool=pool(<poolname
>)&overlaypool=overlaypool(<poolname>)
PUTset the overlay pool for base pool <pool> to be <overlaypool>
osd/tree?epoch={epoch(<int[0-]>)}GETprint OSD tree
osd/unpausePUTunpause osd
osd/unset?key=key(pause|noup|nodown|noou
t|noin|nobackfill|norecover|noscrub
|nodeep-scrub)
PUTunset <key>

http://apiserver:5000/api/v0.1/pg

Possible commands:MethodDescription
pg/debug?debugop=debugop(unfound_objects
_exist|degraded_pgs_exist)
GETshow debug info about pgs
pg/deep-scrub?pgid=pgid(<pgid>)PUTstart deep-scrub on <pgid>
pg/dump?dumpcontents={dumpcontents(all|s
ummary|sum|delta|pools|osds|pgs|pgs_brie
f) [all|summary|sum|delta|pools|osds|pgs
|pgs_brief...]}
GETshow human-readable versions of pg map (only 'all' valid with plain)
pg/dump_json?dumpcontents={dumpcontents(
all|summary|sum|pools|osds|pgs)
[all|summary|sum|pools|osds|pgs...]}
GETshow human-readable version of pg map in json only
pg/dump_pools_jsonGETshow pg pools info in json only
pg/dump_stuck?stuckops={stuckops(inactiv
e|unclean|stale) [inactive|unclean|stale
...]}&threshold={threshold(<int>)}
GETshow information about stuck pgs
pg/force_create_pg?pgid=pgid(<pgid>)PUTforce creation of pg <pgid>
pg/getmapGETget binary pg map to -o/stdout
pg/map?pgid=pgid(<pgid>)GETshow mapping of pg to osds
pg/repair?pgid=pgid(<pgid>) PUTstart repair on <pgid>
pg/scrub?pgid=pgid(<pgid>)PUTstart scrub on <pgid>
pg/send_pg_createsPUTtrigger pg creates to be issued
pg/set_full_ratio?ratio=ratio(<float[0.0
-1.0]>)
PUTset ratio at which pgs are considered full
pg/set_nearfull_ratio?ratio=ratio(<float
[0.0-1.0]>)
PUTset ratio at which pgs are considered nearly full
pg/statGETshow placement group status.

Enjoy !

No comments:

Post a Comment