Commit Graph

34 Commits

Author SHA1 Message Date
Martin Chacon Piza 18ba158e5a Rename the deprecated argument tenant with project
Since oslo.context=4.0.0 Feb 3, 2022  the deprecated argument
tenant was removed [1]

- Remove temporarily monasca-tempest-log-python3-influxdb check
- Remove permanently monasca-tempest-python3-cassandra check

[1] f4cbe4c296

Change-Id: I38dc75df3e7a7575be37dbfa3714e694a19f35c4
2022-03-18 12:19:29 +01:00
Martin Chacon Piza a6e56ab63c Add Support for Falcon 3.0.0, 3.0.1
- Support to new Falcon 3.0.0 and 3.0.1 keeping compatibility
for version 2.0.0

- Remove Falcon's class OptionalRepresentation
Starting from Falcon 3.0.0 version the class OptionalRepresentation
was removed. [1]

- Remove unnecessary URL slashes which are not compatible
with Falcon >= 3.0.0

- Keep facon.API instead of new falcon.App to keep support for
version 2.0.0

- Disable temporary docker-build and docker-publish Zuul jobs.

[1] https://falcon.readthedocs.io/en/stable/changes/3.0.0.html#breaking-changes

Change-Id: Ifb067429dd66fd350110187ac3a8b6a9977bad90
2021-06-06 21:29:22 +02:00
Andreas Jaeger abad342eb2 Update hacking for Python3
The repo is Python 3 now, so update hacking to version 3.0 which
supports Python 3.

Fix problems found by updated hacking version.

Remove hacking and friends from lower-constraints, they are not needed
there at all.

Change-Id: I35d848e9af297d3561ea2838a4808166d1c36601
2020-04-22 07:37:55 +00:00
Martin Chacon Piza 0b7dc58296 Migrate from ujson to simplejson
The change updates the imports to use simplejson library and
monasca_api.common.rest instead of monasca_common.rest, since
it was moved to this project during the API's merge.

Temporarily set following jobs as non-voting:

* monasca-tempest-python3-influxdb
* build-monasca-docker-image
* publish-monasca-api-docker-image

Change-Id: Ife3d2c9795a9dc406c2927cc9a077dda01c183c6
Story: 2007549
Task: 39389
2020-04-18 10:28:24 +02:00
Witek Bedyk 394be3f330 Use Confluent Kafka producer for logs
As already implemented for metrics, also logs should be published to
Apache Kafka using the new Kafka client.

Change-Id: Ie909b13c7692267e787d481f4de658db3b07a1c4
Story: 2003705
Task: 36866
2020-01-27 08:20:40 +00:00
Adrian Czarnecki d2379a018e Merge log-api and api
*Merge monasca-log-api into merge-api
*Enable logs endpoints
*Add configuration that allow to enable/disable metrics and logs part
*Remove redundant log-api source code

Story: 2003881
Task: 30533
Change-Id: Iaa5689694e7081f3375f1a2235cad31d6a7b5f76
2019-09-26 12:02:20 +02:00
Martin Chacon Piza 2485e39b53 Merge monasca-common code into the monasca-api
This change copies the code from monasca-common used by the 3
monasca APIs into monasca-api for the Merge-APIs target.

After mergin the APIs the duplicated code can be removed from
monasca-common.

Change-Id: I52d36fad846637baf10516f5cbbedc541d4c2064
Story: 2003881
Task: 30427
2019-07-26 14:08:31 +02:00
Doug Szumski a9cc4bb482 Add support for using Falcon 2.0.0
Falcon 2.0.0 introduces some breaking changes. The relevant ones here are:

- falcon.testing.TestCase.api property was removed
- falcon.testing.TestBase class was removed

Additionally, the default behaviour for handling trailing slashes on
URIs also changed:

https://falcon.readthedocs.io/en/latest/user/faq.html#how-does-falcon-
handle-a-trailing-slash-in-the-request-path

This commit adds support for using the new release. It currently makes
no effort to be backwards compatible with older releases.

The change also updates the requirements for influxdb and sphinx
libraries to match global requirements.

Until monasca-log-api implementation is not updated to support the new
version of Falcon, `monascalog-python3-tempest` is marked to be
non-voting as agreed in the team meeting.

Story: 2005695
Task: 31015
Change-Id: I03bc8d502a333a7a71d9c12b8ddc7c5dc0a4f588
2019-05-29 16:10:53 +02:00
Adrian Czarnecki e18ed3f02d Improve tests coverage
* Add unit tests
* Fix python3 and python2 compatibility

