Example #1
0
    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)
Example #2
0
    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)