def getVolumeList(self): """Return list of all available volumes""" # self.getLogger().debug('Retrieving volume list') try: volumeList = SanApi().getVolumeList() response = volumeList.getCleanDict() except Exception as ex: self.getLogger().error('%s' % ex) self.handleException(ex) response = self.errorResponse(str(ex)) return self.formatResponse(response)
def addVolume(self, storageAdapter, size, nameFormat='*', shared=False): """ Add volume to the SAN system""" # self.getLogger().debug('Adding volume') try: volume = SanApi().addVolume(storageAdapter, size, nameFormat, 'True' == shared) response = volume.getCleanDict() except Exception as ex: self.getLogger().error('%s' % ex) self.handleException(ex) response = self.errorResponse(str(ex)) return self.formatResponse(response)
def deleteVolume(self, volume): """Delete Volume from SAN system""" response = None # self.getLogger().debug('Deleting volume') try: SanApi().deleteVolume(volume) except Exception as ex: self.getLogger().error('%s' % ex) self.handleException(ex) response = self.errorResponse(str(ex)) return self.formatResponse(response)
def updateVolume(self, volume, shared): """Update volume in SAN system""" response = None # self.getLogger().debug('Updating volume') try: SanApi().updateVolume(volume, shared == 'True') except Exception as ex: self.getLogger().error('%s' % ex) self.handleException(ex) response = self.errorResponse(str(ex)) return self.formatResponse(response)