Returns a dictionary with basic information for the given datastore

    CLI Example:

    .. code-block:: bash

        salt-cloud -f list_datastore_full my-vmware-config datastore=datastore-name
508776
def list_datastore_full(kwargs=None, call=None, datastore=None):
    '''
    
    '''
    if call != 'function':
        raise SaltCloudSystemExit(
            'The list_datastore_full function must be called with '
            '-f or --function.'
        )

    if kwargs:
        datastore = kwargs.get('datastore', None)

    if not datastore:
        raise SaltCloudSystemExit(
            'The list_datastore_full function requires a datastore'
        )

    return {datastore: salt.utils.vmware.list_datastore_full(_get_si(), datastore)}
299472
def list_datastores(call=None):
    '''
    
    '''
    if call == 'action':
        raise SaltCloudSystemExit(
            'The list_datastores function must be called with -f or --function.'
        )

    server, user, password = _get_xml_rpc()
    auth = ':'.join([user, password])
    datastore_pool = server.one.datastorepool.info(auth)[1]

    datastores = {}
    for datastore in _get_xml(datastore_pool):
        datastores[datastore.find('NAME').text] = _xml_to_dict(datastore)

    return datastores
897974
def list_nodes_full(conn=None, call=None):
    '''
    
    '''
    if call == 'action':
        raise SaltCloudSystemExit(
            'The list_nodes_full function must be called with -f or --function.'
        )

    if not conn:
        conn = get_conn()   # pylint: disable=E0602

    nodes = conn.list_nodes()
    ret = {}
    for node in nodes:
        pairs = {}
        for key, value in zip(node.__dict__, six.itervalues(node.__dict__)):
            pairs[key] = value
        ret[node.name] = pairs
        del ret[node.name]['driver']

    __utils__['cloud.cache_node_list'](ret, __active_provider_name__.split(':')[0], __opts__)
    return ret
456975
def get_datacenter(conn):
    '''
    
    '''
    datacenter_id = get_datacenter_id()

    for item in conn.list_datacenters()['items']:
        if item['id'] == datacenter_id:
            return item

    raise SaltCloudNotFound(
        'The specified datacenter \'{0}\' could not be found.'.format(
            datacenter_id
        )
    )
1095395
def list_services(kwargs=None, conn=None, call=None):
    '''
    
    '''
    if call != 'function':
        raise SaltCloudSystemExit(
            'The list_services function must be called with -f or --function.'
        )

    if not conn:
        conn = get_conn()

    data = conn.list_hosted_services()
    ret = {}
    for item in data.hosted_services:
        ret[item.service_name] = object_to_dict(item)
        ret[item.service_name]['name'] = item.service_name
    return ret
589199
def asDictionary(self):
        
        self._dict = {
            "type" : self._type,
            "workspaceId" : self._workspaceId,
            "dataSourceName": self._dataSourceName,
            "gdbVersion" : self._gdbVersion
        }
        return self._dict
70646
def vm_created(name, vm_name, cpu, memory, image, version, interfaces,
               disks, scsi_devices, serial_ports, datacenter, datastore,
               placement, ide_controllers=None, sata_controllers=None,
               cd_dvd_drives=None, advanced_configs=None, power_on=False):
    '''
    
    '''
    result = {'name': name,
              'result': None,
              'changes': {},
              'comment': ''}

    if __opts__['test']:
        result['comment'] = 'Virtual machine {0} will be created'.format(
                vm_name)
        return result

    service_instance = __salt__['vsphere.get_service_instance_via_proxy']()
    try:
        info = __salt__['vsphere.create_vm'](vm_name, cpu, memory, image,
                                             version, datacenter, datastore,
                                             placement, interfaces, disks,
                                             scsi_devices,
                                             serial_ports=serial_ports,
                                             ide_controllers=ide_controllers,
                                             sata_controllers=sata_controllers,
                                             cd_drives=cd_dvd_drives,
                                             advanced_configs=advanced_configs,
                                             service_instance=service_instance)
    except salt.exceptions.CommandExecutionError as exc:
        log.error('Error: %s', exc)
        if service_instance:
            __salt__['vsphere.disconnect'](service_instance)
        result.update({
            'result': False,
            'comment': six.text_type(exc)})
        return result

    if power_on:
        try:
            __salt__['vsphere.power_on_vm'](vm_name, datacenter,
                                            service_instance=service_instance)
        except salt.exceptions.VMwarePowerOnError as exc:
            log.error('Error: %s', exc)
            if service_instance:
                __salt__['vsphere.disconnect'](service_instance)
            result.update({
                'result': False,
                'comment': six.text_type(exc)})
            return result
        info['power_on'] = power_on

    changes = {'name': vm_name, 'info': info}
    __salt__['vsphere.disconnect'](service_instance)
    result = {'name': name,
              'result': True,
              'changes': changes,
              'comment': 'Virtual machine '
                         '{0} created successfully'.format(vm_name)}

    return result
