def testcallseq():
    """Return a friendly HTTP greeting."""
    result_prefix = APP_LOG_PREFIX_ERROR
    result_text = "Unexpected"
    try:
        print('testcallseq', 'start', request.url)
        collection = []
        headers_dict = {}
        next_call = get_next_call(request.args.to_dict(), collection)
        headers_dict = get_headers_to_include(request.headers, headers_dict)
        if next_call:
            try:
                print('next_call-[{}]-[{}]-[{}]'.format(
                    next_call, collection, headers_dict))
                result_text = RestHelper.call_with_sequence(
                    next_call, collection, headers=headers_dict)

                if not result_text.startswith('*Error*'):
                    result_prefix = APP_LOG_PREFIX_SUCCESS
            except Exception as e:
                result_text = '*Error*-Happened - Making the request-url[{}]'.format(
                    request.url)
        else:
            result_text = "Last Call Successful"
    except Exception as e:
        result_text = '*Error* - Unexpected Error Happened - Probably Parsing'
        traceback.print_exc()

    print(result_prefix + ':Call:Result[{}]'.format(result_text))
    return "host:" + K8S_HOST_NAME + "\n" + result_text
def hello():
    """Return a friendly HTTP greeting."""
    collection = [
        {
            'call': 'http://httpbin.org/get'
        },
    ]
    next_call = collection.pop()['call']
    print('next_call-[{}]-[{}]'.format(next_call, collection))
    text = RestHelper.call_with_sequence(next_call, collection)

    print(APP_LOG_PREFIX_SUCCESS + ':Call:Result[{}]'.format(text))
    return text
def manual_hello():
    collection = [
        {
            'call4': 'http://localhost:8080/testcallseq'
        },
        {
            'call3': 'http://httpbin.org/get'
        },
    ]

    text = RestHelper.call_with_sequence('http://localhost:8080/testcallseq',
                                         collection)

    print(APP_LOG_PREFIX_SUCCESS + ':Call:Result[{}]'.format(text))
    return text