Get list of SDC mapped to a specific volume
        :param volObj: ScaleIO volume object
        :return: List of ScaleIO SDC objects (empty list if no mapping exist)
        :rtype: SDC object
972404
def get_sdc_for_volume(self, volObj):
        
        sdcList = []
        if volObj.mapped_sdcs is not None:
            for sdc in volObj.mapped_sdcs:
                sdcList.append(sdc)
        if len(sdcList) == 0:
            self.conn.logger.debug("No SDCs mapped to volume: %s-(%s)" % (volObj.name, volObj.id))
            return []
        # returning an empty list is
        # valid for snapshots or volumes.
        return sdcList
469466
def volume_list(provider):
    '''
    

    '''
    client = _get_client()
    info = client.extra_action(action='volume_list', provider=provider, names='name')
    return info['name']
743013
def to_json(self, with_volumes=True):
        
        data = super().to_json()
        if with_volumes:
            data['volumes'] = [
                {
                    'volumeId': vol.id,
                    'volumeType': vol.volume_type,
                    'size': vol.size
                } for vol in self.volumes
            ]

        return data
985912
def list_volumes():
    '''
    
    '''

    root = _gluster_xml('volume list')
    if not _gluster_ok(root):
        return None
    results = [x.text for x in _iter(root, 'volume')]
    return results
1304016
def get_containers(self):
        
        query = dict(portal_type="Container",
                     sort_on="sortable_title",
                     sort_order="ascending",
                     is_active=True)
        results = api.search(query, "bika_setup_catalog")
        return map(api.get_object, results)
468941
def find_volume(self, name):
        
        try:
            return Volume(self.virsp.storageVolLookupByName(name), self)
        except libvirtError:
            return None
1104445
def _get_dvs(service_instance, dvs_name):
    '''
    
    '''
    switches = list_dvs(service_instance)
    if dvs_name in switches:
        inventory = get_inventory(service_instance)
        container = inventory.viewManager.CreateContainerView(inventory.rootFolder, [vim.DistributedVirtualSwitch], True)
        for item in container.view:
            if item.name == dvs_name:
                return item

    return None
344654
def list_snapshots(self):
        
        return [snap for snap in self.manager.list_snapshots()
                if snap.volume_id == self.id]
806145
def _get_vsan_datastore(si, cluster_name):
    ''''''

    log.trace('Retrieving vsan datastore')
    vsan_datastores = [ds for ds in
                       __salt__['vsphere.list_datastores_via_proxy'](
                           service_instance=si)
                       if ds['type'] == 'vsan']

    if not vsan_datastores:
        raise salt.exceptions.VMwareObjectRetrievalError(
            'No vSAN datastores where retrieved for cluster '
            '\'{0}\''.format(cluster_name))
    return vsan_datastores[0]
420233
def get_volume_options(volumes):
        
        if not isinstance(volumes, list):
            volumes = [volumes]
        volumes = [Volume.create_from_tuple(v) for v in volumes]
        result = []
        for v in volumes:
            result += ["-v", str(v)]
        return result
267911
def _volume_get(self, volume_id):
        '''
        
        '''
        if self.volume_conn is None:
            raise SaltCloudSystemExit('No cinder endpoint available')
        nt_ks = self.volume_conn
        volume = nt_ks.volumes.get(volume_id)
        response = {'name': volume.display_name,
                    'size': volume.size,
                    'id': volume.id,
                    'description': volume.display_description,
                    'attachments': volume.attachments,
                    'status': volume.status
                    }
        return response
745612
def get_volume_by_name(self, name):
        
        for vol in self.conn.volumes:
            if vol.name == name:
                return vol
        raise KeyError("Volume with NAME " + name + " not found")
1289107
def record(self):
        # type: () -> bytes
        '''
        
        '''
        if not self._initialized:
            raise pycdlibexception.PyCdlibInternalError('UDF Logical Volume Descriptor not initialized')

        rec = struct.pack(self.FMT, b'\x00' * 16,
                          self.vol_desc_seqnum, self.desc_char_set,
                          self.logical_vol_ident, 2048,
                          self.domain_ident.record(),
                          self.logical_volume_contents_use.record(), 6, 1,
                          self.impl_ident.record(), self.implementation_use,
                          self.integrity_sequence_length,
                          self.integrity_sequence_extent,
                          self.partition_map.record(), b'\x00' * 66)[16:]
        return self.desc_tag.record(rec) + rec
62522
def volume_list(search_opts=None, profile=None, **kwargs):
    '''
    

    '''
    conn = _auth(profile, **kwargs)
    return conn.volume_list(search_opts=search_opts)
1041405
def record(self):
        # type: () -> bytes
        '''
        
        '''
        if not self._initialized:
            raise pycdlibexception.PyCdlibInternalError('UDF Primary Volume Descriptor not initialized')

        rec = struct.pack(self.FMT, b'\x00' * 16,
                          self.vol_desc_seqnum, self.desc_num,
                          self.vol_ident, 1, 1, 2, self.max_interchange_level, 1, 1,
                          self.vol_set_ident,
                          self.desc_char_set, self.explanatory_char_set,
                          self.vol_abstract_length, self.vol_abstract_extent,
                          self.vol_copyright_length, self.vol_copyright_extent,
                          self.app_ident.record(), self.recording_date.record(),
                          self.impl_ident.record(), self.implementation_use,
                          self.predecessor_vol_desc_location, 0, b'\x00' * 22)[16:]
        return self.desc_tag.record(rec) + rec
415788
public java.util.List<ImportInstanceVolumeDetailItem> getVolumes() {
        if (volumes == null) {
            volumes = new com.amazonaws.internal.SdkInternalList<ImportInstanceVolumeDetailItem>();
        }
        return volumes;
    }
1046344
def get_disks(vm_):
    '''
    
    '''
    with _get_xapi_session() as xapi:

        disk = {}

        vm_uuid = _get_label_uuid(xapi, 'VM', vm_)
        if vm_uuid is False:
            return False
        for vbd in xapi.VM.get_VBDs(vm_uuid):
            dev = xapi.VBD.get_device(vbd)
            if not dev:
                continue
            prop = xapi.VBD.get_runtime_properties(vbd)
            disk[dev] = {
                'backend': prop['backend'],
                'type': prop['device-type'],
                'protocol': prop['protocol']
            }

        return disk