virthttp
0.0
libvirt http interface
|
#include <base.hpp>
Public Types | |
using | Verbs = VerbList< boost::beast::http::verb::post, boost::beast::http::verb::get, boost::beast::http::verb::patch, boost::beast::http::verb::delete_ > |
Public Member Functions | |
virtual DependsOutcome | create (const rapidjson::Value &obj)=0 |
virtual DependsOutcome | query (const rapidjson::Value &obj)=0 |
virtual DependsOutcome | alter (const rapidjson::Value &obj)=0 |
virtual DependsOutcome | vacuum (const rapidjson::Value &obj)=0 |
constexpr | HandlerMethods (HandlerContext &hc) noexcept |
Static Public Member Functions | |
static constexpr long | verb_to_idx (boost::beast::http::verb v) noexcept |
Static Public Attributes | |
static constexpr std::array | methods = {&HandlerMethods::create, &HandlerMethods::query, &HandlerMethods::alter, &HandlerMethods::vacuum} |
Additional Inherited Members | |
Public Attributes inherited from HandlerContext | |
virt::Connection & | conn |
the connection to perform libvirt operations through (plans to change to a vector) More... | |
JsonRes & | json_res |
the result of running the handlers to be sent to the client More... | |
const TargetParser & | target |
the incoming request's URI target More... | |
Protected Member Functions inherited from HandlerContext | |
template<class... Args> | |
auto | error (Args &&...args) const noexcept(noexcept(json_res.error(std::forward< Args >(args)...))) -> decltype(json_res.error(std::forward< Args >(args)...)) |
const auto | fwd_err (bool fwd, int code) |
const auto | fwd_as_if_err (int code) |
Purely abstract base class for libvirt object-specific handlers
Intended to be used in a place where the compiler should definitely be able to de-virtualize
using HandlerMethods::Verbs = VerbList<boost::beast::http::verb::post, boost::beast::http::verb::get, boost::beast::http::verb::patch, boost::beast::http::verb::delete_> |
Array of HTTP verbs handled by the handler methods
|
inlineexplicitnoexcept |
hc | the HandlerContext to use as a base |
|
pure virtual |
Performs the described modification on the associated libvirt object(s) Is the handler for HTTP PATCH
[in] | obj | the HTTP request body, parsed as JSON |
Implemented in NetworkHandlers, and DomainHandlers.
|
pure virtual |
Creates an associated libvirt object. Is the handler for HTTP POST
[in] | obj | the HTTP request body, parsed as JSON |
Implemented in DomainHandlers, and NetworkHandlers.
|
pure virtual |
Retrieves information about the associated libvirt object(s) Is the handler for HTTP GET
[in] | obj | the HTTP request body, parsed as JSON |
Implemented in NetworkHandlers, and DomainHandlers.
|
pure virtual |
Removes the associated libvirt object(s) Is the handler for HTTP DELETE
[in] | obj | the HTTP request body, parsed as JSON |
Implemented in NetworkHandlers, and DomainHandlers.
|
inlinestaticnoexcept |
|
static |
Array of the handler methods, with corresponding indices to the handled verb in Verbs