# 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_regions.py
# REGIONS_NUM = 4
# def regions(detailed=False):
# def get_regions(detailed):


import itertools
import flask
from ceagle.api_fake_data import base
from ceagle.api_fake_data import fake_regions
               ["http://none", "http://none"],
               ["http://none", "http://none", "http://none"],
               ]},
     {"id": "stacklight",
      "title": "Stacklight",
      "description": "Cloud Logging, Metering and Alerting services",
      "urls": [["http://none", "http://none", "http://none", "http://none"]]}],
    [{"id": "horizon",
      "title": "Horizon",
      "description": "Web UI that manages OpenStack resources",
      "urls": [["http://none"]]},
     {"id": "baremetal",
      "title": "Baremetal Provisioning",
      "description": "MaaS service that manages baremetal infrastructure",
      "urls": [["http://none", "http://none"], ["http://none"]]},
     {"id": "jenkins",
      "title": "Jenkins CI/CD",
      "description": "Cloud Continues Integration and Deployment.",
      "urls": [["http://none"]]}]]


@base.api_handler
def get_region_infra(region):
    regions = fake_regions.regions()
    if region not in regions:
        return flask.jsonify({"error": "Region '%s' not found" % region}), 404
    infra_idx = regions.index(region) % len(INFRAS)
    return flask.jsonify({"region": region, "infra": INFRAS[infra_idx]})



# 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_regions.py
# REGIONS_NUM = 4
# def regions(detailed=False):
# def get_regions(detailed):


# Path: ceagle/api_fake_data/fake_infra.py
import itertools
import flask
from ceagle.api_fake_data import base
from ceagle.api_fake_data import fake_regions

               ["http://none", "http://none"],
               ["http://none", "http://none", "http://none"],
               ]},
     {"id": "stacklight",
      "title": "Stacklight",
      "description": "Cloud Logging, Metering and Alerting services",
      "urls": [["http://none", "http://none", "http://none", "http://none"]]}],
    [{"id": "horizon",
      "title": "Horizon",
      "description": "Web UI that manages OpenStack resources",
      "urls": [["http://none"]]},
     {"id": "baremetal",
      "title": "Baremetal Provisioning",
      "description": "MaaS service that manages baremetal infrastructure",
      "urls": [["http://none", "http://none"], ["http://none"]]},
     {"id": "jenkins",
      "title": "Jenkins CI/CD",
      "description": "Cloud Continues Integration and Deployment.",
      "urls": [["http://none"]]}]]


@base.api_handler
def get_region_infra(region):
    regions = fake_regions.regions()
    if region not in regions:
        return flask.jsonify({"error": "Region '%s' not found" % region}), 404
    infra_idx = regions.index(region) % len(INFRAS)
    return flask.jsonify({"region": region, "infra": INFRAS[infra_idx]})



@base.api_handler