The storage service API will hold the equivelent information of the StorageServiceMBean. This adds the API with one stubed method the get local hostid. After the patch the storage_service doc will be available at: http://localhost:10000/api-doc/storage_service/ And the stubed local host id will be under: http://localhost:10000/storage_service/local_hostid and will return an empty string Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
25 lines
550 B
C++
25 lines
550 B
C++
/*
|
|
* Copyright 2015 Cloudius Systems
|
|
*/
|
|
|
|
#include "api.hh"
|
|
#include "http/api_docs.hh"
|
|
#include "storage_service.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->set_api_doc()).then([&ctx, rb] {
|
|
ctx.http_server.set_routes(rb->register_function("storage_service",
|
|
"The storage service API"))
|
|
.then([&ctx] {
|
|
return set_storage_service(ctx);
|
|
});
|
|
});
|
|
}
|
|
|
|
}
|
|
|