virthttp  0.0
libvirt http interface
Public Member Functions | List of all members
DomainHandlers Class Reference

#include <domain.hpp>

Inheritance diagram for DomainHandlers:
HandlerMethods HandlerContext

Public Member Functions

 DomainHandlers (HandlerContext &ctx, virt::Domain &dom)
 
DependsOutcome create (const rapidjson::Value &obj) override
 
DependsOutcome query (const rapidjson::Value &action) override
 
DependsOutcome alter (const rapidjson::Value &action) override
 
DependsOutcome vacuum (const rapidjson::Value &action) override
 
- Public Member Functions inherited from HandlerMethods
constexpr HandlerMethods (HandlerContext &hc) noexcept
 

Additional Inherited Members

- Public Types inherited from HandlerMethods
using Verbs = VerbList< boost::beast::http::verb::post, boost::beast::http::verb::get, boost::beast::http::verb::patch, boost::beast::http::verb::delete_ >
 
- Static Public Member Functions inherited from HandlerMethods
static constexpr long verb_to_idx (boost::beast::http::verb v) noexcept
 
- Public Attributes inherited from HandlerContext
virt::Connectionconn
 the connection to perform libvirt operations through (plans to change to a vector) More...
 
JsonResjson_res
 the result of running the handlers to be sent to the client More...
 
const TargetParsertarget
 the incoming request's URI target More...
 
- Static Public Attributes inherited from HandlerMethods
static constexpr std::array methods = {&HandlerMethods::create, &HandlerMethods::query, &HandlerMethods::alter, &HandlerMethods::vacuum}
 
- 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)
 

Detailed Description

Domain-specific handlers

Constructor & Destructor Documentation

DomainHandlers::DomainHandlers ( HandlerContext ctx,
virt::Domain dom 
)
inlineexplicit

Member Function Documentation

DependsOutcome DomainHandlers::alter ( const rapidjson::Value &  obj)
inlineoverridevirtual

Performs the described modification on the associated libvirt object(s) Is the handler for HTTP PATCH

Parameters
[in]objthe HTTP request body, parsed as JSON
Returns
DependsOutcome::SUCCESS or DependsOutcome::FAILURE

Implements HandlerMethods.

DependsOutcome DomainHandlers::create ( const rapidjson::Value &  obj)
inlineoverridevirtual

Creates an associated libvirt object. Is the handler for HTTP POST

Parameters
[in]objthe HTTP request body, parsed as JSON
Returns
DependsOutcome::SUCCESS or DependsOutcome::FAILURE

Implements HandlerMethods.

DependsOutcome DomainHandlers::query ( const rapidjson::Value &  obj)
inlineoverridevirtual

Retrieves information about the associated libvirt object(s) Is the handler for HTTP GET

Parameters
[in]objthe HTTP request body, parsed as JSON
Returns
DependsOutcome::SUCCESS or DependsOutcome::FAILURE

Implements HandlerMethods.

DependsOutcome DomainHandlers::vacuum ( const rapidjson::Value &  obj)
inlineoverridevirtual

Removes the associated libvirt object(s) Is the handler for HTTP DELETE

Parameters
[in]objthe HTTP request body, parsed as JSON
Returns
DependsOutcome::SUCCESS or DependsOutcome::FAILURE

Implements HandlerMethods.


The documentation for this class was generated from the following file: