Get an individual REST resource
188698
def _get_resource_raw(
        self, cls, id, extra=None, headers=None, stream=False, **filters
    ):
        """"""
        headers = headers or {}
        headers.update(self.session.headers)

        postfix = "/{}".format(extra) if extra else ""
        if cls.api_root != "a":
            url = "{}/{}/{}{}".format(self.api_server, cls.collection_name, id, postfix)
        else:
            url = "{}/a/{}/{}/{}{}".format(
                self.api_server, self.app_id, cls.collection_name, id, postfix
            )

        converted_filters = convert_datetimes_to_timestamps(
            filters, cls.datetime_filter_attrs
        )
        url = str(URLObject(url).add_query_params(converted_filters.items()))
        response = self._get_http_session(cls.api_root).get(
            url, headers=headers, stream=stream
        )
        return _validate(response)
377407
def get_resource(self, path, params=None):
        
        url = '%s%s' % (path, self._param_list(params))
        headers = {
            'Accept': 'application/json;odata=minimalmetadata'
        }

        response = O365_DAO().getURL(self._url(url), headers)

        if response.status != 200:
            raise DataFailureException(url, response.status, response.data)

        return json_loads(response.data)
563742
def get(context, resource, **kwargs):
    """"""
    uri = '%s/%s/%s' % (context.dci_cs_api, resource, kwargs.pop('id'))
    r = context.session.get(uri, timeout=HTTP_TIMEOUT, params=kwargs)
    return r
875827
async def get_instance(self, resource_id) -> ApiResource:
        """"""
        raw = await self.get_resource(resource_id)
        return self._resource_factory(self._get_to_actual_data(raw))
164603
def get_instance(self):
        
        return Instance(self.rest_client.make_request(self.instance), self.rest_client)
1250095
def get(self, resource, params=None, **kwargs):
        """"""
        return self.request('GET', resource, params=params, **kwargs)
48312
def _get(self, url, **kw):
        '''
        
        '''
        headers = kw.pop('headers', {})
        headers.setdefault('Content-Type', 'application/json')
        headers.setdefault('Accept', 'application/json')
        headers.setdefault('Authorization', self.AUTHORIZATION_HEADER)
        kw['headers'] = headers
        resp = self.session.get(url, **kw)
        self._raise_for_status(resp)
        return resp
1246855
def do_get(self, uri):
        
        self.validate_resource_uri(uri)
        return self._connection.get(uri)
574451
def get_rest_api():
    
    assert _has_local_install

    url=[]
    ok = _run_st(['geturl', '--api'], lines=url)
    if not ok:
        raise ChildProcessError('streamtool geturl')
    return url[0]
1100310
def get_resource(self):
        
        return Resource(self.rest_client.make_request(self.resource), self.rest_client)
482748
def url(self):
        """"""
        if not self._url[2].endswith('/'):
            self._url[2] += '/'
        return RestURL.url.__get__(self)
425166
@Override
	@Transactional
	public String getResource(String id)
	{
		final TemplateCall call = templater.template("resource_template");

		final ResourceTemplateEntity entity = resourceProvisionService.getOrCreateTemplate(id);

		if (entity == null)
			throw new RestException(404, "No such resource with id: " + id);

		call.set("entity", entity);
		call.set("nonce", nonceStore.getValue());

		return call.process();
	}
278949
def resource_uri(self):
        
        primary_key_value = getattr(self, self.primary_key(), None)
        return '/{}/{}'.format(self.endpoint(), primary_key_value)
216149
def request(self, path, method='GET', params=None, type=REST_TYPE):
        """"""
        response_text = self._get_http_client(type).request(path, method, params)

        if not response_text:
            return response_text

        response_json = json.loads(response_text)

        if 'errors' in response_json:
            raise (ErrorException([Error().load(e) for e in response_json['errors']]))

        return response_json
982775
def _get_resources(self, resource, obj, params=None, map=None, **kwargs):
        """"""
        r = self._http_resource('GET', resource, params=params)
        d_items = self._resource_deserialize(r.content.decode("utf-8"))

        items =  [obj.new_from_dict(item, h=self, **kwargs) for item in d_items]

        if map is None:
            map = KeyedListResource

        list_resource = map(items=items)
        list_resource._h = self
        list_resource._obj = obj
        list_resource._kwargs = kwargs

        return list_resource
585216
def get(self, id_or_uri):
        
        uri = self.build_uri(id_or_uri)
        logger.debug('Get resource (uri = %s, ID = %s)' %
                     (uri, str(id_or_uri)))
        return self._connection.get(uri)
1066075
def _single_resource_json_response(resource, depth=0):
    
    links = resource.links()
    response = jsonify(**resource.as_dict(depth))
    response.headers['Link'] = ''
    for link in links:
        response.headers['Link'] += '<{}>; rel="{}",'.format(
            link['uri'], link['rel'])
    response.headers['Link'] = response.headers['Link'][:-1]
    return response