Commit Graph

35 Commits

Author SHA1 Message Date
Adrian Czarnecki 1e3e1173ad Update devstack plugin to support new api
Merge log-api and api

Story: 2003881
Task: 36195

Depends-On: https://review.opendev.org/681419/
Change-Id: Idb2361e5ab701cd3dee4eabb4b43116f6e1205c4
2019-12-04 13:52:57 +01:00
Adrian Czarnecki 5359e4e633 Enable uWSGI support in devstack
Story: 2001464
Task: 6181
Change-Id: If4329e51feebeb68538917d7a68aad53ae469b07
2018-06-12 14:36:46 +02: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
Artur Basiak 41cf335127 Adjust monasca-api installation
Adjust monasca-api Python installation with changes:
- start/stop of monasca-api proces handles through run_process
  and stop_process and no service files
- setting up environment with devstack function
- use USE_VENV for monasca-api
- installing monasca-api dependencies from git
- remove configuration file from devstack/files/monasca-api/python
- setup up configuration files with iniset

Change-Id: I2faf48d17fb5e958e1d7ad2383c125ade3faaaf0
2017-06-21 08:32:22 +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
Shinya Kawabata e8831f8229 Add multibyte character support for alarm definition
It was failed that putting multibyte character into
alarm definition name and description by monascaclient.
There were some mistakes about treatment of utf8 encoding.
And mysql connection had no utf8 option, so mysql could not
handle multibyte character.

Change-Id: I8743f89fcc5d5efd4e50f440b76d78abc037e8e7
2017-03-14 15:24:00 +01:00
liyingjun f379d71fcb Use oslo.db for sqla driver
Use create_engine in oslo.db instead of the sqlalchemy one to get
the optimization benefit from oslo.db.

Breaking change would be replacing database.url with
database.connection therefore database.url will be still
supported until Pike is released. database.url
has been marked as deprecated option.

Change-Id: Id3cdafa791a7d2558a5b065022a9afc6ff31e004
Closes-bug: #1640419
2017-03-08 10:08:42 +01:00
Craig Bryant 25914a5efe Remove mysql repositories
The sqla repositores are used for all tests and the mysql repositories aren't
used or tested anymore. Reduce confusion in the code by deleting the dead
mysql reposistories.

Change etc/api-config.conf to use sqla to match the devstack files

Remove the mysql config section, only the database section should
be used now.

Set the repository defaults to be the correct ones in the config file
definition.

Change-Id: I748e91cadb059d91380b78d1e2af0ff0001fc397
2017-02-16 05:17:35 +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
Jakub Wachowski 441a65dff8 Proposition for separate config for loggers.
Sometimes we want that kafka for example should log in debug level,
sql in info level and rest code in warn.

Change-Id: Iac7f29b3909354f75e5d3264ef2c987c9f3e2aec
2016-10-12 05:32:24 +00: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
Brad Klein 5f37594fe7 Add monasca api read-only user role
This will allow dashboard/operator users to see but not add data.

Change-Id: I16a2329356cc9e7d03d2f3e1394127006d6e487e
Implements: blueprint read-only-api-user
2016-08-04 10:30:48 -06:00
Jenkins 9d64d3d124 Merge "Enable Cassandra Database" 2016-08-04 13:17:34 +00:00
Deklan Dieterly 7abd139f0e Enable Cassandra Database
Implement the following resource endpoints using
Cassandra as a backend DB.

metric names
metrics
alarm history
measurements
statistics

Change-Id: I9ddbd2037fb6b989dee5e33945df9dd08afa84e8
2016-08-04 01:56:29 +09: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
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
oiskam1 0462177fb7 ORM (sqlalchemy) implementation for python
It is sqlalchemy part from proposition of oiskam for python.

Change-Id: I699d87c1cd43fe0ab52aa8ca7044f4d90c8a1ba2
2016-02-27 13:15:53 +01: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
cindy oneill f4f14c77fd streams definition POST, GET, GET (id), DELETE
This depends on ansible-monasca-schema changes here:
https://github.com/hpcloud-mon/ansible-monasca-schema/pull/17

Here are sample curl commands for POST, GET, and DELETE:
curl -i -X POST -H 'X-Auth-User: mini-mon' -H 'X-Auth-Token: 8c959d0296344c27a47b8e78dbf912ac' -H 'X-Auth-Key: password' -H 'Accept: application/json' -H 'User-Agent: python-monascaclient' -H 'Content-Tye: application/json' -d '{"fire_criteria": [{"event_type": "compute.instance.create.start"}, {"event_type": "compute.instance.create.end"}], "description": "provisioning duration", "name": "panda", "group_by": ["instance_id"], "expiration": 3, "select": [{"traits": {"tenant_id": "406904"}, "event_type": "compute.instance.create.*"}], "fire_actions": ["ed469bb9-2b4a-457a-9926-9da9f6ac75da"], "expire_actions":["ed469bb9-2b4a-457a-9926-9da9f6ac75da"]}' http://127.0.0.1:8080/v2.0/events/stream-definitions

