示例#1
0
    def get_service_resource(self, request, service_id, region_name):
        """
        Based on the URL prefix of a region and a service, where the region is
        an identifier (like ORD, DFW, etc) and service is a
        dynamically-generated UUID for a particular plugin, retrieve the
        resource associated with that service.
        """
        service_object = self.core.service_with_region(region_name, service_id, base_uri_from_request(request))

        if service_object is None:
            # workaround for https://github.com/twisted/klein/issues/56
            return NoResource()
        return service_object
示例#2
0
    def get_service_resource(self, request, service_id, region_name):
        """
        Based on the URL prefix of a region and a service, where the region is
        an identifier (like ORD, DFW, etc) and service is a
        dynamically-generated UUID for a particular plugin, retrieve the
        resource associated with that service.
        """
        serviceObject = self.core.service_with_region(
            region_name, service_id, base_uri_from_request(request))

        if serviceObject is None:
            # workaround for https://github.com/twisted/klein/issues/56
            return NoResource()
        return serviceObject