Kea  2.1.2-git
isc::stat_cmds::StatCmds Class Reference

Implements the logic for processing commands pertaining to stat manipulation. More...

#include <stat_cmds.h>

Public Member Functions

 StatCmds ()
 Default Constructor. More...
 
int statLease4GetHandler (hooks::CalloutHandle &handle)
 stat-lease4-get command handler More...
 
int statLease6GetHandler (hooks::CalloutHandle &handle)
 stat-lease6-get command handler More...
 

Detailed Description

Implements the logic for processing commands pertaining to stat manipulation.

This class is used by the callouts implementing command handlers for stat manipulations.

Definition at line 25 of file stat_cmds.h.

Constructor & Destructor Documentation

◆ StatCmds()

isc::stat_cmds::StatCmds::StatCmds ( )
inline

Default Constructor.

Definition at line 28 of file stat_cmds.h.

References statLease4GetHandler(), and statLease6GetHandler().

+ Here is the call graph for this function:

Member Function Documentation

◆ statLease4GetHandler()

int isc::stat_cmds::StatCmds::statLease4GetHandler ( hooks::CalloutHandle handle)

stat-lease4-get command handler

This command attempts to fetch lease4 statistics for one or more subnets based upon subnet selection criteria (or lack thereof). It extracts the command name and arguments from the given Callouthandle, attempts to process them, and then set's the handle's "response" arguments accordingly. { "command": "stat-lease4-get", "arguments": { "subnet-id": 10 // optional "subnet-range": { // optional "first-subnet-id": 10, // id >= 10 "last-subnet-id": 50 // id <= 50 } } }

It produces a response as described below:

{ "result": 0, "text": "<message>", "arguments": { "result-set": { "timestamp": "2018-03-22 09:43:30.815371", "columns": ["subnet_id", "total-addresses", "cumulative-assigned-addresses", "assigned-addresses", "declined-addresses"], "rows": [ [1, 600, 1000, 450, 3], : ] } } }

Parameters
handleCallout context - which is expected to contain the

add command JSON text in the "command" argument

Returns
result of the operation

Definition at line 718 of file stat_cmds.cc.

References isc::flex_option::impl, LOG_ERROR, STAT_CMDS_LEASE4_FAILED, isc::stat_cmds::stat_cmds_logger, and isc::stat_cmds::LeaseStatCmdsImpl::statLease4GetHandler().

Referenced by stat_lease4_get(), and StatCmds().

+ Here is the call graph for this function:

◆ statLease6GetHandler()

int isc::stat_cmds::StatCmds::statLease6GetHandler ( hooks::CalloutHandle handle)

stat-lease6-get command handler

This command attempts to fetch lease6 statistics for one or more subnets based upon subnet selection criteria (or lack thereof). It extracts the command name and arguments from the given Callouthandle, attempts to process them, and then set's the handle's "response" argument accordingly. { "command": "stat-lease6-get", "arguments": { "subnet-id": 10 // optional "subnet-range": { // optional "first-subnet-id": 10, // id >= 10 "last-subnet-id": 50 // id <= 50 } } }

It produces a response as described below:

{ "result": 0, "text": "<message>", "arguments": { "result-set": { "timestamp": "2018-03-22 09:43:30.815371", "columns": ["subnet_id", "total-nas", "cumulative-assigned-nas", "assigned-nas", "declined-nas", "total-pds", "cumulative-assigned-pds", "assigned-pds"], "rows": [ [1, 600, 1000, 450, 3, 64, 20, 10], : ] } } }

Parameters
handleCallout context - which is expected to contain the add command JSON text in the "command" argument
Returns
result of the operation

Definition at line 732 of file stat_cmds.cc.

References isc::flex_option::impl, LOG_ERROR, STAT_CMDS_LEASE6_FAILED, isc::stat_cmds::stat_cmds_logger, and isc::stat_cmds::LeaseStatCmdsImpl::statLease6GetHandler().

Referenced by stat_lease6_get(), and StatCmds().

+ Here is the call graph for this function:

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