33#include "cmdhandler.h"
40#include "clientpipe.h"
41#include "longgetopt.h"
45static const char *module_str =
"enforce_cmd";
56 " --zone <zone> aka -z\n");
63 "Force enforce task to run for a zone."
64 " Without arguments run enforce task for every zone.\n"
66 "zone Schedule enforce task for this zone for *now*\n"
76run(cmdhandler_ctx_type* context,
int argc,
char* argv[])
78 int sockfd = context->sockfd;
79 struct longgetopt optctx;
80 int long_index = 0, opt = 0;
81 char const *zone_name = NULL;
85 static struct option long_options[] = {
86 {
"zone", required_argument, 0,
'z'},
90 for(opt = longgetopt(argc, argv,
"z:", long_options, &long_index, &optctx); opt != -1;
91 opt = longgetopt(argc, argv, NULL, long_options, &long_index, &optctx)) {
94 zone_name = optctx.optarg;
97 client_printf_err(sockfd,
"unknown arguments\n");
98 ods_log_error(
"[%s] unknown arguments for enforce command", module_str);
113 "enforce", &usage, &help, NULL, NULL, &run, NULL
struct cmd_func_block enforce_funcblock
void enforce_task_flush_all(engine_type *engine, db_connection_t *dbconn)
void enforce_task_flush_zone(engine_type *engine, char const *zonename)
db_connection_t * getconnectioncontext(cmdhandler_ctx_type *context)
engine_type * getglobalcontext(cmdhandler_ctx_type *context)