示例#1
0
 def __init__(self, taskXml):
     '''
     Constructor
     '''
     self.logger = Util.getLogger(self.__class__.__name__)
     self._loopCount = 10
     self.taskXml = taskXml
示例#2
0
 def __init__(self, catalog, name=None, description=None, requestFileName='default-private-edge-zone.xml', requestParams=None):
     self.logger = Util.getLogger(self.__class__.__name__)
     Element.__init__(self)
     Element.setCatalogMatchParameter(self, PrivateEdgeZone._catalogServiceOfferingType, PrivateEdgeZone._catalogServiceOfferingName, PrivateEdgeZone._catalogLinkTitle)
     Element.setCreateParameter(self, name, description, requestFileName, requestParams)        
     Element.parseCatalog(self, catalog)
     
示例#3
0
 def __init__(self):
     self._logger = Util.getLogger(self.__class__.__name__)
     self._topName = 'My Default Top'
     self._thisObject = None
     self._dataStore = {}
     self._uidList = []
     self._resultList = []
     self._totalTestCase = 0
示例#4
0
 def __init__(self):
     '''
     Constructor
     '''
     self.logger = Util.getLogger(self.__class__.__name__)
     
     self.mySubClassName = self.__class__.__name__
     self.logger.info('')
     self.logger.info('')
     self.logger.info('======================>>>>>> class name: ' + self.mySubClassName + ' <<<<<<<======================')
     self.logger.info('')
     self.logger.info('')
     
     self.getCatalogUrl = ''
     
     # for matching catalog
     self.catalogServiceOfferingType = ''
     self.catalogServiceOfferingName = ''
     self.catalogLinkTitle = ''
     
     # get from parent catalog for this child creation
     self.catalogUid = ''
     self.catalogName = ''
     self.catalogDescription = ''
     self.catalogVersion = ''
     self.catalogSelfUrl = ''
     self.catalogCreateUrl = ''
     
     self.createUid = ''
     self.createName = ''
     self.createDescription = ''
             
     self.createTaskXml = None
     self.getDetailUrl = ''
     self.detailXml = ''
     self.catalogXml = ''
     
     self.deleteUrl = ''
     self.deleteTaskXml = ''
     
     self.updateUrl = ''
     self.updateTaskXml = ''
     
     self.requestBodyFileName = ''
     self.requestBodyFilePath = ''
     self.requestParams = {}
     
     # get from detail
     self.uid = ''
     
     self.pod = None
     
     # debug switch, online by default
     self.isOffLine = False
示例#5
0
    def __init__(self):
        self._logger = Util.getLogger(self.__class__.__name__)
        self._topName = 'My Default Top'
        self._thisObject = None
        self._dataStore = {}
        self._uidList = []
        self._resultList = []
        self._totalTestCase = 0
        self._metaPropertyTestCases = {}

        self._internetEdgeZoneLayer3VlanReservedIpAddressList = None
        self._securedInternetEdgeZoneLayer3VlanReservedIpAddressList = None
示例#6
0
 def __init__(self, ipAddressPoolUid, name, parentName, category):
     self.logger = Util.getLogger(self.__class__.__name__)
     
     self.logger.info('')
     self.logger.info('')
     self.logger.info('======================>>>>>> class name: ' + self.__class__.__name__ + ' <<<<<<<======================')
     self.logger.info('')
     self.logger.info('')
     
     self.isOffLine = False
     
     self.ipAddressPoolUid = ipAddressPoolUid
     self.parentName = parentName
     self.category = category
     
     self.createName = name
     self.catalogXml = None
     self.relLinkDictionary = {}
示例#7
0
 def __init__(self, host, usr, pwd, cmdFileName):
     
     self._subClassName = self.__class__.__name__
     self._logger = Util.getLogger(self._subClassName)
             
     self._cmdFileName = cmdFileName
     self._cmdFilePath = self._cmdFilePath = Define._PathDeviceCmd + '/' + self._cmdFileName
     
     self._cmdMap = Util.getJsonData(self._cmdFilePath)
     
     self._host = host
     self._usr  = usr
     self._pwd  = pwd
     
     if host in DeviceDefine._ACESMandVSSMap.keys():
         host = DeviceDefine._ACESMandVSSMap[host]
         '''
         also need to find VSS usr/pwd in the future
         '''
     
     self._expect = Expect(self._logger, host, usr, pwd)
     
     self._output = None
示例#8
0
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')
    myTopCatalog = myTop.getCatalog('201')
    
