35 auto remote = args->get(
"remote");
46 auto server_tags = args->get(
"server-tags");
56 auto server_tags_list = server_tags->listValue();
59 if (server_tags_list.empty()) {
65 (server_tags_list.size() == 1)) {
69 std::set<std::string> server_tags_set;
70 for (
auto const& tag : server_tags_list) {
73 "multiple elements all these elements must "
74 "have the string type");
77 server_tags_set.insert(server_tag.
get());
80 if (server_tags_set.size() == 1) {
94 auto action = args->get(
"subnets-action");
101 std::string action_txt = action->stringValue();
102 if (action_txt ==
"keep") {
104 }
else if (action_txt ==
"delete") {
108 << action_txt <<
"', possible vales are 'keep' (default)"
115 auto do_include = args->get(
"subnets-include");
122 std::string include_txt = do_include->stringValue();
123 if (include_txt ==
"no") {
125 }
else if (include_txt ==
"full") {
129 << include_txt <<
"', possible values are 'no' (default)"
Parsers for a subset of an object specification, e.g.
A generic exception that is thrown if a parameter given to a method is considered invalid in that con...
ConfigCmdsImpl()
Constructor.
boost::shared_ptr< ConfigCmdsParser > parser_
Shared pointer to the commands parser.
This parser class contains the common logic for various callouts to parse and validate the contents o...
ServerTagsParse
Server selector parsing.
@ TAGS_REQUIRED
server-tags is required
@ TAGS_FORBIDDEN
server-tags is not allowed
SubnetsInclude
Subnets actions for shared network get command.
db::ServerSelector getServerSelector(const data::ConstElementPtr &args, ServerTagsParse tags_parse) const
Creates server selector from the command's arguments.
SubnetsAction
Subnets actions for shared network delete.
@ ACTION_KEEP
keep subnets (default)
@ ACTION_DELETE
delete subnets
SubnetsAction getSubnetsAction(const data::ConstElementPtr &args) const
Creates subnets action from the command's arguments.
SubnetsInclude getSubnetsInclude(const data::ConstElementPtr &args) const
Creates SubnetsInclude from the command's arguments.
db::BackendSelector getBackendSelector(const data::ConstElementPtr &args) const
Creates backend selector from the command's arguments.
std::string get() const
Returns server tag as string.
Server selector for associating objects in a database with specific servers.
static ServerSelector MULTIPLE(const std::set< std::string > &server_tags)
Factory returning "multiple servers" selector.
static ServerSelector ANY()
Factory returning "any server" selector.
static ServerSelector ONE(const std::string &server_tag)
Factory returning selector of one server.
static ServerSelector UNASSIGNED()
Factory returning "unassigned" server selector.
This file contains several functions and constants that are used for handling commands and responses ...
#define isc_throw(type, stream)
A shortcut macro to insert known values into exception arguments.
boost::shared_ptr< const Element > ConstElementPtr
Defines the logger used by the top-level component of kea-lfc.