It would be useful to have groupby functionality to derive meters
by their resource_metadata. This commit adds groupby by
resource_metadata.instance_type for mongodb.
Change-Id: I26e7fb4fa2835d283cb6c83e0aec2dba4ac9bf00
Partially-Closes-Bug: 1331508
Capabilities for storage is "storage:production_ready", but the
sample of Capabilities for storage is only "production_ready",
which cause wrong description in document, and misleading developers.
Change-Id: I98da1908ca99d9a20e0cbf367b73275da09f9f82
Sample type has been described in webapi document, but API path is
missing, this patch fixes it.
Change-Id: I09248aac036479c9ccd250824de4df05713bfaa1
Closes-Bug: #1388507
The recommended group order is:
import stdlib_1
import stdlib_2
import third_party_lib_1
import third_party_lib_2
import project_lib_1
import project_lib_2
Change-Id: If2e22b25b80d6c399a872df307d7f4c58a73795f
this patch adds support to configure an event specific database.
the code currently calls existing metering/event mixed code so
basically both metering and event db share the same code.
segregation of code will be done in subsequent patches for each
driver individually.
Change-Id: I22871737cf297d1bfff6c17a7eaf9333c6415ffd
Partially-Implements: blueprint dedicated-event-db
move event storage models to event module. this is the first step
to separating metering and event data.
Change-Id: I6d720690a958f5b3accf22db66c830bfa48ed9ae
Partially-Implements: blueprint dedicated-event-db
Adding json representation of the v2 REST API at the API root
endpoint. Endpoint still requires authentication.
Change-Id: I069644917f9a29e7ddfe7010695ad3a5aa5ca8c2
Partial-Bug: #1350076
Misspelling of "possibilities" found in
class QueryAlarmHistoryController in
/ceilometer/ceilometer/api/controllers/v2.py
Change-Id: I88a6b3f56198c254763d324f1e4df5302f8d1094
Some drivers/modules might raise NotImplementedError whereas we would
expect things to work. Skipping test when such an error is raised would
be a bad idea, we would know the test failed.
So let's switch to a custom NotImplementedError and let's skip test only
if this one is raised.
Closes-Bug: #1369556
Change-Id: Ie88a281787218f9aba13b6e662eb4d49d3e685d0
When there is a invalid JSON string on the input for e.g. query-alarm-history
at present the exception raised is un-caught causing a internal error
with a HTTP error 500 returned to the client. This fix will handle those
errors and return 400 error with proper message indicating the failure.
Change-Id: Icd81a88f2c29a8baf7993325bf423435f1ad0924
Closes-Bug: 1366215
Currently, ceilometer API is lack of timestamp validation. Timestamp in
query should be checked if it can be parsed to iso timestamp, and raise
explicit exception if not.
Change-Id: I02cb2f30b00bde46bf8a0e4e161a0e2ce9d44c09
Closes-bug: #1270394
Throwing wsme based exceptions out of non-wsme context causes api server
to return 500 since the exception goes uncaught. Instead return
http response with error code 401 to return to client safely
Change-Id: Ifb753581e392ea7961b976bc97ee2348feb6825c
Closes-Bug: 1365770
Currently, alarm API does not validate schema in alarm_actions.
When invalid schema is specified, error occurs later in alarm notifier.
Schema should be validated in advance in API.
Change-Id: I3b28cfe36c460daead2945ba3577fbc1274f9d91
Closes-bug: #1342673
In EventFilter we have an optional parameter 'op' in traits_filter part. But up
to date usage of this param has been implemented only in Hbase and
Mongodb backends. However in API we can use only 'op'='eq'.
This change improves usage of parameter 'op' in query for events in api, and
adds possibility to use comparison in query with SQL backend.
Some tests are also added to cover using of this new feature.
Closes-bug: #1354009
Change-Id: I4824800eac7270bcfa10882a735e48d80bf32712
+ Quotas can be set at a user level or a project level
+ Quotas are set via config options
+ Quotas default values are None (unlimited) for backward compatibility
+ Creates a new client side error OverQuota that is raised when the
quota is reached
+ If OverQuota is raised, return a HTTP 403 (forbidden) response.
Change-Id: Ib9876013f8eb930875a91699a6b3314f8f1b1b47
Implements: blueprint quotas-on-alarms
Co-Authored-By: Ala Rezmerita <ala.rezmerita@cloudwatt.com>
There are several tests where the expected output
relies on order of strings generated from the arbitrary
ordering of dictionaries or sets. The new version of
tox causes that ordering to be different between tests
runs so tests must be resilient and test either the
content of the dicts or sets or their sorted output.
Note: These fixes are only of those cases where a failure
was generated. If there are issues in skipped tests, this
patch has not found nor fixed them. The vast majority of
skipped tests are related to availability of functionality
so there's little that can be done about that with the
current testing setup. The best we can do is be on the
lookout for failures that could be related PYTHONHASHSEED
down the road and fix them as they happen.
Closes-Bug: 1348818
Change-Id: I6b27ca2597c51b0656f441f325f9ffd0e31a606d
That's needed to move further in py3 compatibility.
Partially-Implements: blueprint ceilometer-py33-support
Change-Id: I5796de3b3f359c95ddc059374e19f7e7154e45c6
This redesigns get_events method to generator style, with some additional
changes in unit tests and api.v2
get_traits method is also improved in this patch, additional sorting was
removed from get_traits method.
Closes-bug: #1339626
Change-Id: Ie65cc6f6c85eab53847176273b27de693bd2052f
This changes splits the internal DB API in two parts, alarm and metering.
It also adds a new configuration options to set a different database
for alarm than the 'metering' one.
Example:
[database]
connection = mongodb://localhost/ceilometer
alarm_connection = mysql://localhost/ceilometer
This changes don't take care of the drivers storaged.
They will be splitted in later changes
The ceilometer.storage.ConnectionProxy object ensure that only alarm methods
are available when the namespace is the alarm one, same for the metering
namespace.
Partial implements blueprint dedicated-alarm-database
Change-Id: I1e118e4adc59ca5cd3781dbb18865818c3cc2300
When creating a alarm combination with invalid project, ceilometer will
raise alarm-Not-Found error, even though the specified alarm ids are
existent. The error message is easily misleading.
This change gives a explicit presentation of this case.
Change-Id: Id189209ed4ccf27543f8dc628ca5f82eeeeeaa44
Closes-bug: #1320433
In Ceilometer, meter's name is user supplied, thus can contain non ascii
characters. This patch encode Unicode objects to UTF-8 before returning the
the meter to the client.
Change-Id: I15696b1b09286270de237084869d4a2d4418be8d
Closes-Bug: 1333177
This change isolate storage models used for alarm into a separate file.
This a preparation work to have all alarms related storage API inside
the alarm namespace and then be able to have a different database for
alarming and metering.
Partial implements blueprint dedicated-alarm-database
Change-Id: Iab6b70c6a48301164016823bd0f8e9781ca21abd
To keep the global state of messaging like the old olso-incubator
library does, we have created a global TRANSPORT object.
But since the test use the fake:// driver of oslo.messaging in tests,
this transport is shared between tests, but some tests use 'fake://',
other the default one, and someother disable the transport.
This change ensures that a different transport is used for
code tests.
Change-Id: I22317527cc4fb44ea1fb9642586e8cdcbc97030b
Currently, when we try to get trait, the api service uses storage
data to directly initialize the trait model. However, the trait class
init method expects value field as wsme.text type, while in storage,
it could be int, float, or datetime. So, end user will get 400 error
in such scenarios.
The static method _convert_storage_trait() in Event class can convert
a storage trait data to api trait object, we can use it to fix this
bug. Also, this method should be in Trait class instead of Event class,
This patch does this refactor too.
Change-Id: Ia7bf667967a31a3cc6e8d457f3b6330ffc728471
Closes-Bug: #1324523
This capability is needed to be used in the Tempest tests
to have the difference between Icehouse version (where tests
won't pass due to *really* huge running time) and new Juno
version, where this performance issue has been fixed.
Change-Id: I83bf184a58bfba0e48e09a754237a8b0a4dceb25
The word "Copyright" alone is sufficient to claim copyright, the (c)
symbol need not be present.[1]
As per PEP 263, a Python file with non-ASCII characters must have a
line with "coding: <some-encoding>". Python files containing only
7-bit ASCII characters need no such line.[2]
This commit removes unnecessary Unicode copyright symbols and
unnecessary encoding lines.
[1]: http://www.copyright.gov/circs/circ03.pdf
[2]: http://legacy.python.org/dev/peps/pep-0263/
Closes-Bug: #1324686
Change-Id: Id381ea1f029a0cfddd3773c6d9f16c47842d9c33
According to https://wiki.openstack.org/wiki/Python3 unicode()
should be replaced with six.text_type().
Change-Id: If314b7ada4976a4cf05f16c2bb2beb54d1f595a1
Currently, project authorization check in _verify_query_segregation
only checks query field 'project_id', so normal user can pass the check
with query field 'project'. And the check also checks query operator, which
seems not right, because user will get 401 when project is his own but with
wrong operator, 400 wrong operator can be more precise.
This patch adds project field check and remove the operator check which can
be done in _validate_query.
Change-Id: I82439e4c02afd04d26ab5d419ef67bde1f4aa1ca
Closes-Bug: #1322111
Mutables in the method params defaults might cause errors and
that's why it's anti-pattern in most of the cases and should be
removed.
Change-Id: Ifb59a16c927a4bc285f7b70fac87f719054020f4
oslo.messaging assumes the context is a dict not a RequestContext
and it assumes the payload in json serializable.
This patch ensures this.
Also it removes oslo.messaging mock on some tests and use real oslo.messaging
library with the fake driver.
Change-Id: Ie3c6083bbc4ec83de28e42bb10e7c50c7e135070
Closes-bug: #1275771
Closes-bug: #1317290
This reverts commit 5df4cb53ae.
The commit in question appears to have broken the notification agent
as an unintended side-effect. Reverting pending further investigation
as the notification agent is the more crucial component.
Related-to: #1317290
Change-Id: If9b1d638b60b7029c67f45e2e9feda62b9fd042a
oslo.messaging assume the context is a dict not a RequestContext
This patch ensure this.
Closes-bug: #1275771
Change-Id: Iae58d40f171d1d5780b74b747c26a74cca05b459