A demonstration of creating a simple
ASCII-art status display by fusing
the metadata, perf counters, and maps that
are available to python modules in ceph-mgr.
Signed-off-by: John Spray <john.spray@redhat.com>
Previously only the errors were getting through, because
other stuff was getting held up in the python logging
framework.
Signed-off-by: John Spray <john.spray@redhat.com>
This is a rough implementation that sends all the stats,
without the efficiency of the queue+acks that we use
when talking to the mon.
Signed-off-by: John Spray <john.spray@redhat.com>
The send_report loop doesn't get kicked off
on configure messages unless the period is
set to its initial value (0).
Signed-off-by: John Spray <john.spray@redhat.com>
The ceph_state module is implemented in C++, and isn't available at
build time, which causes import failures when api_docs.py tries to
import calamari_rest in order to introspect it (MgrModule is eventually
imported, which in turn tries to import ceph_state, which fails unless
we stub it out).
Additional changes:
* Search calamari_rest.urls (not calamari_web)
calamari_web isn't available - it largely held static content in
Calamari, and in turn included calamari_rest.urls. Here in ceph-mgr we
only have calamari_rest.
* note that --list-urls does nothing, apparently
* Pass actions to old as_view method
django-rest-framework 3.x raises TypeError if the actions argument isn't
passed to as_view().
* Use view().get_view_name() instead of metadata
Attempting to access view().metadata(None)['name'] results in
"AttributeError: 'super' object has no attribute 'metadata'".
* Use somewhat unfriendly field class names
django-rest-framework 3.x seems to have done away with type_label for
fields, so instead use the field's class name, which is somewhat
unfriendly, but arguably better than nothing.
* import global_instance to fix ImportError
This is necessary to avoid what seems to be weird import loops (if this
isn't present, we later get "ImportError: cannot import name
UserRequest" or similar).
* Make api_examples.json optional
This way we at least get bare docs with no examples, rather than no docs
at all.
* Explain how to generate API docs
Signed-off-by: Tim Serong <tserong@suse.com>
This is "tell mgr" at the moment but it should
be a slicker syntax later (ceph.in is awkward
to refactor just now)
Signed-off-by: John Spray <john.spray@redhat.com>
...and store the list by a string path, for
consumption by the world outside of integer
perf counter/subsystem IDs.
This is for consumption by MgrClient.
Signed-off-by: John Spray <john.spray@redhat.com>
This is responsible for learning the locations of
mgrs, picking an active one, and sharing that
info with MgrClient consumers who subscribe to 'mgrmap'
Signed-off-by: John Spray <john.spray@redhat.com>
Mgr will probably ultimately have different auth caps,
so let's make it a separate entity up front instead
of e.g. pretending to be a mon.
Signed-off-by: John Spray <john.spray@redhat.com>
Create a CommandTable structure for places
in Client, MgrClient, Objecter where we do
basically the same kind of thing for sending
and tracking MCommands.
Signed-off-by: John Spray <john.spray@redhat.com>
The 'save_exception' local would otherwise
be referenced before assignment during
exception handling.
Signed-off-by: John Spray <john.spray@redhat.com>