41 Commits

Author SHA1 Message Date
zhangbailin
8d3ce6c58d Remove future imports
These particular imports are no longer needed in a Python 3-only world.

Change-Id: Ifecdc3c35820977ad561cd2d78471d14b94ee65a
2020-04-30 09:58:27 +00:00
licanwei
1f9194ced5 Support audit type event
Add a new EVENT type to audit type and change the microversion
to 1.4

Partially Implements: blueprint event-driven-optimization-based

Change-Id: Ia9608534d12f6877f9b93e88fa75fe9457c29347
2020-01-07 15:57:11 +08:00
licanwei
431319ee4d Watcherclient supports list data model API
Change-Id: I5527414b5e87253d87a4a26398ad5dcce1193e43
Related-Bug: #1854121
2019-12-02 14:41:32 +08:00
licanwei
ea74a22b49 Fix _make_connection_url
After support uWSGI[1], Watcher endpoint changed from http://ip:port
to http://ip/infra-optim. method _make_connection_url in HTTPClient
class can't return the correct url. This patch fixed it.
[1]: https://review.opendev.org/#/c/666779/

Change-Id: I77e610cd6781b252327a49aa5cd5bc63d395bf91
Closes-Bug: #1837186
2019-07-19 17:17:19 +08:00
Zuul
be479feef9 Merge "Add force option" 2019-05-30 02:06:14 +00:00
Dantali0n
1aebe93477 remove unused cliutils.py file as osc_lib is used
Removes old cliutils.py file that contains methods provided by osc_lib
and remove prettytable dependency that was only required by cliutils.py

Depends-on: I8bc3330a456f8bb76a17c4277a094a64fe9be449
Change-Id: Ib9eedafb211c205ff8b7dd18a9fc87e1f0b2739f
2019-05-23 09:34:30 +02:00
licanwei
cde518be31 Add force option
Partially Implements: blueprint add-force-field-to-audit
Depends-on: Ib2d221ea9c994dea396c54cc8d2d32237025a1d4

Change-Id: I235bbd298b7fa8ad9d8b01a94d68376c8ac27e8d
2019-05-23 07:17:00 +00:00
licanwei
e4ee4ff03c DEFAULT_VER should be '1.latest'
Change-Id: I359838db9ee8427812215833f379a84463c8dbfb
2019-01-26 14:10:20 +08:00
ZhijunWei
4a1b6eaf81 Update hacking version
1. update the hacking to latest, due to[1]
2. fix pep8 failed

[1]: https://github.com/openstack/python-watcherclient/blob/master/HACKING.rst

Change-Id: I02891ca17e2655b9567cc56b5c2c0b4fb6a96446
2019-01-17 14:20:33 +00:00
Zuul
c5b4db7fc1 Merge "Refactor the getid method base.py" 2018-11-19 09:01:44 +00:00
wanghui
94f6864bf0 Refactor the getid method base.py
Refer to a merged commit.
https://review.openstack.org/#/c/588983/

Change-Id: I9765543c288370cfcdaaa930b2839e28b51a9380
2018-11-09 20:11:16 +08:00
licanwei
b7928eb155 Replace latest with explicit version
Change-Id: I8aae4595f7ca9dae7ed36705b1311070a531523f
Closes-Bug: #1802217
2018-11-08 16:59:38 +08:00
Hidekazu Nakamura
946ef06dc6 Update watcher api command argument
This patch set updates watcher api command argument.
1. os_watcher_api_version to os_infra_optim_api_version
2. OS_WATCHER_API_VERSION to OS_INFRA_OPTIM_API_VERSION

This patch set also updated --os-infra-optim-api-version help message.

Change-Id: I2502377b350b8cabfeba80c68f0569d567d24b3a
2018-11-05 13:07:00 +09:00
licanwei
69f0493968 add start and end time for continuous audit
Add new start_time and end_time fields when audit create

Partially Implements: blueprint add-start-end-time-for-continuous-audit

Change-Id: I37d1bd13649dfb92ce7526f04b25054ed088c4f2
2018-11-01 12:01:07 +08:00
Alexander Chadin
2e9de6868b Prepare watcherclient for microversioning
Implements: blueprint bp/api-microversioning

Change-Id: I049f9aac84a5658efaccc9e9fdf6c9d4be677d29
2018-10-18 11:29:30 +03:00
zhurong
2551ff0934 Fix watherclient error in py3
watchercliet will raise error:
Recoverable error: sequence item 0: expected str instance, bytes found

This patch fix this.

Change-Id: I6fe21766f320b0a09a14202203a5d0451175e1d3
2018-07-26 11:37:35 +08:00
deepak_mourya
a4c020c19f Modify Watcher start actionplan command
Currently, watcher start actionplan command uses update request
to start the action plan.
PATCH /v1/action_plans

This Patch Set will send the request to new API for action plan start
POST /v1/action_plans/action_plan_uuid/start

Depends-on: I5353e4aa58d1675d8afb94bea35d9b953514129a
Change-Id: I15291efa994daf719342d764f6179ca7699d8b08
Related-Bug: #1756274
2018-05-08 15:40:27 +05:30
Zuul
32259fe287 Merge "Fix unnecessary retries during conflict" 2017-12-13 14:24:13 +00:00
licanwei
aa9d1a65f6 Add --marker for 'watcher actionplan list'
Change-Id: I88bb986d484198add967cdd953f46e341bf6f9ac
Closes-Bug: #1731826
2017-11-21 18:42:44 -08:00
aditi
5378102cd6 Fix unnecessary retries during conflict
This patch removes retries from python-watcherclient in case
watcher-api responded with conflict case.

Change-Id: I830abe0a3cd67484e165a0a42d5a57b75ed4dac6
Closes-Bug: #1725088
2017-10-20 02:27:13 +00:00
Jenkins
c09ad28c9a Merge "Fix Audit Update functional test" 2017-08-01 02:16:37 +00:00
Alexander Chadin
d6b68dc819 Fix Audit Update functional test
Change-Id: Iffd70302d0b1d7a919db3e6e44bd3bbebcb1e7ce
2017-07-26 11:09:18 +03:00
kavithahr
ee087b85d5 Fixed wrap from taking negative values
Now for wrap input it will take only postive integers as an input and
if any negative numbers are give it will give output as "Wrap argument
should be a positive integer".

Change-Id: I375dab0bdd53ee464f5634162472000119f247cb
2017-07-05 18:06:10 +05:30
daohanli
94c317250e Remove log translations
Log messages are no longer being translated. This removes all use of
the _LE, _LI, and _LW translation markers to simplify logging and to
avoid confusion with new contributions.

See:
http://lists.openstack.org/pipermail/openstack-i18n/2016-November/002574.html
http://lists.openstack.org/pipermail/openstack-dev/2017-March/113365.html

Change-Id: Icfe6ab464fd9fbbbfb9c9a05dba2220aa9e0bace
2017-03-23 10:43:15 +08:00
zhuzeyu
dfe9d31ee4 Using jsonutils instead of json
TrivialFix

