doc: Add a generated reference of all mon commands.#33886
doc: Add a generated reference of all mon commands.#33886sebastian-philipp merged 4 commits intoceph:masterfrom
Conversation
5d2f005 to
981616b
Compare
|
jenkins render docs |
|
Doc render available at http://docs.ceph.com/ceph-prs/33886/ |
|
jenkins retest this please |
|
|
This is great!
|
because of:
|
bbad7cb to
319fb33
Compare
Fixed for the simple commands
Fixed |
|
jenkins render docs |
|
jenkins test make check |
|
Doc render available at http://docs.ceph.com/ceph-prs/33886/ |
319fb33 to
acd4919
Compare
|
jenkins test make check |
|
anyone wants to review this? |
|
@sebastian-philipp i hate to say "sorry". but sorry for the latency. it's on my list. |
|
|
@tchaikov with our move of the documentation to readthedocs.io, is this still feasible? Or would this be part of the locally hosted API documentation then? |
|
@LenzGr yeah, probably the latter. as it'd be difficult to sphinxize following command $vdir/bin/python $TOPDIR/doc/scripts/gen_mon_command_api.py > $TOPDIR/doc/api/mon_command_api.rstif we cannot think of a way to do so, we will have to keep this part of document in |
acd4919 to
05ed550
Compare
|
make check: This is fixed in #34738 |
|
Nice work. I wonder if it would be possible to add at least one hierarchy level here, to improve the document structure by putting e.g. all dashboard commands under a headline? |
epuertat
left a comment
There was a problem hiding this comment.
Looks awesome! Kudos to you! Left a few suggestions.
Other question I had is about changes to stand-alone dashboard unit tests (don't they require anything else to be built or tested, just tox -e py3, right?).
| t = { | ||
| 'CephInt': 'int', | ||
| 'CephString': 'str', | ||
| 'CephChoices': 'str', | ||
| 'CephPgid': 'str', | ||
| 'CephOsdName': 'str', | ||
| 'CephPoolname': 'str', | ||
| 'CephObjectname': 'str', | ||
| 'CephUUID': 'str', | ||
| 'CephEntityAddr': 'str', | ||
| 'CephIPAddr': 'str', | ||
| 'CephName': 'str', | ||
| 'CephBool': 'bool', | ||
| 'CephFloat': 'float', | ||
| 'CephFilepath': 'str', | ||
| } |
There was a problem hiding this comment.
For #34840 I've been thinking how to get this. As all Ceph Types are subclasses of CephArgtype we could simply exploit this and add an @abstractproperty type to the CephArgtype:
class CephInt(CephArgtype):
py_type = int
...
CEPH_TYPE_TO_PY_TYPE = {CephType.__class__ : CephType.py_type for CephType in CephArgType.__subclassess__}There was a problem hiding this comment.
ok, for now, I'd like not to depend on ceph_argparse.py in the docs. the location is a bit awkward and it has no setup.py, which makes it impossible to add ceph_argparse in the requirements.txt.
I really want to move it to python-common first
| bash_example = { | ||
| 'CephInt': '1', | ||
| 'CephString': 'string', | ||
| 'CephChoices': 'choice', | ||
| 'CephPgid': '0', | ||
| 'CephOsdName': 'osd.0', | ||
| 'CephPoolname': 'poolname', | ||
| 'CephObjectname': 'objectname', | ||
| 'CephUUID': 'uuid', | ||
| 'CephEntityAddr': 'entityaddr', | ||
| 'CephIPAddr': '0.0.0.0', | ||
| 'CephName': 'name', | ||
| 'CephBool': 'true', | ||
| 'CephFloat': '0.0', | ||
| 'CephFilepath': '/path/to/file', | ||
| } |
There was a problem hiding this comment.
And we can also add this metadata to there.
Yeah, I thought the same: what about nesting by 1st & 2nd tokens? |
Not sure about it, This would generate a lot of single-entry pages. Still I can see the point for grouping the dashboard and orchestrator, but for all others as well? |
We gather the MGR commands by importing all modules and then concat all `Module.COMMAND` lists. Then we use the C preprocessor to parse the MonCommands.h and then pretent to output to be Python. Which actually works. Signed-off-by: Sebastian Wagner <sebastian.wagner@suse.com>
05ed550 to
0b69821
Compare
Generate a ReST document which contains all mon commands. Signed-off-by: Sebastian Wagner <sebastian.wagner@suse.com>
Signed-off-by: Sebastian Wagner <sebastian.wagner@suse.com>
Signed-off-by: Sebastian Wagner <sebastian.wagner@suse.com>
0b69821 to
7378a0c
Compare
We gather the MGR commands by importing all modules and then concat all
Module.COMMANDlists.Then we use the C preprocessor to parse the MonCommands.h and then pretend the output to be Python. Which actually works.
Then we generate a ReST document which contains all mon commands.
Fixes: sebastian-philipp/ceph-command-api#2
Signed-off-by: Sebastian Wagner sebastian.wagner@suse.com
Depends on
Checklist
Show available Jenkins commands
jenkins retest this pleasejenkins test crimson perfjenkins test signedjenkins test make checkjenkins test make check arm64jenkins test submodulesjenkins test dashboardjenkins test dashboard backendjenkins test docsjenkins render docsjenkins test ceph-volume alljenkins test ceph-volume tox