當前位置: 首頁>>代碼示例>>Python>>正文


Python NsmUtil.getIpAddressListByReservation方法代碼示例

本文整理匯總了Python中isp.nsmUtil.NsmUtil.getIpAddressListByReservation方法的典型用法代碼示例。如果您正苦於以下問題:Python NsmUtil.getIpAddressListByReservation方法的具體用法?Python NsmUtil.getIpAddressListByReservation怎麽用?Python NsmUtil.getIpAddressListByReservation使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在isp.nsmUtil.NsmUtil的用法示例。


在下文中一共展示了NsmUtil.getIpAddressListByReservation方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: reserveIpAddress

# 需要導入模塊: from isp.nsmUtil import NsmUtil [as 別名]
# 或者: from isp.nsmUtil.NsmUtil import getIpAddressListByReservation [as 別名]
 def reserveIpAddress(self, internetEdgeZoneLayer3Vlan, parentName, count, reservationIndex, online):
     
     name = 'My Default IP Address Pool of ' + parentName + ' ' + str(reservationIndex)
     
     myInternetZoneL3VlanSubPoolUid = internetEdgeZoneLayer3Vlan.getSubPoolUid()
     myInternetZoneL3VlanSubPool = IpAddressPool(myInternetZoneL3VlanSubPoolUid, name, parentName, 'SubPool')
     
     if online: myInternetZoneL3VlanSubPool.setOnLine()
     elif not online: myInternetZoneL3VlanSubPool.setOffLine()
     
     myInternetZoneL3VlanSubPoolDetail = myInternetZoneL3VlanSubPool.getDetail('101')
     
     name = 'My Default IP Address Reservation of ' + parentName + ' ' + str(reservationIndex)
     owner = name + ' owner'
     
     description = TestSimple.__descriptionPrefix + name
     requestParams = {
         'owner': owner,
         'count': str(count),
     }
     myInternetZoneIpReservationCount = IpReservation(myInternetZoneL3VlanSubPoolDetail, name, description, 'default-ip-reservation-count.xml', requestParams)
     
     if online: myInternetZoneIpReservationCount.setOnLine()
     elif not online: myInternetZoneIpReservationCount.setOffLine()
     
     myInternetZoneIpReservationCount.create('011')
     myInternetZoneIpReservationCount.getDetail('111')
     
     reservationXml = myInternetZoneIpReservationCount.getReservations('111')
     return NsmUtil.getIpAddressListByReservation(reservationXml, count)
開發者ID:huhe56,項目名稱:nsm-rest-api,代碼行數:32,代碼來源:test-simple-fury.py

示例2: start

# 需要導入模塊: from isp.nsmUtil import NsmUtil [as 別名]
# 或者: from isp.nsmUtil.NsmUtil import getIpAddressListByReservation [as 別名]

