Kea: isc::stat_cmds::StatCmds Class Reference

| Kea 3.2.0-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.
int | statLease4GetHandler (hooks::CalloutHandle &handle)
| stat-lease4-get command handler
int | statLease6GetHandler (hooks::CalloutHandle &handle)
| stat-lease6-get command handler

## 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.

## 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

  handle | Callout context - which is expected to contain the

add command JSON text in the "command" argument

Returns
  result of the operation

Definition at line 743 of file stat_cmds.cc.

References LOG_ERROR, STAT_CMDS_LEASE4_FAILED, and isc::stat_cmds::stat_cmds_logger.

## ◆ 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-addresses", "total-pds", "cumulative-assigned-pds", "assigned-pds"], "rows": [ [1, 600, 1000, 450, 3, 64, 20, 10], : ] } } }

Parameters

  handle | Callout context - which is expected to contain the add command JSON text in the "command" argument

Returns
  result of the operation

Definition at line 756 of file stat_cmds.cc.

References LOG_ERROR, STAT_CMDS_LEASE6_FAILED, and isc::stat_cmds::stat_cmds_logger.

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

- stat_cmds.h
- stat_cmds.cc