11 #ifndef GI_INV_DHCPV4CONFIG_HPP
12 #define GI_INV_DHCPV4CONFIG_HPP
14 #include <boost/optional.hpp>
15 #include "opflex/modb/URIBuilder.h"
16 #include "opflex/modb/mo-internal/MO.h"
20 #include "modelgbp/inv/DNSServer.hpp"
24 #include "modelgbp/inv/Router.hpp"
28 #include "modelgbp/inv/StaticRoute.hpp"
34 :
public opflex::modb::mointernal::MO
41 static const opflex::modb::class_id_t
CLASS_ID = 130;
49 return getObjectInstance().isSet(4259844ul, opflex::modb::PropertyInfo::STRING);
59 return getObjectInstance().getString(4259844ul);
68 const std::string&
getDomain(
const std::string& defaultValue)
70 return getDomain().get_value_or(defaultValue);
83 getTLMutator().modify(getClassId(), getURI())->setString(4259844ul, newValue);
95 getTLMutator().modify(getClassId(), getURI())->unset(4259844ul, opflex::modb::PropertyInfo::STRING, opflex::modb::PropertyInfo::SCALAR);
105 return getObjectInstance().isSet(4259845ul, opflex::modb::PropertyInfo::U64);
115 return (uint16_t)getObjectInstance().getUInt64(4259845ul);
139 getTLMutator().modify(getClassId(), getURI())->setUInt64(4259845ul, newValue);
151 getTLMutator().modify(getClassId(), getURI())->unset(4259845ul, opflex::modb::PropertyInfo::U64, opflex::modb::PropertyInfo::SCALAR);
161 return getObjectInstance().isSet(4259841ul, opflex::modb::PropertyInfo::STRING);
168 boost::optional<const std::string&>
getIp()
171 return getObjectInstance().getString(4259841ul);
180 const std::string&
getIp(
const std::string& defaultValue)
182 return getIp().get_value_or(defaultValue);
195 getTLMutator().modify(getClassId(), getURI())->setString(4259841ul, newValue);
207 getTLMutator().modify(getClassId(), getURI())->unset(4259841ul, opflex::modb::PropertyInfo::STRING, opflex::modb::PropertyInfo::SCALAR);
217 return getObjectInstance().isSet(4259846ul, opflex::modb::PropertyInfo::U64);
227 return (uint32_t)getObjectInstance().getUInt64(4259846ul);
251 getTLMutator().modify(getClassId(), getURI())->setUInt64(4259846ul, newValue);
263 getTLMutator().modify(getClassId(), getURI())->unset(4259846ul, opflex::modb::PropertyInfo::U64, opflex::modb::PropertyInfo::SCALAR);
273 return getObjectInstance().isSet(4259842ul, opflex::modb::PropertyInfo::U64);
283 return (
const uint8_t)getObjectInstance().getUInt64(4259842ul);
307 getTLMutator().modify(getClassId(), getURI())->setUInt64(4259842ul, newValue);
319 getTLMutator().modify(getClassId(), getURI())->unset(4259842ul, opflex::modb::PropertyInfo::U64, opflex::modb::PropertyInfo::SCALAR);
329 return getObjectInstance().isSet(4259843ul, opflex::modb::PropertyInfo::STRING);
339 return getObjectInstance().getString(4259843ul);
363 getTLMutator().modify(getClassId(), getURI())->setString(4259843ul, newValue);
375 getTLMutator().modify(getClassId(), getURI())->unset(4259843ul, opflex::modb::PropertyInfo::STRING, opflex::modb::PropertyInfo::SCALAR);
390 static boost::optional<OF_SHARED_PTR<modelgbp::inv::DHCPv4Config> >
resolve(
391 opflex::ofcore::OFFramework& framework,
392 const opflex::modb::URI& uri)
394 return opflex::modb::mointernal::MO::resolve<modelgbp::inv::DHCPv4Config>(framework,
CLASS_ID, uri);
408 static boost::optional<OF_SHARED_PTR<modelgbp::inv::DHCPv4Config> >
resolve(
409 const opflex::modb::URI& uri)
411 return opflex::modb::mointernal::MO::resolve<modelgbp::inv::DHCPv4Config>(opflex::ofcore::OFFramework::defaultInstance(),
CLASS_ID, uri);
432 static boost::optional<OF_SHARED_PTR<modelgbp::inv::DHCPv4Config> >
resolve(
433 opflex::ofcore::OFFramework& framework,
434 const std::string& invLocalEndpointInventoryName,
435 const std::string& invLocalInventoryEpUuid)
437 return resolve(framework,opflex::modb::URIBuilder().addElement(
"InvUniverse").addElement(
"InvLocalEndpointInventory").addElement(invLocalEndpointInventoryName).addElement(
"InvLocalInventoryEp").addElement(invLocalInventoryEpUuid).addElement(
"InvDHCPv4Config").build());
457 static boost::optional<OF_SHARED_PTR<modelgbp::inv::DHCPv4Config> >
resolve(
458 const std::string& invLocalEndpointInventoryName,
459 const std::string& invLocalInventoryEpUuid)
461 return resolve(opflex::ofcore::OFFramework::defaultInstance(),invLocalEndpointInventoryName,invLocalInventoryEpUuid);
476 const std::string& invDNSServerName)
494 const std::string& invDNSServerName)
496 OF_SHARED_PTR<modelgbp::inv::DNSServer> result = addChild<modelgbp::inv::DNSServer>(
497 CLASS_ID, getURI(), 2151743619ul, 131,
498 opflex::modb::URIBuilder(getURI()).addElement(
"InvDNSServer").addElement(invDNSServerName).build()
500 result->setName(invDNSServerName);
520 opflex::modb::mointernal::MO::resolveChildren<modelgbp::inv::DNSServer>(
521 getFramework(),
CLASS_ID, getURI(), 2151743619ul, 131, out);
536 const std::string& invRouterName)
538 return modelgbp::inv::Router::resolve(getFramework(), opflex::modb::URIBuilder(getURI()).addElement(
"InvRouter").addElement(invRouterName).build());
554 const std::string& invRouterName)
556 OF_SHARED_PTR<modelgbp::inv::Router> result = addChild<modelgbp::inv::Router>(
557 CLASS_ID, getURI(), 2151743620ul, 132,
558 opflex::modb::URIBuilder(getURI()).addElement(
"InvRouter").addElement(invRouterName).build()
560 result->setName(invRouterName);
580 opflex::modb::mointernal::MO::resolveChildren<modelgbp::inv::Router>(
581 getFramework(),
CLASS_ID, getURI(), 2151743620ul, 132, out);
600 const std::string& invStaticRouteDest,
601 const uint8_t invStaticRoutePrefixLen,
602 const std::string& invStaticRouteNextHop)
604 return modelgbp::inv::StaticRoute::resolve(getFramework(), opflex::modb::URIBuilder(getURI()).addElement(
"InvStaticRoute").addElement(invStaticRouteDest).addElement(invStaticRoutePrefixLen).addElement(invStaticRouteNextHop).build());
624 const std::string& invStaticRouteDest,
625 const uint8_t invStaticRoutePrefixLen,
626 const std::string& invStaticRouteNextHop)
628 OF_SHARED_PTR<modelgbp::inv::StaticRoute> result = addChild<modelgbp::inv::StaticRoute>(
629 CLASS_ID, getURI(), 2151743621ul, 133,
630 opflex::modb::URIBuilder(getURI()).addElement(
"InvStaticRoute").addElement(invStaticRouteDest).addElement(invStaticRoutePrefixLen).addElement(invStaticRouteNextHop).build()
632 result->setDest(invStaticRouteDest);
633 result->setPrefixLen(invStaticRoutePrefixLen);
634 result->setNextHop(invStaticRouteNextHop);
654 opflex::modb::mointernal::MO::resolveChildren<modelgbp::inv::StaticRoute>(
655 getFramework(),
CLASS_ID, getURI(), 2151743621ul, 133, out);
668 getTLMutator().remove(
CLASS_ID, getURI());
681 static void remove(opflex::ofcore::OFFramework& framework,
682 const opflex::modb::URI& uri)
684 MO::remove(framework,
CLASS_ID, uri);
697 static void remove(
const opflex::modb::URI& uri)
699 remove(opflex::ofcore::OFFramework::defaultInstance(), uri);
719 opflex::ofcore::OFFramework& framework,
720 const std::string& invLocalEndpointInventoryName,
721 const std::string& invLocalInventoryEpUuid)
723 MO::remove(framework,
CLASS_ID, opflex::modb::URIBuilder().addElement(
"InvUniverse").addElement(
"InvLocalEndpointInventory").addElement(invLocalEndpointInventoryName).addElement(
"InvLocalInventoryEp").addElement(invLocalInventoryEpUuid).addElement(
"InvDHCPv4Config").build());
743 const std::string& invLocalEndpointInventoryName,
744 const std::string& invLocalInventoryEpUuid)
746 remove(opflex::ofcore::OFFramework::defaultInstance(),invLocalEndpointInventoryName,invLocalInventoryEpUuid);
761 opflex::ofcore::OFFramework& framework,
762 opflex::modb::ObjectListener* listener)
764 opflex::modb::mointernal
765 ::MO::registerListener(framework, listener,
CLASS_ID);
780 opflex::modb::ObjectListener* listener)
792 opflex::ofcore::OFFramework& framework,
793 opflex::modb::ObjectListener* listener)
795 opflex::modb::mointernal
796 ::MO::unregisterListener(framework, listener,
CLASS_ID);
806 opflex::modb::ObjectListener* listener)
816 opflex::ofcore::OFFramework& framework,
817 const opflex::modb::URI& uri,
818 const OF_SHARED_PTR<const opflex::modb::mointernal::ObjectInstance>& oi)
819 : MO(framework,
CLASS_ID, uri, oi) { }
824 #endif // GI_INV_DHCPV4CONFIG_HPP
uint16_t getInterfaceMTU(uint16_t defaultValue)
Get the value of interfaceMTU if set, otherwise the value of default passed in.
Definition: DHCPv4Config.hpp:124
modelgbp::inv::DHCPv4Config & setDomain(const std::string &newValue)
Set domain to the specified value in the currently-active mutator.
Definition: DHCPv4Config.hpp:81
modelgbp::inv::DHCPv4Config & unsetIp()
Unset ip in the currently-active mutator.
Definition: DHCPv4Config.hpp:205
uint32_t getLeaseTime(uint32_t defaultValue)
Get the value of leaseTime if set, otherwise the value of default passed in.
Definition: DHCPv4Config.hpp:236
boost::optional< OF_SHARED_PTR< modelgbp::inv::DNSServer > > resolveInvDNSServer(const std::string &invDNSServerName)
Retrieve the child object with the specified naming properties.
Definition: DHCPv4Config.hpp:475
boost::optional< const std::string & > getServerIp()
Get the value of serverIp if it has been set.
Definition: DHCPv4Config.hpp:336
modelgbp::inv::DHCPv4Config & unsetInterfaceMTU()
Unset interfaceMTU in the currently-active mutator.
Definition: DHCPv4Config.hpp:149
void resolveInvDNSServer(std::vector< OF_SHARED_PTR< modelgbp::inv::DNSServer > > &out)
Resolve and retrieve all of the immediate children of type modelgbp::inv::DNSServer.
Definition: DHCPv4Config.hpp:518
static boost::optional< OF_SHARED_PTR< modelgbp::inv::DHCPv4Config > > resolve(opflex::ofcore::OFFramework &framework, const std::string &invLocalEndpointInventoryName, const std::string &invLocalInventoryEpUuid)
Retrieve an instance of DHCPv4Config from the managed object store by constructing its URI from the p...
Definition: DHCPv4Config.hpp:432
boost::optional< OF_SHARED_PTR< modelgbp::inv::StaticRoute > > resolveInvStaticRoute(const std::string &invStaticRouteDest, const uint8_t invStaticRoutePrefixLen, const std::string &invStaticRouteNextHop)
Retrieve the child object with the specified naming properties.
Definition: DHCPv4Config.hpp:599
static void registerListener(opflex::ofcore::OFFramework &framework, opflex::modb::ObjectListener *listener)
Register a listener that will get called for changes related to this class.
Definition: DHCPv4Config.hpp:760
modelgbp::inv::DHCPv4Config & unsetServerIp()
Unset serverIp in the currently-active mutator.
Definition: DHCPv4Config.hpp:373
bool isLeaseTimeSet()
Check whether leaseTime has been set.
Definition: DHCPv4Config.hpp:215
modelgbp::inv::DHCPv4Config & setServerIp(const std::string &newValue)
Set serverIp to the specified value in the currently-active mutator.
Definition: DHCPv4Config.hpp:361
boost::optional< const uint8_t > getPrefixLen()
Get the value of prefixLen if it has been set.
Definition: DHCPv4Config.hpp:280
modelgbp::inv::DHCPv4Config & unsetLeaseTime()
Unset leaseTime in the currently-active mutator.
Definition: DHCPv4Config.hpp:261
modelgbp::inv::DHCPv4Config & unsetPrefixLen()
Unset prefixLen in the currently-active mutator.
Definition: DHCPv4Config.hpp:317
boost::optional< const std::string & > getDomain()
Get the value of domain if it has been set.
Definition: DHCPv4Config.hpp:56
const uint8_t getPrefixLen(const uint8_t defaultValue)
Get the value of prefixLen if set, otherwise the value of default passed in.
Definition: DHCPv4Config.hpp:292
modelgbp::inv::DHCPv4Config & setPrefixLen(const uint8_t newValue)
Set prefixLen to the specified value in the currently-active mutator.
Definition: DHCPv4Config.hpp:305
static boost::optional< OF_SHARED_PTR< modelgbp::inv::DHCPv4Config > > resolve(const std::string &invLocalEndpointInventoryName, const std::string &invLocalInventoryEpUuid)
Retrieve an instance of DHCPv4Config from the default managed object store by constructing its URI fr...
Definition: DHCPv4Config.hpp:457
static boost::optional< OF_SHARED_PTR< modelgbp::inv::DHCPv4Config > > resolve(opflex::ofcore::OFFramework &framework, const opflex::modb::URI &uri)
Retrieve an instance of DHCPv4Config from the managed object store.
Definition: DHCPv4Config.hpp:390
boost::optional< uint32_t > getLeaseTime()
Get the value of leaseTime if it has been set.
Definition: DHCPv4Config.hpp:224
OF_SHARED_PTR< modelgbp::inv::DNSServer > addInvDNSServer(const std::string &invDNSServerName)
Create a new child object with the specified naming properties and make it a child of this object in ...
Definition: DHCPv4Config.hpp:493
static void unregisterListener(opflex::modb::ObjectListener *listener)
Unregister a listener from updates to this class from the default framework instance.
Definition: DHCPv4Config.hpp:805
OF_SHARED_PTR< modelgbp::inv::StaticRoute > addInvStaticRoute(const std::string &invStaticRouteDest, const uint8_t invStaticRoutePrefixLen, const std::string &invStaticRouteNextHop)
Create a new child object with the specified naming properties and make it a child of this object in ...
Definition: DHCPv4Config.hpp:623
modelgbp::inv::DHCPv4Config & setInterfaceMTU(uint16_t newValue)
Set interfaceMTU to the specified value in the currently-active mutator.
Definition: DHCPv4Config.hpp:137
const std::string & getIp(const std::string &defaultValue)
Get the value of ip if set, otherwise the value of default passed in.
Definition: DHCPv4Config.hpp:180
modelgbp::inv::DHCPv4Config & unsetDomain()
Unset domain in the currently-active mutator.
Definition: DHCPv4Config.hpp:93
bool isInterfaceMTUSet()
Check whether interfaceMTU has been set.
Definition: DHCPv4Config.hpp:103
const std::string & getDomain(const std::string &defaultValue)
Get the value of domain if set, otherwise the value of default passed in.
Definition: DHCPv4Config.hpp:68
OF_SHARED_PTR< modelgbp::inv::Router > addInvRouter(const std::string &invRouterName)
Create a new child object with the specified naming properties and make it a child of this object in ...
Definition: DHCPv4Config.hpp:553
void resolveInvRouter(std::vector< OF_SHARED_PTR< modelgbp::inv::Router > > &out)
Resolve and retrieve all of the immediate children of type modelgbp::inv::Router. ...
Definition: DHCPv4Config.hpp:578
void resolveInvStaticRoute(std::vector< OF_SHARED_PTR< modelgbp::inv::StaticRoute > > &out)
Resolve and retrieve all of the immediate children of type modelgbp::inv::StaticRoute.
Definition: DHCPv4Config.hpp:652
static void unregisterListener(opflex::ofcore::OFFramework &framework, opflex::modb::ObjectListener *listener)
Unregister a listener from updates to this class.
Definition: DHCPv4Config.hpp:791
boost::optional< uint16_t > getInterfaceMTU()
Get the value of interfaceMTU if it has been set.
Definition: DHCPv4Config.hpp:112
bool isServerIpSet()
Check whether serverIp has been set.
Definition: DHCPv4Config.hpp:327
bool isPrefixLenSet()
Check whether prefixLen has been set.
Definition: DHCPv4Config.hpp:271
static void registerListener(opflex::modb::ObjectListener *listener)
Register a listener that will get called for changes related to this class with the default framework...
Definition: DHCPv4Config.hpp:779
boost::optional< OF_SHARED_PTR< modelgbp::inv::Router > > resolveInvRouter(const std::string &invRouterName)
Retrieve the child object with the specified naming properties.
Definition: DHCPv4Config.hpp:535
static const opflex::modb::class_id_t CLASS_ID
The unique class ID for DHCPv4Config.
Definition: DHCPv4Config.hpp:41
bool isDomainSet()
Check whether domain has been set.
Definition: DHCPv4Config.hpp:47
static boost::optional< OF_SHARED_PTR< modelgbp::inv::Router > > resolve(opflex::ofcore::OFFramework &framework, const opflex::modb::URI &uri)
Retrieve an instance of Router from the managed object store.
Definition: Router.hpp:98
DHCPv4Config(opflex::ofcore::OFFramework &framework, const opflex::modb::URI &uri, const OF_SHARED_PTR< const opflex::modb::mointernal::ObjectInstance > &oi)
Construct an instance of DHCPv4Config.
Definition: DHCPv4Config.hpp:815
modelgbp::inv::DHCPv4Config & setLeaseTime(uint32_t newValue)
Set leaseTime to the specified value in the currently-active mutator.
Definition: DHCPv4Config.hpp:249
const std::string & getServerIp(const std::string &defaultValue)
Get the value of serverIp if set, otherwise the value of default passed in.
Definition: DHCPv4Config.hpp:348
static boost::optional< OF_SHARED_PTR< modelgbp::inv::DNSServer > > resolve(opflex::ofcore::OFFramework &framework, const opflex::modb::URI &uri)
Retrieve an instance of DNSServer from the managed object store.
Definition: DNSServer.hpp:98
static boost::optional< OF_SHARED_PTR< modelgbp::inv::StaticRoute > > resolve(opflex::ofcore::OFFramework &framework, const opflex::modb::URI &uri)
Retrieve an instance of StaticRoute from the managed object store.
Definition: StaticRoute.hpp:210
static boost::optional< OF_SHARED_PTR< modelgbp::inv::DHCPv4Config > > resolve(const opflex::modb::URI &uri)
Retrieve an instance of DHCPv4Config from the managed object store using the default framework instan...
Definition: DHCPv4Config.hpp:408
modelgbp::inv::DHCPv4Config & setIp(const std::string &newValue)
Set ip to the specified value in the currently-active mutator.
Definition: DHCPv4Config.hpp:193
Definition: DHCPv4Config.hpp:33
boost::optional< const std::string & > getIp()
Get the value of ip if it has been set.
Definition: DHCPv4Config.hpp:168
bool isIpSet()
Check whether ip has been set.
Definition: DHCPv4Config.hpp:159