1 ##############################################################################
2 # Copyright (c) 2016 NEC Corporation and others.
4 # All rights reserved. This program and the accompanying materials
5 # are made available under the terms of the Apache License, Version 2.0
6 # which accompanies this distribution, and is available at
7 # http://www.apache.org/licenses/LICENSE-2.0
8 ##############################################################################
11 from flask import Flask
12 from flask import request
14 import logger as doctor_log
17 LOG = doctor_log.Logger('doctor_consumer').getLogger()
23 @app.route('/failure', methods=['POST'])
25 LOG.info('doctor consumer notified at %s' % time.time())
26 LOG.info('received data = %s' % request.data)
27 d = json.loads(request.data)
32 parser = argparse.ArgumentParser(description='Doctor Sample Consumer')
33 parser.add_argument('port', metavar='PORT', type=int, nargs='?',
34 help='the port for consumer')
35 return parser.parse_args()
40 app.run(host="0.0.0.0", port=args.port)
43 if __name__ == '__main__':