Returns an object that a :class:`~bang.deployers.deployer.Deployer`
        uses to control resources of :attr:`resource_type`.

        :param str service:  Any of the resources defined
            in :mod:`bang.resources`.
494295
def get_consul(self, resource_type):
        
        consul = self.CONSUL_MAP.get(resource_type)
        if consul:
            return consul(self)
413128
def get_resources(self):
        
        json_resources = self.rest_client.make_request(self.resource_url)['resources']
        return [RestResource(resource, self.rest_client) for resource in json_resources]
762233
def _url_format(self, service):
        
        base_service_url = '{base}{service}'.format(
            base=self.urlbase,
            service=service
        )
        return base_service_url
1100310
def get_resource(self):
        
        return Resource(self.rest_client.make_request(self.resource), self.rest_client)
281336
def service(self):
        """"""
        if not self._service:
            self._service = self._client.service(id=self.service_id)
        return self._service
1373466
def get_service():
    """"""
    global _SERVICE_MANAGER

    if _SERVICE_MANAGER is None:
        _SERVICE_MANAGER = driver.DriverManager(
            namespace='tvrenamer.data.services',
            name=cfg.CONF.lookup_service,
            invoke_on_load=True)
    return _SERVICE_MANAGER.driver
1264026
def from_api_repr(cls, resource):
        
        action = resource["action"]
        instance = cls(action["storageClass"], _factory=True)
        instance.update(resource)
        return instance
99701
def parseService(self, yadis_url, uri, type_uris, service_element):
        """"""
        self.type_uris = type_uris
        self.server_url = uri
        self.used_yadis = True

        if not self.isOPIdentifier():
            # XXX: This has crappy implications for Service elements
            # that contain both 'server' and 'signon' Types.  But
            # that's a pathological configuration anyway, so I don't
            # think I care.
            self.local_id = findOPLocalIdentifier(service_element,
                                                  self.type_uris)
            self.claimed_id = yadis_url
915165
def resource_definition(resource):
    
    meta = getmeta(resource)

    definition = {
        'type': "object",
        'properties': {}
    }

    for field in meta.all_fields:
        field_definition = {}

        type_def = map_field_to_type(field)
        if type_def:
            field_definition['type'] = str(type_def)
            if type_def.format:
                field_definition['format'] = type_def.format

        if field.doc_text:
            field_definition['description'] = field.doc_text

        if isinstance(field, VirtualField) or field in meta.readonly_fields:
            field_definition['readOnly'] = True

        # Use getattr to support calculated fields
        if getattr(field, 'choices', None):
            field_definition['enum'] = [c[0] for c in field.choices]

        definition['properties'][field.name] = field_definition

    return definition
1052778
def attach_service(cls, service):
        
        invalid_service = True
        _service_classes = {'_tcp_service': TCPService, '_http_service': HTTPService}
        for key, value in _service_classes.items():
            if isinstance(service, value):
                cls._services[key] = service
                invalid_service = False
                break
        if invalid_service:
            cls._logger.error('Invalid argument attached as service')
        cls._set_bus(service)
895481
def get_resource(self, type: Type[T_Resource], name: str = 'default') -> Optional[T_Resource]:
        
        assert check_argument_types()
        self._check_closed()
        key = (type, name)

        # First check if there's already a matching resource in this context
        resource = self._resources.get(key)
        if resource is not None:
            return resource.value_or_factory

        # Next, check if there's a resource factory available on the context chain
        resource = next((ctx._resource_factories[key] for ctx in self.context_chain
                         if key in ctx._resource_factories), None)
        if resource is not None:
            return resource.generate_value(self)

        # Finally, check parents for a matching resource
        return next((ctx._resources[key].value_or_factory for ctx in self.context_chain
                     if key in ctx._resources), None)
92606
def _get_or_create_service_key(self):
        
        keys = self.service._get_service_keys(self.name)
        for key in keys['resources']:
            if key['entity']['name'] == self.service_name:
                return self.service.get_service_key(self.name,
                        self.service_name)

        self.service.create_service_key(self.name, self.service_name)
        return self.service.get_service_key(self.name, self.service_name)
751146
def get(self):
        
        resource = dict()
        resource.update(self._parse_config())
        resource.update(self._parse_interfaces())

        return resource
1056876
def get_instance(self, payload):
        
        return BuildInstance(self._version, payload, service_sid=self._solution['service_sid'], )
199939
function Resource(spec, options) {
  if (!(this instanceof Resource)) {
    return new Resource(spec, options);
  }

  if (typeof spec !== 'object') {
    throw new Error('resource spec must be an object');
  }

  debug('create resource %s', spec.path, spec);

  this.spec = spec;
  this.list = [];
  this.options = options || {};

  this.middleware = {};
  this.operations = {};
}
657325
function getResource(serviceInfo, moduleStack) {
        var resourceName = serviceInfo.resourceName;
        var resourcePath = '/resources/' + resourceName + '/' + resourceName + '.resource';
        return this.loadIfExists(resourcePath, moduleStack, 'Could not find resource file');
    }
477975
def interface_type(self):
        
        return self.visalib.parse_resource(self._resource_manager.session,
                                           self.resource_name)[0].interface_type