# 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 datetime
import random
import flask
from ceagle.api_fake_data import base
from ceagle.api_fake_data import fake_regions
#         http://www.apache.org/licenses/LICENSE-2.0
#
#    Unless required by applicable law or agreed to in writing, software
#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
#    License for the specific language governing permissions and limitations
#    under the License.





RESPONSE_TOTAL_NULL_PROBABILITY = 10
HEALTH_NULL_PROBABILITY = 5
PERFORMANCE_NULL_PROBABILITY = 5
AVAILABILITY_NULL_PROBABILITY = 5
STATUS_NULL_PROBABILITY = 20


def validate_period(period):
    if period not in ("day", "week", "month", "year"):
        flask.abort(404)


def generate_timestamps(period):
    today = datetime.date.today()
    stamps = []
    if period == "day":
        day = (today - datetime.timedelta(days=1)).strftime("%Y-%m-%d")
        stamps = []

# 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_status.py
import datetime
import random
import flask
from ceagle.api_fake_data import base
from ceagle.api_fake_data import fake_regions

#         http://www.apache.org/licenses/LICENSE-2.0
#
#    Unless required by applicable law or agreed to in writing, software
#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
#    License for the specific language governing permissions and limitations
#    under the License.





RESPONSE_TOTAL_NULL_PROBABILITY = 10
HEALTH_NULL_PROBABILITY = 5
PERFORMANCE_NULL_PROBABILITY = 5
AVAILABILITY_NULL_PROBABILITY = 5
STATUS_NULL_PROBABILITY = 20


def validate_period(period):
    if period not in ("day", "week", "month", "year"):
        flask.abort(404)


def generate_timestamps(period):
    today = datetime.date.today()
    stamps = []
    if period == "day":
        day = (today - datetime.timedelta(days=1)).strftime("%Y-%m-%d")
        stamps = []

        for hour in range(24):