Story: 2003881
Task: 29254

Change-Id: Ib54b94737dace3104976321e38ad1a9076a46877
2019-03-11 14:49:33 +00:00
Thomas Bechtold 96e13dad75 Replace api-config.conf with monasca-api.conf
api-config.conf is the deprecated path for the configuration file. The
new path is /etc/monasca/monasca-api.conf .

Story: 2004708
Task: 28987

Change-Id: If06d9114529c3ef4520247dfc7c32d3769f07084
2019-01-19 12:15:22 +01:00
Doug Szumski f79049538c Allow mod_wsgi to find application
The refactoring of the wsgi.py file to support uWSGI in devstack
unfortunately broke existing WSGI deployments which fail to load
the Monasca API with a message like this:

Target WSGI script '/monasca-api/monasca_api/api/wsgi.py' does not
contain WSGI application 'application'.

This change allows mod_wsgi to find the application definition.

Change-Id: I9002bdcb4e132495ec639ad3636bdabdd8714e01
Story: 2001919
Task: 23343
2018-07-31 16:40:41 +01:00
Zuul ddbc1c4efb Merge "Enable uWSGI support in devstack" 2018-06-15 09:26:56 +00:00
Adrian Czarnecki 5359e4e633 Enable uWSGI support in devstack
Story: 2001464
Task: 6181
Change-Id: If4329e51feebeb68538917d7a68aad53ae469b07
2018-06-12 14:36:46 +02:00
Amir Mofakhar 3ca4b057dd Using oslo.policy for monasca-api
Added policies and used policy enforcement engine
from monasca-common.

- Replaced security with oslo.policy
- Updated unit tests and implemented some new tests
- Added a new entry point for generating sample policy file by tox

story: 2001233
task: 6355

Change-Id: I4aa444fe6ec883160c03c201145c77994b6615f9
Signed-off-by: Amir Mofakhar <amofakhar@op5.com>
2018-06-05 12:25:07 +00:00
Tomasz Trębski 5d27af4079 Config-generator for monasca-api
Change migrates the monasca-api to use oslo-config-generator in
order to always build newest configuration file. That removes
the need of maintaning the file along with changes to oslo configuration.
The example of the file is also included in the documentation.

Also:
* ported case for launching api under WSGI and allowing the argument
  parsing of oslo to take place

Story: 2000970
Task: 4865

Story: 2000964
Task: 4106

Change-Id: I57547b0e2122e40f58db5f949773900b76214526
2017-08-28 06:58:57 +00:00
Jakub Wachowski 200c10be96 Load config only once
Currently when kafka is down on monasca-api startup,
monasca-api enters infinite error loop with
ArgsAlreadyParsedError: arguments already parsed:
  cannot register CLI option

Change-Id: Iabcd830d76ba4225e39843db88ab35555d4ea921
2017-07-11 11:51:34 +02:00
Artur Basiak 4e168edf6e Add healtcheck endpoint
Provide new healtcheck endpoint to monasca-api.
Add simple check for HEAD and complex check for GET.
Complex check contains information about dependent
services like:
- kafka
- relational database (mariadb, postgresql)
- timeseries database (influxdb, cassandra)

Story: 2000974
Task: 4125

Change-Id: I863071194041a512b144262bbffce5024b97086b
2017-05-30 11:30:56 +02:00
Thomas Bechtold 6e59104539 Only import wsgiref when needed
wsgiref is only used then server.py is called directly which is usually not the
case if monasca-api runs under a wsgi container.

Change-Id: I229ac6034107d087750179460153e1350aad314e
2017-04-16 18:04:03 +00:00
Tomasz Trębski bff8cd27eb Adding WSGI support
Following commits adds possiblity to run monasca-api
with Apache2 (mod_wsgi).

Needed-By: Idcc181bbb19a68c622eca51dc9822bde9a91f6a9
Change-Id: Id07dcc249965d97644da9396b6d288255ffaab43
2017-03-07 17:56:54 +00:00
Tomasz Trębski 044f389848 Integration with oslo.context
Similar to other openstack projects,
monasca-api should provide information
about request's context in the log information.

This is done by:
* implementing custom Request that creates context (oslo.context)
* changing logging configuration to use ContextLogFormatter

