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
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
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
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
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
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
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
Sometimes we want that kafka for example should log in debug level,
sql in info level and rest code in warn.
Change-Id: Iac7f29b3909354f75e5d3264ef2c987c9f3e2aec
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
This will allow dashboard/operator users to see but not add data.
Change-Id: I16a2329356cc9e7d03d2f3e1394127006d6e487e
Implements: blueprint read-only-api-user
Implement the following resource endpoints using
Cassandra as a backend DB.
metric names
metrics
alarm history
measurements
statistics
Change-Id: I9ddbd2037fb6b989dee5e33945df9dd08afa84e8
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
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
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
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
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
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
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