11 #ifndef GI_GBP_SECGROUPRULE_HPP
12 #define GI_GBP_SECGROUPRULE_HPP
14 #include <boost/optional.hpp>
15 #include "opflex/modb/URIBuilder.h"
16 #include "opflex/modb/mo-internal/MO.h"
20 #include "modelgbp/gbp/RuleToClassifierRSrc.hpp"
24 #include "modelgbp/gbp/RuleToActionRSrc.hpp"
28 #include "modelgbp/gbp/SecGroupRuleToRemoteAddressRSrc.hpp"
34 :
public opflex::modb::mointernal::MO
41 static const opflex::modb::class_id_t
CLASS_ID = 161;
49 return getObjectInstance().isSet(5275651ul, opflex::modb::PropertyInfo::ENUM8);
59 return (
const uint8_t)getObjectInstance().getUInt64(5275651ul);
83 getTLMutator().modify(getClassId(), getURI())->setUInt64(5275651ul, newValue);
95 getTLMutator().modify(getClassId(), getURI())->unset(5275651ul, opflex::modb::PropertyInfo::ENUM8, opflex::modb::PropertyInfo::SCALAR);
105 return getObjectInstance().isSet(5275649ul, opflex::modb::PropertyInfo::STRING);
115 return getObjectInstance().getString(5275649ul);
124 const std::string&
getName(
const std::string& defaultValue)
126 return getName().get_value_or(defaultValue);
139 getTLMutator().modify(getClassId(), getURI())->setString(5275649ul, newValue);
151 getTLMutator().modify(getClassId(), getURI())->unset(5275649ul, opflex::modb::PropertyInfo::STRING, opflex::modb::PropertyInfo::SCALAR);
161 return getObjectInstance().isSet(5275650ul, opflex::modb::PropertyInfo::U64);
171 return (uint32_t)getObjectInstance().getUInt64(5275650ul);
182 return getOrder().get_value_or(defaultValue);
195 getTLMutator().modify(getClassId(), getURI())->setUInt64(5275650ul, newValue);
207 getTLMutator().modify(getClassId(), getURI())->unset(5275650ul, opflex::modb::PropertyInfo::U64, opflex::modb::PropertyInfo::SCALAR);
222 static boost::optional<boost::shared_ptr<modelgbp::gbp::SecGroupRule> >
resolve(
223 opflex::ofcore::OFFramework& framework,
224 const opflex::modb::URI& uri)
226 return opflex::modb::mointernal::MO::resolve<modelgbp::gbp::SecGroupRule>(framework,
CLASS_ID, uri);
240 static boost::optional<boost::shared_ptr<modelgbp::gbp::SecGroupRule> >
resolve(
241 const opflex::modb::URI& uri)
243 return opflex::modb::mointernal::MO::resolve<modelgbp::gbp::SecGroupRule>(opflex::ofcore::OFFramework::defaultInstance(),
CLASS_ID, uri);
269 opflex::ofcore::OFFramework& framework,
270 const std::string& policySpaceName,
271 const std::string& gbpContractName,
272 const std::string& gbpSubjectName,
273 const std::string& gbpSecGroupRuleName)
275 return resolve(framework,opflex::modb::URIBuilder().addElement(
"PolicyUniverse").addElement(
"PolicySpace").addElement(policySpaceName).addElement(
"GbpContract").addElement(gbpContractName).addElement(
"GbpSubject").addElement(gbpSubjectName).addElement(
"GbpSecGroupRule").addElement(gbpSecGroupRuleName).build());
300 const std::string& policySpaceName,
301 const std::string& gbpContractName,
302 const std::string& gbpSubjectName,
303 const std::string& gbpSecGroupRuleName)
331 opflex::ofcore::OFFramework& framework,
332 const std::string& policySpaceName,
333 const std::string& gbpSecGroupName,
334 const std::string& gbpSecGroupSubjectName,
335 const std::string& gbpSecGroupRuleName)
337 return resolve(framework,opflex::modb::URIBuilder().addElement(
"PolicyUniverse").addElement(
"PolicySpace").addElement(policySpaceName).addElement(
"GbpSecGroup").addElement(gbpSecGroupName).addElement(
"GbpSecGroupSubject").addElement(gbpSecGroupSubjectName).addElement(
"GbpSecGroupRule").addElement(gbpSecGroupRuleName).build());
362 const std::string& policySpaceName,
363 const std::string& gbpSecGroupName,
364 const std::string& gbpSecGroupSubjectName,
365 const std::string& gbpSecGroupRuleName)
384 const std::string& gbpRuleToClassifierRSrcTargetName)
386 opflex::modb::class_id_t gbpRuleToClassifierRSrcTargetClass = 31;
387 return modelgbp::gbp::RuleToClassifierRSrc::resolve(getFramework(), opflex::modb::URIBuilder(getURI()).addElement(
"GbpRuleToClassifierRSrc").addElement(gbpRuleToClassifierRSrcTargetClass).addElement(gbpRuleToClassifierRSrcTargetName).build());
405 const std::string& gbpRuleToClassifierRSrcTargetName)
407 opflex::modb::class_id_t gbpRuleToClassifierRSrcTargetClass = 31;
408 boost::shared_ptr<modelgbp::gbp::RuleToClassifierRSrc> result = addChild<modelgbp::gbp::RuleToClassifierRSrc>(
409 CLASS_ID, getURI(), 2152759401ul, 105,
410 opflex::modb::URIBuilder(getURI()).addElement(
"GbpRuleToClassifierRSrc").addElement(gbpRuleToClassifierRSrcTargetClass).addElement(gbpRuleToClassifierRSrcTargetName).build()
412 result->setTargetL24Classifier(opflex::modb::URI(gbpRuleToClassifierRSrcTargetName));
432 opflex::modb::mointernal::MO::resolveChildren<modelgbp::gbp::RuleToClassifierRSrc>(
433 getFramework(),
CLASS_ID, getURI(), 2152759401ul, 105, out);
450 const std::string& gbpRuleToActionRSrcTargetName)
452 opflex::modb::class_id_t gbpRuleToActionRSrcTargetClass = 100;
453 return modelgbp::gbp::RuleToActionRSrc::resolve(getFramework(), opflex::modb::URIBuilder(getURI()).addElement(
"GbpRuleToActionRSrc").addElement(gbpRuleToActionRSrcTargetClass).addElement(gbpRuleToActionRSrcTargetName).build());
471 const std::string& gbpRuleToActionRSrcTargetName)
473 opflex::modb::class_id_t gbpRuleToActionRSrcTargetClass = 100;
474 boost::shared_ptr<modelgbp::gbp::RuleToActionRSrc> result = addChild<modelgbp::gbp::RuleToActionRSrc>(
475 CLASS_ID, getURI(), 2152759404ul, 108,
476 opflex::modb::URIBuilder(getURI()).addElement(
"GbpRuleToActionRSrc").addElement(gbpRuleToActionRSrcTargetClass).addElement(gbpRuleToActionRSrcTargetName).build()
478 result->setTargetAllowDenyAction(opflex::modb::URI(gbpRuleToActionRSrcTargetName));
498 opflex::modb::mointernal::MO::resolveChildren<modelgbp::gbp::RuleToActionRSrc>(
499 getFramework(),
CLASS_ID, getURI(), 2152759404ul, 108, out);
516 const std::string& gbpSecGroupRuleToRemoteAddressRSrcTargetName)
518 opflex::modb::class_id_t gbpSecGroupRuleToRemoteAddressRSrcTargetClass = 152;
519 return modelgbp::gbp::SecGroupRuleToRemoteAddressRSrc::resolve(getFramework(), opflex::modb::URIBuilder(getURI()).addElement(
"GbpSecGroupRuleToRemoteAddressRSrc").addElement(gbpSecGroupRuleToRemoteAddressRSrcTargetClass).addElement(gbpSecGroupRuleToRemoteAddressRSrcTargetName).build());
537 const std::string& gbpSecGroupRuleToRemoteAddressRSrcTargetName)
539 opflex::modb::class_id_t gbpSecGroupRuleToRemoteAddressRSrcTargetClass = 152;
540 boost::shared_ptr<modelgbp::gbp::SecGroupRuleToRemoteAddressRSrc> result = addChild<modelgbp::gbp::SecGroupRuleToRemoteAddressRSrc>(
541 CLASS_ID, getURI(), 2152759458ul, 162,
542 opflex::modb::URIBuilder(getURI()).addElement(
"GbpSecGroupRuleToRemoteAddressRSrc").addElement(gbpSecGroupRuleToRemoteAddressRSrcTargetClass).addElement(gbpSecGroupRuleToRemoteAddressRSrcTargetName).build()
544 result->setTargetSubnets(opflex::modb::URI(gbpSecGroupRuleToRemoteAddressRSrcTargetName));
564 opflex::modb::mointernal::MO::resolveChildren<modelgbp::gbp::SecGroupRuleToRemoteAddressRSrc>(
565 getFramework(),
CLASS_ID, getURI(), 2152759458ul, 162, out);
578 getTLMutator().remove(
CLASS_ID, getURI());
591 static void remove(opflex::ofcore::OFFramework& framework,
592 const opflex::modb::URI& uri)
594 MO::remove(framework,
CLASS_ID, uri);
607 static void remove(
const opflex::modb::URI& uri)
609 remove(opflex::ofcore::OFFramework::defaultInstance(), uri);
633 opflex::ofcore::OFFramework& framework,
634 const std::string& policySpaceName,
635 const std::string& gbpContractName,
636 const std::string& gbpSubjectName,
637 const std::string& gbpSecGroupRuleName)
639 MO::remove(framework,
CLASS_ID, opflex::modb::URIBuilder().addElement(
"PolicyUniverse").addElement(
"PolicySpace").addElement(policySpaceName).addElement(
"GbpContract").addElement(gbpContractName).addElement(
"GbpSubject").addElement(gbpSubjectName).addElement(
"GbpSecGroupRule").addElement(gbpSecGroupRuleName).build());
663 const std::string& policySpaceName,
664 const std::string& gbpContractName,
665 const std::string& gbpSubjectName,
666 const std::string& gbpSecGroupRuleName)
692 opflex::ofcore::OFFramework& framework,
693 const std::string& policySpaceName,
694 const std::string& gbpSecGroupName,
695 const std::string& gbpSecGroupSubjectName,
696 const std::string& gbpSecGroupRuleName)
698 MO::remove(framework,
CLASS_ID, opflex::modb::URIBuilder().addElement(
"PolicyUniverse").addElement(
"PolicySpace").addElement(policySpaceName).addElement(
"GbpSecGroup").addElement(gbpSecGroupName).addElement(
"GbpSecGroupSubject").addElement(gbpSecGroupSubjectName).addElement(
"GbpSecGroupRule").addElement(gbpSecGroupRuleName).build());
722 const std::string& policySpaceName,
723 const std::string& gbpSecGroupName,
724 const std::string& gbpSecGroupSubjectName,
725 const std::string& gbpSecGroupRuleName)
742 opflex::ofcore::OFFramework& framework,
743 opflex::modb::ObjectListener* listener)
745 opflex::modb::mointernal
746 ::MO::registerListener(framework, listener,
CLASS_ID);
761 opflex::modb::ObjectListener* listener)
773 opflex::ofcore::OFFramework& framework,
774 opflex::modb::ObjectListener* listener)
776 opflex::modb::mointernal
777 ::MO::unregisterListener(framework, listener,
CLASS_ID);
787 opflex::modb::ObjectListener* listener)
797 opflex::ofcore::OFFramework& framework,
798 const opflex::modb::URI& uri,
799 const boost::shared_ptr<const opflex::modb::mointernal::ObjectInstance>& oi)
800 : MO(framework,
CLASS_ID, uri, oi) { }
805 #endif // GI_GBP_SECGROUPRULE_HPP
boost::optional< boost::shared_ptr< modelgbp::gbp::RuleToClassifierRSrc > > resolveGbpRuleToClassifierRSrc(const std::string &gbpRuleToClassifierRSrcTargetName)
Retrieve the child object with the specified naming properties.
Definition: SecGroupRule.hpp:383
const uint8_t getDirection(const uint8_t defaultValue)
Get the value of direction if set, otherwise the value of default passed in.
Definition: SecGroupRule.hpp:68
SecGroupRule(opflex::ofcore::OFFramework &framework, const opflex::modb::URI &uri, const boost::shared_ptr< const opflex::modb::mointernal::ObjectInstance > &oi)
Construct an instance of SecGroupRule.
Definition: SecGroupRule.hpp:796
static void removeUnderPolicyUniversePolicySpaceGbpSecGroupGbpSecGroupSubject(opflex::ofcore::OFFramework &framework, const std::string &policySpaceName, const std::string &gbpSecGroupName, const std::string &gbpSecGroupSubjectName, const std::string &gbpSecGroupRuleName)
Remove the SecGroupRule object with the specified path elements from the managed object store...
Definition: SecGroupRule.hpp:691
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: SecGroupRule.hpp:760
modelgbp::gbp::SecGroupRule & unsetName()
Unset name in the currently-active mutator.
Definition: SecGroupRule.hpp:149
Definition: SecGroupRule.hpp:33
static boost::optional< boost::shared_ptr< modelgbp::gbp::RuleToActionRSrc > > resolve(opflex::ofcore::OFFramework &framework, const opflex::modb::URI &uri)
Retrieve an instance of RuleToActionRSrc from the managed object store.
Definition: RuleToActionRSrc.hpp:257
static void removeUnderPolicyUniversePolicySpaceGbpSecGroupGbpSecGroupSubject(const std::string &policySpaceName, const std::string &gbpSecGroupName, const std::string &gbpSecGroupSubjectName, const std::string &gbpSecGroupRuleName)
Remove the SecGroupRule object with the specified path elements from the managed object store using t...
Definition: SecGroupRule.hpp:721
boost::shared_ptr< modelgbp::gbp::SecGroupRuleToRemoteAddressRSrc > addGbpSecGroupRuleToRemoteAddressRSrc(const std::string &gbpSecGroupRuleToRemoteAddressRSrcTargetName)
Create a new child object with the specified naming properties and make it a child of this object in ...
Definition: SecGroupRule.hpp:536
static void removeUnderPolicyUniversePolicySpaceGbpContractGbpSubject(const std::string &policySpaceName, const std::string &gbpContractName, const std::string &gbpSubjectName, const std::string &gbpSecGroupRuleName)
Remove the SecGroupRule object with the specified path elements from the managed object store using t...
Definition: SecGroupRule.hpp:662
static boost::optional< boost::shared_ptr< modelgbp::gbp::SecGroupRule > > resolve(const opflex::modb::URI &uri)
Retrieve an instance of SecGroupRule from the managed object store using the default framework instan...
Definition: SecGroupRule.hpp:240
static void unregisterListener(opflex::modb::ObjectListener *listener)
Unregister a listener from updates to this class from the default framework instance.
Definition: SecGroupRule.hpp:786
void resolveGbpSecGroupRuleToRemoteAddressRSrc(std::vector< boost::shared_ptr< modelgbp::gbp::SecGroupRuleToRemoteAddressRSrc > > &out)
Resolve and retrieve all of the immediate children of type modelgbp::gbp::SecGroupRuleToRemoteAddress...
Definition: SecGroupRule.hpp:562
modelgbp::gbp::SecGroupRule & unsetOrder()
Unset order in the currently-active mutator.
Definition: SecGroupRule.hpp:205
boost::optional< uint32_t > getOrder()
Get the value of order if it has been set.
Definition: SecGroupRule.hpp:168
static boost::optional< boost::shared_ptr< modelgbp::gbp::SecGroupRule > > resolveUnderPolicyUniversePolicySpaceGbpSecGroupGbpSecGroupSubject(opflex::ofcore::OFFramework &framework, const std::string &policySpaceName, const std::string &gbpSecGroupName, const std::string &gbpSecGroupSubjectName, const std::string &gbpSecGroupRuleName)
Retrieve an instance of SecGroupRule from the managed object store by constructing its URI from the p...
Definition: SecGroupRule.hpp:330
static boost::optional< boost::shared_ptr< modelgbp::gbp::SecGroupRuleToRemoteAddressRSrc > > resolve(opflex::ofcore::OFFramework &framework, const opflex::modb::URI &uri)
Retrieve an instance of SecGroupRuleToRemoteAddressRSrc from the managed object store.
Definition: SecGroupRuleToRemoteAddressRSrc.hpp:257
static void removeUnderPolicyUniversePolicySpaceGbpContractGbpSubject(opflex::ofcore::OFFramework &framework, const std::string &policySpaceName, const std::string &gbpContractName, const std::string &gbpSubjectName, const std::string &gbpSecGroupRuleName)
Remove the SecGroupRule object with the specified path elements from the managed object store...
Definition: SecGroupRule.hpp:632
boost::shared_ptr< modelgbp::gbp::RuleToActionRSrc > addGbpRuleToActionRSrc(const std::string &gbpRuleToActionRSrcTargetName)
Create a new child object with the specified naming properties and make it a child of this object in ...
Definition: SecGroupRule.hpp:470
static const opflex::modb::class_id_t CLASS_ID
The unique class ID for SecGroupRule.
Definition: SecGroupRule.hpp:41
void resolveGbpRuleToActionRSrc(std::vector< boost::shared_ptr< modelgbp::gbp::RuleToActionRSrc > > &out)
Resolve and retrieve all of the immediate children of type modelgbp::gbp::RuleToActionRSrc.
Definition: SecGroupRule.hpp:496
bool isNameSet()
Check whether name has been set.
Definition: SecGroupRule.hpp:103
void resolveGbpRuleToClassifierRSrc(std::vector< boost::shared_ptr< modelgbp::gbp::RuleToClassifierRSrc > > &out)
Resolve and retrieve all of the immediate children of type modelgbp::gbp::RuleToClassifierRSrc.
Definition: SecGroupRule.hpp:430
modelgbp::gbp::SecGroupRule & setOrder(uint32_t newValue)
Set order to the specified value in the currently-active mutator.
Definition: SecGroupRule.hpp:193
boost::optional< boost::shared_ptr< modelgbp::gbp::SecGroupRuleToRemoteAddressRSrc > > resolveGbpSecGroupRuleToRemoteAddressRSrc(const std::string &gbpSecGroupRuleToRemoteAddressRSrcTargetName)
Retrieve the child object with the specified naming properties.
Definition: SecGroupRule.hpp:515
bool isOrderSet()
Check whether order has been set.
Definition: SecGroupRule.hpp:159
modelgbp::gbp::SecGroupRule & setDirection(const uint8_t newValue)
Set direction to the specified value in the currently-active mutator.
Definition: SecGroupRule.hpp:81
const std::string & getName(const std::string &defaultValue)
Get the value of name if set, otherwise the value of default passed in.
Definition: SecGroupRule.hpp:124
static boost::optional< boost::shared_ptr< modelgbp::gbp::SecGroupRule > > resolveUnderPolicyUniversePolicySpaceGbpContractGbpSubject(const std::string &policySpaceName, const std::string &gbpContractName, const std::string &gbpSubjectName, const std::string &gbpSecGroupRuleName)
Retrieve an instance of SecGroupRule from the default managed object store by constructing its URI fr...
Definition: SecGroupRule.hpp:299
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: SecGroupRule.hpp:741
static boost::optional< boost::shared_ptr< modelgbp::gbp::SecGroupRule > > resolve(opflex::ofcore::OFFramework &framework, const opflex::modb::URI &uri)
Retrieve an instance of SecGroupRule from the managed object store.
Definition: SecGroupRule.hpp:222
boost::optional< const std::string & > getName()
Get the value of name if it has been set.
Definition: SecGroupRule.hpp:112
static void unregisterListener(opflex::ofcore::OFFramework &framework, opflex::modb::ObjectListener *listener)
Unregister a listener from updates to this class.
Definition: SecGroupRule.hpp:772
static boost::optional< boost::shared_ptr< modelgbp::gbp::RuleToClassifierRSrc > > resolve(opflex::ofcore::OFFramework &framework, const opflex::modb::URI &uri)
Retrieve an instance of RuleToClassifierRSrc from the managed object store.
Definition: RuleToClassifierRSrc.hpp:257
modelgbp::gbp::SecGroupRule & setName(const std::string &newValue)
Set name to the specified value in the currently-active mutator.
Definition: SecGroupRule.hpp:137
uint32_t getOrder(uint32_t defaultValue)
Get the value of order if set, otherwise the value of default passed in.
Definition: SecGroupRule.hpp:180
modelgbp::gbp::SecGroupRule & unsetDirection()
Unset direction in the currently-active mutator.
Definition: SecGroupRule.hpp:93
static boost::optional< boost::shared_ptr< modelgbp::gbp::SecGroupRule > > resolveUnderPolicyUniversePolicySpaceGbpContractGbpSubject(opflex::ofcore::OFFramework &framework, const std::string &policySpaceName, const std::string &gbpContractName, const std::string &gbpSubjectName, const std::string &gbpSecGroupRuleName)
Retrieve an instance of SecGroupRule from the managed object store by constructing its URI from the p...
Definition: SecGroupRule.hpp:268
bool isDirectionSet()
Check whether direction has been set.
Definition: SecGroupRule.hpp:47
boost::optional< const uint8_t > getDirection()
Get the value of direction if it has been set.
Definition: SecGroupRule.hpp:56
static boost::optional< boost::shared_ptr< modelgbp::gbp::SecGroupRule > > resolveUnderPolicyUniversePolicySpaceGbpSecGroupGbpSecGroupSubject(const std::string &policySpaceName, const std::string &gbpSecGroupName, const std::string &gbpSecGroupSubjectName, const std::string &gbpSecGroupRuleName)
Retrieve an instance of SecGroupRule from the default managed object store by constructing its URI fr...
Definition: SecGroupRule.hpp:361
boost::shared_ptr< modelgbp::gbp::RuleToClassifierRSrc > addGbpRuleToClassifierRSrc(const std::string &gbpRuleToClassifierRSrcTargetName)
Create a new child object with the specified naming properties and make it a child of this object in ...
Definition: SecGroupRule.hpp:404
boost::optional< boost::shared_ptr< modelgbp::gbp::RuleToActionRSrc > > resolveGbpRuleToActionRSrc(const std::string &gbpRuleToActionRSrcTargetName)
Retrieve the child object with the specified naming properties.
Definition: SecGroupRule.hpp:449