74a4fec297
For system tests purposes http handlers for fetching stats added into analytics. Implemented OSWLs exporters: - /api/v1/json/oswls/<master_node_uid>, - /api/v1/json/oswls/<master_node_uid>/<resource_type> Implemented installation info exporter: - /api/v1/json/installation_info/<master_node_uid> Implemented action logs exporter: - /api/v1/json/action_logs/<master_node_uid> Change-Id: I746b43c387c90b20c70d5160d92859b4b44998c1 Closes-Bug: #1438228
53 lines
1.7 KiB
Python
53 lines
1.7 KiB
Python
# Copyright 2015 Mirantis, Inc.
|
|
#
|
|
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
|
# not use this file except in compliance with the License. You may obtain
|
|
# a copy of the License at
|
|
#
|
|
# 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.
|
|
|
|
import logging
|
|
import os
|
|
|
|
|
|
class Production(object):
|
|
DEBUG = False
|
|
LOG_FILE = '/var/log/fuel-stats/analytics.log'
|
|
LOG_LEVEL = logging.ERROR
|
|
LOG_ROTATION = False
|
|
LOGGER_NAME = 'analytics'
|
|
ELASTIC_HOST = 'product-stats.mirantis.com'
|
|
ELASTIC_PORT = 443
|
|
ELASTIC_USE_SSL = True
|
|
ELASTIC_INDEX_FUEL = 'fuel'
|
|
ELASTIC_DOC_TYPE_STRUCTURE = 'structure'
|
|
SQLALCHEMY_DATABASE_URI = \
|
|
'postgresql://collector:*****@localhost/collector'
|
|
CSV_DEFAULT_FROM_DATE_DAYS = 90
|
|
CSV_DB_YIELD_PER = 1000
|
|
JSON_DB_DEFAULT_LIMIT = 1000
|
|
# Number of attachments included into volumes CSV report
|
|
CSV_VOLUME_ATTACHMENTS_NUM = 1
|
|
|
|
|
|
class Testing(Production):
|
|
DEBUG = True
|
|
LOG_FILE = os.path.realpath(os.path.join(
|
|
os.path.dirname(__file__), '..', 'test', 'logs', 'analytics.log'))
|
|
LOG_LEVEL = logging.DEBUG
|
|
LOG_ROTATION = True
|
|
LOG_FILE_SIZE = 2048000
|
|
LOG_FILES_COUNT = 5
|
|
ELASTIC_HOST = 'localhost'
|
|
ELASTIC_PORT = 9200
|
|
ELASTIC_USE_SSL = False
|
|
SQLALCHEMY_DATABASE_URI = \
|
|
'postgresql://collector:collector@localhost/collector'
|
|
SQLALCHEMY_ECHO = True
|