Commit Graph

30 Commits

Author SHA1 Message Date
Martin Chacon Piza 8c0ddb4f4d Added validations
- Empty events list
- Missing content-type or wrong content-type
- Empty body

Change-Id: I5848dd018aee6b9d95bff7be52eece0ac97b2a49
Story: 2003955
Task: 27036
2018-11-19 12:20:45 +00:00
Adrian Czarnecki 3c5e504ede Refactor devstack-plugin
* Make monasca-event-api devstack plugin compatible
with monaca devstack metrics and logs plugins
* Add monasca-ui
* Enable events visualization in kibana
* By default metrics and logs pipelines are disabled
* Change deployment mode from gunicorn to uwsgi

Story: 2003815
Task: 26569

Depends-On: https://review.openstack.org/#/c/593602/
Change-Id: I7efb969d89f0733bf27517d393cd024750e278a7
2018-11-19 11:43:13 +01:00
Artur Basiak 620a477df0 Add events endpoint
Provide basic endpoint:
/v1.0/events/
/healthcheck
/version
Endpoint reads request and returns HTTP code 200.
Provide code to run application in gunicorn mode.

Story: 2001112
Task: 4863

Change-Id: Ic7c344360b5acec5af7751a825e2dff8346cf1f7
Depends-On: I18d9f4ec543c76bfe1311ed1ee940827d4162298
2017-12-18 13:42:02 +01:00
Jakub Wachowski c3a3b4b765 Create devstack plugin for monasca-events
!Parts of code taken from monasca-api and monasca-log-api!

Also create a dummy implementataion for version endpoint
so that the deployment can be tested.

Story: 2001112
Task: 4808

Change-Id: Ic35f6388c34c4d4c1198401a1c6972b802a54c67
2017-11-08 13:55:10 +01:00
Artur Basiak 32c4560c3b Provide oslo.policies
Add policies to the api based on oslo.policies.
Small changes in documentation. Provide generator for
sample policies file.
Add policies for agent and admin.

Story: 200112
Task: 4807

Depends-On: I76d737bf9d1216b041bc1a518cc2098f28e7da7b
Change-Id: Idf5c4ec1b663ad9ed3ab25744bdf0b7f28cdb1a2
2017-08-01 13:24:09 +02:00
Tomasz Trębski 5321635049 Preparing infrastructure for events-api
Following change aims at setting up the
tooling for events-api againts latest
requirements and guideliness from OpenStack.
Removing old code , add basic structure of the python
modules. Add basic documentation and release notes.
Prepare to use oslo-config-generator.
Add devstack basic setup to the project.

Story: 2001112
Task: 4798

Change-Id: I76d737bf9d1216b041bc1a518cc2098f28e7da7b
2017-07-12 12:08:35 +02:00
SamKirsch10 5b23c97de7 added versions to api and updated requirements falcon==0.2.0 2015-07-21 13:08:57 -06:00
Roland Hochmuth 2896511aa0 Cleanup and deleted unused message formats 2015-06-25 23:56:09 -06:00
Roland Hochmuth e6e82ebc62 Modified to use oslo libraries 2015-06-19 19:51:16 -06:00
cindy oneill ab957bc8e9 fixes for api_func_test, and log dir 2015-05-04 16:20:02 -06:00
Joe Keen 7f241fee88 Moved default port from 8080 to 8082 2015-05-04 11:29:34 -06:00
Joe Keen 837d45ef98 Removed unused code 2015-05-01 17:05:03 -06:00
Joe Keen ca838cbbcc Upgrade to Falcon 0.2 2015-05-01 13:55:49 -06:00
Joe Keen 3c0c2e6b9e Refactorig API structure
Replaced stevedore with simport

Updated documentation
Updated config files for simport
Updated config defaults for simport
2015-04-30 13:35:42 -06:00
Joe Keen 9ebf70a81d Cleanup
Fixed imports
Removed repositories not specific to events
Removed some unused sample objects
2015-04-28 11:09:23 -06:00
Joe Keen 1017120c9d Cleanup
Removing java API

Moving python package from monasca to monasca_events_api
2015-04-27 14:58:12 -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