'Gets total capacity and free capacity, in bytes, of the flexvol.'

def get_flexvol_capacity(self, flexvol_path=None, flexvol_name=None):

    volume_id_attributes = {}
    if flexvol_path:
        volume_id_attributes['junction-path'] = flexvol_path
    if flexvol_name:
        volume_id_attributes['name'] = flexvol_name
    api_args = {'query': {'volume-attributes': {'volume-id-attributes': volume_id_attributes}}, 'desired-attributes': {'volume-attributes': {'volume-space-attributes': {'size-available': None, 'size-total': None}}}}
    result = self.send_iter_request('volume-get-iter', api_args)
    if (self._get_record_count(result) != 1):
        msg = _('Volume    %s    not    found.')
        msg_args = (flexvol_path or flexvol_name)
        raise exception.NetAppDriverException((msg % msg_args))
    attributes_list = result.get_child_by_name('attributes-list')
    volume_attributes = attributes_list.get_child_by_name('volume-attributes')
    volume_space_attributes = volume_attributes.get_child_by_name('volume-space-attributes')
    size_available = float(volume_space_attributes.get_child_content('size-available'))
    size_total = float(volume_space_attributes.get_child_content('size-total'))
    return {'size-total': size_total, 'size-available': size_available}