Change-Id: I1d17994f4cf854f6ba62c75ed18ebee3c7f5fa47
2017-02-03 15:48:12 +08:00
DeepaJon
17a144e2f8 Removes unnecessary utf-8 encoding
This patches removes unnecessary utf-8 encoding in the
watcherclient/*
doc/source/conf.py

Change-Id: Ic74c9c57f52f7bf021dfa25d4de069b57e5cb474
2017-01-11 14:23:40 +05:30
gengchc2
5b8e3d4d6c Replace six.iteritems() with .items()
1.As mentioned in [1], we should avoid using
six.iteritems to achieve iterators. We can
use dict.items instead, as it will return
iterators in PY3 as well. And dict.items/keys
will more readable. 2.In py2, the performance
about list should be negligible, see the link [2].
[1] https://wiki.openstack.org/wiki/Python3
[2] http://lists.openstack.org/pipermail/openstack-dev/2015-June/066391.html

Change-Id: Ic6af69d5b4b36f3dd02aab0f9c446aa54970f388
2016-12-09 11:31:24 +08:00
gecong1973
dfdee212cc Add __ne__ built-in function
In Python 3 __ne__ by default delegates to __eq__ and inverts the
result, but in Python 2 they urge you to define __ne__ when you
define __eq__ for it to work properly [1].There are no implied
relationships among the comparison operators. The truth of x==y
does not imply that x!=y is false. Accordingly, when defining __eq__(),
one should also define __ne__() so that the operators will behave as
expected.
[1]https://docs.python.org/2/reference/datamodel.html#object.__ne__

Change-Id: I6b43b9ac33b4f6e6331b390366e68f2a5bbb997c
2016-10-17 09:02:05 +08:00
Alexander Chadin
c185f32ebb Add support for Audit Scope
This patch set adds audit scope support in python-watcherclient.

Change-Id: I2a94320bec0fd7051a38bee1c872148e39f69d0c
Partially-Implements: blueprint define-the-audit-scope
2016-10-07 12:30:44 +03:00
Vincent Francoise
940a7093e6 Added support for Client creation from KS session
In this changeset, I refactored some of the code to now support
the creation of a watcher client using a Keystone session as it was
already possible in most other OS projects.

Change-Id: I3462daeaac9103138366a0fcaa2fc46729bbd8ce
Related-Bug: #1625643
Closes-Bug: #1623070
2016-09-28 17:54:29 +02:00
Alexandr Stavitskiy
5b914e8877 Fix for error importing of exception class
This patch set fixes error while importing of ConnectionRefused
exception class.

Change-Id: I4aee677ccc25334ba9bd12633b1c487db2b1dd3e
Closes-Bug: #1602214
2016-07-12 16:12:04 +03:00
hongzhezheng
91d1d8b0e1 Remove the blank space between the function name and the parenthesis.
TrivialFix

Change-Id: I73e659d2cf30a2878767a9362d3671bdd06c0513
2016-07-12 15:23:37 +08:00
PanFengyun
3ffe4869f3 Prints '-' instead of 'None' when data is None
Client prints 'None' when data is None , and client also prints
'None' when data is a string 'None'. But string 'None' is  different
to None. To clear the confusion, Client should print '-' instead of
'None' when data is None. Nova Client and Cinder Client has cleared
the confusion.

Change-Id: I6a8908fcb2df39d7f2c5fc4055cc41779d668d6c
2016-07-10 19:29:01 +08:00
Vincent Francoise
5586bbdff3 OpenStackClient plugin for goal
In this changeset, I implemented the OpenStackClient plugin which
allows Watcher to be used via the "openstack" unified CLI.

Partially Implements: blueprint openstackclient-plugin

Change-Id: I1e0a3830eb15a9bd5014bbbf45962627d21fe7fa
2016-05-24 15:47:11 +02:00
Vincent Francoise
cbc578998a Tidy up
In this changeset, I do some tidy up so I can later on make it
easier to refactor the lot.

Partially Implements: blueprint openstackclient-plugin

Change-Id: I566101fb951b9489481a3e6c1a4008c80b14f6fd
2016-05-24 15:45:12 +02:00
Vincent Francoise
e6ca4e54a7 Updated CLI for new /goals API
In this changeset I added the support for the refactored /goals API.

Partially Implements: blueprint get-goal-from-strategy

Change-Id: Idbf8ced7ad9fbe6246e27791890e9b6a3ec0dc9c
2016-05-12 10:03:20 +00:00
Alexander Chadin
0aaaf13278 Add audit-template name checking in CLI
This patch set allows to send audit_template_uuid as uuid type only.
If audit_template argument given as name, watcherclient will send request
to get audit template uuid.

Change-Id: Idf5f07ca08f2e5d871dc2163c32fbda9ed338a99
Related-Bug: #1532843
2016-04-14 16:13:07 +03:00
Tin Lam
a36b42afef Replace deprecated LOG.warn with LOG.warning
LOG.warn is deprecated. It is still used in a few places.
This replaces it with the non-deprecated LOG.warning.

Change-Id: I7ed615a24dcb4eff919d747d8f30625d6d4db0ee
Partial-Bug:#1508442
2016-02-14 17:45:11 -06:00
David.T
740dcf7bc2 i18n - Make string translatable
Since internationalization should be enabled in Watcher CLI/SDK,
this patchset refactors the watcherclient codebase to wrap
previously untranslatable strings with i18n translation functions
so we can import them for translation into the .pot template file.

Change-Id: Ibb987e66b95e009e33b596add8c96ecb193a3773
Implements: blueprint support-translation
2016-01-13 11:01:26 +00:00
David.T
03d12fd030 Sync with oslo-incubator
Most of librairies available under openstack/common folder are
now deployed by using oslo dedicated package. So we can remove
them and point to new python package.

Moreover, According to the November agreement in Oslo team,
apiclient and clituils will be removed from Oslo incubator.
We should keep the local copy by ourselfs

Change-Id: I3abc09d1c512df1f5cb868ed462a7900260705ce
Implements: blueprint make-watcherclient-use-graduated-oslo-lib
2016-01-12 15:52:32 +00:00
David TARDIVEL
3957331e52 push initial version
Change-Id: Ifecc2c7dd6bd859ba6ef327fddd891982382df3b
2015-06-04 14:59:34 +02:00