def get_cloudify_endpoint(_ctx):
    """
        ctx.endpoint collapses the functionality for local and manager
        rest clients.

    :param _ctx: the NodeInstanceContext
    :return: endpoint object
    """
    if hasattr(_ctx._endpoint, 'storage'):
        return _ctx._endpoint.storage
    return _ctx._endpoint