コード例 #1
0
 def create_rp(self, rp_name, action="accept", term_t='network-device'):
     rp = RoutingPolicy(name=rp_name, term_type=term_t)
     rp.set_routing_policy_entries(
         PolicyStatementType(term=[
             PolicyTermType(term_match_condition=TermMatchConditionType(),
                            term_action_list=TermActionListType(
                                action=action))
         ]))
     return rp
コード例 #2
0
 def test_routing_policy_community_target(self):
     rp = RoutingPolicy(name=self.id(), term_type='network-device')
     rp.set_routing_policy_entries(
         PolicyStatementType(term=[
             PolicyTermType(
                 term_match_condition=TermMatchConditionType(),
                 term_action_list=TermActionListType(
                     action='accept',
                     update=ActionUpdateType(community=ActionCommunityType(
                         add=CommunityListType(community=[
                             'color:30:12345', '30:1234556890', '0x030b:1:1'
                         ]))))),
         ]))
     self._vnc_lib.routing_policy_create(rp)
     self.assertIsNotNone(rp.uuid)