#.........這裏部分代碼省略.........
        ''' private zone firewall '''
        catalog = tenant.getCatalog()
        privateFirewallService1 = self.run(catalog, 'test-private-firewall-service-between-secured-and-unsecured-zone.json', TestSimple.__online4)
        
        catalog = tenant.getCatalog()
        privateFirewallService2 = self.run(catalog, 'test-private-firewall-service-between-secured-and-external-network.json', TestSimple.__online4)
        
        
        
        
        ''' internet zone ip reservation '''
        
        name = 'My Default IP Address Pool of Internet Edge Zone Layer 3 Vlan'
        myInternetZoneL3VlanSubPoolUid = internetEdgeZoneLayer3Vlan.getSubPoolUid()
        myInternetZoneL3VlanSubPool = IpAddressPool(myInternetZoneL3VlanSubPoolUid, name, 'Layer3ExternalAccessVlan', 'SubPool')
        
        if TestSimple.__online4: myInternetZoneL3VlanSubPool.setOnLine()
        elif not TestSimple.__online4: myInternetZoneL3VlanSubPool.setOffLine()
        
        myInternetZoneL3VlanSubPoolDetail = myInternetZoneL3VlanSubPool.getDetail('101')
        
        name = 'My Default IP Address Reservation of Internet Edge Zone Layer 3 Vlan'
        description = TestSimple.__descriptionPrefix + name
        requestParams = {
            'owner': 'My Default Internet Edge Zone Layer 3 Vlan Sub Pool Owner',
            'count': '16',
        }
        myInternetZoneIpReservationCount = IpReservation(myInternetZoneL3VlanSubPoolDetail, name, description, 'default-ip-reservation-count.xml', requestParams)
        
        if TestSimple.__online4: myInternetZoneIpReservationCount.setOnLine()
        elif not TestSimple.__online4: myInternetZoneIpReservationCount.setOffLine()
        
        myInternetZoneIpReservationCount.create('011')
        myInternetZoneIpReservationCount.getDetail('111')
        
        reservationXml = myInternetZoneIpReservationCount.getReservations('111')
        self._internetEdgeZoneLayer3VlanReservedIpAddressList = NsmUtil.getIpAddressListByReservation(reservationXml, 16)
        
        
        ''' secured internet zone ip reservation '''
        
        name = 'My Default IP Address Pool of Secured Internet Edge Zone Layer 3 Vlan'
        mySecuredInternetZoneL3VlanSubPoolUid = securedInternetEdgeZoneLayer3Vlan.getSubPoolUid()
        mySecuredInternetZoneL3VlanSubPool = IpAddressPool(mySecuredInternetZoneL3VlanSubPoolUid, name, 'Layer3ExternalAccessVlan', 'SubPool')
        
        if TestSimple.__online4: 
            mySecuredInternetZoneL3VlanSubPool.setOnLine()
        elif not TestSimple.__online4: 
            mySecuredInternetZoneL3VlanSubPool.setOffLine()
        
        mySecuredInternetZoneL3VlanSubPoolDetail = mySecuredInternetZoneL3VlanSubPool.getDetail('101')
        
        
        name = 'My Default IP Address Reservation of Secured Internet Edge Zone Layer 3 Vlan'
        description = TestSimple.__descriptionPrefix + name
        requestParams = {
            'owner': 'My Default Secured Internet Edge Zone Layer 3 Vlan Sub Pool Owner',
            'count': '16',
        }
        mySecuredInternetZoneIpReservationCount = IpReservation(mySecuredInternetZoneL3VlanSubPoolDetail, name, description, 'default-ip-reservation-count.xml', requestParams)
        
        if TestSimple.__online4: 
            mySecuredInternetZoneIpReservationCount.setOnLine()
        elif not TestSimple.__online4: 
            mySecuredInternetZoneIpReservationCount.setOffLine()
        
        mySecuredInternetZoneIpReservationCount.create('011')
        mySecuredInternetZoneIpReservationCount.getDetail('111')
        
        reservationXml = mySecuredInternetZoneIpReservationCount.getReservations('111')
        self._securedInternetEdgeZoneLayer3VlanReservedIpAddressList = NsmUtil.getIpAddressListByReservation(reservationXml, 16)
        
        
        ''' internet zone lb service '''
        catalog = tenant.getCatalog()
        self.run(catalog, 'test-internet-load-balancer.json', TestSimple.__online5)
        
        
        ''' internet zone NAT service '''
        catalog = tenant.getCatalog()
        self.run(catalog, 'test-internet-dynamic-pat.json', TestSimple.__online5)
                 
        catalog = tenant.getCatalog()
        self.run(catalog, 'test-internet-static-nat.json', TestSimple.__online5)
        
        catalog = tenant.getCatalog()
        self.run(catalog, 'test-internet-static-nat-port-redirection.json', TestSimple.__online5)
        
        
        ''' secured internet zone lb service '''
        catalog = tenant.getCatalog()
        securedInternetLoadBalancer = self.run(catalog, 'test-secured-internet-load-balancer.json', TestSimple.__online5)
        
        
        ''' update name '''
        catalog = tenant.getCatalog()
        securedInternetLoadBalancer = self.run(catalog, 'test-secured-internet-load-balancer-update.json', TestSimple.__online5, None, securedInternetLoadBalancer)
        
        catalog = securedPrivateEdgeZone.getCatalog()
        privateEdgeZoneLayer3Vlan = self.run(catalog, 'test-private-edge-zone-layer3-vlan-update.json', TestSimple.__online5, pod, privateEdgeZoneLayer3Vlan)
開發者ID:huhe56,項目名稱:nsm-rest-api,代碼行數:104,代碼來源:test-simple-update.py

示例3: start

# 需要導入模塊: from isp.nsmUtil import NsmUtil [as 別名]
# 或者: from isp.nsmUtil.NsmUtil import getIpAddressListByReservation [as 別名]

