Monasca REST API
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Ghanshyam Mann 658c68b593 Drop lower-constraints.txt and its testing 4 weeks ago
api-ref Switch to newer openstackdocstheme and reno versions 2 years ago
common Restore user condition but with zuul 5 years ago
config-generator Add keystonemiddleware to oslo-config-generator conf 3 years ago
contrib Remove bundled intree monasca-api tempest plugin 4 years ago
devstack Clean up extra spaces 8 months ago
doc [Doc] Update Freenode to OFTC as our IRC server 12 months ago
docker Fix Docker build 12 months ago
docs Allow users to set periodic notifications on all notification types 2 years ago
etc Update devstack plugin to support new api 3 years ago
java [Trivial Fix] change the unicode of some higher numbered characters 4 years ago
monasca_api Rename the deprecated argument tenant with project 2 months ago
perf Add read performance testing to monasca-api 4 years ago
playbooks Fix zuul publish docker image job 4 months ago
releasenotes Update master for stable/yoga 3 months ago
tools Avoid for constraints support 5 years ago
.coveragerc Migrate test run to ostestr 5 years ago
.gitignore Merge log-api and api 3 years ago
.gitreview OpenDev Migration Patch 3 years ago
.stestr.conf Add .stestr.conf . 5 years ago
.zuul.yaml Drop lower-constraints.txt and its testing 4 weeks ago
CONTRIBUTING.rst Update Monasca contribution documentation 2 years ago
LICENSE Added license file 8 years ago
README.rst [ussuri][goal] Drop python 2.7 support and testing 2 years ago
babel.cfg initial python implementation 8 years ago
bindep.txt Add libssl to fix pep8 5 years ago
pom.xml Update links in pom.xml 4 years ago
requirements.txt Drop lower-constraints.txt and its testing 4 weeks ago Ensure the same branch is used for common build 6 years ago
setup.cfg setup.cfg: Replace dashes with underscores 12 months ago Cleanup py27 support 2 years ago
test-requirements.txt Add doc/requirements 1 year ago
tox.ini Drop lower-constraints.txt and its testing 4 weeks ago


Team and repository tags



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


The full API Specification can be found in docs/

Python Monasca API Implementation

To install the python api implementation, git clone the source and run the following command:

$ sudo python 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:


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 py36

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/

    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

    SetEnv no-gzip 1


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.


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

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.