Since information like tenant-id can be
retrieved from the context, modified resource code to use
that.

Also moved 'limit' directly to request property.

Change-Id: I917fa2cba99dc668842fea0a62cda2cabd796d09
2017-01-09 05:35:58 +00:00
Joachim Barheine 0f7fb35936 python impl. of metric-name-list for InfluxDB returns incomplete results
Change-Id: I269344f59684c74f9a8ad556620f1b786906cbc5
Closes-Bug: 1628798
2016-10-11 10:39:52 +02:00
Kaiyan Sheng f26c427b4b Add metrics/dimensions/names into monasca-api
This endpoint will return all the dimension names for a given metric
name.
Added dimension-names for influx in python api and java api
Added dimension-names for vertica in java api

Depends-On: Id981dafd00778a6d4a376b9ceab011231e94c0c6
Change-Id: I0192ccb9276ea94103a477bd2ad7d10f21e64d31
Implements: blueprint dimensions-api
2016-10-07 15:25:36 -06:00
haali1 5a0801e9d9 Adds support for notification plugins in monacaapi
This review
  1) Removes the hard coded notification types
  2) Adds a new Rest API to get the notification types

Partially-implements: blueprint notification-engine-plugin
Change-Id: Ie043533974f9dcf60c77093c5d6df5eced99e68b
2016-08-01 12:49:05 -07:00
Jenkins 8c5dc5620d Merge "Change Monasca Port" 2016-07-26 21:31:24 +00:00
Brad Klein a317508031 Add metrics/dimensions/names/values api for grafana templating optimization
This endpoint will return all the dimension values for a given
dimension name and optional metric name (for the scoped project).
This will allow grafana templating to use this (much faster call)
instead of making a full metric-list call and then parsing out
dimensions.

Change-Id: Ia1e2487fe0f96dee03d97d865c58a3728b43f448
Implements: blueprint dimensions-api
2016-07-20 10:17:25 -06:00
Matteus Silva 51ac51bd3d Change Monasca Port
Actually, default port for Monasca API is 8070.

Change-Id: Ifc02440184c1347ef649172d13f292a6bf273fc0
2016-07-19 01:27:00 +00:00
Jenkins 7e9f30862b Merge "Add patch to notification method and clean up code" 2016-06-24 15:45:47 +00:00
Michael James Hoppal 04d6b5fdfd Add patch to notification method and clean up code
Update docs with new command

Move validation of the period field to the setter for
java api which is called by jackson as it constructs the
command objects.

Add tempest tests for patching

Change-Id: I7f31aa059601c0390c42b0f5bdf4091706f6660d
2016-06-17 10:57:04 -06:00
Kaiyan Sheng b5f5951351 Import simport from monasca-common
Change-Id: If4aecd60faf20775b8d9f9a6b4273bac2ef3d204
2016-06-16 09:48:48 -06:00
Bertrand Lallau c0c8277241 Remove unnecessary executable permissions
Removes executable permissions on python module not requiring it.

Change-Id: I7e9f498d4c595853028fec3d024a22b8f2d30c0b
2016-05-24 09:26:33 +02:00
Ryan Brandt b0ff5227b0 Add alarm count resource
Add alarm counts resource at /v2.0/alarms/count
Add alarm counts spec
Add tempest tests for alarm count

Change-Id: I84f762ddf438ff87bc8e5daa04c970f5d484a61b
2016-01-26 11:13:42 -07:00
Ryan Brandt 370d34f65f Update API to falcon 0.3
Mostly compatible, but required a different approach for the
versions resource. Should be able to revert when updating to
falcon 0.4

Change-Id: I41a5073748c9a8a3f5b92afdb416bb0294311911
2016-01-22 15:00:57 -07:00
Roland Hochmuth 2d566e4adc Converted to the oslo libraries in pypi
Removed all local copies of oslo files

Change-Id: I5d920fe01e48880caf156e6ef2551f9cbe92a07a
2015-06-12 22:20:32 -06:00
Roland Hochmuth 89731de2a6 Updated for Falcon 0.2 and clean-up
Upgraded to Falcon 0.2
Converted from stevedore to simport
Converted from monasca to monasca_api
Removed events. Events api is in monasca-events-api
Removed references to elastic search
Removed support for message format translations
Removed unused and dead code
Removed author tags

Change-Id: I5034ea256372d22b9f824e301c379da81f82b4e2
2015-06-06 21:47:03 -06:00