当前位置: 首页>>代码示例>>Python>>正文


Python NsmUtil.mkPresetDir方法代码示例

本文整理汇总了Python中isp.nsmUtil.NsmUtil.mkPresetDir方法的典型用法代码示例。如果您正苦于以下问题:Python NsmUtil.mkPresetDir方法的具体用法?Python NsmUtil.mkPresetDir怎么用?Python NsmUtil.mkPresetDir使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在isp.nsmUtil.NsmUtil的用法示例。


在下文中一共展示了NsmUtil.mkPresetDir方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: Top

# 需要导入模块: from isp.nsmUtil import NsmUtil [as 别名]
# 或者: from isp.nsmUtil.NsmUtil import mkPresetDir [as 别名]
from isp.internetEdgeZone import InternetEdgeZone
from isp.layer3ExternalAccessVlan import Layer3ExternalAccessVlan
from isp.externalConnection import ExternalConnection
from isp.securedInternetEdgeZone import SecuredInternetEdgeZone
from isp.firewallService import FirewallService
from isp.privateEdgeZone import PrivateEdgeZone
from isp.layer3PrivateAccessVlan import Layer3PrivateAccessVlan
from isp.privateMplsConnection import PrivateMplsConnection
from isp.securedPrivateEdgeZone import SecuredPrivateEdgeZone
from isp.ipAddressPool import IpAddressPool
from isp.ipReservation import IpReservation


if __name__ == '__main__':
    
    NsmUtil.mkPresetDir()
    
    logger = Util.getLogger(__file__)
    descriptionPrefix = 'This is the description of '
    
    name = 'My Default NSM V1'
    myNsmV1 = NsmV1(None, name)
    myNsmV1.setOffLine()
    myNsmV1.create('001')
    myNsmV1Catalog = myNsmV1.getCatalog('201')
    myNsmV1ProviderList = myNsmV1.getProviderList('301')
    
    name = 'My Default Top'
    myTop = Top(myNsmV1Catalog, name)
    myTop.setOffLine()
    myTop.create('001')
开发者ID:huhe56,项目名称:nsm-rest-api,代码行数:33,代码来源:delete-tenant-all.py

示例2: start

