summaryrefslogtreecommitdiff
path: root/ceilometerclient/v2/shell.py
Commit message (Collapse)AuthorAgeFilesLines
* Fix to disable meter-links on resource-list CLIRohit Jaiswal2015-11-061-1/+4
| | | | | | | | | | | | | | This adds an optional param to resource-list CLI to disable meter-links. By default its False to generate meter links for backward compatibility. This is a cherry-pick from master patch that enables meter-links on resource-list CLI. Change-Id: I308b94c8a57833cf30b4815ecec2ff9a50e91af6 Closes-Bug: #1508708 (cherry picked from commit e4a62a20b1d072969e842c38b2885a46a20fc54c)
* support specify user-id when create sample and alarmZhiQiang Fan2015-04-211-0/+9
| | | | | | | | | | | The change of I9ba984f804aecee5b63e5a86e699733040dee245 enables us to specify os-user-id in CLI, but it shadows the user-id when creating sample and alarm, this patch fixes it as what we've done for project-id. Change-Id: Ic3ce5dc8e1aea49b3e41fe495be4921fbf85ea5a ref-change: I0ce2416dccd61eb50584799e6df0b8c45d44cdda (cherry picked from commit f72dc0c38951c898fc139cee6446ef0f125fde10)
* Enable specified project_id in CLI commandsZhiQiang Fan2015-04-161-8/+30
| | | | | | | | | | | | | | | | | After we port to oslo-incubator.apiclient, the project_id can no longer be specified for alarm-{,threhsold,combination}-{create,update} and sample-create, this is because client.AuthPlugin registers a CLI argument named --os-project-id which will shadow the project-id argument. Since os-project-id is used for Keystone V3 API, we should not remove it from AuthPlugin, so this patch moves the dest of project_id to {alarm,sample}_project_id, and adds a decorator to restore shadowed project_id field when we call v2 client. Change-Id: I0ce2416dccd61eb50584799e6df0b8c45d44cdda Closes-Bug: #1393489 (cherry picked from commit 0c23c62cef6f1388d26c04d6cf0e74153db0a0b5)
* alarm: Use new gnocchi aggregation APIMehdi Abaakouk2015-04-151-15/+82
| | | | | | | | | | | | | Since https://review.openstack.org/#/c/163462/ and https://review.openstack.org/#/c/162649/4 in gnocchi, all kind of aggregations have been moved in the same URI namespace (/v1/aggregation/...) and we can use complex query to make aggregation across multiples metrics. This change sync the ceilometerclient alarm shell to match these changes. Change-Id: I5717a4604af5505dfb8c56463e2bdb86c59e41ce (cherry picked from commit db48aa28b169fa8df01020d54a20e644c9a0b7df)
* Corrected the errors in sample-show and sample-createLianhao Lu2015-02-121-2/+2
| | | | | | | | | Patchset I67152c636526dad3ec27e06058ff73ad969ae2b9 broke the sample-show and sample-create when introducing the new sample API support. This patch fixes those. Change-Id: I3e36df61cf672b44c376c4a18dc808d565315bf6 Closes-Bug: #1421040
* Merge "Allow create/update gnocchi alarm rule"Jenkins2015-02-091-0/+146
|\
| * Allow create/update gnocchi alarm ruleMehdi Abaakouk2015-02-061-0/+146
| | | | | | | | Change-Id: Id1c6832c2db32c5cce0e31cd0022a86508630a7e
* | Merge "add --no-traits for event-list"Jenkins2015-02-051-0/+5
|\ \
| * | add --no-traits for event-listZhiQiang Fan2015-02-051-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently we print traits list for each event when run event-list command, but that is a lot of information. After system run for a few days, the event-list command prints so much that it is not convenient to know the whole event-list even with less command. This patch adds a simple argument called --no-traits, it is False by default, event-list will not print traits if this argument is specified. Since this argument is boolean type, no need to assign a value, if it is specified, then it is actived. Change-Id: Ib69209fef5967a18f094f2d4665fa189e4ca3e6a
* | | Merge "Add Sample API support"Jenkins2015-02-051-5/+40
|\ \ \
| * | | Add Sample API supportZhiQiang Fan2015-02-051-5/+40
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | Sample API has been implemented in Ceilometer for a long time, but CLI is lack of such support, this patch implements Sample CLI. Implements blueprint cli-samples-api Change-Id: I67152c636526dad3ec27e06058ff73ad969ae2b9 DocImpact
* | | Merge "Remove trailing space before , in the help string of --time-constraint"Jenkins2015-02-051-1/+1
|\ \ \ | |/ / |/| |
| * | Remove trailing space before , in the help string of --time-constraintChristian Berendt2015-01-201-1/+1
| | | | | | | | | | | | | | | | | | | | | Instead of 'with a cron expression , whereas its duration' it should be 'with a cron expression, whereas its duration'. Change-Id: Id545045dd4b25b5cbd2d79933851adab4963dada
* | | Add severity field to alarm CLIPradeep Kilambi2015-01-261-7/+11
| |/ |/| | | | | | | Change-Id: I699bea4859d4f0a5832ced5ba74ba7fb26c122ef Partially-Implements: blueprint ceilometer-alarm-level
* | Merge "Triple double-quoted strings should be used for docstrings"Jenkins2015-01-201-26/+26
|\ \
| * | Triple double-quoted strings should be used for docstringsLena Novokshonova2015-01-121-26/+26
| | | | | | | | | | | | Change-Id: Ib563a9817f6f24ce0d72fe7a8ba96cb6e35c4e46
* | | Merge "Allow all pep8 checks"Jenkins2015-01-201-3/+1
|\ \ \ | |/ / | | / | |/ |/|
| * Allow all pep8 checksDina Belova2015-01-121-3/+1
| | | | | | | | | | | | | | Fix H405 pep8 issue. H904 issue check was ignored, although there were no places in client code violating this rule. Change-Id: If3b84eb8abb03511d7f77cabfa2955f472a60f23
* | event-list should sort by timestamp, not idZhiQiang Fan2015-01-131-1/+2
|/ | | | | | | | | | Currently, event-list output will be sorted by message id, that is because table field 0 is the default sort field. But sort by id makes no sense, and REST API returns events by timestamp order, so let's keep consistent with upstream. Change-Id: I524b05ed5ff9db34430afd722991d02545c263cb Closes-Bug: #1406622
* switch to oslo.utilsgordon chung2014-09-291-1/+1
| | | | | | | oslo.utils is released and corresponding code in oslo-incubator has been removed. Change-Id: Ic3a13380809a8b00c979e5ac405b4084f486a31d
* Merge "Fix a help string nit for statistics command"1.0.11Jenkins2014-09-211-1/+1
|\
| * Fix a help string nit for statistics commandliu-sheng2014-09-091-1/+1
| | | | | | | | Change-Id: I0aee668d9a19da76bb01646c87b3cd17418822e5
* | Reduce redundant parameter of some commands in CLIls11752014-09-191-13/+45
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When deleting an alarm, we use "ceilometer alarm-delete -a <ALARM_ID>", unlike other deleting commands of openstack, the parameter-a/--alarm_id is redundant. The similar situations exist in showing alarm, geting alarm state, showing resource and so on. It is more easy to use for reducing these parameters. New behaviour: $ ceilometer help alarm-show usage: ceilometer alarm-show [<ALARM_ID>] Show an alarm. Positional arguments: <ALARM_ID> ID of the alarm to show. $ ceilometer alarm-show alarm_id should not be empty $ ceilometer alarm-show abcde Not Found (HTTP 404) $ ceilometer alarm-show -a abcde -a is obsolete! See help for more details. Not Found (HTTP 404) $ ceilometer alarm-show --alarm_id abcde --alarm_id is obsolete! See help for more details. Not Found (HTTP 404) Co-Authored-By: Nejc Saje <nsaje@redhat.com> Change-Id: I1fbc85aa253929bfbb5e73ed834a725b9cf828b4 Closes-bug: #1268557
* Merge "Check if the alarm has time constraints field before displaying"Jenkins2014-08-281-23/+24
|\
| * Check if the alarm has time constraints field before displayingNejc Saje2014-08-251-23/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | Fixes the bug that broke the alarms CLI if the alarm didn't have a time constraints field. Reduces code duplication of alarm printing code, so now all the alarm printing code is actually tested. Renames some auxiliary methods for more clarity. Change-Id: Ib691b4a5a6cf5ae133cd0a5576f90e4d0d189a92 Closes-bug: #1316390
* | Merge "Avoid empty entity field in uri path"Jenkins2014-07-241-15/+24
|\ \ | |/ |/|
| * Avoid empty entity field in uri pathZhiQiang Fan2014-05-271-15/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | Currently, empty entity field is accepted but will fail when call cli, it is because the empty field leads to incorrect rest api uri, which will get 404 error. This patch checks some required entity fields, which will present in uri path, and raises CommandError if they are empty. Note the other required fields will not cause the same problem, so they are not checked. Change-Id: I59411b760ff7457064b386911e868518b3057e3a Closes-Bug: #1313679
* | Merge "Fix alarm-threshold-update --query option"Jenkins2014-06-251-0/+1
|\ \
| * | Fix alarm-threshold-update --query optionZhiQiang Fan2014-06-111-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, alarm-threshold-update command can not update its query field, because the dest value is removed accidently so the query is not put under threshold_rule dict. This patch simply adds it back. Change-Id: I2eeaf8cbb26f506e097dafdcb6d0eae4ad7fec3e Closes-Bug: #1313676
* | | Merge "Add methods to resource classes"Jenkins2014-06-241-3/+2
|\ \ \
| * | | Add methods to resource classesArtur Svechnikov2014-06-161-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Resource classes of managers should have methods like delete() and get(). Basicly base.Resource class has method get(), which uses id attribute, but classes Alarm, Event, etc. have no this attribute. Added intercept getting of id in the resource classes. Also added catch of HTTPNotFound for alarm get() because it affects correct functionality of scenario tests. Closes-Bug: #1312146 Change-Id: Ie598b73c64dece2185955467936dc6544a8a3dc7
* | | | Merge "Provide explicit help string of resource-metadata"Jenkins2014-06-181-1/+2
|\ \ \ \
| * | | | Provide explicit help string of resource-metadataliu-sheng2014-06-171-1/+2
| |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, the "--resource-metadata" in ceilometer sample-create command is not easy to use. For compatibility, this patch just provides an explicit help string for the parameter. Change-Id: I6d68d5b653c3b33808cba6f9a781301fba9b44e3 Closes-Bug: #1324759
* | | | Fix the alarm history order shown to userDina Belova2014-06-181-1/+5
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | In the Ceilometer storage backends implementation we are specially sorting the alarm history points in the following way: the first one by the timestamp should be the last one in the list. The Python client itself provides the information in this way, but the table printed had the opposite one, so this was fixed. Change-Id: If39bb5868e360f37ed76c12b55fc71eade331f47
* | | Merge "Fix hacking rules: H302,H305,H307,H402"Jenkins2014-06-141-0/+1
|\ \ \
| * | | Fix hacking rules: H302,H305,H307,H402ZhiQiang Fan2014-06-111-0/+1
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, OpenStack Proposal Bot tries to update requirements with global requirements, while the upgraded hacking has introduced some new rules which are not fully handled by current code. This patch fixes some simple rules which are quite straight-forward. Change-Id: If8334f69fb1ad34fbbd6ad898e0e92eb3f81e95a
* | | Merge "Remove © and remove unnecessary encoding lines"Jenkins2014-06-121-2/+1
|\ \ \ | |/ / |/| |
| * | Remove © and remove unnecessary encoding linesMartin Geisler2014-05-301-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The word "Copyright" alone is sufficient to claim copyright, the © 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/ Change-Id: I6b43cc5ecfd0440e06b0aebd91ebb574b7f37a91
* | | Merge "replace dict.iteritems() with six.iteritems(dict)"Jenkins2014-06-101-1/+1
|\ \ \ | |/ / |/| |
| * | replace dict.iteritems() with six.iteritems(dict)Christian Berendt2014-05-261-1/+1
| |/ | | | | | | | | | | | | According to https://wiki.openstack.org/wiki/Python3 dict.iteritems() should be replaced with six.iteritems(dict). Change-Id: I52cc0e89c030d7b6bfc735239638b513410933c5
* | fixed several pep8 issuesChristian Berendt2014-05-161-6/+5
|/ | | | | | | | | | | * E122 continuation line missing indentation or outdented * E126 continuation line over-indented for hanging indent * E128 continuation line under-indented for visual indent * E265 block comment should start with '# ' Tested with pep8 version 1.5.6 (2014-04-14). Change-Id: Iaea72c74d3678061b0ac837eb8fe8c85a883bb4a
* Merge "Fix some help strings"Jenkins2014-04-291-3/+3
|\
| * Fix some help stringsAndreas Jaeger2014-04-241-3/+3
| | | | | | | | | | | | | | | | | | It should be ID instead of id - like in nearly all other help strings. Also add missing "." to end of string and use plural for one string. Change-Id: I14c8c622978b206e092e56741ad5cc6885b2d118 Co-Authored-By: Summer Long <slong@redhat.com>
* | Correct help string about insufficient_dataliu-sheng2014-04-281-2/+2
|/ | | | | | | | | Replace insufficient_data to insufficient data in parameter "--state" of alarm-create/alarm-combination-create/alarm-threshold-create help sting. Change-Id: Ica0ea14d19a3a6cac9491d5cbdc3be23b5c91b60 Closes-bug: #1290230
* Implementation of statistics aggregatorsMichał Jastrzębski2014-03-271-14/+43
| | | | | | | | | | | | | | This corresponds to do API calls on: /v2/meters/meter-name/statistics?aggregate.func=func-name Usage: aggregates = [{'func': 'cardinality', 'param': 'resource_id'}]) client.statistics.list(meter_name="instance", aggregates=aggregates) CLI: ceilometer statistics -m instance -a "cardinality<-resource_id" Change-Id: I0096668585a5c7e7985973f07049eb91f44413fe
* Merge "Adds alarm time constraint support to ceilometer CLI"Jenkins2014-03-261-4/+71
|\
| * Adds alarm time constraint support to ceilometer CLIUros Jovanovic2014-03-261-4/+71
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Time constraints can be specified for create and update families of commands with the following format: --time-constraint name=constraint1;start='0 11 * * *';duration=300 This switch can be specified multiple times in the case of multiple time constraints. With update commands, time constraints are updated by name, e.g. --time-constraint name=constraint1;duration=500 updates the constraint 'constraint1' with a new duration 500. Time constraints can be removed with update commands using the switch --remove-time-constraint=constraint1,constraint2 . Example of display outputs: > ceilometer alarm-list +--------------------------------------+-------+-------------------+---------+------------+----------------------------+--------------------------------------------------------------+ | Alarm ID | Name | State | Enabled | Continuous | Alarm condition | Time constraints | +--------------------------------------+-------+-------------------+---------+------------+----------------------------+--------------------------------------------------------------+ | 2ead776d-2fc7-47a2-b0bb-0f88dcefa457 | test2 | insufficient data | True | False | cpu == 50.0 during 1 x 60s | cons1 at 0 11 * * * for 300s, cons2 at 0 23 * * * for 600s | +--------------------------------------+-------+-------------------+---------+------------+----------------------------+--------------------------------------------------------------+ > ceilometer alarm-show -a +---------------------------+-----------------------------------------------------------------------+ | Property | Value | +---------------------------+-----------------------------------------------------------------------+ | alarm_actions | [] | | alarm_id | 2ead776d-2fc7-47a2-b0bb-0f88dcefa457 | | comparison_operator | eq | | description | Alarm when cpu is eq a avg of 50.0 over 60 seconds | | enabled | True | | evaluation_periods | 1 | | exclude_outliers | False | | insufficient_data_actions | [] | | meter_name | cpu | | name | test2 | | ok_actions | [] | | period | 60 | | project_id | 962f75ad22c24cbf99d40d7b82718505 | | query | | | repeat_actions | False | | state | insufficient data | | statistic | avg | | threshold | 50.0 | | time_constraints | [{name: cons1, | | | description: Time constraint at 0 11 * * * lasting for 300 seconds, | | | start: 0 11 * * *, | | | duration: 300}, | | | {name: cons2, | | | description: Time constraint at 0 23 * * * lasting for 600 seconds, | | | start: 0 23 * * *, | | | duration: 600}] | | type | threshold | | user_id | 76f335df8e2f4c7e9e8185e26ea85759 | +---------------------------+-----------------------------------------------------------------------+ > ceilometer alarm-history -a 2ead776d-2fc7-47a2-b0bb-0f88dcefa457 +----------+----------------------------+--------------------------------------------------------------------------------+ | Type | Timestamp | Detail | +----------+----------------------------+--------------------------------------------------------------------------------+ | creation | 2014-03-06T07:41:35.362050 | name: test2 | | | | description: Alarm when cpu is eq a avg of 50.0 over 60 seconds | | | | type: threshold | | | | rule: cpu == 50.0 during 1 x 60s | | | | time_constraints: cons1 at 0 11 * * * for 300s, cons2 at 0 23 * * * for 600s | +----------+----------------------------+--------------------------------------------------------------------------------+ Change-Id: I3953276537b4526e46e5e6d229d6fa154f8ab0fc Closes-Bug: #1288246
* | Merge "Add complex query support for alarm history"Jenkins2014-03-251-0/+27
|\ \
| * | Add complex query support for alarm historyIldiko Vancsa2014-03-181-0/+27
| | | | | | | | | | | | Change-Id: Ie41d9a0be73a525ae105262fb5859960bf9f9df6
* | | Merge "Add complex query support for alarms"Jenkins2014-03-251-0/+28
|\ \ \ | |/ /