This implement the gossipier API. All actions perform on the local
gossiper.
The following functionality is supported:
/gossiper/downtime/{addr}
/gossiper/generation_number/{addr}
/gossiper/assassinate/{addr}
The following are extened API beyond the MBean definition:
/gossiper/endpoint/down
/gossiper/endpoint/live
Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
33 lines
811 B
C++
33 lines
811 B
C++
/*
|
|
* Copyright 2015 Cloudius Systems
|
|
*/
|
|
|
|
#include "api.hh"
|
|
#include "http/api_docs.hh"
|
|
#include "storage_service.hh"
|
|
#include "commitlog.hh"
|
|
#include "gossiper.hh"
|
|
|
|
namespace api {
|
|
|
|
future<> set_server(http_context& ctx) {
|
|
auto rb = std::make_shared < api_registry_builder > ("api/api-doc/");
|
|
|
|
return ctx.http_server.set_routes([rb, &ctx](routes& r) {
|
|
rb->set_api_doc(r);
|
|
rb->register_function(r, "storage_service",
|
|
"The storage service API");
|
|
set_storage_service(ctx,r);
|
|
rb->register_function(r, "commitlog",
|
|
"The commit log API");
|
|
set_commitlog(ctx,r);
|
|
rb->register_function(r, "gossiper",
|
|
"The gossiper API");
|
|
set_gossiper(ctx,r);
|
|
|
|
});
|
|
}
|
|
|
|
}
|
|
|