Return datacenter ID from provider configuration
962037
def get_datacenter_id():
    '''
    
    '''
    datacenter_id = config.get_cloud_config_value(
        'datacenter_id',
        get_configured_provider(),
        __opts__,
        search_global=False
    )

    conn = get_conn()

    try:
        conn.get_datacenter(datacenter_id=datacenter_id)
    except PBNotFoundError:
        log.error('Failed to get datacenter: %s', datacenter_id)
        raise

    return datacenter_id
659124
def get_host_id(kwargs=None, call=None):
    '''
    
    '''
    if call == 'action':
        raise SaltCloudSystemExit(
            'The get_host_id function must be called with -f or --function.'
        )

    if kwargs is None:
        kwargs = {}

    name = kwargs.get('name', None)
    if name is None:
        raise SaltCloudSystemExit(
            'The get_host_id function requires a name.'
        )

    try:
        ret = avail_locations()[name]['id']
    except KeyError:
        raise SaltCloudSystemExit(
            'The host \'{0}\' could not be found'.format(name)
        )

    return ret
127122
def get_connectware_id(self, use_cached=True):
        """"""
        device_json = self.get_device_json(use_cached)
        return device_json.get("devConnectwareId")
62926
def _get_esxdatacenter_proxy_details():
    '''
    
    '''
    det = __salt__['esxdatacenter.get_details']()
    return det.get('vcenter'), det.get('username'), det.get('password'), \
            det.get('protocol'), det.get('port'), det.get('mechanism'), \
            det.get('principal'), det.get('domain'), det.get('datacenter')
1290497
public Id fetchProviderStatId() {

        if (providerId == null) {
            synchronized (providerIdLock) {
                if (providerId == null) {
                    providerId = Lookout.registry().createId("rpc.provider.service.stats");
                }
            }
        }

        return providerId;
    }
1110667
public static ProviderInfo convertProviderToProviderInfo(ProviderConfig config, ServerConfig server) {
        ProviderInfo providerInfo = new ProviderInfo()
            .setPort(server.getPort())
            .setWeight(config.getWeight())
            .setSerializationType(config.getSerialization())
            .setProtocolType(server.getProtocol())
            .setPath(server.getContextPath());
        String host = server.getHost();
        if (NetUtils.isLocalHost(host) || NetUtils.isAnyHost(host)) {
            host = SystemInfo.getLocalHost();
        }
        providerInfo.setHost(host);
        return providerInfo;
    }
766453
private static String getFullInstanceId(String hostname, String id) {
    String str = hostname == null ? "" : hostname;
    str = str.replace('.', '_');
    str += (id == null ? "" : "-" + id);
    return str;
  }
821164
@Override
    public String getDatacenter(final InetAddress endpoint)
    {
        final NodeData nodeData = nodeDataMap.get(endpoint);
        return nodeData != null ? nodeData.datacenter
                : defaultNodeData.datacenter;
    }
159680
def get_hosting_device_config(self, client, hosting_device_id):
        """"""
        return client.get((self.resource_path + HOSTING_DEVICE_CONFIG) %
                          hosting_device_id)
624701
def get_user_id(self, provider, info):
        ""
        id_key = self.provider_id or 'id'
        result = info
        try:
            for key in id_key.split('.'):
                result = result[key]
            return result
        except KeyError:
            return None
281362
def get_in_net_id(cls, tenant_id):
        
        if 'in' not in cls.ip_db_obj:
            LOG.error("Fabric not prepared for tenant %s", tenant_id)
            return None
        db_obj = cls.ip_db_obj.get('in')
        in_subnet_dict = cls.get_in_ip_addr(tenant_id)
        sub = db_obj.get_subnet(in_subnet_dict.get('subnet'))
        return sub.network_id
916524
def get_connection(self, provider_name='default'):
        """"""
        try:
            return self._providers[provider_name].get_connection()
        except KeyError:
            raise AssertionError(f'No Provider registered with name {provider_name}')
1121001
def usable_id(cls, id):
        
        try:
            # id is maybe a dc_code
            qry_id = cls.from_dc_code(id)
            if not qry_id:
                # id is maybe a ISO
                qry_id = cls.from_iso(id)
                if qry_id:
                    cls.deprecated('ISO code for datacenter filter use '
                                   'dc_code instead')
            if not qry_id:
                # id is maybe a country
                qry_id = cls.from_country(id)
            if not qry_id:
                qry_id = int(id)
        except Exception:
            qry_id = None

        if not qry_id:
            msg = 'unknown identifier %s' % id
            cls.error(msg)

        return qry_id
377799
public ManagedEntity findByUuid(Datacenter datacenter, String uuid, boolean vmOnly, Boolean instanceUuid) throws RuntimeFault, RemoteException {
        ManagedObjectReference mor = getVimService().findByUuid(getMOR(), datacenter == null ? null : datacenter.getMOR(), uuid, vmOnly, instanceUuid);
        return MorUtil.createExactManagedEntity(getServerConnection(), mor);
    }
1065748
def server_id(self) :
        ""
        c_result = dbus.dbus_connection_get_server_id(self._dbobj)
        result = ct.cast(c_result, ct.c_char_p).value.decode()
        dbus.dbus_free(c_result)
        return \
            result
458692
def get_networkid(vm_):
    '''
    
    '''
    networkid = config.get_cloud_config_value('networkid', vm_, __opts__)

    if networkid is not None:
        return networkid
    else:
        return False
1238397
def get_user_from_identifier(settings, identifier):
    """"""
    providers = list(auth.strip() for auth in settings.get('authenticators').split(','))
    identities = Identity.find_all(Identity.provider.in_(providers), Identity.identifier == identifier)
    if identities:
        return sorted(identities, key=lambda x: providers.index(x.provider))[0].user
    for provider in providers:
        try:
            identity_info = multipass.get_identity(provider, identifier)
        except IdentityRetrievalFailed:
            continue
        if identity_info is None:
            continue
        if not identity_info.provider.settings.get('trusted_email'):
            continue
        emails = {email.lower() for email in identity_info.data.getlist('email') if email}
        if not emails:
            continue
        user = User.find_first(~User.is_deleted, User.all_emails.in_(list(emails)))
        if user:
            return user