# 需要导入模块: from isp.nsmUtil import NsmUtil [as 别名]
# 或者: from isp.nsmUtil.NsmUtil import mkPresetDir [as 别名]
    def start(self):
        
        if (TestAll.__online1 and TestAll.__online2 and TestAll.__online3 and TestAll.__online4 and TestAll.__online5): NsmUtil.moveLogResponse()
            
        NsmUtil.mkPresetDir()

        test = Test()
        nsmV1 = self.run(None, 'test-nsm-v1.json', TestAll.__online1)
        nsmV1.getProviderList('301')
        
        catalog = nsmV1.getCatalog()
        top = self.run(catalog, 'test-top.json', TestAll.__online1)
        
        catalog = top.getCatalog()
        provider = self.run(catalog, 'test-provider.json', TestAll.__online1)
                                
        nsmV1.getProviderList('311')
        provider.getPodList('301')
        
        name = 'My Default IP Address Pool of Provider Global'
        ipAddressPoolGlobal         = self.testProviderIpAddressPool(provider, name, 'Global', '101', TestAll.__online1)
        self.testIpReservation('Global', ipAddressPoolGlobal, 'test-ip-reservation-global.json', '111', TestAll.__online1)
        
        catalog = provider.getCatalog()
        pod = self.run(catalog, 'test-pod.json', TestAll.__online1)
        
        provider.getPodList('311')
        
        
        name = 'My Default IP Address Pool of Pod Infrastructure'
        #ipAddressPoolInfrastructure = self.testProviderIpAddressPool(pod, name, 'Infrastructure', '101', TestAll.__online1)
        #self.testIpReservation('Infrastructure', ipAddressPoolInfrastructure, 'test-ip-reservation-infrastructure.json', '111', TestAll.__online1)
        
        
        if TestAll.__online1: 
            NsmUtil.printHeadLine1('test completed up to Pod')
            if Define._DummyAgent:
                acp = ACP()
                acp.start(Define._UrlHostPortEngine, Define._PathScreenShotFile)
                time.sleep(10)
        
        
        catalog = provider.getCatalog()
        tenant = self.run(catalog, 'test-tenant.json', TestAll.__online2)
        
        catalog = tenant.getCatalog()
        tenantNetworkContainer = self.run(catalog, 'test-tenant-network-container.json', TestAll.__online2)
        
        
    
        catalog = tenant.getCatalog()
        internetExtenalNetwork = self.run(catalog, 'test-internet-external-network.json', TestAll.__online3)
        
        catalog = tenantNetworkContainer.getCatalog()
        internetEdgeZone = self.run(catalog, 'test-internet-edge-zone.json', TestAll.__online3, pod)
        
        catalog = internetEdgeZone.getCatalog()
        internetEdgeZoneLayer3Vlan = self.run(catalog, 'test-internet-edge-zone-layer3-vlan.json', TestAll.__online3, pod)
        
        catalog = tenantNetworkContainer.getCatalog()
        externalConnection = self.run(catalog, 'test-internet-external-connection.json', TestAll.__online3, pod)
        
        catalog = tenantNetworkContainer.getCatalog()
        securedInternetEdgeZone = self.run(catalog, 'test-secured-internet-edge-zone.json', TestAll.__online3, pod)
        
        catalog = securedInternetEdgeZone.getCatalog()
        securedInternetEdgeZoneLayer3Vlan = self.run(catalog, 'test-secured-internet-edge-zone-layer3-vlan.json', TestAll.__online3, pod)
        
        
        catalog = tenant.getCatalog()
        internetFirewallService1 = self.run(catalog, 'test-internet-firewall-service-between-secured-and-unsecured-zone.json', TestAll.__online3)
        
        
        catalog = tenant.getCatalog()
        internetFirewallService2 = self.run(catalog, 'test-internet-firewall-service-between-secured-and-external-network.json', TestAll.__online3)
        
        
        catalog = tenant.getCatalog()
        privateExtenalNetwork = self.run(catalog, 'test-private-external-network.json', TestAll.__online4)
        
        catalog = tenantNetworkContainer.getCatalog()
        privateEdgeZone = self.run(catalog, 'test-private-edge-zone.json', TestAll.__online4, pod)
        
        catalog = privateEdgeZone.getCatalog()
        privateEdgeZoneLayer3Vlan = self.run(catalog, 'test-private-edge-zone-layer3-vlan.json', TestAll.__online4, pod)
        
        catalog = tenantNetworkContainer.getCatalog()
        privateMplsConnection = self.run(catalog, 'test-private-mpls-connection.json', TestAll.__online4, pod)
        
        catalog = tenantNetworkContainer.getCatalog()
        securedPrivateEdgeZone = self.run(catalog, 'test-secured-private-edge-zone.json', TestAll.__online4, pod)
        
        catalog = securedPrivateEdgeZone.getCatalog()
        privateEdgeZoneLayer3Vlan = self.run(catalog, 'test-secured-private-edge-zone-layer3-vlan.json', TestAll.__online4, pod)
        
        #sys.exit()
        
        catalog = tenant.getCatalog()
        privateFirewallService1 = self.run(catalog, 'test-private-firewall-service-between-secured-and-unsecured-zone.json', TestAll.__online4)
        
#.........这里部分代码省略.........
开发者ID:huhe56,项目名称:nsm-rest-api,代码行数:103,代码来源:test-all.py

示例3: start

# 需要导入模块: from isp.nsmUtil import NsmUtil [as 别名]
# 或者: from isp.nsmUtil.NsmUtil import mkPresetDir [as 别名]
    def start(self):
        
        Define._PathTestCase = Define._PathTestCase + '-simplified-update'
        
        if (TestSimple.__online1 and TestSimple.__online2 and TestSimple.__online3 and TestSimple.__online4 and TestSimple.__online5): 
            NsmUtil.moveLogResponse()
            NsmUtil.mkPresetDir()
            
            if Define._ResetNSM: Reset.resetNSM()
            
            if not Define._DummyAgent:
                if Define._ResetDevice: 
                    Reset.resetDevice()
                if Define._CopyCleanRunningConfig:
                    Reset.copyRunningConfigToTFTPServer()
                    Reset.copyRunningConfigToTemp('copy-to-tmp-clean')
                if Define._DiffClean:
                    Reset.diffCleanClean()

        test = Test()
        nsmV1 = self.run(None, 'test-nsm-v1.json', TestSimple.__online1)
        nsmV1.getProviderList('301')
        
        catalog = nsmV1.getCatalog()
        top = self.run(catalog, 'test-top.json', TestSimple.__online1)
        
        catalog = top.getCatalog()
        provider = self.run(catalog, 'test-provider.json', TestSimple.__online1)
        
        #sys.exit()
        
        catalog = provider.getCatalog()
        pod = self.run(catalog, 'test-pod-full.json', TestSimple.__online1)        
                                                           
        #sys.exit()
                                                                     
        if TestSimple.__online1: 
            NsmUtil.printHeadLine1('test completed up to Pod')
            if Define._DummyAgent:
                acp = ACP()
                acp.start(Define._UrlHostPortEngine, Define._PathScreenShotFile)
                time.sleep(10)
            else:
                #sys.exit()
                Reset.startController()
                time.sleep(300)
                if Define._SetDSCLoggingDebug:
                    Reset.setDSCLogDebug()
                
        
        catalog = provider.getCatalog()
        tenant = self.run(catalog, 'test-tenant.json', TestSimple.__online2)
        
        catalog = tenant.getCatalog()
        tenantNetworkContainer = self.run(catalog, 'test-tenant-network-container.json', TestSimple.__online2)
        
        
    
        ''' internet zone '''
        catalog = tenant.getCatalog()
        internetExtenalNetwork = self.run(catalog, 'test-internet-external-network.json', TestSimple.__online3)
        
        catalog = tenantNetworkContainer.getCatalog()
        internetEdgeZone = self.run(catalog, 'test-internet-edge-zone.json', TestSimple.__online3, pod)        
        
        catalog = internetEdgeZone.getCatalog()
        internetEdgeZoneLayer3Vlan = self.run(catalog, 'test-internet-edge-zone-layer3-vlan.json', TestSimple.__online3, pod)
        
        catalog = tenantNetworkContainer.getCatalog()
        externalConnection = self.run(catalog, 'test-internet-external-connection.json', TestSimple.__online3, pod)
        
                
        ''' secured internet zone '''
        catalog = tenantNetworkContainer.getCatalog()
        securedInternetEdgeZone = self.run(catalog, 'test-secured-internet-edge-zone.json', TestSimple.__online3, pod)
        
        catalog = securedInternetEdgeZone.getCatalog()
        securedInternetEdgeZoneLayer3Vlan = self.run(catalog, 'test-secured-internet-edge-zone-layer3-vlan.json', TestSimple.__online3, pod)
    
        
        ''' internet zone firewall '''
        catalog = tenant.getCatalog()
        internetFirewallService1 = self.run(catalog, 'test-internet-firewall-service-between-secured-and-unsecured-zone.json', TestSimple.__online3)
        
        catalog = tenant.getCatalog()
        internetFirewallService2 = self.run(catalog, 'test-internet-firewall-service-between-secured-and-external-network.json', TestSimple.__online3)
        
        
        
        ''' private zone '''
        catalog = tenant.getCatalog()
        privateExtenalNetwork = self.run(catalog, 'test-private-external-network.json', TestSimple.__online4)
        
        catalog = tenantNetworkContainer.getCatalog()
        privateEdgeZone = self.run(catalog, 'test-private-edge-zone.json', TestSimple.__online4, pod)
        
        catalog = privateEdgeZone.getCatalog()
        privateEdgeZoneLayer3Vlan = self.run(catalog, 'test-private-edge-zone-layer3-vlan.json', TestSimple.__online4, pod)
        
        catalog = tenantNetworkContainer.getCatalog()
#.........这里部分代码省略.........
开发者ID:huhe56,项目名称:nsm-rest-api,代码行数:103,代码来源:test-simple-update.py

示例4: start

