Monasca REST API
Java Python Shell Other
Clone or download
Permalink
Failed to load latest commit information.
api-ref Prepare foundation for doc migration Jul 31, 2017
common Restore user condition but with zuul Oct 19, 2017
config-generator Using oslo.policy for monasca-api Jun 5, 2018
contrib Remove bundled intree monasca-api tempest plugin Jan 31, 2018
devstack Merge "Upgrade InfluxDB to version 1.3.9" Aug 10, 2018
doc Add monasca_db command line tool Aug 1, 2018
docs Replace chinese double quotes to English double quotes Jun 17, 2018
etc Enable uWSGI support in devstack Jun 12, 2018
java upper common and persister pom version to 1.3.0 Dec 19, 2017
monasca_api Merge "Remove usage of future library" Aug 8, 2018
perf Add read performance testing to monasca-api Jan 25, 2018
playbooks/legacy/monasca-tempest-base Remove bundled intree monasca-api tempest plugin Jan 31, 2018
releasenotes Merge "Upgrade InfluxDB to version 1.3.9" Aug 10, 2018
tools Avoid tox_install.sh for constraints support Dec 1, 2017
.coveragerc Migrate test run to ostestr Jan 14, 2017
.gitignore Add .stestr.conf . Sep 22, 2017
.gitreview Update .gitreview for new namespace Oct 17, 2015
.stestr.conf Add .stestr.conf . Sep 22, 2017
.testr.conf Migrate test run to ostestr Jan 14, 2017
.zuul.yaml import zuul job settings from project-config Aug 8, 2018
LICENSE Added license file May 1, 2014
README.rst Fix README.rst and add syntax check Aug 6, 2018
babel.cfg initial python implementation Sep 15, 2014
bindep.txt Add libssl to fix pep8 Jun 7, 2017
lower-constraints.txt Fix lower-constraints job Apr 9, 2018
pom.xml Update links in pom.xml Jan 12, 2018
requirements.txt Using oslo.policy for monasca-api Jun 5, 2018
run_maven.sh Ensure the same branch is used for common build Feb 10, 2016
setup.cfg Add monasca_db command line tool Aug 1, 2018
setup.py Updated from global requirements Mar 2, 2017
test-requirements.txt Switch to using stestr Jun 29, 2018
tox.ini Fix README.rst and add syntax check Aug 6, 2018

README.rst

Team and repository tags

Overview

monasca-api is a RESTful API server that is designed with a layered architecture.

Documentation

The full API Specification can be found in docs/monasca-api-spec.md

Python Monasca API Implementation

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/api-config.ini
/etc/monasca/api-config.conf
/etc/monasca/api-logging.conf

Once the configuration files 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/api-config.ini

Running the server as daemons
$ gunicorn -k eventlet --worker-connections=2000 --backlog=1000 --paste /etc/monasca/api-config.ini -D

To check if the code follows python coding style, run the following command from the root directory of this project

$ tox -e pep8

To run all the unit test cases, run the following command from the root directory of this project

$ tox -e py27

Start the Server – for Apache

To start the server using Apache: create a modwsgi file, create a modwsgi configuration file, and enable the wsgi module in Apache.

The modwsgi configuration file may look something like this, and the site will need to be enabled:

Listen 8070

<VirtualHost *:8070>

    WSGIDaemonProcess monasca-api processes=4 threads=1 socket-timeout=120 user=mon-api group=monasca python-path=/usr/local/lib/python2.7/site-packages
    WSGIProcessGroup monasca-api
    WSGIApplicationGroup monasca-api
    WSGIScriptAlias / /usr/local/lib/python2.7/site-packages/monasca_api/api/wsgi/monasca_api.py

    WSGIPassAuthorization On

    LogLevel info
    ErrorLog /var/log/monasca-api/wsgi.log
    CustomLog /var/log/monasca-api/wsgi-access.log combined

    <Directory /usr/local/lib/python2.7/site-packages/monasca_api>
      Require all granted
    </Directory>

    SetEnv no-gzip 1

</VirtualHost>

The wsgi file may look something like this:

from monasca_api.api import server

application = server.get_wsgi_app(config_base_path='/etc/monasca')

Java Implementation

Details on usage can be found here

WARNING: The Java implementation of Monasca API is DEPRECATED and will be removed in future release.

License

Copyright (c) 2014 Hewlett-Packard Development Company, L.P.

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.