9b93fc8864
Implemented specification proposal for batch support at, https://review.openstack.org/#/c/273058/ Note, if you want to use this in the monasca-vagrant environment it should work. I've modified the value of the field kafka_url in etc/monasca/monasca_log_api.conf to use the kafka server in the mini-mon vm. After you've deployed monasca-vagrant using "vagrant up" ssh into mini-mon "vagrant ssh mini-mon" and then create a new topic for logs which can be done running the command: /opt/kafka/bin/kafka-topics.sh --create -zookeeper localhost:2181 --replication-factor 1 --partitions 128 --topic logs To watch the log messages at the console in the mini-mon VM /opt/kafka/bin/kafka-console-consumer.sh --zookeeper localhost:2181 --topic logs Change-Id: I4247d1824a237ecbe4db878e72485938f40a31c3 |
||
---|---|---|
.. | ||
api | ||
healthcheck | ||
middleware | ||
tests | ||
v2 | ||
v3 | ||
.gitignore | ||
README.md | ||
__init__.py | ||
server.py |
README.md
Monasca-log-api Python
Installation
To install the python api implementation, git clone the source and run the following command::
sudo python setup.py install
If it installs successfully, you will need to make changes to the following two files to reflect your system settings, especially where kafka server is located::
/etc/monasca/log-api-config.conf
/etc/monasca/log-api-config.ini
Once the configurations are modified to match your environment, you can start up the server by following the following instructions.
To start the server, run the following command:
Running the server in foreground mode
gunicorn -k eventlet --worker-connections=2000 --backlog=1000
--paste /etc/monasca/log-api.ini
Running the server as daemons
gunicorn -k eventlet --worker-connections=2000 --backlog=1000
--paste /etc/monasca/log-api.ini -D
Testing
PEP8 guidelines
To check if the code follows python coding style, run the following command from the root directory of this project:
tox -e pep8
Testing
To run all the unit test cases, run the following command from the root directory of this project:
tox -e py27 (or -e py26, -e py33)
Coverage
To generate coverage results, run the following command from the root directory of this project:
tox -e cover
Building
To build an installable package, run the following command from the root directory of this project:
python setup.py sdist
Documentation
To generate documentation, run the following command from the root directory of this project:
make html
That will create documentation under build folder relative to root of the project.