# 需要导入模块: from isp.nsmUtil import NsmUtil [as 别名]
# 或者: from isp.nsmUtil.NsmUtil import mkPresetDir [as 别名]
    def start(self):
        
        #if Define._TenantStartIndex != 1:
        #    TestSimple.__online1 = False
            
        Define._PathTestCase = Define._PathTestCase + '-simplified-fury'
        
        if (TestSimple.__online1 and TestSimple.__online2 and TestSimple.__online3 and TestSimple.__online4 and TestSimple.__online5): 
            NsmUtil.moveLogResponse()
            NsmUtil.mkPresetDir()
            
            if Define._ResetNSM: Reset.resetNSM()
            
            if not Define._DummyAgent:
                if Define._ResetDevice: 
                    Reset.resetDevice()
                if Define._CopyCleanRunningConfig:
                    Reset.copyRunningConfigToTFTPServer()
                    Reset.copyRunningConfigToTemp('copy-to-tmp-clean')
                if Define._DiffClean:
                    Reset.diffCleanClean()
        

        test = Test()
        nsmV1 = self.run(None, 'test-nsm-v1.json', TestSimple.__online1)
        nsmV1.getProviderList('301')
        
        catalog = nsmV1.getCatalog()
        top = self.run(catalog, 'test-top.json', TestSimple.__online1)
        
        catalog = top.getCatalog()
        provider = self.run(catalog, 'test-provider.json', TestSimple.__online1)
        
        catalog = provider.getCatalog()
        pod = self.run(catalog, 'test-pod-full-fury.json', TestSimple.__online1)                                    
                                   
                                                               
        if TestSimple.__online1: 
            NsmUtil.printHeadLine1('test completed up to Pod')
            if Define._DummyAgent:
                ''' acp not working any more because of new firefox upgrade, need to work on it later '''
                sys.exit()
                acp = ACP()
                acp.start(Define._UrlHostPortEngine, Define._PathScreenShotFile)
                time.sleep(10)
            else:
                #sys.exit()
                Reset.startController()
                time.sleep(300)
                if Define._SetDSCLoggingDebug:
                    Reset.setDSCLogDebug()
                
                
        for tenantIndex in range(Define._TenantStartIndex, Define._TenantStartIndex + Define._TenantCount):         
            
            #if tenantIndex != 1: time.sleep(15*60)
            
            if Define._Performance:
                currentPerfTenant = PerfTenant()
                Define._PerformanceData.addCurrentTenant(currentPerfTenant)
                Define._PerformanceData.setCurrentTenantStartTime(datetime.now())
                
            
            Define._TenantIndex = tenantIndex
        
            
            providerNetworkContainer = self.run(catalog, 'test-provider-network-container.json', TestSimple.__online2)
            catalogPNC = providerNetworkContainer.getCatalog()
            
            internetExtenalNetwork = self.run(catalogPNC, 'test-internet-external-network.json', TestSimple.__online2)
            catalog = internetExtenalNetwork.getCatalog()
            
            northZone = self.run(catalogPNC, 'test-north-zone.json', TestSimple.__online2)
            catalog = northZone.getCatalog() 
            
            externalConnection = self.run(catalogPNC, 'test-internet-external-connection-fury.json', TestSimple.__online2, pod)
            catalog = externalConnection.getCatalog()
            
            southZone = self.run(catalogPNC, 'test-south-zone.json', TestSimple.__online2)
            catalog = southZone.getCatalog() 
            
            layer3ExplicitSubnet = self.run(catalog, 'test-south-zone-layer3-explicit-subnet.json', TestSimple.__online2)
            catalog = layer3ExplicitSubnet.getCatalog() 
                                                  
            self._internetEdgeZoneLayer3VlanReservedIpAddressList = self.reserveIpAddress(layer3ExplicitSubnet, 'Layer3ExplicitSubnet', 16, 1, TestSimple.__online4)
            
            #internetFirewallService0 = self.run(catalogPNC, 'test-internet-firewall-service-between-south-zone-and-external-network.json', TestSimple.__online5)
            internetFirewallService1 = self.run(catalogPNC, 'test-internet-firewall-service-between-south-zone-and-external-network-any-1.json', TestSimple.__online5)
            internetFirewallService2 = self.run(catalogPNC, 'test-internet-firewall-service-between-south-zone-and-external-network-any-2.json', TestSimple.__online5)

            if Define._Performance:
                Define._PerformanceData.setCurrentTenantEndTime(datetime.now(), Define._TenantIndex)
开发者ID:huhe56,项目名称:nsm-rest-api,代码行数:94,代码来源:test-simple-fury.py


注:本文中的isp.nsmUtil.NsmUtil.mkPresetDir方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。