コード例 #1
0
    def main_function(self):
        # set Autonomous System Number
        bgp_instpol = self.look_up_mo('uni/fabric/bgpInstP-default', '')
        setAutonomousSystemNumber.set_autonomous_system_number(bgp_instpol, self.autonomous_system_number)
        self.commit_change()

        # create Bpg Route Reflector
        bgp_rrp = self.look_up_mo('uni/fabric/bgpInstP-default/rr', '')
        for reflector_id in self.reflector_id:
            createBgpRouteReflector.create_bgp_route_reflector(bgp_rrp, reflector_id)
        self.commit_change()

        # create Pod Policy group
        fabric_funcp = self.look_up_mo('uni/fabric/funcprof/', '')
        createPodPolicyGroup.create_pod_policy_group(fabric_funcp, self.pod_policy_group['name'], optional_args=self.pod_policy_group['optional_args'])
        self.commit_change()

        # select Pod Policy
        bgp_pods = self.look_up_mo('uni/fabric/podprof-default/pods-default-typ-ALL', '')
        selectPodPolicy.select_pod_policy(bgp_pods, self.pod_policy_group['name'])

        # create Bpg Route Outside Network
        self.check_if_tenant_exist()
        l3ext_out = createRoutedOutside.create_routed_outside(self.mo, self.routed_outside['name'], optional_args=self.routed_outside['optional_args'])
        self.commit_change()

        # create Node-And-Interface Profile
        l3ext_lnodep = createNodesAndInterfacesProfile.create_node_profile(l3ext_out, self.node_profile['name'], optional_args=self.node_profile['optional_args'])
        self.commit_change(l3ext_out)

        # create Nodes And Interfaces
        createNodes.create_node(l3ext_lnodep, str(self.leaf_id), str(self.router_id))
        l3ext_lifp = createInterfaceProfile.create_interface_profile(l3ext_lnodep, self.interface_profile['name'])
        self.commit_change(l3ext_lnodep)

        # create Routed Interface Profile
        createRoutedInterfaceProfile.create_routed_interface_profile(l3ext_lifp, str(self.interface_profile['leaf_id']), str(self.interface_profile['eth_num']), self.interface_profile['ip_address'], optional_args=self.interface_profile['optional_args'])
        self.commit_change(l3ext_lifp)

        # create External Network
        l3ext_instp = createExternalNetwork.create_external_network(l3ext_out, self.external_network_epg['name'], optional_args=self.external_network_epg['optional_args'])
        self.commit_change(l3ext_out)

        # configure provider/consumer for L3 outside network.
        createL3EpgProviderOrConsumerContract.create_L3_epg_provider_or_consumer_contract(l3ext_instp, 'provided', self.provider_contract['name'], optional_args=self.provider_contract['optional_args'])
        createL3EpgProviderOrConsumerContract.create_L3_epg_provider_or_consumer_contract(l3ext_instp, 'consumed', self.consumer_contract['name'], optional_args=self.consumer_contract['optional_args'])
        self.commit_change()

        # Set default settings for private network.
        self.check_if_mo_exist('uni/tn-' + self.tenant + '/ctx-', self.private_network['name'], Ctx, description='Private Network')
        setDefaultSettingForPrivateNetwork.set_default_setting_for_private_network(self.mo, optional_args=self.private_network['optional_args'])
        self.commit_change()

        # Associate the L3 Outside Network to a Birdge Domain.
        self.check_if_mo_exist('uni/tn-' + self.tenant + '/BD-', self.bridge_domain, BD, description='Bridge Domain')
        associateL3OutsideNetworkToBD.associate_l3_outside_network_to_bd(self.mo, self.routed_outside['name'])
コード例 #2
0
    def main_function(self):

        # set autonomous system number
        self.look_up_mo('uni/fabric/bgpInstP-default', '')
        setAutonomousSystemNumber.set_autonomous_system_number(self.mo, self.autonomous_system_number)
        self.commit_change()

        # Create node route reflectors
        self.look_up_mo('uni/fabric/bgpInstP-default/rr', '')
        for reflector_id in self.reflector_ids:
            createBgpRouteReflector.create_bgp_route_reflector(self.mo, reflector_id)
        self.commit_change()

        # create Pod Policy Group
        self.look_up_mo('uni/fabric/funcprof/', '')
        createPodPolicyGroup.create_pod_policy_group(self.mo, self.policy_group, optional_args=self.optional_args)
        self.commit_change()

        # set the Pod Policy Group as default
        self.look_up_mo('uni/fabric/podprof-default/pods-default-typ-ALL', '')
        selectPodPolicy.select_pod_policy(self.mo, self.policy_group)
コード例 #3
0
    def main_function(self):

        # set autonomous system number
        self.look_up_mo('uni/fabric/bgpInstP-default', '')
        setAutonomousSystemNumber.set_autonomous_system_number(
            self.mo, self.autonomous_system_number)
        self.commit_change()

        # Create node route reflectors
        self.look_up_mo('uni/fabric/bgpInstP-default/rr', '')
        for reflector_id in self.reflector_ids:
            createBgpRouteReflector.create_bgp_route_reflector(
                self.mo, reflector_id)
        self.commit_change()

        # create Pod Policy Group
        self.look_up_mo('uni/fabric/funcprof/', '')
        createPodPolicyGroup.create_pod_policy_group(
            self.mo, self.policy_group, optional_args=self.optional_args)
        self.commit_change()

        # set the Pod Policy Group as default
        self.look_up_mo('uni/fabric/podprof-default/pods-default-typ-ALL', '')
        selectPodPolicy.select_pod_policy(self.mo, self.policy_group)