def main_function(self):

        # 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=return_valid_optional_args(self.node_profile))
        # self.commit_change(l3ext_out)

        # create Nodes And Interfaces
        l3ext_rsnodel3outatt = 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 static route
        createStaticRoute.create_static_route(l3ext_rsnodel3outatt, self.static_route['prefix'], optional_args=self.static_route['optional_args'])
        # self.commit_change(l3ext_rsnodel3outatt)

        # 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=return_valid_optional_args(self.external_network_epg))
        # self.commit_change(l3ext_out)

        # configure provider/consumer for L3 outside network.
        createL3EpgProviderOrConsumerContract.create_L3_epg_provider_or_consumer_contract(l3ext_instp, 'consumed', self.consumer_contract['name'], optional_args=return_valid_optional_args(self.consumer_contract))
    def main_function(self):

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

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

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

        # create Routed Interface Profile
        for interface in self.select_routed_interfaces:
            createRoutedInterfaceProfile.create_routed_interface_profile(l3ext_lifp, str(interface['leaf_id']), str(interface['eth_num']), interface['ip_address'], optional_args=return_valid_optional_args(interface))
        self.commit_change(l3ext_lifp)

        # create External Network
        l3ext_instp = createExternalNetwork.create_external_network(l3ext_out, self.external_network, optional_args=return_valid_optional_args(self.external_network))
        self.commit_change(l3ext_out)
示例#3
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'])
示例#4
0
    def main_function(self):

        # 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=return_valid_optional_args(self.node_profile))
        # self.commit_change(l3ext_out)

        # create Nodes And Interfaces
        l3ext_rsnodel3outatt = 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 static route
        createStaticRoute.create_static_route(
            l3ext_rsnodel3outatt,
            self.static_route['prefix'],
            optional_args=self.static_route['optional_args'])
        # self.commit_change(l3ext_rsnodel3outatt)

        # 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=return_valid_optional_args(
                self.external_network_epg))
        # self.commit_change(l3ext_out)

        # configure provider/consumer for L3 outside network.
        createL3EpgProviderOrConsumerContract.create_L3_epg_provider_or_consumer_contract(
            l3ext_instp,
            'consumed',
            self.consumer_contract['name'],
            optional_args=return_valid_optional_args(self.consumer_contract))
示例#5
0
    def main_function(self):

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

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

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

        # create Routed Interface Profile
        for interface in self.select_routed_interfaces:
            createRoutedInterfaceProfile.create_routed_interface_profile(
                l3ext_lifp,
                str(interface['leaf_id']),
                str(interface['eth_num']),
                interface['ip_address'],
                optional_args=return_valid_optional_args(interface))
        self.commit_change(l3ext_lifp)

        # create External Network
        l3ext_instp = createExternalNetwork.create_external_network(
            l3ext_out,
            self.external_network,
            optional_args=return_valid_optional_args(self.external_network))
        self.commit_change(l3ext_out)