示例#1
0
    def get_loadbalancer_object_from_dictionary(self, dict_obj):

        if not isinstance(dict_obj, dict):
            self.logger.debug(
                "Bad Request: We are expecting  a dictionary to be passed as a parameter"
            )
            raise BadRequestException(
                "Validation fault", "the object is not valid",
                "malformed request body. expecting a loadBalancer object")

        loadBalancer = Utils.get_object_from_dictionary(
            "loadBalancer", dict_obj, self)

        return loadBalancer
示例#2
0
    def get_lbnode_object_from_dictionary(self, dict_obj):

        if not isinstance(dict_obj, dict):
            self.logger.debug(
                "Bad Request: We are expecting  a dictionary to be passed as a parameter"
            )
            raise BadRequestException(
                "Validation fault", "the object is not valid",
                "malformed request body: expecting a node object")

        lbnode = Utils.get_object_from_dictionary("node", dict_obj, self)

        self.logger.debug("Exiting get_lbnode_object_from_dictionary()")

        return lbnode