Пример #1
0
    def get_addresponse(self, lbnode, req):

        if isinstance(lbnode, list):
            payload = Utils.get_response_body("nodes", lbnode, self)
        else:
            payload = Utils.get_response_body("node", lbnode, self)

        response = Response(body=payload, request=req)

        response.status = "202 Accepted"
        response.content_type = Utils.get_mimetype_from_format(
            self.response_format)
        response.charset = 'utf8'

        return response
Пример #2
0
    def get_updateresponse(self, loadBalancer, req):

        payload = Utils.get_response_body("loadBalancer", loadBalancer, self)
        """response = Response(body=payload, request=req)"""

        response = Response(request=req)
        response.status = "202 Accepted"
        """response.content_type = Utils.get_mimetype_from_format(self.response_format)
        response.charset = 'utf8'
        """

        return response
Пример #3
0
    def get_listresponse(self, loadBalancers, req):

        payload = Utils.get_response_body("loadBalancers", loadBalancers, self)

        response = Response(body=payload, request=req)

        response.status = "200 OK"
        response.content_type = Utils.get_mimetype_from_format(
            self.response_format)
        response.charset = 'utf8'

        return response
Пример #4
0
    def get_updateresponse(self, lbhealthmonitor, req):

        payload = Utils.get_response_body("healthMonitor", lbhealthmonitor,
                                          self)

        response = Response(body=payload, request=req)

        response.status = "202 Accepted"
        response.content_type = Utils.get_mimetype_from_format(
            self.response_format)
        response.charset = 'utf8'

        return response
Пример #5
0
    def get_getresponse(self, loadBalancer, req):

        payload = Utils.get_response_body("loadBalancer", loadBalancer, self)

        self.logger.debug("response payload: %s" % payload)

        response = Response(body=payload, request=req)

        response.status = "200 OK"
        response.content_type = Utils.get_mimetype_from_format(
            self.response_format)
        response.charset = 'utf8'

        return response
Пример #6
0
    def GetAlgorithms(self, req, env):
        self.init_request_environment(req, env)

        lbalgorithms = self.get_lbalgorithms()

        payload = Utils.get_response_body("algorithms", lbalgorithms, self)

        response = Response(body=payload, request=req)

        response.status = "200 OK"
        response.content_type = Utils.get_mimetype_from_format(
            self.response_format)
        response.charset = 'utf8'

        return response
Пример #7
0
    def GetProtocols(self, req, env):
        self.init_request_environment(req, env)

        lbprotocols = self.get_lbprotocols()

        payload = Utils.get_response_body("protocols", lbprotocols, self)

        response = Response(body=payload, request=req)

        response.status = "200 OK"
        response.content_type = Utils.get_mimetype_from_format(
            self.response_format)
        response.charset = 'utf8'

        return response

        raise NotImplementedException(
            "GET Protocols functionality not implemented")