Rename to Panko
Change-Id: I50b5f6c7b74a4431ccb7af271c11fe9c027f83ab Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
parent
ba4f572fd3
commit
3009be7ee7
|
@ -1,7 +1,7 @@
|
|||
[run]
|
||||
branch = True
|
||||
source = ceilometer
|
||||
omit = ceilometer/tests/*
|
||||
source = panko
|
||||
omit = panko/tests/*
|
||||
|
||||
[report]
|
||||
ignore_errors = True
|
||||
|
|
|
@ -11,5 +11,5 @@ cover/*
|
|||
dist/*
|
||||
doc/build
|
||||
doc/source/api/
|
||||
etc/ceilometer/ceilometer.conf
|
||||
etc/panko/panko.conf
|
||||
subunit.log
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
[gerrit]
|
||||
host=review.openstack.org
|
||||
port=29418
|
||||
project=openstack/ceilometer.git
|
||||
project=openstack/panko.git
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
test_command=OS_STDOUT_CAPTURE=${OS_STDOUT_CAPTURE:-1} \
|
||||
OS_STDERR_CAPTURE=${OS_STDERR_CAPTURE:-1} \
|
||||
OS_TEST_TIMEOUT=${OS_TEST_TIMEOUT:-600} \
|
||||
${PYTHON:-python} -m subunit.run discover ${OS_TEST_PATH:-./ceilometer/tests} -t . $LISTOPT $IDOPTION
|
||||
${PYTHON:-python} -m subunit.run discover ${OS_TEST_PATH:-./panko/tests} -t . $LISTOPT $IDOPTION
|
||||
test_id_option=--load-list $IDFILE
|
||||
test_list_option=--list
|
||||
# NOTE(chdent): Only used/matches on gabbi-related tests.
|
||||
|
|
|
@ -13,4 +13,4 @@ Pull requests submitted through GitHub will be ignored.
|
|||
|
||||
Bugs should be filed on Launchpad, not GitHub:
|
||||
|
||||
https://bugs.launchpad.net/ceilometer
|
||||
https://bugs.launchpad.net/panko
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
Ceilometer Style Commandments
|
||||
=============================
|
||||
Panko Style Commandments
|
||||
========================
|
||||
|
||||
- Step 1: Read the OpenStack Style Commandments
|
||||
http://docs.openstack.org/developer/hacking/
|
||||
- Step 2: Read on
|
||||
|
||||
Ceilometer Specific Commandments
|
||||
--------------------------------
|
||||
Panko Specific Commandments
|
||||
---------------------------
|
||||
|
||||
- [C301] LOG.warn() is not allowed. Use LOG.warning()
|
||||
- [C302] Deprecated library function os.popen()
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
= Generalist Code Reviewers =
|
||||
|
||||
The current members of ceilometer-core are listed here:
|
||||
The current members of panko-core are listed here:
|
||||
|
||||
https://launchpad.net/~ceilometer-drivers/+members#active
|
||||
https://launchpad.net/~panko-drivers/+members#active
|
||||
|
||||
This group can +2 and approve patches in Ceilometer. However, they may
|
||||
This group can +2 and approve patches in Panko. However, they may
|
||||
choose to seek feedback from the appropriate specialist maintainer before
|
||||
approving a patch if it is in any way controversial or risky.
|
||||
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
ceilometer
|
||||
==========
|
||||
panko
|
||||
=====
|
||||
|
||||
Documentation for the project can be found at:
|
||||
http://docs.openstack.org/developer/ceilometer/
|
||||
http://docs.openstack.org/developer/panko/
|
||||
|
||||
The project home is at:
|
||||
http://launchpad.net/ceilometer
|
||||
http://launchpad.net/panko
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
===============================
|
||||
Enabling Ceilometer in DevStack
|
||||
===============================
|
||||
==========================
|
||||
Enabling Panko in DevStack
|
||||
==========================
|
||||
|
||||
1. Download Devstack::
|
||||
|
||||
|
@ -10,11 +10,11 @@ Enabling Ceilometer in DevStack
|
|||
2. Add this repo as an external repository in ``local.conf`` file::
|
||||
|
||||
[[local|localrc]]
|
||||
enable_plugin ceilometer https://git.openstack.org/openstack/ceilometer
|
||||
enable_plugin panko https://git.openstack.org/openstack/panko
|
||||
|
||||
There are some options, such as CEILOMETER_BACKEND, defined in
|
||||
``ceilometer/devstack/settings``, they can be used to configure the
|
||||
installation of Ceilometer. If you don't want to use their default value,
|
||||
There are some options, such as PANKO_BACKEND, defined in
|
||||
``panko/devstack/settings``, they can be used to configure the
|
||||
installation of Panko. If you don't want to use their default value,
|
||||
you can set a new one in ``local.conf``.
|
||||
|
||||
3. Run ``stack.sh``.
|
||||
|
|
|
@ -1,15 +0,0 @@
|
|||
Listen %PORT%
|
||||
|
||||
<VirtualHost *:%PORT%>
|
||||
WSGIDaemonProcess ceilometer-api processes=2 threads=10 user=%USER% display-name=%{GROUP} %VIRTUALENV%
|
||||
WSGIProcessGroup ceilometer-api
|
||||
WSGIScriptAlias / %WSGIAPP%
|
||||
WSGIApplicationGroup %{GLOBAL}
|
||||
<IfVersion >= 2.4>
|
||||
ErrorLogFormat "%{cu}t %M"
|
||||
</IfVersion>
|
||||
ErrorLog /var/log/%APACHE_NAME%/ceilometer.log
|
||||
CustomLog /var/log/%APACHE_NAME%/ceilometer_access.log combined
|
||||
</VirtualHost>
|
||||
|
||||
WSGISocketPrefix /var/run/%APACHE_NAME%
|
|
@ -0,0 +1,15 @@
|
|||
Listen %PORT%
|
||||
|
||||
<VirtualHost *:%PORT%>
|
||||
WSGIDaemonProcess panko-api processes=2 threads=10 user=%USER% display-name=%{GROUP} %VIRTUALENV%
|
||||
WSGIProcessGroup panko-api
|
||||
WSGIScriptAlias / %WSGIAPP%
|
||||
WSGIApplicationGroup %{GLOBAL}
|
||||
<IfVersion >= 2.4>
|
||||
ErrorLogFormat "%{cu}t %M"
|
||||
</IfVersion>
|
||||
ErrorLog /var/log/%APACHE_NAME%/panko.log
|
||||
CustomLog /var/log/%APACHE_NAME%/panko_access.log combined
|
||||
</VirtualHost>
|
||||
|
||||
WSGISocketPrefix /var/run/%APACHE_NAME%
|
|
@ -1,15 +1,15 @@
|
|||
# Install and start **Ceilometer** service in devstack
|
||||
# Install and start **Panko** service in devstack
|
||||
#
|
||||
# To enable Ceilometer in devstack add an entry to local.conf that
|
||||
# To enable Panko in devstack add an entry to local.conf that
|
||||
# looks like
|
||||
#
|
||||
# [[local|localrc]]
|
||||
# enable_plugin ceilometer git://git.openstack.org/openstack/ceilometer
|
||||
# enable_plugin panko git://git.openstack.org/openstack/panko
|
||||
#
|
||||
# Several variables set in the localrc section adjust common behaviors
|
||||
# of Ceilometer (see within for additional settings):
|
||||
# of Panko (see within for additional settings):
|
||||
#
|
||||
# CEILOMETER_BACKEND: Database backend (e.g. 'mysql', 'mongodb', 'es')
|
||||
# PANKO_BACKEND: Database backend (e.g. 'mysql', 'mongodb', 'es')
|
||||
|
||||
# Save trace setting
|
||||
XTRACE=$(set +o | grep xtrace)
|
||||
|
@ -17,19 +17,19 @@ set -o xtrace
|
|||
|
||||
# Support potential entry-points console scripts in VENV or not
|
||||
if [[ ${USE_VENV} = True ]]; then
|
||||
PROJECT_VENV["ceilometer"]=${CEILOMETER_DIR}.venv
|
||||
CEILOMETER_BIN_DIR=${PROJECT_VENV["ceilometer"]}/bin
|
||||
PROJECT_VENV["panko"]=${PANKO_DIR}.venv
|
||||
PANKO_BIN_DIR=${PROJECT_VENV["panko"]}/bin
|
||||
else
|
||||
CEILOMETER_BIN_DIR=$(get_python_exec_prefix)
|
||||
PANKO_BIN_DIR=$(get_python_exec_prefix)
|
||||
fi
|
||||
|
||||
function ceilometer_service_url {
|
||||
echo "$CEILOMETER_SERVICE_PROTOCOL://$CEILOMETER_SERVICE_HOST:$CEILOMETER_SERVICE_PORT"
|
||||
function panko_service_url {
|
||||
echo "$PANKO_SERVICE_PROTOCOL://$PANKO_SERVICE_HOST:$PANKO_SERVICE_PORT"
|
||||
}
|
||||
|
||||
|
||||
# _ceilometer_install_mongdb - Install mongodb and python lib.
|
||||
function _ceilometer_install_mongodb {
|
||||
# _panko_install_mongdb - Install mongodb and python lib.
|
||||
function _panko_install_mongodb {
|
||||
# Server package is the same on all
|
||||
local packages=mongodb-server
|
||||
|
||||
|
@ -51,225 +51,225 @@ function _ceilometer_install_mongodb {
|
|||
}
|
||||
|
||||
# Configure mod_wsgi
|
||||
function _ceilometer_config_apache_wsgi {
|
||||
sudo mkdir -p $CEILOMETER_WSGI_DIR
|
||||
function _panko_config_apache_wsgi {
|
||||
sudo mkdir -p $PANKO_WSGI_DIR
|
||||
|
||||
local ceilometer_apache_conf=$(apache_site_config_for ceilometer)
|
||||
local panko_apache_conf=$(apache_site_config_for panko)
|
||||
local apache_version=$(get_apache_version)
|
||||
local venv_path=""
|
||||
|
||||
# Copy proxy vhost and wsgi file
|
||||
sudo cp $CEILOMETER_DIR/ceilometer/api/app.wsgi $CEILOMETER_WSGI_DIR/app
|
||||
sudo cp $PANKO_DIR/panko/api/app.wsgi $PANKO_WSGI_DIR/app
|
||||
|
||||
if [[ ${USE_VENV} = True ]]; then
|
||||
venv_path="python-path=${PROJECT_VENV["ceilometer"]}/lib/$(python_version)/site-packages"
|
||||
venv_path="python-path=${PROJECT_VENV["panko"]}/lib/$(python_version)/site-packages"
|
||||
fi
|
||||
|
||||
sudo cp $CEILOMETER_DIR/devstack/apache-ceilometer.template $ceilometer_apache_conf
|
||||
sudo cp $PANKO_DIR/devstack/apache-panko.template $panko_apache_conf
|
||||
sudo sed -e "
|
||||
s|%PORT%|$CEILOMETER_SERVICE_PORT|g;
|
||||
s|%PORT%|$PANKO_SERVICE_PORT|g;
|
||||
s|%APACHE_NAME%|$APACHE_NAME|g;
|
||||
s|%WSGIAPP%|$CEILOMETER_WSGI_DIR/app|g;
|
||||
s|%WSGIAPP%|$PANKO_WSGI_DIR/app|g;
|
||||
s|%USER%|$STACK_USER|g;
|
||||
s|%VIRTUALENV%|$venv_path|g
|
||||
" -i $ceilometer_apache_conf
|
||||
" -i $panko_apache_conf
|
||||
}
|
||||
|
||||
# Install required services for storage backends
|
||||
function _ceilometer_prepare_storage_backend {
|
||||
if [ "$CEILOMETER_BACKEND" = 'mongodb' ] ; then
|
||||
function _panko_prepare_storage_backend {
|
||||
if [ "$PANKO_BACKEND" = 'mongodb' ] ; then
|
||||
pip_install_gr pymongo
|
||||
_ceilometer_install_mongodb
|
||||
_panko_install_mongodb
|
||||
fi
|
||||
|
||||
if [ "$CEILOMETER_BACKEND" = 'es' ] ; then
|
||||
if [ "$PANKO_BACKEND" = 'es' ] ; then
|
||||
${TOP_DIR}/pkg/elasticsearch.sh download
|
||||
${TOP_DIR}/pkg/elasticsearch.sh install
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
# Create ceilometer related accounts in Keystone
|
||||
function _ceilometer_create_accounts {
|
||||
if is_service_enabled ceilometer-api; then
|
||||
# Create panko related accounts in Keystone
|
||||
function _panko_create_accounts {
|
||||
if is_service_enabled panko-api; then
|
||||
|
||||
create_service_user "ceilometer" "admin"
|
||||
create_service_user "panko" "admin"
|
||||
|
||||
get_or_create_service "ceilometer" "metering" "OpenStack Telemetry Service"
|
||||
get_or_create_service "panko" "metering" "OpenStack Telemetry Service"
|
||||
get_or_create_endpoint "metering" \
|
||||
"$REGION_NAME" \
|
||||
"$(ceilometer_service_url)" \
|
||||
"$(ceilometer_service_url)" \
|
||||
"$(ceilometer_service_url)"
|
||||
"$(panko_service_url)" \
|
||||
"$(panko_service_url)" \
|
||||
"$(panko_service_url)"
|
||||
fi
|
||||
}
|
||||
|
||||
# Activities to do before ceilometer has been installed.
|
||||
function preinstall_ceilometer {
|
||||
# Activities to do before panko has been installed.
|
||||
function preinstall_panko {
|
||||
echo_summary "Preinstall not in virtualenv context. Skipping."
|
||||
}
|
||||
|
||||
# Remove WSGI files, disable and remove Apache vhost file
|
||||
function _ceilometer_cleanup_apache_wsgi {
|
||||
if is_service_enabled ceilometer-api && [ "$CEILOMETER_USE_MOD_WSGI" == "True" ]; then
|
||||
sudo rm -f "$CEILOMETER_WSGI_DIR"/*
|
||||
sudo rmdir "$CEILOMETER_WSGI_DIR"
|
||||
sudo rm -f $(apache_site_config_for ceilometer)
|
||||
function _panko_cleanup_apache_wsgi {
|
||||
if is_service_enabled panko-api && [ "$PANKO_USE_MOD_WSGI" == "True" ]; then
|
||||
sudo rm -f "$PANKO_WSGI_DIR"/*
|
||||
sudo rmdir "$PANKO_WSGI_DIR"
|
||||
sudo rm -f $(apache_site_config_for panko)
|
||||
fi
|
||||
}
|
||||
|
||||
function _drop_database {
|
||||
if is_service_enabled ceilometer-api ; then
|
||||
if [ "$CEILOMETER_BACKEND" = 'mongodb' ] ; then
|
||||
mongo ceilometer --eval "db.dropDatabase();"
|
||||
elif [ "$CEILOMETER_BACKEND" = 'es' ] ; then
|
||||
if is_service_enabled panko-api ; then
|
||||
if [ "$PANKO_BACKEND" = 'mongodb' ] ; then
|
||||
mongo panko --eval "db.dropDatabase();"
|
||||
elif [ "$PANKO_BACKEND" = 'es' ] ; then
|
||||
curl -XDELETE "localhost:9200/events_*"
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
# cleanup_ceilometer() - Remove residual data files, anything left over
|
||||
# cleanup_panko() - Remove residual data files, anything left over
|
||||
# from previous runs that a clean run would need to clean up
|
||||
function cleanup_ceilometer {
|
||||
_ceilometer_cleanup_apache_wsgi
|
||||
function cleanup_panko {
|
||||
_panko_cleanup_apache_wsgi
|
||||
_drop_database
|
||||
sudo rm -f "$CEILOMETER_CONF_DIR"/*
|
||||
sudo rmdir "$CEILOMETER_CONF_DIR"
|
||||
sudo rm -f "$PANKO_CONF_DIR"/*
|
||||
sudo rmdir "$PANKO_CONF_DIR"
|
||||
}
|
||||
|
||||
# Set configuration for storage backend.
|
||||
function _ceilometer_configure_storage_backend {
|
||||
if [ "$CEILOMETER_BACKEND" = 'mysql' ] || [ "$CEILOMETER_BACKEND" = 'postgresql' ] ; then
|
||||
iniset $CEILOMETER_CONF database event_connection $(database_connection_url ceilometer)
|
||||
elif [ "$CEILOMETER_BACKEND" = 'es' ] ; then
|
||||
function _panko_configure_storage_backend {
|
||||
if [ "$PANKO_BACKEND" = 'mysql' ] || [ "$PANKO_BACKEND" = 'postgresql' ] ; then
|
||||
iniset $PANKO_CONF database event_connection $(database_connection_url panko)
|
||||
elif [ "$PANKO_BACKEND" = 'es' ] ; then
|
||||
# es is only supported for events. we will use sql for metering.
|
||||
iniset $CEILOMETER_CONF database event_connection es://localhost:9200
|
||||
iniset $PANKO_CONF database event_connection es://localhost:9200
|
||||
${TOP_DIR}/pkg/elasticsearch.sh start
|
||||
elif [ "$CEILOMETER_BACKEND" = 'mongodb' ] ; then
|
||||
iniset $CEILOMETER_CONF database event_connection mongodb://localhost:27017/ceilometer
|
||||
elif [ "$PANKO_BACKEND" = 'mongodb' ] ; then
|
||||
iniset $PANKO_CONF database event_connection mongodb://localhost:27017/panko
|
||||
else
|
||||
die $LINENO "Unable to configure unknown CEILOMETER_BACKEND $CEILOMETER_BACKEND"
|
||||
die $LINENO "Unable to configure unknown PANKO_BACKEND $PANKO_BACKEND"
|
||||
fi
|
||||
_drop_database
|
||||
}
|
||||
|
||||
# Configure Ceilometer
|
||||
function configure_ceilometer {
|
||||
# Configure Panko
|
||||
function configure_panko {
|
||||
|
||||
local conffile
|
||||
|
||||
iniset $CEILOMETER_CONF DEFAULT debug "$ENABLE_DEBUG_LOG_LEVEL"
|
||||
iniset $PANKO_CONF DEFAULT debug "$ENABLE_DEBUG_LOG_LEVEL"
|
||||
|
||||
# Install the policy file and declarative configuration files to
|
||||
# the conf dir.
|
||||
# NOTE(cdent): Do not make this a glob as it will conflict
|
||||
# with rootwrap installation done elsewhere and also clobber
|
||||
# ceilometer.conf settings that have already been made.
|
||||
# panko.conf settings that have already been made.
|
||||
# Anyway, explicit is better than implicit.
|
||||
for conffile in policy.json api_paste.ini; do
|
||||
cp $CEILOMETER_DIR/etc/ceilometer/$conffile $CEILOMETER_CONF_DIR
|
||||
cp $PANKO_DIR/etc/panko/$conffile $PANKO_CONF_DIR
|
||||
done
|
||||
|
||||
configure_auth_token_middleware $CEILOMETER_CONF ceilometer $CEILOMETER_AUTH_CACHE_DIR
|
||||
configure_auth_token_middleware $PANKO_CONF panko $PANKO_AUTH_CACHE_DIR
|
||||
|
||||
# Configure storage
|
||||
if is_service_enabled ceilometer-api; then
|
||||
_ceilometer_configure_storage_backend
|
||||
if is_service_enabled panko-api; then
|
||||
_panko_configure_storage_backend
|
||||
fi
|
||||
|
||||
if is_service_enabled ceilometer-api && [ "$CEILOMETER_USE_MOD_WSGI" == "True" ]; then
|
||||
iniset $CEILOMETER_CONF api pecan_debug "False"
|
||||
_ceilometer_config_apache_wsgi
|
||||
if is_service_enabled panko-api && [ "$PANKO_USE_MOD_WSGI" == "True" ]; then
|
||||
iniset $PANKO_CONF api pecan_debug "False"
|
||||
_panko_config_apache_wsgi
|
||||
fi
|
||||
}
|
||||
|
||||
# init_ceilometer() - Initialize etc.
|
||||
function init_ceilometer {
|
||||
# Get ceilometer keystone settings in place
|
||||
_ceilometer_create_accounts
|
||||
# init_panko() - Initialize etc.
|
||||
function init_panko {
|
||||
# Get panko keystone settings in place
|
||||
_panko_create_accounts
|
||||
# Create cache dir
|
||||
sudo install -d -o $STACK_USER $CEILOMETER_AUTH_CACHE_DIR
|
||||
rm -f $CEILOMETER_AUTH_CACHE_DIR/*
|
||||
sudo install -d -o $STACK_USER $PANKO_AUTH_CACHE_DIR
|
||||
rm -f $PANKO_AUTH_CACHE_DIR/*
|
||||
|
||||
if is_service_enabled ceilometer-api && is_service_enabled mysql postgresql ; then
|
||||
if [ "$CEILOMETER_BACKEND" = 'mysql' ] || [ "$CEILOMETER_BACKEND" = 'postgresql' ] || [ "$CEILOMETER_BACKEND" = 'es' ] ; then
|
||||
recreate_database ceilometer
|
||||
$CEILOMETER_BIN_DIR/ceilometer-dbsync
|
||||
if is_service_enabled panko-api && is_service_enabled mysql postgresql ; then
|
||||
if [ "$PANKO_BACKEND" = 'mysql' ] || [ "$PANKO_BACKEND" = 'postgresql' ] || [ "$PANKO_BACKEND" = 'es' ] ; then
|
||||
recreate_database panko
|
||||
$PANKO_BIN_DIR/panko-dbsync
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
# Install Ceilometer.
|
||||
function install_ceilometer {
|
||||
if is_service_enabled ceilometer-api; then
|
||||
_ceilometer_prepare_storage_backend
|
||||
# Install Panko.
|
||||
function install_panko {
|
||||
if is_service_enabled panko-api; then
|
||||
_panko_prepare_storage_backend
|
||||
fi
|
||||
|
||||
setup_develop $CEILOMETER_DIR
|
||||
sudo install -d -o $STACK_USER -m 755 $CEILOMETER_CONF_DIR
|
||||
setup_develop $PANKO_DIR
|
||||
sudo install -d -o $STACK_USER -m 755 $PANKO_CONF_DIR
|
||||
}
|
||||
|
||||
# start_ceilometer() - Start running processes, including screen
|
||||
function start_ceilometer {
|
||||
if [[ "$CEILOMETER_USE_MOD_WSGI" == "False" ]]; then
|
||||
run_process ceilometer-api "$CEILOMETER_BIN_DIR/ceilometer-api -d -v --config-file $CEILOMETER_CONF"
|
||||
elif is_service_enabled ceilometer-api; then
|
||||
enable_apache_site ceilometer
|
||||
# start_panko() - Start running processes, including screen
|
||||
function start_panko {
|
||||
if [[ "$PANKO_USE_MOD_WSGI" == "False" ]]; then
|
||||
run_process panko-api "$PANKO_BIN_DIR/panko-api -d -v --config-file $PANKO_CONF"
|
||||
elif is_service_enabled panko-api; then
|
||||
enable_apache_site panko
|
||||
restart_apache_server
|
||||
tail_log ceilometer /var/log/$APACHE_NAME/ceilometer.log
|
||||
tail_log ceilometer-api /var/log/$APACHE_NAME/ceilometer_access.log
|
||||
tail_log panko /var/log/$APACHE_NAME/panko.log
|
||||
tail_log panko-api /var/log/$APACHE_NAME/panko_access.log
|
||||
fi
|
||||
|
||||
# Only die on API if it was actually intended to be turned on
|
||||
if is_service_enabled ceilometer-api; then
|
||||
echo "Waiting for ceilometer-api to start..."
|
||||
if ! wait_for_service $SERVICE_TIMEOUT $(ceilometer_service_url)/v2/; then
|
||||
die $LINENO "ceilometer-api did not start"
|
||||
if is_service_enabled panko-api; then
|
||||
echo "Waiting for panko-api to start..."
|
||||
if ! wait_for_service $SERVICE_TIMEOUT $(panko_service_url)/v2/; then
|
||||
die $LINENO "panko-api did not start"
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
# stop_ceilometer() - Stop running processes
|
||||
function stop_ceilometer {
|
||||
if is_service_enabled ceilometer-api ; then
|
||||
if [ "$CEILOMETER_USE_MOD_WSGI" == "True" ]; then
|
||||
disable_apache_site ceilometer
|
||||
# stop_panko() - Stop running processes
|
||||
function stop_panko {
|
||||
if is_service_enabled panko-api ; then
|
||||
if [ "$PANKO_USE_MOD_WSGI" == "True" ]; then
|
||||
disable_apache_site panko
|
||||
restart_apache_server
|
||||
else
|
||||
stop_process ceilometer-api
|
||||
stop_process panko-api
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
# This is the main for plugin.sh
|
||||
if is_service_enabled ceilometer; then
|
||||
if is_service_enabled panko; then
|
||||
if [[ "$1" == "stack" && "$2" == "pre-install" ]]; then
|
||||
# Set up other services
|
||||
echo_summary "Configuring system services for Ceilometer"
|
||||
preinstall_ceilometer
|
||||
echo_summary "Configuring system services for Panko"
|
||||
preinstall_panko
|
||||
elif [[ "$1" == "stack" && "$2" == "install" ]]; then
|
||||
echo_summary "Installing Ceilometer"
|
||||
echo_summary "Installing Panko"
|
||||
# Use stack_install_service here to account for vitualenv
|
||||
stack_install_service ceilometer
|
||||
stack_install_service panko
|
||||
elif [[ "$1" == "stack" && "$2" == "post-config" ]]; then
|
||||
echo_summary "Configuring Ceilometer"
|
||||
configure_ceilometer
|
||||
echo_summary "Configuring Panko"
|
||||
configure_panko
|
||||
elif [[ "$1" == "stack" && "$2" == "extra" ]]; then
|
||||
echo_summary "Initializing Ceilometer"
|
||||
# Tidy base for ceilometer
|
||||
init_ceilometer
|
||||
echo_summary "Initializing Panko"
|
||||
# Tidy base for panko
|
||||
init_panko
|
||||
# Start the services
|
||||
start_ceilometer
|
||||
start_panko
|
||||
fi
|
||||
|
||||
if [[ "$1" == "unstack" ]]; then
|
||||
echo_summary "Shutting Down Ceilometer"
|
||||
stop_ceilometer
|
||||
echo_summary "Shutting Down Panko"
|
||||
stop_panko
|
||||
fi
|
||||
|
||||
if [[ "$1" == "clean" ]]; then
|
||||
echo_summary "Cleaning Ceilometer"
|
||||
cleanup_ceilometer
|
||||
echo_summary "Cleaning Panko"
|
||||
cleanup_panko
|
||||
fi
|
||||
fi
|
||||
|
||||
|
|
|
@ -1,20 +1,20 @@
|
|||
enable_service ceilometer-api
|
||||
enable_service panko-api
|
||||
|
||||
# Default directories
|
||||
CEILOMETER_DIR=$DEST/ceilometer
|
||||
CEILOMETER_CONF_DIR=/etc/ceilometer
|
||||
CEILOMETER_CONF=$CEILOMETER_CONF_DIR/ceilometer.conf
|
||||
CEILOMETER_AUTH_CACHE_DIR=${CEILOMETER_AUTH_CACHE_DIR:-/var/cache/ceilometer}
|
||||
CEILOMETER_WSGI_DIR=${CEILOMETER_WSGI_DIR:-/var/www/ceilometer}
|
||||
PANKO_DIR=$DEST/panko
|
||||
PANKO_CONF_DIR=/etc/panko
|
||||
PANKO_CONF=$PANKO_CONF_DIR/panko.conf
|
||||
PANKO_AUTH_CACHE_DIR=${PANKO_AUTH_CACHE_DIR:-/var/cache/panko}
|
||||
PANKO_WSGI_DIR=${PANKO_WSGI_DIR:-/var/www/panko}
|
||||
|
||||
# Set up database backend
|
||||
CEILOMETER_BACKEND=${CEILOMETER_BACKEND:-mysql}
|
||||
PANKO_BACKEND=${PANKO_BACKEND:-mysql}
|
||||
|
||||
# Ceilometer connection info.
|
||||
CEILOMETER_SERVICE_PROTOCOL=http
|
||||
CEILOMETER_SERVICE_HOST=$SERVICE_HOST
|
||||
CEILOMETER_SERVICE_PORT=${CEILOMETER_SERVICE_PORT:-8777}
|
||||
CEILOMETER_USE_MOD_WSGI=${CEILOMETER_USE_MOD_WSGI:-${ENABLE_HTTPD_MOD_WSGI_SERVICES}}
|
||||
# Panko connection info.
|
||||
PANKO_SERVICE_PROTOCOL=http
|
||||
PANKO_SERVICE_HOST=$SERVICE_HOST
|
||||
PANKO_SERVICE_PORT=${PANKO_SERVICE_PORT:-8779}
|
||||
PANKO_USE_MOD_WSGI=${PANKO_USE_MOD_WSGI:-${ENABLE_HTTPD_MOD_WSGI_SERVICES}}
|
||||
|
||||
# Get rid of this before done.
|
||||
# Tell emacs to use shell-script-mode
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
register_project_for_upgrade ceilometer
|
||||
register_project_for_upgrade panko
|
||||
|
||||
devstack_localrc base enable_plugin ceilometer git://git.openstack.org/openstack/ceilometer
|
||||
devstack_localrc base enable_service ceilometer-api tempest
|
||||
devstack_localrc base enable_plugin panko git://git.openstack.org/openstack/panko
|
||||
devstack_localrc base enable_service panko-api tempest
|
||||
|
||||
devstack_localrc target enable_plugin ceilometer git://git.openstack.org/openstack/ceilometer
|
||||
devstack_localrc target enable_service ceilometer-api tempest
|
||||
devstack_localrc target enable_plugin panko git://git.openstack.org/openstack/panko
|
||||
devstack_localrc target enable_service panko-api tempest
|
||||
|
|
|
@ -12,16 +12,16 @@ source $BASE_DEVSTACK_DIR/stackrc # needed for status directory
|
|||
source $BASE_DEVSTACK_DIR/lib/tls
|
||||
source $BASE_DEVSTACK_DIR/lib/apache
|
||||
|
||||
# Locate the ceilometer plugin and get its functions
|
||||
CEILOMETER_DEVSTACK_DIR=$(dirname $(dirname $0))
|
||||
source $CEILOMETER_DEVSTACK_DIR/plugin.sh
|
||||
# Locate the panko plugin and get its functions
|
||||
PANKO_DEVSTACK_DIR=$(dirname $(dirname $0))
|
||||
source $PANKO_DEVSTACK_DIR/plugin.sh
|
||||
|
||||
set -o xtrace
|
||||
|
||||
stop_ceilometer
|
||||
stop_panko
|
||||
|
||||
# ensure everything is stopped
|
||||
|
||||
SERVICES_DOWN="ceilometer-api"
|
||||
SERVICES_DOWN="panko-api"
|
||||
|
||||
ensure_services_stopped $SERVICES_DOWN
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
# ``upgrade-ceilometer``
|
||||
# ``upgrade-panko``
|
||||
|
||||
echo "*********************************************************************"
|
||||
echo "Begin $0"
|
||||
|
@ -34,50 +34,50 @@ source $GRENADE_DIR/functions
|
|||
set -o errexit
|
||||
|
||||
# Save mongodb state (replace with snapshot)
|
||||
# TODO(chdent): There used to be a 'register_db_to_save ceilometer'
|
||||
# TODO(chdent): There used to be a 'register_db_to_save panko'
|
||||
# which may wish to consider putting back in.
|
||||
if grep -q 'connection *= *mongo' /etc/ceilometer/ceilometer.conf; then
|
||||
mongodump --db ceilometer --out $SAVE_DIR/ceilometer-dump.$BASE_RELEASE
|
||||
if grep -q 'connection *= *mongo' /etc/panko/panko.conf; then
|
||||
mongodump --db panko --out $SAVE_DIR/panko-dump.$BASE_RELEASE
|
||||
fi
|
||||
|
||||
# Upgrade Ceilometer
|
||||
# Upgrade Panko
|
||||
# ==================
|
||||
# Locate ceilometer devstack plugin, the directory above the
|
||||
# Locate panko devstack plugin, the directory above the
|
||||
# grenade plugin.
|
||||
CEILOMETER_DEVSTACK_DIR=$(dirname $(dirname $0))
|
||||
PANKO_DEVSTACK_DIR=$(dirname $(dirname $0))
|
||||
|
||||
# Get functions from current DevStack
|
||||
source $TARGET_DEVSTACK_DIR/functions
|
||||
source $TARGET_DEVSTACK_DIR/stackrc
|
||||
source $TARGET_DEVSTACK_DIR/lib/apache
|
||||
|
||||
# Get ceilometer functions from devstack plugin
|
||||
source $CEILOMETER_DEVSTACK_DIR/settings
|
||||
# Get panko functions from devstack plugin
|
||||
source $PANKO_DEVSTACK_DIR/settings
|
||||
|
||||
# Print the commands being run so that we can see the command that triggers
|
||||
# an error.
|
||||
set -o xtrace
|
||||
|
||||
# Install the target ceilometer
|
||||
source $CEILOMETER_DEVSTACK_DIR/plugin.sh stack install
|
||||
# Install the target panko
|
||||
source $PANKO_DEVSTACK_DIR/plugin.sh stack install
|
||||
|
||||
# calls upgrade-ceilometer for specific release
|
||||
upgrade_project ceilometer $RUN_DIR $BASE_DEVSTACK_BRANCH $TARGET_DEVSTACK_BRANCH
|
||||
# calls upgrade-panko for specific release
|
||||
upgrade_project panko $RUN_DIR $BASE_DEVSTACK_BRANCH $TARGET_DEVSTACK_BRANCH
|
||||
|
||||
# Migrate the database
|
||||
# NOTE(chdent): As we evolve BIN_DIR is likely to be defined, but
|
||||
# currently it is not.
|
||||
CEILOMETER_BIN_DIR=$(dirname $(which ceilometer-dbsync))
|
||||
$CEILOMETER_BIN_DIR/ceilometer-dbsync || die $LINENO "DB sync error"
|
||||
PANKO_BIN_DIR=$(dirname $(which panko-dbsync))
|
||||
$PANKO_BIN_DIR/panko-dbsync || die $LINENO "DB sync error"
|
||||
|
||||
# Start Ceilometer
|
||||
start_ceilometer
|
||||
# Start Panko
|
||||
start_panko
|
||||
|
||||
ensure_services_started ceilometer-api
|
||||
ensure_services_started panko-api
|
||||
|
||||
# Save mongodb state (replace with snapshot)
|
||||
if grep -q 'connection *= *mongo' /etc/ceilometer/ceilometer.conf; then
|
||||
mongodump --db ceilometer --out $SAVE_DIR/ceilometer-dump.$TARGET_RELEASE
|
||||
if grep -q 'connection *= *mongo' /etc/panko/panko.conf; then
|
||||
mongodump --db panko --out $SAVE_DIR/panko-dump.$TARGET_RELEASE
|
||||
fi
|
||||
|
||||
|
||||
|
|
|
@ -88,17 +88,17 @@ qthelp:
|
|||
@echo
|
||||
@echo "Build finished; now you can run "qcollectiongenerator" with the" \
|
||||
".qhcp project file in $(BUILDDIR)/qthelp, like this:"
|
||||
@echo "# qcollectiongenerator $(BUILDDIR)/qthelp/Ceilometer.qhcp"
|
||||
@echo "# qcollectiongenerator $(BUILDDIR)/qthelp/Panko.qhcp"
|
||||
@echo "To view the help file:"
|
||||
@echo "# assistant -collectionFile $(BUILDDIR)/qthelp/Ceilometer.qhc"
|
||||
@echo "# assistant -collectionFile $(BUILDDIR)/qthelp/Panko.qhc"
|
||||
|
||||
devhelp:
|
||||
$(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
|
||||
@echo
|
||||
@echo "Build finished."
|
||||
@echo "To view the help file:"
|
||||
@echo "# mkdir -p $$HOME/.local/share/devhelp/Ceilometer"
|
||||
@echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/Ceilometer"
|
||||
@echo "# mkdir -p $$HOME/.local/share/devhelp/Panko"
|
||||
@echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/Panko"
|
||||
@echo "# devhelp"
|
||||
|
||||
epub:
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#
|
||||
# Ceilometer documentation build configuration file, created by
|
||||
# Panko documentation build configuration file, created by
|
||||
# sphinx-quickstart on Thu Oct 27 11:38:59 2011.
|
||||
#
|
||||
# This file is execfile()d with the current directory set to its
|
||||
|
@ -68,7 +68,7 @@ source_suffix = '.rst'
|
|||
master_doc = 'index'
|
||||
|
||||
# General information about the project.
|
||||
project = u'Ceilometer'
|
||||
project = u'Panko'
|
||||
copyright = u'2012-2015, OpenStack Foundation'
|
||||
|
||||
# The language for content autogenerated by Sphinx. Refer to documentation
|
||||
|
@ -199,7 +199,7 @@ except Exception:
|
|||
#html_file_suffix = None
|
||||
|
||||
# Output file base name for HTML help builder.
|
||||
htmlhelp_basename = 'Ceilometerdoc'
|
||||
htmlhelp_basename = 'Pankodoc'
|
||||
|
||||
|
||||
# -- Options for LaTeX output -------------------------------------------------
|
||||
|
@ -219,7 +219,7 @@ latex_elements = {
|
|||
# (source start file, target name, title, author, documentclass
|
||||
# [howto/manual]).
|
||||
latex_documents = [
|
||||
('index', 'Ceilometer.tex', u'Ceilometer Documentation',
|
||||
('index', 'Panko.tex', u'Panko Documentation',
|
||||
u'OpenStack Foundation', 'manual'),
|
||||
]
|
||||
|
||||
|
@ -249,7 +249,7 @@ latex_documents = [
|
|||
# One entry per manual page. List of tuples
|
||||
# (source start file, name, description, authors, manual section).
|
||||
man_pages = [
|
||||
('index', 'ceilometer', u'Ceilometer Documentation',
|
||||
('index', 'panko', u'Panko Documentation',
|
||||
[u'OpenStack'], 1)
|
||||
]
|
||||
|
||||
|
@ -263,8 +263,8 @@ man_pages = [
|
|||
# (source start file, target name, title, author,
|
||||
# dir menu entry, description, category)
|
||||
texinfo_documents = [
|
||||
('index', 'Ceilometer', u'Ceilometer Documentation', u'OpenStack',
|
||||
'Ceilometer', 'One line description of project.', 'Miscellaneous'),
|
||||
('index', 'Panko', u'Panko Documentation', u'OpenStack',
|
||||
'Panko', 'One line description of project.', 'Miscellaneous'),
|
||||
]
|
||||
|
||||
# Documents to append as an appendix to all manuals.
|
||||
|
@ -280,7 +280,7 @@ texinfo_documents = [
|
|||
# -- Options for Epub output --------------------------------------------------
|
||||
|
||||
# Bibliographic Dublin Core info.
|
||||
epub_title = u'Ceilometer'
|
||||
epub_title = u'Panko'
|
||||
epub_author = u'OpenStack'
|
||||
epub_publisher = u'OpenStack'
|
||||
epub_copyright = u'2012-2015, OpenStack'
|
||||
|
|
|
@ -14,11 +14,11 @@
|
|||
.. _contributing:
|
||||
|
||||
============================
|
||||
Contributing to Ceilometer
|
||||
Contributing to Panko
|
||||
============================
|
||||
|
||||
Ceilometer follows the same workflow as other OpenStack projects. To start
|
||||
contributing to Ceilometer, please follow the workflow found here_.
|
||||
Panko follows the same workflow as other OpenStack projects. To start
|
||||
contributing to Panko, please follow the workflow found here_.
|
||||
|
||||
.. _here: https://wiki.openstack.org/wiki/Gerrit_Workflow
|
||||
|
||||
|
@ -26,8 +26,8 @@ contributing to Ceilometer, please follow the workflow found here_.
|
|||
Project Hosting Details
|
||||
=======================
|
||||
|
||||
:Bug tracker: http://launchpad.net/ceilometer
|
||||
:Mailing list: http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev (prefix subjects with ``[Ceilometer]`` for faster responses)
|
||||
:Wiki: http://wiki.openstack.org/wiki/Ceilometer
|
||||
:Code Hosting: https://git.openstack.org/cgit/openstack/ceilometer/
|
||||
:Code Review: https://review.openstack.org/#/q/status:open+project:openstack/ceilometer,n,z
|
||||
:Bug tracker: http://launchpad.net/panko
|
||||
:Mailing list: http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev (prefix subjects with ``[Panko]`` for faster responses)
|
||||
:Wiki: http://wiki.openstack.org/wiki/Panko
|
||||
:Code Hosting: https://git.openstack.org/cgit/openstack/panko/
|
||||
:Code Review: https://review.openstack.org/#/q/status:open+project:openstack/panko,n,z
|
||||
|
|
|
@ -16,7 +16,7 @@ and a growing number of applications running on top of OpenStack infrastructure.
|
|||
In an effort to avoid significant integration work that would be required if
|
||||
each service produced a unique notification payload, we have defined a minimum
|
||||
data set that provides the core data elements needed for downstream metering
|
||||
processes. This format is not enforced by Ceilometer but serves as an advisory
|
||||
processes. This format is not enforced by Panko but serves as an advisory
|
||||
guideline for PaaS service developers:
|
||||
|
||||
::
|
||||
|
@ -184,7 +184,7 @@ guideline for PaaS service developers:
|
|||
"Type": "enumeration",
|
||||
"Description": "gauge, cumulative, delta",
|
||||
"Compliance": "required",
|
||||
"Notes": "describes the behavior of the metric, from Ceilometer"
|
||||
"Notes": "describes the behavior of the metric, from Panko"
|
||||
},
|
||||
{
|
||||
"Field": "metric_value",
|
||||
|
|
|
@ -16,21 +16,21 @@
|
|||
Guru Meditation Reports
|
||||
=======================
|
||||
|
||||
Ceilometer contains a mechanism whereby developers and system administrators
|
||||
can generate a report about the state of a running Ceilometer executable. This
|
||||
Panko contains a mechanism whereby developers and system administrators
|
||||
can generate a report about the state of a running Panko executable. This
|
||||
report is called a *Guru Meditation Report* (*GMR* for short).
|
||||
|
||||
Generating a GMR
|
||||
----------------
|
||||
|
||||
A *GMR* can be generated by sending the *USR1* signal to any Ceilometer process
|
||||
A *GMR* can be generated by sending the *USR1* signal to any Panko process
|
||||
with support (see below). The *GMR* will then be outputted standard error for
|
||||
that particular process.
|
||||
|
||||
For example, suppose that ``ceilometer-api`` has process id ``8675``, and
|
||||
was run with ``2>/var/log/ceilometer/ceilometer-api.log``. Then,
|
||||
For example, suppose that ``panko-api`` has process id ``8675``, and
|
||||
was run with ``2>/var/log/panko/panko-api.log``. Then,
|
||||
``kill -USR1 8675`` will trigger the Guru Meditation report to be printed to
|
||||
``/var/log/ceilometer/ceilometer-api.log``.
|
||||
``/var/log/panko/panko-api.log``.
|
||||
|
||||
Structure of a GMR
|
||||
------------------
|
||||
|
@ -59,12 +59,12 @@ Adding Support for GMRs to New Executables
|
|||
Adding support for a *GMR* to a given executable is fairly easy.
|
||||
|
||||
First import the module (currently residing in oslo-incubator), as well as the
|
||||
Ceilometer version module:
|
||||
Panko version module:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
from oslo_reports import guru_meditation_report as gmr
|
||||
from ceilometer import version
|
||||
from panko import version
|
||||
|
||||
Then, register any additional sections (optional):
|
||||
|
||||
|
|
|
@ -13,13 +13,13 @@
|
|||
License for the specific language governing permissions and limitations
|
||||
under the License.
|
||||
|
||||
==================================================
|
||||
Welcome to the Ceilometer developer documentation!
|
||||
==================================================
|
||||
=============================================
|
||||
Welcome to the Panko developer documentation!
|
||||
=============================================
|
||||
|
||||
Ceilometer is a component of the Telemetry project.
|
||||
Panko is a component of the Telemetry project.
|
||||
|
||||
This documentation offers information on how Ceilometer works and how to
|
||||
This documentation offers information on how Panko works and how to
|
||||
contribute to the project.
|
||||
|
||||
Overview
|
||||
|
|
|
@ -28,14 +28,14 @@ Configuring devstack
|
|||
|
||||
2. Create a ``local.conf`` file as input to devstack.
|
||||
|
||||
3. The ceilometer services are not enabled by default, so they must be
|
||||
3. The panko services are not enabled by default, so they must be
|
||||
enabled in ``local.conf`` before running ``stack.sh``.
|
||||
|
||||
This example ``local.conf`` file shows all of the settings required for
|
||||
ceilometer::
|
||||
panko::
|
||||
|
||||
[[local|localrc]]
|
||||
# Enable the Ceilometer devstack plugin
|
||||
enable_plugin ceilometer https://git.openstack.org/openstack/ceilometer.git
|
||||
# Enable the Panko devstack plugin
|
||||
enable_plugin panko https://git.openstack.org/openstack/panko.git
|
||||
|
||||
.. _devstack: http://www.devstack.org/
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
.. _install:
|
||||
|
||||
=======================
|
||||
Installing Ceilometer
|
||||
Installing Panko
|
||||
=======================
|
||||
|
||||
.. toctree::
|
||||
|
|
|
@ -25,7 +25,7 @@ Storage Backend Installation
|
|||
============================
|
||||
|
||||
This step is a prerequisite for the collector and API services. You may use
|
||||
one of the listed database backends below to store Ceilometer data.
|
||||
one of the listed database backends below to store Panko data.
|
||||
|
||||
MongoDB
|
||||
-------
|
||||
|
@ -35,10 +35,10 @@ MongoDB
|
|||
2.4.x. You will also need to have pymongo_ 2.4 installed
|
||||
|
||||
To use MongoDB as the storage backend, change the 'database' section in
|
||||
ceilometer.conf as follows::
|
||||
panko.conf as follows::
|
||||
|
||||
[database]
|
||||
connection = mongodb://username:password@host:27017/ceilometer
|
||||
connection = mongodb://username:password@host:27017/panko
|
||||
|
||||
SQLalchemy-supported DBs
|
||||
------------------------
|
||||
|
@ -47,10 +47,10 @@ SQLalchemy-supported DBs
|
|||
`PostgreSQL` or `MySQL`.
|
||||
|
||||
To use MySQL as the storage backend, change the 'database' section in
|
||||
ceilometer.conf as follows::
|
||||
panko.conf as follows::
|
||||
|
||||
[database]
|
||||
connection = mysql+pymysql://username:password@host/ceilometer?charset=utf8
|
||||
connection = mysql+pymysql://username:password@host/panko?charset=utf8
|
||||
|
||||
|
||||
.. _MongoDB: http://www.mongodb.org/
|
||||
|
@ -65,38 +65,38 @@ Installing the API Server
|
|||
|
||||
.. note::
|
||||
|
||||
The API server needs to be able to talk to keystone and ceilometer's
|
||||
The API server needs to be able to talk to keystone and panko's
|
||||
database. It is only required if you choose to store data in legacy
|
||||
database or if you inject new samples via REST API.
|
||||
|
||||
1. Clone the ceilometer git repository to the server::
|
||||
1. Clone the panko git repository to the server::
|
||||
|
||||
$ cd /opt/stack
|
||||
$ git clone https://git.openstack.org/openstack/ceilometer.git
|
||||
$ git clone https://git.openstack.org/openstack/panko.git
|
||||
|
||||
2. As a user with ``root`` permissions or ``sudo`` privileges, run the
|
||||
ceilometer installer::
|
||||
panko installer::
|
||||
|
||||
$ cd ceilometer
|
||||
$ cd panko
|
||||
$ sudo python setup.py install
|
||||
|
||||
3. Copy the sample configuration files from the source tree
|
||||
to their final location::
|
||||
|
||||
$ mkdir -p /etc/ceilometer
|
||||
$ cp etc/ceilometer/api_paste.ini /etc/ceilometer
|
||||
$ cp etc/ceilometer/*.json /etc/ceilometer
|
||||
$ cp etc/ceilometer/*.yaml /etc/ceilometer
|
||||
$ cp etc/ceilometer/ceilometer.conf.sample /etc/ceilometer/ceilometer.conf
|
||||
$ mkdir -p /etc/panko
|
||||
$ cp etc/panko/api_paste.ini /etc/panko
|
||||
$ cp etc/panko/*.json /etc/panko
|
||||
$ cp etc/panko/*.yaml /etc/panko
|
||||
$ cp etc/panko/panko.conf.sample /etc/panko/panko.conf
|
||||
|
||||
4. Create a service for ceilometer in keystone::
|
||||
4. Create a service for panko in keystone::
|
||||
|
||||
$ openstack service create metering --name=ceilometer \
|
||||
--description="Ceilometer Service"
|
||||
$ openstack service create metering --name=panko \
|
||||
--description="Panko Service"
|
||||
|
||||
5. Create an endpoint in keystone for ceilometer::
|
||||
5. Create an endpoint in keystone for panko::
|
||||
|
||||
$ openstack endpoint create $CEILOMETER_SERVICE \
|
||||
$ openstack endpoint create $PANKO_SERVICE \
|
||||
--region RegionOne \
|
||||
--publicurl "http://$SERVICE_HOST:8777" \
|
||||
--adminurl "http://$SERVICE_HOST:8777" \
|
||||
|
@ -104,14 +104,14 @@ Installing the API Server
|
|||
|
||||
.. note::
|
||||
|
||||
CEILOMETER_SERVICE is the id of the service created by the first command
|
||||
and SERVICE_HOST is the host where the Ceilometer API is running. The
|
||||
default port value for ceilometer API is 8777. If the port value
|
||||
PANKO_SERVICE is the id of the service created by the first command
|
||||
and SERVICE_HOST is the host where the Panko API is running. The
|
||||
default port value for panko API is 8777. If the port value
|
||||
has been customized, adjust accordingly.
|
||||
|
||||
6. Choose and start the API server.
|
||||
|
||||
Ceilometer includes the ``ceilometer-api`` command. This can be
|
||||
Panko includes the ``panko-api`` command. This can be
|
||||
used to run the API server. For smaller or proof-of-concept
|
||||
installations this is a reasonable choice. For larger installations it
|
||||
is strongly recommended to install the API server in a WSGI host
|
||||
|
@ -119,10 +119,10 @@ Installing the API Server
|
|||
performance and more options for making adjustments specific to the
|
||||
installation environment.
|
||||
|
||||
If you are using the ``ceilometer-api`` command it can be started
|
||||
If you are using the ``panko-api`` command it can be started
|
||||
as::
|
||||
|
||||
$ ceilometer-api
|
||||
$ panko-api
|
||||
|
||||
.. note::
|
||||
|
||||
|
|
|
@ -17,23 +17,23 @@
|
|||
Installing the API behind mod_wsgi
|
||||
===================================
|
||||
|
||||
Ceilometer comes with a few example files for configuring the API
|
||||
Panko comes with a few example files for configuring the API
|
||||
service to run behind Apache with ``mod_wsgi``.
|
||||
|
||||
app.wsgi
|
||||
========
|
||||
|
||||
The file ``ceilometer/api/app.wsgi`` sets up the V2 API WSGI
|
||||
application. The file is installed with the rest of the ceilometer
|
||||
The file ``panko/api/app.wsgi`` sets up the V2 API WSGI
|
||||
application. The file is installed with the rest of the panko
|
||||
application code, and should not need to be modified.
|
||||
|
||||
etc/apache2/ceilometer
|
||||
etc/apache2/panko
|
||||
======================
|
||||
|
||||
The ``etc/apache2/ceilometer`` file contains example settings that
|
||||
work with a copy of ceilometer installed via devstack.
|
||||
The ``etc/apache2/panko`` file contains example settings that
|
||||
work with a copy of panko installed via devstack.
|
||||
|
||||
.. literalinclude:: ../../../etc/apache2/ceilometer
|
||||
.. literalinclude:: ../../../etc/apache2/panko
|
||||
|
||||
1. On deb-based systems copy or symlink the file to
|
||||
``/etc/apache2/sites-available``. For rpm-based systems the file will go in
|
||||
|
@ -41,11 +41,11 @@ work with a copy of ceilometer installed via devstack.
|
|||
|
||||
2. Modify the ``WSGIDaemonProcess`` directive to set the ``user`` and
|
||||
``group`` values to an appropriate user on your server. In many
|
||||
installations ``ceilometer`` will be correct.
|
||||
installations ``panko`` will be correct.
|
||||
|
||||
3. Enable the ceilometer site. On deb-based systems::
|
||||
3. Enable the panko site. On deb-based systems::
|
||||
|
||||
$ a2ensite ceilometer
|
||||
$ a2ensite panko
|
||||
$ service apache2 reload
|
||||
|
||||
On rpm-based systems::
|
||||
|
@ -56,11 +56,11 @@ work with a copy of ceilometer installed via devstack.
|
|||
Limitation
|
||||
==========
|
||||
|
||||
As Ceilometer is using Pecan and Pecan's DebugMiddleware doesn't support
|
||||
As Panko is using Pecan and Pecan's DebugMiddleware doesn't support
|
||||
multiple processes, there is no way to set debug mode in the multiprocessing
|
||||
case. To allow multiple processes the DebugMiddleware may be turned off by
|
||||
setting ``pecan_debug`` to ``False`` in the ``api`` section of
|
||||
``ceilometer.conf``.
|
||||
``panko.conf``.
|
||||
|
||||
For other WSGI setup you can refer to the `pecan deployment`_ documentation.
|
||||
.. _`pecan deployment`: http://pecan.readthedocs.org/en/latest/deployment.html
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
Running the Tests
|
||||
=================
|
||||
|
||||
Ceilometer includes an extensive set of automated unit tests which are
|
||||
Panko includes an extensive set of automated unit tests which are
|
||||
run through tox_.
|
||||
|
||||
1. Install ``tox``::
|
||||
|
@ -37,11 +37,11 @@ run through tox_.
|
|||
|
||||
3. Install the test dependencies::
|
||||
|
||||
$ sudo pip install -r /opt/stack/ceilometer/test-requirements.txt
|
||||
$ sudo pip install -r /opt/stack/panko/test-requirements.txt
|
||||
|
||||
4. Run the unit and code-style tests::
|
||||
|
||||
$ cd /opt/stack/ceilometer
|
||||
$ cd /opt/stack/panko
|
||||
$ tox -e py27,pep8
|
||||
|
||||
As tox is a wrapper around testr, it also accepts the same flags as testr.
|
||||
|
@ -57,20 +57,20 @@ run through tox_.
|
|||
environment. Here's an example, passing the name of a test since you'll
|
||||
normally only want to run the test that hits your breakpoint::
|
||||
|
||||
$ tox -e debug ceilometer.tests.test_bin
|
||||
$ tox -e debug panko.tests.test_bin
|
||||
|
||||
For reference, the ``debug`` tox environment implements the instructions
|
||||
here: https://wiki.openstack.org/wiki/Testr#Debugging_.28pdb.29_Tests
|
||||
|
||||
5. There is a growing suite of tests which use a tool called `gabbi`_ to
|
||||
test and validate the behavior of the Ceilometer API. These tests are run
|
||||
test and validate the behavior of the Panko API. These tests are run
|
||||
when using the usual ``py27`` tox target but if desired they can be run by
|
||||
themselves::
|
||||
|
||||
$ tox -e gabbi
|
||||
|
||||
The YAML files used to drive the gabbi tests can be found in
|
||||
``ceilometer/tests/gabbi/gabbits``. If you are adding to or adjusting the
|
||||
``panko/tests/gabbi/gabbits``. If you are adding to or adjusting the
|
||||
API you should consider adding tests here.
|
||||
|
||||
.. _gabbi: https://gabbi.readthedocs.org/
|
||||
|
|
|
@ -14,37 +14,37 @@ returns a flattened dictionary of properties with associated boolean values -
|
|||
a 'False' or absent value means that the corresponding feature is not
|
||||
available in the backend.
|
||||
|
||||
.. rest-controller:: ceilometer.api.controllers.v2.capabilities:CapabilitiesController
|
||||
.. rest-controller:: panko.api.controllers.v2.capabilities:CapabilitiesController
|
||||
:webprefix: /v2/capabilities
|
||||
|
||||
.. autotype:: ceilometer.api.controllers.v2.capabilities.Capabilities
|
||||
.. autotype:: panko.api.controllers.v2.capabilities.Capabilities
|
||||
:members:
|
||||
|
||||
Events and Traits
|
||||
=================
|
||||
|
||||
.. rest-controller:: ceilometer.api.controllers.v2.events:EventTypesController
|
||||
.. rest-controller:: panko.api.controllers.v2.events:EventTypesController
|
||||
:webprefix: /v2/event_types
|
||||
|
||||
.. rest-controller:: ceilometer.api.controllers.v2.events:TraitsController
|
||||
.. rest-controller:: panko.api.controllers.v2.events:TraitsController
|
||||
:webprefix: /v2/event_types/(event_type)/traits
|
||||
|
||||
.. rest-controller:: ceilometer.api.controllers.v2.events:EventsController
|
||||
.. rest-controller:: panko.api.controllers.v2.events:EventsController
|
||||
:webprefix: /v2/events
|
||||
|
||||
.. autotype:: ceilometer.api.controllers.v2.events.Event
|
||||
.. autotype:: panko.api.controllers.v2.events.Event
|
||||
:members:
|
||||
|
||||
.. autotype:: ceilometer.api.controllers.v2.events.Trait
|
||||
.. autotype:: panko.api.controllers.v2.events.Trait
|
||||
:members:
|
||||
|
||||
.. autotype:: ceilometer.api.controllers.v2.events.TraitDescription
|
||||
.. autotype:: panko.api.controllers.v2.events.TraitDescription
|
||||
:members:
|
||||
|
||||
Filtering Queries
|
||||
=================
|
||||
|
||||
Ceilometer's REST API currently supports two types of queries. The Simple
|
||||
Panko's REST API currently supports two types of queries. The Simple
|
||||
Query functionality provides simple filtering on several fields of the
|
||||
*Sample* type. Complex Query provides the possibility to specify queries
|
||||
with logical and comparison operators on the fields of *Sample*.
|
||||
|
@ -73,7 +73,7 @@ type (for example, if you apply a filter on a query for statistics,
|
|||
you won't target *duration_start* field of *Statistics*, but *timestamp*
|
||||
field of *Sample*). See :ref:`api-queries` for how to query the API.
|
||||
|
||||
.. autotype:: ceilometer.api.controllers.v2.base.Query
|
||||
.. autotype:: panko.api.controllers.v2.base.Query
|
||||
:members:
|
||||
|
||||
Event Query
|
||||
|
@ -86,5 +86,5 @@ event_type, message_id, start_timestamp, end_timestamp, then this field
|
|||
will be applied on event, otherwise it will be treated as trait name and
|
||||
applied on trait. See :ref:`api-queries` for how to query the API.
|
||||
|
||||
.. autotype:: ceilometer.api.controllers.v2.events.EventQuery
|
||||
.. autotype:: panko.api.controllers.v2.events.EventQuery
|
||||
:members:
|
||||
|
|
|
@ -1,18 +0,0 @@
|
|||
{
|
||||
"context_is_admin": "role:admin",
|
||||
"segregation": "rule:context_is_admin",
|
||||
|
||||
"telemetry:get_samples": "",
|
||||
"telemetry:get_sample": "",
|
||||
"telemetry:query_sample": "",
|
||||
"telemetry:create_samples": "",
|
||||
|
||||
"telemetry:compute_statistics": "",
|
||||
"telemetry:get_meters": "",
|
||||
|
||||
"telemetry:get_resource": "",
|
||||
"telemetry:get_resources": "",
|
||||
|
||||
"telemetry:events:index": "",
|
||||
"telemetry:events:show": ""
|
||||
}
|
|
@ -1,6 +1,6 @@
|
|||
# Ceilometer API WSGI Pipeline
|
||||
# Panko API WSGI Pipeline
|
||||
# Define the filters that make up the pipeline for processing WSGI requests
|
||||
# Note: This pipeline is PasteDeploy's term rather than Ceilometer's pipeline
|
||||
# Note: This pipeline is PasteDeploy's term rather than Panko's pipeline
|
||||
# used for processing samples
|
||||
|
||||
# Remove authtoken from the pipeline if you don't want to use keystone authentication
|
||||
|
@ -8,7 +8,7 @@
|
|||
pipeline = cors request_id authtoken api-server
|
||||
|
||||
[app:api-server]
|
||||
paste.app_factory = ceilometer.api.app:app_factory
|
||||
paste.app_factory = panko.api.app:app_factory
|
||||
|
||||
[filter:authtoken]
|
||||
paste.filter_factory = keystonemiddleware.auth_token:filter_factory
|
||||
|
@ -18,4 +18,4 @@ paste.filter_factory = oslo_middleware:RequestId.factory
|
|||
|
||||
[filter:cors]
|
||||
paste.filter_factory = oslo_middleware.cors:filter_factory
|
||||
oslo_config_project = ceilometer
|
||||
oslo_config_project = panko
|
|
@ -1,7 +1,7 @@
|
|||
[DEFAULT]
|
||||
output_file = etc/ceilometer/ceilometer.conf
|
||||
output_file = etc/panko/panko.conf
|
||||
wrap_width = 79
|
||||
namespace = ceilometer
|
||||
namespace = panko
|
||||
namespace = oslo.db
|
||||
namespace = oslo.log
|
||||
namespace = oslo.middleware.cors
|
|
@ -21,16 +21,16 @@ OPTS = [
|
|||
default=8777,
|
||||
deprecated_name='metering_api_port',
|
||||
deprecated_group='DEFAULT',
|
||||
help='The port for the ceilometer API server.',
|
||||
help='The port for the Panko API server.',
|
||||
),
|
||||
cfg.StrOpt('host',
|
||||
default='0.0.0.0',
|
||||
help='The listen IP for the ceilometer API server.',
|
||||
help='The listen IP for the Panko API server.',
|
||||
),
|
||||
]
|
||||
|
||||
CONF = cfg.CONF
|
||||
opt_group = cfg.OptGroup(name='api',
|
||||
title='Options for the ceilometer-api service')
|
||||
title='Options for the panko-api service')
|
||||
CONF.register_group(opt_group)
|
||||
CONF.register_opts(OPTS, opt_group)
|
|
@ -21,9 +21,9 @@ from paste import deploy
|
|||
import pecan
|
||||
from werkzeug import serving
|
||||
|
||||
from ceilometer.api import hooks
|
||||
from ceilometer.api import middleware
|
||||
from ceilometer.i18n import _LI, _LW
|
||||
from panko.api import hooks
|
||||
from panko.api import middleware
|
||||
from panko.i18n import _LI, _LW
|
||||
|
||||
LOG = log.getLogger(__name__)
|
||||
|
||||
|
@ -66,8 +66,8 @@ def setup_app(pecan_config=None):
|
|||
|
||||
pecan_config = pecan_config or {
|
||||
"app": {
|
||||
'root': 'ceilometer.api.controllers.root.RootController',
|
||||
'modules': ['ceilometer.api'],
|
||||
'root': 'panko.api.controllers.root.RootController',
|
||||
'modules': ['panko.api'],
|
||||
}
|
||||
}
|
||||
|
|
@ -17,8 +17,8 @@
|
|||
|
||||
See http://pecan.readthedocs.org/en/latest/deployment.html for details.
|
||||
"""
|
||||
from ceilometer import service
|
||||
from ceilometer.api import app
|
||||
from panko import service
|
||||
from panko.api import app
|
||||
|
||||
# Initialize the oslo configuration library and logging
|
||||
service.prepare_service([])
|
|
@ -15,7 +15,7 @@
|
|||
|
||||
import pecan
|
||||
|
||||
from ceilometer.api.controllers.v2 import root as v2
|
||||
from panko.api.controllers.v2 import root as v2
|
||||
|
||||
MEDIA_TYPE_JSON = 'application/vnd.openstack.telemetry-%s+json'
|
||||
MEDIA_TYPE_XML = 'application/vnd.openstack.telemetry-%s+xml'
|
|
@ -31,7 +31,7 @@ import six
|
|||
import wsme
|
||||
from wsme import types as wtypes
|
||||
|
||||
from ceilometer.i18n import _
|
||||
from panko.i18n import _
|
||||
|
||||
|
||||
operation_kind = ('lt', 'le', 'eq', 'ne', 'ge', 'gt')
|
|
@ -23,8 +23,8 @@ from pecan import rest
|
|||
from wsme import types as wtypes
|
||||
import wsmeext.pecan as wsme_pecan
|
||||
|
||||
from ceilometer.api.controllers.v2 import base
|
||||
from ceilometer import utils
|
||||
from panko.api.controllers.v2 import base
|
||||
from panko import utils
|
||||
|
||||
|
||||
def _flatten_capabilities(capabilities):
|
|
@ -28,12 +28,12 @@ import wsme
|
|||
from wsme import types as wtypes
|
||||
import wsmeext.pecan as wsme_pecan
|
||||
|
||||
from ceilometer.api.controllers.v2 import base
|
||||
from ceilometer.api.controllers.v2 import utils as v2_utils
|
||||
from ceilometer.api import rbac
|
||||
from ceilometer.event import storage
|
||||
from ceilometer.event.storage import models as event_models
|
||||
from ceilometer.i18n import _
|
||||
from panko.api.controllers.v2 import base
|
||||
from panko.api.controllers.v2 import utils as v2_utils
|
||||
from panko.api import rbac
|
||||
from panko.event import storage
|
||||
from panko.event.storage import models as event_models
|
||||
from panko.i18n import _
|
||||
|
||||
LOG = log.getLogger(__name__)
|
||||
|
|
@ -18,8 +18,8 @@
|
|||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from ceilometer.api.controllers.v2 import capabilities
|
||||
from ceilometer.api.controllers.v2 import events
|
||||
from panko.api.controllers.v2 import capabilities
|
||||
from panko.api.controllers.v2 import events
|
||||
|
||||
|
||||
class V2Controller(object):
|
|
@ -24,12 +24,12 @@ from oslo_config import cfg
|
|||
from oslo_log import log
|
||||
import pecan
|
||||
|
||||
from ceilometer.api.controllers.v2 import base
|
||||
from ceilometer.api import rbac
|
||||
from ceilometer.i18n import _, _LI
|
||||
from panko.api.controllers.v2 import base
|
||||
from panko.api import rbac
|
||||
from panko.i18n import _, _LI
|
||||
|
||||
LOG = log.getLogger(__name__)
|
||||
cfg.CONF.import_opt('default_api_return_limit', 'ceilometer.api.app',
|
||||
cfg.CONF.import_opt('default_api_return_limit', 'panko.api.app',
|
||||
group='api')
|
||||
|
||||
|
|
@ -17,7 +17,7 @@ from oslo_config import cfg
|
|||
|
||||
from pecan import hooks
|
||||
|
||||
from ceilometer import storage
|
||||
from panko import storage
|
||||
|
||||
|
||||
class ConfigHook(hooks.PecanHook):
|
|
@ -26,8 +26,8 @@ from oslo_log import log
|
|||
import six
|
||||
import webob
|
||||
|
||||
from ceilometer import i18n
|
||||
from ceilometer.i18n import _
|
||||
from panko import i18n
|
||||
from panko.i18n import _
|
||||
|
||||
LOG = log.getLogger(__name__)
|
||||
|
|
@ -14,8 +14,8 @@
|
|||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from ceilometer.api import app
|
||||
from ceilometer import service
|
||||
from panko.api import app
|
||||
from panko import service
|
||||
|
||||
|
||||
def main():
|
|
@ -17,9 +17,9 @@
|
|||
from oslo_config import cfg
|
||||
from oslo_log import log
|
||||
|
||||
from ceilometer.i18n import _LI
|
||||
from ceilometer import service
|
||||
from ceilometer import storage
|
||||
from panko.i18n import _LI
|
||||
from panko import service
|
||||
from panko import storage
|
||||
|
||||
|
||||
LOG = log.getLogger(__name__)
|
|
@ -16,10 +16,10 @@
|
|||
from oslo_log import log
|
||||
from oslo_utils import timeutils
|
||||
|
||||
from ceilometer import dispatcher
|
||||
from ceilometer.event.storage import models
|
||||
from ceilometer.i18n import _LE
|
||||
from ceilometer import storage
|
||||
from panko import dispatcher
|
||||
from panko.event.storage import models
|
||||
from panko.i18n import _LE
|
||||
from panko import storage
|
||||
|
||||
LOG = log.getLogger(__name__)
|
||||
|
||||
|
@ -28,10 +28,10 @@ class DatabaseDispatcher(dispatcher.EventDispatcherBase):
|
|||
"""Dispatcher class for recording metering data into database.
|
||||
|
||||
The dispatcher class which records each meter into a database configured
|
||||
in ceilometer configuration file.
|
||||
in panko configuration file.
|
||||
|
||||
To enable this dispatcher, the following section needs to be present in
|
||||
ceilometer.conf file
|
||||
panko.conf file
|
||||
|
||||
[DEFAULT]
|
||||
meter_dispatchers = database
|
|
@ -12,7 +12,7 @@
|
|||
|
||||
import six
|
||||
|
||||
from ceilometer import utils
|
||||
from panko import utils
|
||||
|
||||
|
||||
class EventFilter(object):
|
|
@ -10,7 +10,7 @@
|
|||
# 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 ceilometer
|
||||
import panko
|
||||
|
||||
|
||||
class Connection(object):
|
||||
|
@ -42,17 +42,17 @@ class Connection(object):
|
|||
|
||||
:param events: a list of model.Event objects.
|
||||
"""
|
||||
raise ceilometer.NotImplementedError('Events not implemented.')
|
||||
raise panko.NotImplementedError('Events not implemented.')
|
||||
|
||||
@staticmethod
|
||||
def get_events(event_filter, limit=None):
|
||||
"""Return an iterable of model.Event objects."""
|
||||
raise ceilometer.NotImplementedError('Events not implemented.')
|
||||
raise panko.NotImplementedError('Events not implemented.')
|
||||
|
||||
@staticmethod
|
||||
def get_event_types():
|
||||
"""Return all event types as an iterable of strings."""
|
||||
raise ceilometer.NotImplementedError('Events not implemented.')
|
||||
raise panko.NotImplementedError('Events not implemented.')
|
||||
|
||||
@staticmethod
|
||||
def get_trait_types(event_type):
|
||||
|
@ -62,7 +62,7 @@ class Connection(object):
|
|||
returned.
|
||||
:param event_type: the type of the Event
|
||||
"""
|
||||
raise ceilometer.NotImplementedError('Events not implemented.')
|
||||
raise panko.NotImplementedError('Events not implemented.')
|
||||
|
||||
@staticmethod
|
||||
def get_traits(event_type, trait_type=None):
|
||||
|
@ -73,7 +73,7 @@ class Connection(object):
|
|||
:param trait_type: the name of the Trait to filter by
|
||||
"""
|
||||
|
||||
raise ceilometer.NotImplementedError('Events not implemented.')
|
||||
raise panko.NotImplementedError('Events not implemented.')
|
||||
|
||||
@classmethod
|
||||
def get_capabilities(cls):
|
||||
|
@ -96,4 +96,4 @@ class Connection(object):
|
|||
|
||||
:param ttl: Number of seconds to keep records for.
|
||||
"""
|
||||
raise ceilometer.NotImplementedError('Clearing events not implemented')
|
||||
raise panko.NotImplementedError('Clearing events not implemented')
|
|
@ -21,11 +21,11 @@ from oslo_utils import netutils
|
|||
from oslo_utils import timeutils
|
||||
import six
|
||||
|
||||
from ceilometer.event.storage import base
|
||||
from ceilometer.event.storage import models
|
||||
from ceilometer.i18n import _LE, _LI
|
||||
from ceilometer import storage
|
||||
from ceilometer import utils
|
||||
from panko.event.storage import base
|
||||
from panko.event.storage import models
|
||||
from panko.i18n import _LE, _LI
|
||||
from panko import storage
|
||||
from panko import utils
|
||||
|
||||
LOG = log.getLogger(__name__)
|
||||
|
|
@ -15,12 +15,12 @@ import operator
|
|||
|
||||
from oslo_log import log
|
||||
|
||||
from ceilometer.event.storage import base
|
||||
from ceilometer.event.storage import models
|
||||
from ceilometer.i18n import _LE
|
||||
from ceilometer.storage.hbase import base as hbase_base
|
||||
from ceilometer.storage.hbase import utils as hbase_utils
|
||||
from ceilometer import utils
|
||||
from panko.event.storage import base
|
||||
from panko.event.storage import models
|
||||
from panko.i18n import _LE
|
||||
from panko.storage.hbase import base as hbase_base
|
||||
from panko.storage.hbase import utils as hbase_utils
|
||||
from panko import utils
|
||||
|
||||
LOG = log.getLogger(__name__)
|
||||
|
|
@ -13,8 +13,8 @@
|
|||
|
||||
from oslo_log import log
|
||||
|
||||
from ceilometer.event.storage import base
|
||||
from ceilometer.i18n import _LI
|
||||
from panko.event.storage import base
|
||||
from panko.i18n import _LI
|
||||
|
||||
LOG = log.getLogger(__name__)
|
||||
|
|
@ -16,9 +16,9 @@ from oslo_config import cfg
|
|||
from oslo_log import log
|
||||
import pymongo
|
||||
|
||||
from ceilometer.event.storage import pymongo_base
|
||||
from ceilometer import storage
|
||||
from ceilometer.storage.mongo import utils as pymongo_utils
|
||||
from panko.event.storage import pymongo_base
|
||||
from panko import storage
|
||||
from panko.storage.mongo import utils as pymongo_utils
|
||||
|
||||
LOG = log.getLogger(__name__)
|
||||
|
|
@ -23,12 +23,12 @@ from oslo_log import log
|
|||
from oslo_utils import timeutils
|
||||
import sqlalchemy as sa
|
||||
|
||||
from ceilometer.event.storage import base
|
||||
from ceilometer.event.storage import models as api_models
|
||||
from ceilometer.i18n import _LE, _LI
|
||||
from ceilometer import storage
|
||||
from ceilometer.storage.sqlalchemy import models
|
||||
from ceilometer import utils
|
||||
from panko.event.storage import base
|
||||
from panko.event.storage import models as api_models
|
||||
from panko.i18n import _LE, _LI
|
||||
from panko import storage
|
||||
from panko.storage.sqlalchemy import models
|
||||
from panko import utils
|
||||
|
||||
LOG = log.getLogger(__name__)
|
||||
|
||||
|
@ -130,7 +130,7 @@ class Connection(base.Connection):
|
|||
# in storage.__init__.get_connection_from_config function
|
||||
options = dict(cfg.CONF.database.items())
|
||||
options['max_retries'] = 0
|
||||
# oslo.db doesn't support options defined by Ceilometer
|
||||
# oslo.db doesn't support options defined by Panko
|
||||
for opt in storage.OPTS:
|
||||
options.pop(opt.name, None)
|
||||
self._engine_facade = db_session.EngineFacade(url, **options)
|
|
@ -15,7 +15,7 @@
|
|||
from oslo_utils import timeutils
|
||||
import six
|
||||
|
||||
from ceilometer.storage import base
|
||||
from panko.storage import base
|
||||
|
||||
|
||||
def serialize_dt(value):
|
|
@ -15,11 +15,11 @@
|
|||
from oslo_log import log
|
||||
import pymongo
|
||||
|
||||
from ceilometer.event.storage import base
|
||||
from ceilometer.event.storage import models
|
||||
from ceilometer.i18n import _LE, _LI
|
||||
from ceilometer.storage.mongo import utils as pymongo_utils
|
||||
from ceilometer import utils
|
||||
from panko.event.storage import base
|
||||
from panko.event.storage import models
|
||||
from panko.i18n import _LE, _LI
|
||||
from panko.storage.mongo import utils as pymongo_utils
|
||||
from panko import utils
|
||||
|
||||
LOG = log.getLogger(__name__)
|
||||
|
|
@ -16,7 +16,7 @@
|
|||
"""
|
||||
Guidelines for writing new hacking checks
|
||||
|
||||
- Use only for Ceilometer specific tests. OpenStack general tests
|
||||
- Use only for Panko specific tests. OpenStack general tests
|
||||
should be submitted to the common 'hacking' module.
|
||||
- Pick numbers in the range X3xx. Find the current test with
|
||||
the highest allocated number and then pick the next value.
|
|
@ -20,7 +20,7 @@ See http://docs.openstack.org/developer/oslo.i18n/usage.html
|
|||
|
||||
import oslo_i18n
|
||||
|
||||
DOMAIN = 'ceilometer'
|
||||
DOMAIN = 'panko'
|
||||
|
||||
_translators = oslo_i18n.TranslatorFactory(domain=DOMAIN)
|
||||
|
|
@ -13,19 +13,19 @@
|
|||
# under the License.
|
||||
import itertools
|
||||
|
||||
import ceilometer.api
|
||||
import ceilometer.api.app
|
||||
import ceilometer.dispatcher
|
||||
import ceilometer.storage
|
||||
import ceilometer.utils
|
||||
import panko.api
|
||||
import panko.api.app
|
||||
import panko.dispatcher
|
||||
import panko.storage
|
||||
import panko.utils
|
||||
|
||||
|
||||
def list_opts():
|
||||
return [
|
||||
('DEFAULT', ceilometer.api.app.OPTS),
|
||||
('DEFAULT', panko.api.app.OPTS),
|
||||
('api',
|
||||
itertools.chain(ceilometer.api.OPTS,
|
||||
ceilometer.api.app.API_OPTS)),
|
||||
('database', ceilometer.storage.OPTS),
|
||||
('storage', ceilometer.dispatcher.STORAGE_OPTS),
|
||||
itertools.chain(panko.api.OPTS,
|
||||
panko.api.app.API_OPTS)),
|
||||
('database', panko.storage.OPTS),
|
||||
('storage', panko.dispatcher.STORAGE_OPTS),
|
||||
]
|
|
@ -19,8 +19,8 @@ import oslo_i18n
|
|||
from oslo_log import log
|
||||
from oslo_reports import guru_meditation_report as gmr
|
||||
|
||||
from ceilometer.conf import defaults
|
||||
from ceilometer import version
|
||||
from panko.conf import defaults
|
||||
from panko import version
|
||||
|
||||
|
||||
def prepare_service(argv=None, config_files=None):
|
||||
|
@ -30,13 +30,13 @@ def prepare_service(argv=None, config_files=None):
|
|||
|
||||
if argv is None:
|
||||
argv = sys.argv
|
||||
cfg.CONF(argv[1:], project='ceilometer', validate_default_values=True,
|
||||
cfg.CONF(argv[1:], project='panko', validate_default_values=True,
|
||||
version=version.version_info.version_string(),
|
||||
default_config_files=config_files)
|
||||
|
||||
log.setup(cfg.CONF, 'ceilometer')
|
||||
log.setup(cfg.CONF, 'panko')
|
||||
# NOTE(liusheng): guru cannot run with service under apache daemon, so when
|
||||
# ceilometer-api running with mod_wsgi, the argv is [], we don't start
|
||||
# panko-api running with mod_wsgi, the argv is [], we don't start
|
||||
# guru.
|
||||
if argv:
|
||||
gmr.TextGuruMeditation.setup_autorun(version)
|
|
@ -76,7 +76,7 @@ def get_connection(url):
|
|||
# 'dialect+driver'. Handle the case where driver is specified.
|
||||
engine_name = connection_scheme.split('+')[0]
|
||||
# NOTE: translation not applied bug #1446983
|
||||
LOG.debug('looking for %(name)r driver in ceilometer.event.storage',
|
||||
LOG.debug('looking for %(name)r driver in panko.event.storage',
|
||||
{'name': engine_name})
|
||||
mgr = driver.DriverManager('ceilometer.event.storage', engine_name)
|
||||
mgr = driver.DriverManager('panko.event.storage', engine_name)
|
||||
return mgr.driver(url)
|
|
@ -18,7 +18,7 @@ from oslo_log import log
|
|||
from oslo_utils import netutils
|
||||
from six.moves.urllib import parse as urlparse
|
||||
|
||||
from ceilometer.storage.hbase import inmemory as hbase_inmemory
|
||||
from panko.storage.hbase import inmemory as hbase_inmemory
|
||||
|
||||
LOG = log.getLogger(__name__)
|
||||
|
||||
|
@ -33,7 +33,7 @@ class Connection(object):
|
|||
opts = self._parse_connection_url(url)
|
||||
|
||||
if opts['host'] == '__test__':
|
||||
url = os.environ.get('CEILOMETER_TEST_HBASE_URL')
|
||||
url = os.environ.get('PANKO_TEST_HBASE_URL')
|
||||
if url:
|
||||
# Reparse URL, but from the env variable now
|
||||
opts = self._parse_connection_url(url)
|
|
@ -20,7 +20,7 @@ import re
|
|||
from oslo_log import log
|
||||
import six
|
||||
|
||||
import ceilometer
|
||||
import panko
|
||||
|
||||
LOG = log.getLogger(__name__)
|
||||
|
||||
|
@ -112,7 +112,7 @@ class MTable(object):
|
|||
# in case of multiple filters
|
||||
rows = m(fargs, rows)
|
||||
else:
|
||||
raise ceilometer.NotImplementedError(
|
||||
raise panko.NotImplementedError(
|
||||
"%s filter is not implemented, "
|
||||
"you may want to add it!")
|
||||
for k in sorted(rows)[:limit]:
|
||||
|
@ -197,7 +197,7 @@ class MTable(object):
|
|||
if g == row:
|
||||
r[row] = data
|
||||
else:
|
||||
raise ceilometer.NotImplementedError(
|
||||
raise panko.NotImplementedError(
|
||||
"In-memory "
|
||||
"RowFilter doesn't support "
|
||||
"the %s operation yet" % op)
|
||||
|
@ -234,7 +234,7 @@ class MTable(object):
|
|||
(is_regex and re.search(value, key))):
|
||||
r_data[key] = data[key]
|
||||
else:
|
||||
raise ceilometer.NotImplementedError(
|
||||
raise panko.NotImplementedError(
|
||||
"In-memory QualifierFilter "
|
||||
"doesn't support the %s "
|
||||
"operation yet" % op)
|
|
@ -21,8 +21,8 @@ from happybase.hbase import ttypes
|
|||
from oslo_log import log
|
||||
import six
|
||||
|
||||
from ceilometer.i18n import _
|
||||
from ceilometer import utils
|
||||
from panko.i18n import _
|
||||
from panko import utils
|
||||
|
||||
LOG = log.getLogger(__name__)
|
||||
|
|
@ -28,7 +28,7 @@ import pymongo
|
|||
import pymongo.errors
|
||||
import six
|
||||
|
||||
from ceilometer.i18n import _, _LI
|
||||
from panko.i18n import _, _LI
|
||||
|
||||
ERROR_INDEX_WITH_DIFFERENT_SPEC_ALREADY_EXISTS = 86
|
||||
|
|
@ -11,7 +11,7 @@
|
|||
# under the License.
|
||||
|
||||
"""
|
||||
SQLAlchemy models for Ceilometer data.
|
||||
SQLAlchemy models for Panko data.
|
||||
"""
|
||||
import json
|
||||
|
||||
|
@ -24,7 +24,7 @@ from sqlalchemy.orm import deferred
|
|||
from sqlalchemy.orm import relationship
|
||||
from sqlalchemy.types import TypeDecorator
|
||||
|
||||
from ceilometer import utils
|
||||
from panko import utils
|
||||
|
||||
|
||||
class JSONEncodedDict(TypeDecorator):
|
||||
|
@ -74,8 +74,8 @@ class PreciseTimestamp(TypeDecorator):
|
|||
return value
|
||||
|
||||
|
||||
class CeilometerBase(object):
|
||||
"""Base class for Ceilometer Models."""
|
||||
class PankoBase(object):
|
||||
"""Base class for Panko Models."""
|
||||
__table_args__ = {'mysql_charset': "utf8",
|
||||
'mysql_engine': "InnoDB"}
|
||||
__table_initialized__ = False
|
||||
|
@ -92,7 +92,7 @@ class CeilometerBase(object):
|
|||
setattr(self, k, v)
|
||||
|
||||
|
||||
Base = declarative_base(cls=CeilometerBase)
|
||||
Base = declarative_base(cls=PankoBase)
|
||||
|
||||
|
||||
class EventType(Base):
|
|
@ -22,7 +22,7 @@ import six
|
|||
from testtools import testcase
|
||||
import webtest
|
||||
|
||||
import ceilometer
|
||||
import panko
|
||||
|
||||
|
||||
class BaseTestCase(base.BaseTestCase):
|
||||
|
@ -70,7 +70,7 @@ def _skip_decorator(func):
|
|||
def skip_if_not_implemented(*args, **kwargs):
|
||||
try:
|
||||
return func(*args, **kwargs)
|
||||
except ceilometer.NotImplementedError as e:
|
||||
except panko.NotImplementedError as e:
|
||||
raise testcase.TestSkipped(six.text_type(e))
|
||||
except webtest.app.AppError as e:
|
||||
if 'not implemented' in six.text_type(e):
|
|
@ -28,10 +28,10 @@ from six.moves.urllib import parse as urlparse
|
|||
import sqlalchemy
|
||||
from testtools import testcase
|
||||
|
||||
from ceilometer import storage
|
||||
from ceilometer.tests import base as test_base
|
||||
from panko import storage
|
||||
from panko.tests import base as test_base
|
||||
try:
|
||||
from ceilometer.tests import mocks
|
||||
from panko.tests import mocks
|
||||
except ImportError:
|
||||
mocks = None # happybase module is not Python 3 compatible yet
|
||||
|
||||
|
@ -63,7 +63,7 @@ class MongoDbManager(fixtures.Fixture):
|
|||
|
||||
class SQLManager(fixtures.Fixture):
|
||||
def __init__(self, url):
|
||||
db_name = 'ceilometer_%s' % uuid.uuid4().hex
|
||||
db_name = 'panko_%s' % uuid.uuid4().hex
|
||||
engine = sqlalchemy.create_engine(url)
|
||||
conn = engine.connect()
|
||||
self._create_database(conn, db_name)
|
||||
|
@ -138,8 +138,8 @@ class HBaseManager(fixtures.Fixture):
|
|||
def url(self):
|
||||
return '%s?table_prefix=%s&table_prefix_separator=%s' % (
|
||||
self._url,
|
||||
os.getenv("CEILOMETER_TEST_HBASE_TABLE_PREFIX", "test"),
|
||||
os.getenv("CEILOMETER_TEST_HBASE_TABLE_PREFIX_SEPARATOR", "_")
|
||||
os.getenv("PANKO_TEST_HBASE_TABLE_PREFIX", "test"),
|
||||
os.getenv("PANKO_TEST_HBASE_TABLE_PREFIX_SEPARATOR", "_")
|
||||
)
|
||||
|
||||
|
||||
|
@ -185,7 +185,7 @@ class TestBase(test_base.BaseTestCase):
|
|||
'Test is not applicable for %s' % engine)
|
||||
|
||||
self.CONF = self.useFixture(fixture_config.Config()).conf
|
||||
self.CONF([], project='ceilometer', validate_default_values=True)
|
||||
self.CONF([], project='panko', validate_default_values=True)
|
||||
|
||||
manager = self.DRIVER_MANAGERS.get(engine)
|
||||
if not manager:
|
||||
|
@ -198,7 +198,7 @@ class TestBase(test_base.BaseTestCase):
|
|||
self.event_conn = self.db_manager.event_connection
|
||||
self.event_conn.upgrade()
|
||||
|
||||
self.useFixture(mockpatch.Patch('ceilometer.storage.get_connection',
|
||||
self.useFixture(mockpatch.Patch('panko.storage.get_connection',
|
||||
side_effect=self._get_connection))
|
||||
|
||||
def tearDown(self):
|
|
@ -21,12 +21,12 @@ from oslo_policy import opts
|
|||
import pecan
|
||||
import pecan.testing
|
||||
|
||||
from ceilometer.api import rbac
|
||||
from ceilometer.tests import db as db_test_base
|
||||
from panko.api import rbac
|
||||
from panko.tests import db as db_test_base
|
||||
|
||||
OPT_GROUP_NAME = 'keystone_authtoken'
|
||||
cfg.CONF.import_group(OPT_GROUP_NAME, "keystonemiddleware.auth_token")
|
||||
cfg.CONF.import_group('api', 'ceilometer.api.controllers.v2.root')
|
||||
cfg.CONF.import_group('api', 'panko.api.controllers.v2.root')
|
||||
|
||||
|
||||
class FunctionalTest(db_test_base.TestBase):
|
||||
|
@ -46,7 +46,7 @@ class FunctionalTest(db_test_base.TestBase):
|
|||
self.CONF.set_override("auth_version", "v2.0",
|
||||
group=OPT_GROUP_NAME)
|
||||
self.CONF.set_override("policy_file",
|
||||
self.path_get('etc/ceilometer/policy.json'),
|
||||
self.path_get('etc/panko/policy.json'),
|
||||
group='oslo_policy')
|
||||
|
||||
self.app = self._make_app()
|
||||
|
@ -54,8 +54,8 @@ class FunctionalTest(db_test_base.TestBase):
|
|||
def _make_app(self, enable_acl=False):
|
||||
self.config = {
|
||||
'app': {
|
||||
'root': 'ceilometer.api.controllers.root.RootController',
|
||||
'modules': ['ceilometer.api'],
|
||||
'root': 'panko.api.controllers.root.RootController',
|
||||
'modules': ['panko.api'],
|
||||
'enable_acl': enable_acl,
|
||||
},
|
||||
'wsme': {
|
|
@ -13,7 +13,7 @@
|
|||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from ceilometer.tests.functional import api
|
||||
from panko.tests.functional import api
|
||||
|
||||
|
||||
class FunctionalTest(api.FunctionalTest):
|
|
@ -23,9 +23,9 @@ from oslo_utils import fileutils
|
|||
import six
|
||||
import webtest
|
||||
|
||||
from ceilometer.api import app
|
||||
from ceilometer.event.storage import models as ev_model
|
||||
from ceilometer.tests.functional.api import v2
|
||||
from panko.api import app
|
||||
from panko.event.storage import models as ev_model
|
||||
from panko.tests.functional.api import v2
|
||||
|
||||
VALID_TOKEN = uuid.uuid4().hex
|
||||
VALID_TOKEN2 = uuid.uuid4().hex
|
||||
|
@ -64,7 +64,7 @@ class TestAPIACL(v2.FunctionalTest):
|
|||
**params)
|
||||
|
||||
def _make_app(self):
|
||||
file_name = self.path_get('etc/ceilometer/api_paste.ini')
|
||||
file_name = self.path_get('etc/panko/api_paste.ini')
|
||||
self.CONF.set_override("api_paste_config", file_name)
|
||||
return webtest.TestApp(app.load_app())
|
||||
|
|
@ -13,9 +13,9 @@
|
|||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
"""Test basic ceilometer-api app
|
||||
"""Test basic panko-api app
|
||||
"""
|
||||
from ceilometer.tests.functional.api import v2
|
||||
from panko.tests.functional.api import v2
|
||||
|
||||
|
||||
class TestApiMiddleware(v2.FunctionalTest):
|
|
@ -14,7 +14,7 @@
|
|||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
from ceilometer.tests.functional.api import v2 as tests_api
|
||||
from panko.tests.functional.api import v2 as tests_api
|
||||
|
||||
|
||||
class TestCapabilitiesController(tests_api.FunctionalTest):
|
|
@ -19,9 +19,9 @@ import uuid
|
|||
|
||||
import webtest.app
|
||||
|
||||
from ceilometer.event.storage import models
|
||||
from ceilometer.tests import db as tests_db
|
||||
from ceilometer.tests.functional.api import v2
|
||||
from panko.event.storage import models
|
||||
from panko.tests import db as tests_db
|
||||
from panko.tests.functional.api import v2
|
||||
|
||||
USER_ID = uuid.uuid4().hex
|
||||
PROJ_ID = uuid.uuid4().hex
|
|
@ -28,8 +28,8 @@ from oslo_utils import fileutils
|
|||
import six
|
||||
from six.moves.urllib import parse as urlparse
|
||||
|
||||
from ceilometer.event.storage import models
|
||||
from ceilometer import storage
|
||||
from panko.event.storage import models
|
||||
from panko import storage
|
||||
|
||||
# TODO(chdent): For now only MongoDB is supported, because of easy
|
||||
# database name handling and intentional focus on the API, not the
|
||||
|
@ -57,9 +57,9 @@ class ConfigFixture(fixture.GabbiFixture):
|
|||
|
||||
conf = fixture_config.Config().conf
|
||||
self.conf = conf
|
||||
self.conf([], project='ceilometer', validate_default_values=True)
|
||||
self.conf([], project='panko', validate_default_values=True)
|
||||
opts.set_defaults(self.conf)
|
||||
conf.import_group('api', 'ceilometer.api.controllers.v2.root')
|
||||
conf.import_group('api', 'panko.api.controllers.v2.root')
|
||||
|
||||
content = ('{"default": ""}')
|
||||
if six.PY3:
|
||||
|
@ -73,7 +73,7 @@ class ConfigFixture(fixture.GabbiFixture):
|
|||
conf.set_override(
|
||||
'api_paste_config',
|
||||
os.path.abspath(
|
||||
'ceilometer/tests/functional/gabbi/gabbi_paste.ini')
|
||||
'panko/tests/functional/gabbi/gabbi_paste.ini')
|
||||
)
|
||||
|
||||
database_name = '%s-%s' % (db_url, str(uuid.uuid4()))
|
|
@ -1,6 +1,6 @@
|
|||
# Ceilometer API WSGI Pipeline
|
||||
# Panko API WSGI Pipeline
|
||||
# Define the filters that make up the pipeline for processing WSGI requests
|
||||
# Note: This pipeline is PasteDeploy's term rather than Ceilometer's pipeline
|
||||
# Note: This pipeline is PasteDeploy's term rather than Panko's pipeline
|
||||
# used for processing samples
|
||||
#
|
||||
# This version is specific for gabbi. It removes support for keystone while
|
||||
|
@ -11,7 +11,7 @@
|
|||
pipeline = cors api-server
|
||||
|
||||
[app:api-server]
|
||||
paste.app_factory = ceilometer.api.app:app_factory
|
||||
paste.app_factory = panko.api.app:app_factory
|
||||
|
||||
[filter:authtoken]
|
||||
paste.filter_factory = keystonemiddleware.auth_token:filter_factory
|
||||
|
@ -21,4 +21,4 @@ paste.filter_factory = oslo_middleware:RequestId.factory
|
|||
|
||||
[filter:cors]
|
||||
paste.filter_factory = oslo_middleware.cors:filter_factory
|
||||
oslo_config_project = ceilometer
|
||||
oslo_config_project = panko
|
|
@ -13,7 +13,7 @@
|
|||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
"""A test module to exercise the Ceilometer API with gabbi
|
||||
"""A test module to exercise the Panko API with gabbi
|
||||
|
||||
For the sake of exploratory development.
|
||||
"""
|
||||
|
@ -22,8 +22,8 @@ import os
|
|||
|
||||
from gabbi import driver
|
||||
|
||||
from ceilometer.api import app
|
||||
from ceilometer.tests.functional.gabbi import fixtures as fixture_module
|
||||
from panko.api import app
|
||||
from panko.tests.functional.gabbi import fixtures as fixture_module
|
||||
|
||||
TESTS_DIR = 'gabbits'
|
||||
|
|
@ -13,14 +13,14 @@
|
|||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
"""A module to exercise the Ceilometer API with gabbi with a URL prefix"""
|
||||
"""A module to exercise the Panko API with gabbi with a URL prefix"""
|
||||
|
||||
import os
|
||||
|
||||
from gabbi import driver
|
||||
|
||||
from ceilometer.api import app
|
||||
from ceilometer.tests.functional.gabbi import fixtures as fixture_module
|
||||
from panko.api import app
|
||||
from panko.tests.functional.gabbi import fixtures as fixture_module
|
||||
|
||||
TESTS_DIR = 'gabbits_prefix'
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue