Get the instance configuration specified in metadata.

    Returns:
      string, the instance configuration data.
329593
def _GetInstanceConfig(self):
    
    try:
      instance_data = self.metadata_dict['instance']['attributes']
    except KeyError:
      instance_data = {}
      self.logger.warning('Instance attributes were not found.')

    try:
      project_data = self.metadata_dict['project']['attributes']
    except KeyError:
      project_data = {}
      self.logger.warning('Project attributes were not found.')

    return (instance_data.get('google-instance-configs')
            or project_data.get('google-instance-configs'))
407178
def get_configuration():
    
    root = getLogger()
    name_levels = [('', logging.getLevelName(root.level))]
    name_levels.extend(
        (name, logging.getLevelName(logger.level))
        for name, logger
        in root.manager.loggerDict.items()
        if hasattr(logger, 'level')
    )

    config_string = ','.join('%s:%s' % x for x in name_levels)

    return dict(config_string=config_string, log_json=SLogger.manager.log_json)
157277
def get_runtime_configuration(self):
        # type: () -> RuntimeConfiguration
        
        request_mapper = GenericRequestMapper(
            request_handler_chains=self.request_handler_chains)
        exception_mapper = GenericExceptionMapper(
            exception_handlers=self.exception_handlers)
        handler_adapter = GenericHandlerAdapter()

        runtime_configuration = RuntimeConfiguration(
            request_mappers=[request_mapper],
            handler_adapters=[handler_adapter],
            exception_mapper=exception_mapper,
            request_interceptors=self.global_request_interceptors,
            response_interceptors=self.global_response_interceptors)

        return runtime_configuration
77114
def metadata(self):
        
        if self._metadata is None:
            try:
                with open(self.paths.metadata()) as metadata_fd:
                    self._metadata = json.load(metadata_fd)
            except IOError:
                self._metadata = {}
        return self._metadata
482242
def metadata(self):
    
    if self._info is None:
      try:
        self._info = self._api.buckets_get(self._name)
      except Exception as e:
        raise e

    return BucketMetadata(self._info) if self._info else None
759613
def get_build_metadata(key):
    '''
    '''
    headers = {"Metadata-Flavor":"Google"}
    url = "http://metadata.google.internal/computeMetadata/v1/instance/attributes/%s" %(key)        
    response = requests.get(url=url,headers=headers)
    if response.status_code == 200:
        return response.text
    return None
968506
async def get(self):
        
        shepherd = self.request.app.vmshepherd
        data = {'presets': {}, 'config': shepherd.config}
        presets = await shepherd.preset_manager.list_presets()
        runtime = shepherd.runtime_manager
        for name in presets:
            preset = shepherd.preset_manager.get_preset(name)
            data['presets'][name] = {
                'preset': preset,
                'vms': preset.vms,
                'runtime': await runtime.get_preset_data(name),
                'vmshepherd_id': shepherd.instance_id,
                'now': time.time()
            }
        return data
313272
def get_name(cls):
        
        if not hasattr(cls.Meta, 'name'):
            class_name = getattr(cls.get_model(), '__name__', None)
            setattr(
                cls.Meta,
                'name',
                inflection.underscore(class_name) if class_name else None
            )

        return cls.Meta.name
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
837642
def get_configuration(self, scaling_group):
        
        uri = "/%s/%s/config" % (self.uri_base, utils.get_id(scaling_group))
        resp, resp_body = self.api.method_get(uri)
        return resp_body.get("groupConfiguration")
246001
def get_license_metadata(self):
        
        metadata = dict(self._license_metadata)
        metadata.update({'existing_string_values': self.my_osid_object_form._my_map['license']})
        return Metadata(**metadata)
297312
def get_registered_configs(self, instances=None):
        
        configs = self.state.get('config_files', {})
        if instances is not None:
            for config_file, config in configs.items():
                if config['instance_name'] not in instances:
                    configs.pop(config_file)
        return configs
206377
def get_config(self, model):
        """"""
        if not inspect.isclass(model):
            model = model.__class__
        return self.configs.get(self.get_model_name(model))
123888
def get_context_data(cls, instance):
        '''
        
        '''

        context_engine_id = None
        context_name = ''

        if "user" in instance:
            if 'context_engine_id' in instance:
                context_engine_id = OctetString(instance['context_engine_id'])
            if 'context_name' in instance:
                context_name = instance['context_name']

        return context_engine_id, context_name
484199
def _get_metadata(self):
        """"""
        self.metadata = self.fetch_header()
        self.variables = {g.name for g in self.metadata.grids}
1077257
def config(self):
        
        if not hasattr(self, '_config'):
            raw_config = configparser.RawConfigParser()
            f = self._open()
            if f:
                raw_config.readfp(f)
                f.close()
            self._config = raw_config
        return self._config
750621
def metadataContributer(self):
        """"""
        if self._metaFL is None:
            fl = FeatureService(url=self._metadataURL,
                              proxy_url=self._proxy_url,
                              proxy_port=self._proxy_port)
            self._metaFS = fl
        return self._metaFS