示例#9
0
 def __init__(self):
     self._logger = Util.getLogger(self.__class__.__name__)
     Test.__init__(self)
 def __init__(self, catalog, name=None, description=None, requestFileName='default-tenant-network-container.xml', requestParams=None):
     self.logger = Util.getLogger(self.__class__.__name__)
     Element.__init__(self)
     Element.setCatalogMatchParameter(self, TenantNetworkContainer._catalogServiceOfferingType, TenantNetworkContainer._catalogServiceOfferingName, TenantNetworkContainer._catalogLinkTitle)
     Element.setCreateParameter(self, name, description, requestFileName, requestParams)        
     Element.parseCatalog(self, catalog)
示例#11
0
'''
Created on Oct 19, 2012

@author: huhe
'''
import time
from device.main.myClosure import MyClosure
from device.main.myExpect import Expect
from lib import Util

if __name__ == '__main__':
    logger = Util.getLogger('sample1.py')
    expect = Expect(logger, 'od-c3-asr-a', 'admin', 'cisco123')
    expect.expectIt('#')
    expect.sendIt('terminal length 0')
    i = expect.expectIt('#')
    expect.sendIt('show run')
    i = expect.expectIt('#')
    expect.sendIt('show run')
    i = expect.expectRegex('ntp source GigabitEthernet0')
    strbuffer = expect.printGetMatch()
    print 'i = ' + str(i)
    
    
示例#12
0
 def __init__(self, catalog, name=None, description=None, requestFileName='default-layer3-explicit-subnet.xml', requestParams=None):
     self.logger = Util.getLogger(self.__class__.__name__)
     Element.__init__(self)
     Element.setCatalogMatchParameter(self, Layer3ExplicitSubnet._catalogServiceOfferingType, Layer3ExplicitSubnet._catalogServiceOfferingName, Layer3ExplicitSubnet._catalogLinkTitle)
     Element.setCreateParameter(self, name, description, requestFileName, requestParams)        
     Element.parseCatalog(self, catalog)
示例#13
0
@author: huhe
'''

import jarray, os
from java.security import Security
from java.io import DataOutputStream
from java.io import ByteArrayOutputStream
from java.net import URL
from javax.net.ssl import HttpsURLConnection;

from lib import Util
import MySSLProvider
import MyHostnameVerifier

logger = Util.getLogger(Util.getFileNameWithoutSuffix(__file__))

def doGet(url, credential):
    httpMethod = "GET"
    return doService(httpMethod, url, credential)

def doPost(url, credential, requestBody=None):
    httpMethod = "POST"
    return doService(httpMethod, url, credential, requestBody)

def doService(httpMethod, url, credential, requestBody=None):
    
    Security.addProvider(MySSLProvider())
    Security.setProperty("ssl.TrustManagerFactory.algorithm", "TrustAllCertificates")
    HttpsURLConnection.setDefaultHostnameVerifier(MyHostnameVerifier())
    
示例#14
0
 def __init__(self, catalog, name=None, description=None, requestFileName='default-load-balancer-service.xml', requestParams=None):
     self.logger = Util.getLogger(self.__class__.__name__)
     Element.__init__(self)
     Element.setCatalogMatchParameter(self, LoadBalancerService._catalogServiceOfferingType, LoadBalancerService._catalogServiceOfferingName, LoadBalancerService._catalogLinkTitle)
     Element.setCreateParameter(self, name, description, requestFileName, requestParams)        
     Element.parseCatalog(self, catalog)     
示例#15
0
 def __init__(self, catalog, name=None, description=None, requestFileName='default-external-connection.xml', requestParams=None):
     self.logger = Util.getLogger(self.__class__.__name__)
     Element.__init__(self)
     Element.setCatalogMatchParameter(self, ExternalConnection._catalogServiceOfferingType, ExternalConnection._catalogServiceOfferingName, ExternalConnection._catalogLinkTitle)
     Element.setCreateParameter(self, name, description, requestFileName, requestParams)        
     Element.parseCatalog(self, catalog)
 def __init__(self, catalog, name=None, description=None, requestFileName='default-static-nat-port-redirection-service.xml', requestParams=None):
     self.logger = Util.getLogger(self.__class__.__name__)
     Element.__init__(self)
     Element.setCatalogMatchParameter(self, StaticNatPortRedirectionService._catalogServiceOfferingType, StaticNatPortRedirectionService._catalogServiceOfferingName, StaticNatPortRedirectionService._catalogLinkTitle)
     Element.setCreateParameter(self, name, description, requestFileName, requestParams)        
     Element.parseCatalog(self, catalog)