curl -i -X GET -H 'X-Auth-User: mini-mon' -H 'X-Auth-Token: 8c959d0296344c27a47b8e78dbf912ac' -H 'X-Auth-Key: password' -H 'Accept: application/json' -H 'User-Agent: python-monascaclient' -H 'Content-Type: application/json' http://127.0.0.1:8080/v2.0/events/stream-definitions/

curl -i -X DELETE -H 'X-Auth-User: mini-mon' -H 'X-Auth-Token: 8c959d0296344c27a47b8e78dbf912ac' -H 'X-Auth-Key: password' -H 'Accept: application/json' -H 'User-Agent: python-monascaclient' -H 'Content-Type: application/json' http://127.0.0.1:8080/v2.0/events/stream-definitions/86177f0e-f811-4c42-a91a-1813251bf93f

Note: the limit parameter is passed into the streams_repository method for listing streams, but not yet used. We will open a separate Jira to to handle pagination with a user input limit parameter.

Note: fixed a few events problems. stevedore wasn't loading the driver, and missing some abstact function defs.  I tested stream-defintions and events, they both work now.  Had to change the URI for stream-definitions because it conflicted with events, and now is more RESTful.
Change-Id: I0b6dc385e1d095c1bd33867a038fe170ca277bfe
2015-04-24 15:55:20 -06:00
Jenkins c934fdb6f5 Merge "Conversion to milliseconds" 2015-03-12 01:08:35 +00:00
Roland Hochmuth ee0952dd2a Conversion to milliseconds
Change-Id: I7f7b03e1ebf1189acda2baeb5de95b8972c46cba
2015-03-11 16:18:49 -06:00
cindy oneill 9335ca5a1f Events (already distilled) will be posted to transformed-events
Change-Id: I145fd7bb6fe63983bcc0f2b275981c423a346755
2015-03-04 16:56:35 -07:00
henriquetruta ccdb3e1806 Integrating monasca-api with keystonemiddleware
Adds the possibility of authenticating through keystone-middleware
and creates a Keystone Context after validating the token.

Both v3 and v2 tokens are valid, once the user has a valid role
on the project/tenant he's scoped. The default_authorized_roles property
in monasca.conf must be updated if another user should have API full access.

Change-Id: Iacd66cd2868cd44a5ab1b2a3f80fa38c7e0bb6da
2015-02-12 10:00:28 -07:00
Tong Li 7eeacb686a enable microservice
move implementation specific configurations in server.py to
v2/reference module. Making the server.py only responsible
for loading dispatchers which are configured in monasca.conf
file. This change will enable any dispatcher to be loaded
according to the configuration file. For example, to config
two dispatchers to be served on a server, a monasca.conf
file can look like the following:

[DEFAULT]
dispatcher = v2_ref_metrics
dispatcher = v2_ref_alarms

If all the reference dispatchers should be served out of
one server, then the configuration file may look like this:

[DEFAULT]
dispatcher = v2_ref_metrics
dispatcher = v2_ref_alarms
dispatcher = v2_ref_alarm_definitions
dispatcher = v2_ref_events
dispatcher = v2_ref_transforms
dispatcher = v2_ref_notifications

One can use the configuration to load any dispatchers which
may be developed by third party. This way, to load new
dispatchers, one only needs to change the configuration file.

This patch set makes the API server a true miscroservice
server.

Change-Id: I87005f8ff4807e4c818057f1e7866001482a50e1
2014-12-04 14:07:28 -05:00
Deklan Dieterly 9a31307470 Add Alarms resources files
Change-Id: If2305a636b0b5eedc09a8f49ab9466c7bcc476ed
2014-11-07 14:34:34 -07:00
Deklan Dieterly ba39188b2f Add alarm definition create resource
Change-Id: I65e1c9f8697632e3c2004282bb624ed814828864
2014-10-31 09:45:01 -06:00
cindy oneill 4c585dc46e Notifications resource support, helpers.py link functions
Change-Id: I09e69529fe1cd09f824b837887251921f060f640
2014-10-24 09:04:14 -06:00
Deklan Dieterly 17a440f352 Fix config file for case sensitivity
"Default" must be in all upper case to work.  Really.

Change-Id: I604d3f2342aa496f2a6a1f6c3943302d1e88673e
2014-10-15 14:53:45 -06:00
Craig Bryant f23bc9f782 Use new monasca-common package names
Fixed some places where old api package name was used

Change-Id: I06c4f3f05fdce3893cbf25563a721ba561a4f934
2014-10-14 13:00:17 -06:00
Roland Hochmuth c5f5fba741 Start of initial reference implementation and re-factored
Change-Id: I90d09331a41f15c47870cd7690b22405087ff7a4
2014-10-02 13:56:47 -06:00
Tong Li ed99a4edb3 initial python implementation
Change-Id: I25ca78414cd26340a4a640cb4f9ee92dda650037
2014-09-15 13:18:10 -04:00
Derrick Johnson 648bb38cd8 updated to get middleware working 2014-06-02 12:13:13 -04:00