11 #ifndef GI_PLATFORM_CONFIG_HPP
12 #define GI_PLATFORM_CONFIG_HPP
14 #include <boost/optional.hpp>
15 #include "opflex/modb/URIBuilder.h"
16 #include "opflex/modb/mo-internal/MO.h"
20 #include "modelgbp/gbpe/SNATIPPool.hpp"
24 #include "modelgbp/cdp/Config.hpp"
28 #include "modelgbp/dfw/Config.hpp"
32 #include "modelgbp/domain/ConfigFromConfigRTgt.hpp"
36 #include "modelgbp/l2/Config.hpp"
40 #include "modelgbp/lacp/Config.hpp"
44 #include "modelgbp/lldp/Config.hpp"
48 #include "modelgbp/span/SrcGrp.hpp"
52 #include "modelgbp/span/DstGrp.hpp"
56 #include "modelgbp/span/LocalEp.hpp"
60 #include "modelgbp/stp/Config.hpp"
66 :
public opflex::modb::mointernal::MO
73 static const opflex::modb::class_id_t
CLASS_ID = 51;
81 return getObjectInstance().isSet(1671170ul, opflex::modb::PropertyInfo::ENUM8);
91 return (
const uint8_t)getObjectInstance().getUInt64(1671170ul);
115 getTLMutator().modify(getClassId(), getURI())->setUInt64(1671170ul, newValue);
127 getTLMutator().modify(getClassId(), getURI())->unset(1671170ul, opflex::modb::PropertyInfo::ENUM8, opflex::modb::PropertyInfo::SCALAR);
137 return getObjectInstance().isSet(1671171ul, opflex::modb::PropertyInfo::ENUM8);
147 return (
const uint8_t)getObjectInstance().getUInt64(1671171ul);
156 const uint8_t
getMode(
const uint8_t defaultValue)
158 return getMode().get_value_or(defaultValue);
171 getTLMutator().modify(getClassId(), getURI())->setUInt64(1671171ul, newValue);
183 getTLMutator().modify(getClassId(), getURI())->unset(1671171ul, opflex::modb::PropertyInfo::ENUM8, opflex::modb::PropertyInfo::SCALAR);
193 return getObjectInstance().isSet(1671172ul, opflex::modb::PropertyInfo::STRING);
203 return getObjectInstance().getString(1671172ul);
227 getTLMutator().modify(getClassId(), getURI())->setString(1671172ul, newValue);
239 getTLMutator().modify(getClassId(), getURI())->unset(1671172ul, opflex::modb::PropertyInfo::STRING, opflex::modb::PropertyInfo::SCALAR);
249 return getObjectInstance().isSet(1671169ul, opflex::modb::PropertyInfo::STRING);
259 return getObjectInstance().getString(1671169ul);
268 const std::string&
getName(
const std::string& defaultValue)
270 return getName().get_value_or(defaultValue);
283 getTLMutator().modify(getClassId(), getURI())->setString(1671169ul, newValue);
295 getTLMutator().modify(getClassId(), getURI())->unset(1671169ul, opflex::modb::PropertyInfo::STRING, opflex::modb::PropertyInfo::SCALAR);
310 static boost::optional<OF_SHARED_PTR<modelgbp::platform::Config> >
resolve(
311 opflex::ofcore::OFFramework& framework,
312 const opflex::modb::URI& uri)
314 return opflex::modb::mointernal::MO::resolve<modelgbp::platform::Config>(framework,
CLASS_ID, uri);
328 static boost::optional<OF_SHARED_PTR<modelgbp::platform::Config> >
resolve(
329 const opflex::modb::URI& uri)
331 return opflex::modb::mointernal::MO::resolve<modelgbp::platform::Config>(opflex::ofcore::OFFramework::defaultInstance(),
CLASS_ID, uri);
350 static boost::optional<OF_SHARED_PTR<modelgbp::platform::Config> >
resolve(
351 opflex::ofcore::OFFramework& framework,
352 const std::string& platformConfigName)
354 return resolve(framework,opflex::modb::URIBuilder().addElement(
"PolicyUniverse").addElement(
"PlatformConfig").addElement(platformConfigName).build());
372 static boost::optional<OF_SHARED_PTR<modelgbp::platform::Config> >
resolve(
373 const std::string& platformConfigName)
375 return resolve(opflex::ofcore::OFFramework::defaultInstance(),platformConfigName);
390 const std::string& gbpeSNATIPPoolName)
408 const std::string& gbpeSNATIPPoolName)
410 OF_SHARED_PTR<modelgbp::gbpe::SNATIPPool> result = addChild<modelgbp::gbpe::SNATIPPool>(
411 CLASS_ID, getURI(), 2149154862ul, 46,
412 opflex::modb::URIBuilder(getURI()).addElement(
"GbpeSNATIPPool").addElement(gbpeSNATIPPoolName).build()
414 result->setName(gbpeSNATIPPoolName);
434 opflex::modb::mointernal::MO::resolveChildren<modelgbp::gbpe::SNATIPPool>(
435 getFramework(),
CLASS_ID, getURI(), 2149154862ul, 46, out);
466 OF_SHARED_PTR<modelgbp::cdp::Config> result = addChild<modelgbp::cdp::Config>(
467 CLASS_ID, getURI(), 2149154869ul, 53,
468 opflex::modb::URIBuilder(getURI()).addElement(
"CdpConfig").build()
501 OF_SHARED_PTR<modelgbp::dfw::Config> result = addChild<modelgbp::dfw::Config>(
502 CLASS_ID, getURI(), 2149154870ul, 54,
503 opflex::modb::URIBuilder(getURI()).addElement(
"DfwConfig").build()
520 const std::string& domainConfigFromConfigRTgtSource)
538 const std::string& domainConfigFromConfigRTgtSource)
540 OF_SHARED_PTR<modelgbp::domain::ConfigFromConfigRTgt> result = addChild<modelgbp::domain::ConfigFromConfigRTgt>(
541 CLASS_ID, getURI(), 2149154874ul, 58,
542 opflex::modb::URIBuilder(getURI()).addElement(
"DomainConfigFromConfigRTgt").addElement(domainConfigFromConfigRTgtSource).build()
544 result->setSource(domainConfigFromConfigRTgtSource);
564 opflex::modb::mointernal::MO::resolveChildren<modelgbp::domain::ConfigFromConfigRTgt>(
565 getFramework(),
CLASS_ID, getURI(), 2149154874ul, 58, out);
596 OF_SHARED_PTR<modelgbp::l2::Config> result = addChild<modelgbp::l2::Config>(
597 CLASS_ID, getURI(), 2149154879ul, 63,
598 opflex::modb::URIBuilder(getURI()).addElement(
"L2Config").build()
631 OF_SHARED_PTR<modelgbp::lacp::Config> result = addChild<modelgbp::lacp::Config>(
632 CLASS_ID, getURI(), 2149154880ul, 64,
633 opflex::modb::URIBuilder(getURI()).addElement(
"LacpConfig").build()
666 OF_SHARED_PTR<modelgbp::lldp::Config> result = addChild<modelgbp::lldp::Config>(
667 CLASS_ID, getURI(), 2149154881ul, 65,
668 opflex::modb::URIBuilder(getURI()).addElement(
"LldpConfig").build()
685 const std::string& spanSrcGrpName)
687 return modelgbp::span::SrcGrp::resolve(getFramework(), opflex::modb::URIBuilder(getURI()).addElement(
"SpanSrcGrp").addElement(spanSrcGrpName).build());
703 const std::string& spanSrcGrpName)
705 OF_SHARED_PTR<modelgbp::span::SrcGrp> result = addChild<modelgbp::span::SrcGrp>(
706 CLASS_ID, getURI(), 2149154883ul, 67,
707 opflex::modb::URIBuilder(getURI()).addElement(
"SpanSrcGrp").addElement(spanSrcGrpName).build()
709 result->setName(spanSrcGrpName);
729 opflex::modb::mointernal::MO::resolveChildren<modelgbp::span::SrcGrp>(
730 getFramework(),
CLASS_ID, getURI(), 2149154883ul, 67, out);
745 const std::string& spanDstGrpName)
747 return modelgbp::span::DstGrp::resolve(getFramework(), opflex::modb::URIBuilder(getURI()).addElement(
"SpanDstGrp").addElement(spanDstGrpName).build());
763 const std::string& spanDstGrpName)
765 OF_SHARED_PTR<modelgbp::span::DstGrp> result = addChild<modelgbp::span::DstGrp>(
766 CLASS_ID, getURI(), 2149154884ul, 68,
767 opflex::modb::URIBuilder(getURI()).addElement(
"SpanDstGrp").addElement(spanDstGrpName).build()
769 result->setName(spanDstGrpName);
789 opflex::modb::mointernal::MO::resolveChildren<modelgbp::span::DstGrp>(
790 getFramework(),
CLASS_ID, getURI(), 2149154884ul, 68, out);
805 const std::string& spanLocalEpName)
823 const std::string& spanLocalEpName)
825 OF_SHARED_PTR<modelgbp::span::LocalEp> result = addChild<modelgbp::span::LocalEp>(
826 CLASS_ID, getURI(), 2149154885ul, 69,
827 opflex::modb::URIBuilder(getURI()).addElement(
"SpanLocalEp").addElement(spanLocalEpName).build()
829 result->setName(spanLocalEpName);
849 opflex::modb::mointernal::MO::resolveChildren<modelgbp::span::LocalEp>(
850 getFramework(),
CLASS_ID, getURI(), 2149154885ul, 69, out);
881 OF_SHARED_PTR<modelgbp::stp::Config> result = addChild<modelgbp::stp::Config>(
882 CLASS_ID, getURI(), 2149154896ul, 80,
883 opflex::modb::URIBuilder(getURI()).addElement(
"StpConfig").build()
898 getTLMutator().remove(
CLASS_ID, getURI());
911 static void remove(opflex::ofcore::OFFramework& framework,
912 const opflex::modb::URI& uri)
914 MO::remove(framework,
CLASS_ID, uri);
927 static void remove(
const opflex::modb::URI& uri)
929 remove(opflex::ofcore::OFFramework::defaultInstance(), uri);
947 opflex::ofcore::OFFramework& framework,
948 const std::string& platformConfigName)
950 MO::remove(framework,
CLASS_ID, opflex::modb::URIBuilder().addElement(
"PolicyUniverse").addElement(
"PlatformConfig").addElement(platformConfigName).build());
968 const std::string& platformConfigName)
970 remove(opflex::ofcore::OFFramework::defaultInstance(),platformConfigName);
985 opflex::ofcore::OFFramework& framework,
986 opflex::modb::ObjectListener* listener)
988 opflex::modb::mointernal
989 ::MO::registerListener(framework, listener,
CLASS_ID);
1004 opflex::modb::ObjectListener* listener)
1006 registerListener(opflex::ofcore::OFFramework::defaultInstance(), listener);
1016 opflex::ofcore::OFFramework& framework,
1017 opflex::modb::ObjectListener* listener)
1019 opflex::modb::mointernal
1020 ::MO::unregisterListener(framework, listener,
CLASS_ID);
1030 opflex::modb::ObjectListener* listener)
1040 opflex::ofcore::OFFramework& framework,
1041 const opflex::modb::URI& uri,
1042 const OF_SHARED_PTR<const opflex::modb::mointernal::ObjectInstance>& oi)
1043 : MO(framework,
CLASS_ID, uri, oi) { }
1048 #endif // GI_PLATFORM_CONFIG_HPP
static boost::optional< OF_SHARED_PTR< modelgbp::stp::Config > > resolve(opflex::ofcore::OFFramework &framework, const opflex::modb::URI &uri)
Retrieve an instance of Config from the managed object store.
Definition: stp/Config.hpp:210
static boost::optional< OF_SHARED_PTR< modelgbp::l2::Config > > resolve(opflex::ofcore::OFFramework &framework, const opflex::modb::URI &uri)
Retrieve an instance of Config from the managed object store.
Definition: l2/Config.hpp:154
static boost::optional< OF_SHARED_PTR< modelgbp::domain::ConfigFromConfigRTgt > > resolve(opflex::ofcore::OFFramework &framework, const opflex::modb::URI &uri)
Retrieve an instance of ConfigFromConfigRTgt from the managed object store.
Definition: ConfigFromConfigRTgt.hpp:210
static boost::optional< OF_SHARED_PTR< modelgbp::gbpe::SNATIPPool > > resolve(opflex::ofcore::OFFramework &framework, const opflex::modb::URI &uri)
Retrieve an instance of SNATIPPool from the managed object store.
Definition: SNATIPPool.hpp:322
static boost::optional< OF_SHARED_PTR< modelgbp::span::DstGrp > > resolve(opflex::ofcore::OFFramework &framework, const opflex::modb::URI &uri)
Retrieve an instance of DstGrp from the managed object store.
Definition: DstGrp.hpp:106
static boost::optional< OF_SHARED_PTR< modelgbp::lacp::Config > > resolve(opflex::ofcore::OFFramework &framework, const opflex::modb::URI &uri)
Retrieve an instance of Config from the managed object store.
Definition: lacp/Config.hpp:322
static boost::optional< OF_SHARED_PTR< modelgbp::dfw::Config > > resolve(opflex::ofcore::OFFramework &framework, const opflex::modb::URI &uri)
Retrieve an instance of Config from the managed object store.
Definition: dfw/Config.hpp:154
static boost::optional< OF_SHARED_PTR< modelgbp::span::LocalEp > > resolve(opflex::ofcore::OFFramework &framework, const opflex::modb::URI &uri)
Retrieve an instance of LocalEp from the managed object store.
Definition: LocalEp.hpp:162
static boost::optional< OF_SHARED_PTR< modelgbp::span::SrcGrp > > resolve(opflex::ofcore::OFFramework &framework, const opflex::modb::URI &uri)
Retrieve an instance of SrcGrp from the managed object store.
Definition: SrcGrp.hpp:218
static boost::optional< OF_SHARED_PTR< modelgbp::cdp::Config > > resolve(opflex::ofcore::OFFramework &framework, const opflex::modb::URI &uri)
Retrieve an instance of Config from the managed object store.
Definition: cdp/Config.hpp:154
static boost::optional< OF_SHARED_PTR< modelgbp::lldp::Config > > resolve(opflex::ofcore::OFFramework &framework, const opflex::modb::URI &uri)
Retrieve an instance of Config from the managed object store.
Definition: lldp/Config.hpp:210