1033027
def get_storage(store_type, data_type, name, args = {})
      full_name = "#{key}_#{name}"
      result = nil
      case store_type.to_sym
      when :redis
        result = get_redis_storage(data_type, full_name.to_s, args)
      when :local
        @_local_cache ||= {}
        unless @_local_cache[full_name.to_s]
          @_local_cache[full_name.to_s] = get_local_storage(data_type, full_name.to_s, args)
        end
        result = @_local_cache[full_name.to_s]
      else
        raise TypeError.new("Unsupported caching storage type encountered: #{store_type}")
      end
      unless full_name == "#{key}_registry_#{key}"
        registry[name.to_s] = data_type
      end
      result
    end
1205613
def _storage_list_keys(bucket, pattern):
  
  data = [{'Name': item.metadata.name,
           'Type': item.metadata.content_type,
           'Size': item.metadata.size,
           'Updated': item.metadata.updated_on}
          for item in _storage_get_keys(bucket, pattern)]
  return datalab.utils.commands.render_dictionary(data, ['Name', 'Type', 'Size', 'Updated'])
102069
def _datastore_api(self):
        """"""
        if self._datastore_api_internal is None:
            if self._use_grpc:
                self._datastore_api_internal = make_datastore_api(self)
            else:
                self._datastore_api_internal = HTTPDatastoreAPI(self)
        return self._datastore_api_internal
619130
def to_dict(self):
        
        fields = dict(vars(self).items())

        if self.populated:
            fields['ip_addresses'] = []
            fields['storage_devices'] = []
            for ip in self.ip_addresses:
                fields['ip_addresses'].append({
                    'address': ip.address,
                    'access': ip.access,
                    'family': ip.family
                })

            for storage in self.storage_devices:
                fields['storage_devices'].append({
                    'address': storage.address,
                    'storage': storage.uuid,
                    'storage_size': storage.size,
                    'storage_title': storage.title,
                    'type': storage.type,
                })

        del fields['populated']
        del fields['cloud_manager']
        return fields
280177
def _init_datastores():
    
    global _DATASTORES
    array = settings.DATASTORES
    for config in array:
        cls = _lookup(config['ENGINE'])
        ds = _get_datastore(cls, DataStore, config)
        _DATASTORES.append(ds)
    legacy_settings = getattr(settings, 'MACHINE_CATEGORY_DATASTORES', None)
    if legacy_settings is not None:
        warnings.warn(
            "MACHINE_CATEGORY_DATASTORES is deprecated, "
            "please change to use DATASTORES",
        )
        for name in ['ldap']:
            array = settings.MACHINE_CATEGORY_DATASTORES.get(name, [])
            for config in array:
                cls = _lookup(config['ENGINE'])
                ds = _get_datastore(cls, DataStore, config)
                _DATASTORES.append(ds)
63723
def get_datacenter(service_instance, datacenter_name):
    '''
    
    '''
    items = get_datacenters(service_instance,
                            datacenter_names=[datacenter_name])
    if not items:
        raise salt.exceptions.VMwareObjectRetrievalError(
            'Datacenter \'{0}\' was not found'.format(datacenter_name))
    return items[0]
115660
def facts
      logger.debug "get complete data of all VMs in all datacenters: begin"
      result = Hash[vm_mos_to_h(@vcenter.vms).map do |h|
        [h['name'], Hash[h.map { |k, v| [k.tr('.', '_'), v] }]]
      end]
      logger.debug "get complete data of all VMs in all datacenters: end"
      result
    end
377634
def __get_metadata(vm_):
    '''
    
    '''
    md = config.get_cloud_config_value(
        'metadata', vm_, __opts__,
        default='{}', search_global=False)
    # Consider warning the user that the metadata in the cloud profile
    # could not be interpreted, bad formatting?
    try:
        metadata = literal_eval(md)
    except Exception:  # pylint: disable=W0703
        metadata = None
    if not metadata or not isinstance(metadata, dict):
        metadata = {'items': [{
            'key': 'salt-cloud-profile',
            'value': vm_['profile']
        }]}
    else:
        metadata['salt-cloud-profile'] = vm_['profile']
        items = []
        for k, v in six.iteritems(metadata):
            items.append({'key': k, 'value': v})
        metadata = {'items': items}
    return metadata
1077248
def as_dict(self, env=None, internal=False):
        
        ctx_mgr = suppress() if env is None else self.using_env(env)
        with ctx_mgr:
            data = self.store.copy()
            # if not internal remove internal settings
            if not internal:
                for name in dir(default_settings):
                    data.pop(name, None)
            return data
364319
def _get_vm_info(self):
        

        vm_info = {}
        results = yield from self.manager.execute("showvminfo", [self._vmname, "--machinereadable"])
        for info in results:
            try:
                name, value = info.split('=', 1)
            except ValueError:
                continue
            vm_info[name.strip('"')] = value.strip('"')
        return vm_info