Ejemplo n.º 1
0
def getDrivername(productType, version):
    driverMgmt = driver_mgmt(None,dbfile)
    driverret = driverMgmt.find_driver(productType, version)
    if (driverret == None) : 
        drivername = ''
    else : 
        drivername = driverret[3]
        drivername = drivername.split('.')[0]
    return drivername
Ejemplo n.º 2
0
def getDrivername(productType, version):
    driverMgmt = driver_mgmt(None,dbfile)
    driverret = driverMgmt.find_driver(productType, version)
    if (driverret == None) : 
        drivername = ''
    else : 
        drivername = driverret[3]
        drivername = drivername.split('.')[0]
    return drivername
Ejemplo n.º 3
0
def drivers_delete(db, driver_id):
    #return showalldevices(db)
    dm2 = driver_mgmt(db=db)
    ret = dm2.delete_driver_id(driver_id)
    if ret == False:
        response.status = HTTP_SERVER_ERROR
        return dict(error='failed to delete driver .')
    
    return dict(ok='ok')
Ejemplo n.º 4
0
def drivers_delete(db, driver_id):
    #return showalldevices(db)
    dm2 = driver_mgmt(db=db)
    ret = dm2.delete_driver_id(driver_id)
    if ret == False:
        response.status = HTTP_SERVER_ERROR
        return dict(error='failed to delete driver .')
    
    return dict(ok='ok')
Ejemplo n.º 5
0
def adddriverall():
    dm2 = driver_mgmt(None,dbfile)
    dm2.add_driver('NE5000E', '1.0', 'generalDriver.py')
    dm2.add_driver('NE5000E', '2.0', 'generalDriver.py')
    dm2.add_driver('NE5000E', '3.0', 'generalDriver.py')
    dm2.add_driver('NE5000E', 'V800R005', 'generalDriver.py')
    dm2.add_driver('NE5000E', 'V800R006', 'generalDriver.py')
    dm2.add_driver('NE5000E', 'V800R007', 'generalDriver.py')
    dm2.add_driver('NE5000E', 'V800R008', 'generalDriver.py')
    dm2.add_driver('CE5800', 'V100R003', 'generalDriver.py')
    dm2.add_driver('CE6800', 'V100R003', 'generalDriver.py')
    dm2.add_driver('CE12800', 'V100R003', 'generalDriver.py')
    dm2.add_driver('CX600', 'V100R003', 'generalDriver.py')
    dm2.add_driver('NE40E', '1.0', 'telnet_Client.py')  
    dm2.add_driver('AgileController', '1.0', 'generalDriver.py')  
Ejemplo n.º 6
0
def adddriverall():
    dm2 = driver_mgmt(None,dbfile)
    dm2.add_driver('NE5000E', '1.0', 'generalDriver.py')
    dm2.add_driver('NE5000E', '2.0', 'generalDriver.py')
    dm2.add_driver('NE5000E', '3.0', 'generalDriver.py')
    dm2.add_driver('NE5000E', 'V800R005', 'generalDriver.py')
    dm2.add_driver('NE5000E', 'V800R006', 'generalDriver.py')
    dm2.add_driver('NE5000E', 'V800R007', 'generalDriver.py')
    dm2.add_driver('NE5000E', 'V800R008', 'generalDriver.py')
    dm2.add_driver('CE5800', 'V100R003', 'generalDriver.py')
    dm2.add_driver('CE6800', 'V100R003', 'generalDriver.py')
    dm2.add_driver('CE12800', 'V100R003', 'generalDriver.py')
    dm2.add_driver('CX600', 'V100R003', 'generalDriver.py')
    dm2.add_driver('NE40E', '1.0', 'telnet_Client.py')  
    dm2.add_driver('AgileController', '1.0', 'generalDriver.py')  
Ejemplo n.º 7
0
def drivers_post(db):
    
    body= request.body
    ddict = body.read()
    try:
        deviceinfo = json.loads(ddict)
        
        productType = deviceinfo['productType']
        version = deviceinfo['version']
        driverFile = deviceinfo['driverFile']
        
        dm2 = driver_mgmt(db=db)
        ret = dm2.add_driver(productType, version, driverFile)
  
        if ret == False:
            response.status = HTTP_SERVER_ERROR
            return dict(error='failed to create driver .')
        else:
            return dict(ok='ok')
    except Exception, e:
        response.status = HTTP_SERVER_ERROR
        return dict(error=e.message)
Ejemplo n.º 8
0
def drivers_post(db):
    
    body= request.body
    ddict = body.read()
    try:
        deviceinfo = json.loads(ddict)
        
        productType = deviceinfo['productType']
        version = deviceinfo['version']
        driverFile = deviceinfo['driverFile']
        
        dm2 = driver_mgmt(db=db)
        ret = dm2.add_driver(productType, version, driverFile)
  
        if ret == False:
            response.status = HTTP_SERVER_ERROR
            return dict(error='failed to create driver .')
        else:
            return dict(ok='ok')
    except Exception, e:
        response.status = HTTP_SERVER_ERROR
        return dict(error=e.message)
Ejemplo n.º 9
0
def drivers_get(db):
    #return showalldevices(db)
    dm2 = driver_mgmt(db=db)
    namelist = dm2.getAllDriverInfo()
    return {'drivers':namelist}
Ejemplo n.º 10
0
def drivers_get(db):
    #return showalldevices(db)
    dm2 = driver_mgmt(db=db)
    namelist = dm2.getAllDriverInfo()
    return {'drivers':namelist}