Kea: isc::host_cmds::HostDataParser< ParserBase > Class Template Reference

| Kea 3.2.0-git

isc::host_cmds::HostDataParser< ParserBase > Class Template Reference

A class for parsing extended host reservation data. More...

`#include <host_data_parser.h>`

Inheritance diagram for isc::host_cmds::HostDataParser< ParserBase >:
[legend]

## Public Member Functions
isc::dhcp::HostPtr | parseWithSubnet (isc::data::ConstElementPtr host_data, bool required=true)
| Parser specified parameter as host reservation data.

## Detailed Description

template<typename ParserBase>
class isc::host_cmds::HostDataParser< ParserBase >

A class for parsing extended host reservation data.

This template class provides a convenient interface for parsing extended host reservation data. Extended means that it is the typical host reservation as used in configuration file, with the addition of subnet-id parameter. It is not needed in the configuration file, because it's always obvious from the context (HR is defined in a subnet that has subnet-id). However, in reservation-add, reservation-del, reservation-update commands, the subnet-id parameter has to be specified explicitly.

Template Parameters

  ParserBase | base class to be extended

Definition at line 30 of file host_data_parser.h.

## Member Function Documentation

## ◆ parseWithSubnet()

template<typename ParserBase>

isc::dhcp::HostPtr isc::host_cmds::HostDataParser< ParserBase >::parseWithSubnet | ( | isc::data::ConstElementPtr | host_data,
|  | bool | required = true )
| inline

Parser specified parameter as host reservation data.

This method expects the input to be a ConstElementPtr tree structure that represents host reservation information. If parsing is successful, it returns HostPtr to the Host object that was created.

This method calls parse method from the ParserBase class. This method may throw additional exception types.

Parameters

  host_data | Element tree to be parsed
  required | True (default) if the subnet-id entry is required, false otherwise.

Returns
  parsed host information

Exceptions

  BadValue | if subnet-id is required but missing, or has invalid format.

Definition at line 48 of file host_data_parser.h.

Referenced by isc::host_cmds::HostCmdsImpl::reservationAddHandler(), and isc::host_cmds::HostCmdsImpl::reservationUpdateHandler().

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

- host_data_parser.h