Monasca REST API
Go to file
yangyawei 3d43cbec0f setup.cfg: Replace dashes with underscores
Setuptools v54.1.0 introduces a warning that the use of dash-separated
options in 'setup.cfg' will not be supported in a future version [1].
Get ahead of the issue by replacing the dashes with underscores. Without
this, we see 'UserWarning' messages like the following on new enough
versions of setuptools:

  UserWarning: Usage of dash-separated 'description-file' will not be
  supported in future versions. Please use the underscore name
  'description_file' instead

[1] https://github.com/pypa/setuptools/commit/a2e9ae4cb

Change-Id: I9f43416f6f1121b39518555ccaa2a4d5452fea91
2021-06-07 20:35:03 +00:00
api-ref Switch to newer openstackdocstheme and reno versions 2020-05-21 17:14:23 +02:00
common Restore user condition but with zuul 2017-10-19 06:08:28 +02:00
config-generator Add keystonemiddleware to oslo-config-generator conf 2019-01-28 16:11:51 +01:00
contrib Remove bundled intree monasca-api tempest plugin 2018-01-31 11:50:16 +05:30
devstack Merge "Fix log-metric configuration" 2021-04-06 12:33:33 +00:00
doc [Doc] Update Freenode to OFTC as our IRC server 2021-06-01 13:25:05 +02:00
docker Fix Docker build 2021-06-07 13:12:36 +02:00
docs Allow users to set periodic notifications on all notification types 2020-01-21 10:49:22 +00:00
etc Update devstack plugin to support new api 2019-12-04 13:52:57 +01:00
java [Trivial Fix] change the unicode of some higher numbered characters 2018-09-07 08:44:04 +08:00
monasca_api Add Support for Falcon 3.0.0, 3.0.1 2021-06-06 21:29:22 +02:00
perf Add read performance testing to monasca-api 2018-01-25 08:18:13 -08:00
playbooks Fix zuul publish docker image job 2021-01-19 13:10:10 +01:00
releasenotes Update master for stable/wallaby 2021-03-31 22:50:22 +00:00
tools Avoid tox_install.sh for constraints support 2017-12-01 15:37:36 +01:00
.coveragerc Migrate test run to ostestr 2017-01-14 19:47:29 +00:00
.gitignore Merge log-api and api 2019-09-26 12:02:20 +02:00
.gitreview OpenDev Migration Patch 2019-04-19 19:29:15 +00:00
.stestr.conf Add .stestr.conf . 2017-09-22 13:41:11 +02:00
.zuul.yaml Fix Docker build 2021-06-07 13:12:36 +02:00
babel.cfg initial python implementation 2014-09-15 13:18:10 -04:00
bindep.txt Add libssl to fix pep8 2017-06-07 15:54:02 -06:00
CONTRIBUTING.rst Update Monasca contribution documentation 2020-05-19 16:51:08 +02:00
LICENSE Added license file 2014-05-01 16:22:11 -07:00
lower-constraints.txt [goal] Deprecate the JSON formatted policy file 2021-02-02 14:36:06 +00:00
pom.xml Update links in pom.xml 2018-01-12 16:27:30 +08:00
README.rst [ussuri][goal] Drop python 2.7 support and testing 2019-12-10 13:58:58 +01:00
requirements.txt [goal] Deprecate the JSON formatted policy file 2021-02-02 14:36:06 +00:00
run_maven.sh Ensure the same branch is used for common build 2016-02-10 09:11:02 -07:00
setup.cfg setup.cfg: Replace dashes with underscores 2021-06-07 20:35:03 +00:00
setup.py Cleanup py27 support 2020-04-05 11:35:05 +02:00
test-requirements.txt Add doc/requirements 2021-01-07 13:18:06 +01:00
tox.ini [goal] Deprecate the JSON formatted policy file 2021-02-02 14:36:06 +00:00

Team and repository tags

image

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/monasca-api.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 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/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.