當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。