def post(self): args = self.parser.parse_args() config = None status = "failure" if args['node_id'] is not None or args['host_identifier'] is not None: if args['host_identifier'] is not None: node = dao.get_node_by_host_identifier(args['host_identifier']) else: node_id = args['node_id'] node = dao.getNodeById(node_id) if node: config = assemble_configuration(node) status = "success" message = "Successfully fetched full config of the node for the host identifier passed" else: message = "Host identifier or node id passed is not correct!" else: message = "Atleast one of host identifier or node id should be given!" return marshal(respcls(message, status, config), parentwrapper.common_response_wrapper, skip_none=True)
def get_config(self, **kwargs): from polylogyx.utils import assemble_configuration return assemble_configuration(self)