'Increase the capacity of a volume'

def expand_volume(self, object_id, new_capacity, thin_provisioned, capacity_unit='gb'):

    if thin_provisioned:
        path = self.RESOURCE_PATHS.get('thin_volume_expand')
        data = {'newVirtualSize': new_capacity, 'sizeUnit': capacity_unit, 'newRepositorySize': new_capacity}
        return self._invoke('POST', path, data, **{'object-id': object_id})
    else:
        path = self.RESOURCE_PATHS.get('volume_expand')
        data = {'expansionSize': new_capacity, 'sizeUnit': capacity_unit}
        return self._invoke('POST', path, data, **{'object-id': object_id})