#.........這裏部分代碼省略.........
        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)
        
        catalog = tenant.getCatalog()
        privateFirewallService2 = self.run(catalog, 'test-private-firewall-service-between-secured-and-external-network.json', TestAll.__online4)
        


        name = 'My Default IP Address Pool of Internet Edge Zone Layer 3 Vlan'
        myInternetZoneL3VlanSubPoolUid = internetEdgeZoneLayer3Vlan.getSubPoolUid()
        myInternetZoneL3VlanSubPool = IpAddressPool(myInternetZoneL3VlanSubPoolUid, name, 'Layer3ExternalAccessVlan', 'SubPool')
        
        if TestAll.__online5: myInternetZoneL3VlanSubPool.setOnLine()
        elif not TestAll.__online5: myInternetZoneL3VlanSubPool.setOffLine()
        
        myInternetZoneL3VlanSubPoolDetail = myInternetZoneL3VlanSubPool.getDetail('101')
        myInternetZoneL3VlanSubPool.getAllocated('101')
        myInternetZoneL3VlanSubPool.getAvailable('101')
        myInternetZoneL3VlanSubPool.getReservations('101')
        
        name = 'My Default IP Address Reservation of Internet Edge Zone Layer 3 Vlan'
        description = TestAll.__descriptionPrefix + name
        requestParams = {
            'owner': 'My Default Internet Edge Zone Layer 3 Vlan Sub Pool Owner',
            'count': '24',
        }
        myInternetZoneIpReservationCount = IpReservation(myInternetZoneL3VlanSubPoolDetail, name, description, 'default-ip-reservation-count.xml', requestParams)
        
        if TestAll.__online5: myInternetZoneIpReservationCount.setOnLine()
        elif not TestAll.__online5: myInternetZoneIpReservationCount.setOffLine()
        
        myInternetZoneIpReservationCount.create('011')
        myInternetZoneIpReservationCount.getDetail('111')
        myInternetZoneIpReservationCount.getAllocated('111')
        myInternetZoneIpReservationCount.getAvailable('111')
        reservationXml = myInternetZoneIpReservationCount.getReservations('111')
        self._internetEdgeZoneLayer3VlanReservedIpAddressList = NsmUtil.getIpAddressListByReservation(reservationXml, 24)
        
        
        name = 'My Default IP Address Pool of Secured Internet Edge Zone Layer 3 Vlan'
        mySecuredInternetZoneL3VlanSubPoolUid = securedInternetEdgeZoneLayer3Vlan.getSubPoolUid()
        mySecuredInternetZoneL3VlanSubPool = IpAddressPool(mySecuredInternetZoneL3VlanSubPoolUid, name, 'Layer3ExternalAccessVlan', 'SubPool')
        
        if TestAll.__online5: 
            mySecuredInternetZoneL3VlanSubPool.setOnLine()
        elif not TestAll.__online5: 
            mySecuredInternetZoneL3VlanSubPool.setOffLine()
        
        mySecuredInternetZoneL3VlanSubPoolDetail = mySecuredInternetZoneL3VlanSubPool.getDetail('101')
        mySecuredInternetZoneL3VlanSubPool.getAllocated('101')
        mySecuredInternetZoneL3VlanSubPool.getAvailable('101')
        mySecuredInternetZoneL3VlanSubPool.getReservations('101')
        
        
        name = 'My Default IP Address Reservation of Secured Internet Edge Zone Layer 3 Vlan'
        description = TestAll.__descriptionPrefix + name
        requestParams = {
            'owner': 'My Default Secured Internet Edge Zone Layer 3 Vlan Sub Pool Owner',
            'count': '24',
        }
        mySecuredInternetZoneIpReservationCount = IpReservation(mySecuredInternetZoneL3VlanSubPoolDetail, name, description, 'default-ip-reservation-count.xml', requestParams)
        
        if TestAll.__online5: 
            mySecuredInternetZoneIpReservationCount.setOnLine()
        elif not TestAll.__online5: 
            mySecuredInternetZoneIpReservationCount.setOffLine()
        
        mySecuredInternetZoneIpReservationCount.create('011')
        mySecuredInternetZoneIpReservationCount.getDetail('111')
        mySecuredInternetZoneIpReservationCount.getAllocated('111')
        mySecuredInternetZoneIpReservationCount.getAvailable('111')
        reservationXml = mySecuredInternetZoneIpReservationCount.getReservations('111')
        self._securedInternetEdgeZoneLayer3VlanReservedIpAddressList = NsmUtil.getIpAddressListByReservation(reservationXml, 24)
        
                
        catalog = tenant.getCatalog()
        self.run(catalog, 'test-internet-load-balancer.json', TestAll.__online5)
        
        catalog = tenant.getCatalog()
        self.run(catalog, 'test-internet-dynamic-pat.json', TestAll.__online5)
        
        catalog = tenant.getCatalog()
        self.run(catalog, 'test-internet-static-nat.json', TestAll.__online5)
        
        catalog = tenant.getCatalog()
        self.run(catalog, 'test-internet-static-nat-port-redirection.json', TestAll.__online5)
開發者ID:huhe56,項目名稱:nsm-rest-api,代碼行數:104,代碼來源:test-all.py


注:本文中的isp.nsmUtil.NsmUtil.getIpAddressListByReservation方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。