# Path: ceagle/api_fake_data/base.py
# CONF = config.CONF
# def route(reg):
#     def decorator(method):
#     def __init__(self, name, endpoint):
#     def _setup_routing(self):
#     def _find_route(self, path):
#     def default(self, path, *args, **kwargs):
#     def get(self, path, **kwargs):
# def api_handler(fake):
#     def real_function_handler(real):
#         def choice_maker(*args, **kwargs):
# def randnum(from_num, to_num, round_by=2):
# class FakeClient(object):


import datetime
import random
import flask
from ceagle.api_fake_data import base
        return flask.jsonify(get_single_runbook())
    elif flask.request.method == "PUT":
        body = flask.request.get_json(silent=True) or {}
        for field in ["description", "name",
                      "runbook", "type"]:
            if field not in body:
                return flask.jsonify(
                    {"error": "missing {}".format(field)}), 400
        body["id"] = book_id
        return flask.jsonify(body)
    elif flask.request.method == "DELETE":
        return '', 204


@base.api_handler
def run_runbook(region, book_id):
    run = get_single_run()
    run['finished_at'] = None
    run['output'] = None
    run['return_code'] = None
    return flask.jsonify(run), 202


@base.api_handler
def runbook_runs(region=None):
    return flask.jsonify(
        {"runs": [get_single_run() for i in range(10)]}
    )



# Path: ceagle/api_fake_data/base.py
# CONF = config.CONF
# def route(reg):
#     def decorator(method):
#     def __init__(self, name, endpoint):
#     def _setup_routing(self):
#     def _find_route(self, path):
#     def default(self, path, *args, **kwargs):
#     def get(self, path, **kwargs):
# def api_handler(fake):
#     def real_function_handler(real):
#         def choice_maker(*args, **kwargs):
# def randnum(from_num, to_num, round_by=2):
# class FakeClient(object):


# Path: ceagle/api_fake_data/fake_runbooks.py
import datetime
import random
import flask
from ceagle.api_fake_data import base

        return flask.jsonify(get_single_runbook())
    elif flask.request.method == "PUT":
        body = flask.request.get_json(silent=True) or {}
        for field in ["description", "name",
                      "runbook", "type"]:
            if field not in body:
                return flask.jsonify(
                    {"error": "missing {}".format(field)}), 400
        body["id"] = book_id
        return flask.jsonify(body)
    elif flask.request.method == "DELETE":
        return '', 204


@base.api_handler
def run_runbook(region, book_id):
    run = get_single_run()
    run['finished_at'] = None
    run['output'] = None
    run['return_code'] = None
    return flask.jsonify(run), 202


@base.api_handler
def runbook_runs(region=None):
    return flask.jsonify(
        {"runs": [get_single_run() for i in range(10)]}
    )



@base.api_handler