Commit Graph

143 Commits

Author SHA1 Message Date
Elod Illes 716be84983 Add Python3 zed unit tests
This is an automatically generated patch to ensure unit testing
is in place for all the of the tested runtimes for zed.

See also the PTI in governance [1].

[1]: https://governance.openstack.org/tc/reference/project-testing-interface.html

Change-Id: I033a3b5a98848fc9b6a3ae3a439a272762b6dae1
2022-08-08 16:09:51 +00:00
Q.hongtao 7dbc1e89e2 Remove unicode from client
Change-Id: If0ac1d13a7958edb1389c1f76abce47016e50845
2021-01-03 06:49:56 +00:00
Q.hongtao f4f7ed012a Remove six
The Python 2.7 Support has been dropped since Ussuri.
So remove hacking rules for compatibility between python 2 and 3.

Change-Id: I5f0980bf56c8f7b8f9e7f75c7641443e0354e3c1
2020-09-19 12:13:02 +08:00
Hervé Beraud ae40b5560f Stop to use the __future__ module.
The __future__ module [1] was used in this context to ensure compatibility
between python 2 and python 3.

We previously dropped the support of python 2.7 [2] and now we only support
python 3 so we don't need to continue to use this module and the imports
listed below.

Imports commonly used and their related PEPs:
- `division` is related to PEP 238 [3]
- `print_function` is related to PEP 3105 [4]
- `unicode_literals` is related to PEP 3112 [5]
- `with_statement` is related to PEP 343 [6]
- `absolute_import` is related to PEP 328 [7]

[1] https://docs.python.org/3/library/__future__.html
[2] https://governance.openstack.org/tc/goals/selected/ussuri/drop-py27.html
[3] https://www.python.org/dev/peps/pep-0238
[4] https://www.python.org/dev/peps/pep-3105
[5] https://www.python.org/dev/peps/pep-3112
[6] https://www.python.org/dev/peps/pep-0343
[7] https://www.python.org/dev/peps/pep-0328

Change-Id: I7cc35696d770e1bf9e87310e5a081e1abe719522
2020-06-02 20:54:24 +02:00
Sean McGinnis 993563f610
Use unittest.mock instead of third party mock
Now that we no longer support py27, we can use the standard library
unittest.mock module instead of the third party mock lib.

Change-Id: I564357caf5982a0db9be01c77e9e8c42bee932d6
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
2020-04-18 11:59:50 -05:00
Eyal ba5f71fecc Add new api vitrage status
To Check if vitrage is ready then you can check its
status some users don't want to check on every api call
if vitrage is ready, in that case you can check ad hoc

Change-Id: I0817016538a6b286816b99176339262c6453dc08
2019-07-01 13:10:03 +03:00
Eyal 4b4bf371cf Template show in cli should be by default in yaml
Templates are written as yaml so why not show them
in the cli by default as yaml. User can still see it
in json using the flag -f json

Change-Id: I17c5b26b8ef2a0ae02886dbf703c29434ad89781
2019-06-13 16:15:53 +03:00
Eyal 97fbcff27b fixed help message for add and delete
Change-Id: I698c6b7587f4b488f7478846e7f28f431cf783e6
2019-06-13 08:21:26 +03:00
Zuul 74707888e1 Merge "Add option to overwrite when adding template" 2019-06-12 07:35:13 +00:00
Eyal 0d93ef1d78 Add new api to list template versions supported
Will print also the status which can be CURRENT, SUPPORTED
or DEPRECATED

Change-Id: I6c7aa8ee92136b8cea9eb4e431f86381dc79206a
2019-06-10 15:14:18 +03:00
Eyal aac0531341 Add option to overwrite when adding template
Add --overwrite to the cli as an option
and a parameter to the api

Change-Id: I3a1aad94a87c80a95e5867c24e491e4987029982
2019-06-10 08:36:16 +00:00
Eyal cc07041fc4 Add option to wait for add and delete template
Add --wait to the cli as an option

Change-Id: I1980dba674e2baee4877f465a9faaffd9feb86cb
2019-06-05 13:45:39 +03:00
Eyal a4bcd82eb9 Support using name in show and delete templates
Vitrage can show and delete templates by name
So remove the constraints on using only uuid
in CLI for deleting templates

renamed the parameters also to be more clear

Change-Id: Iaf68f994bdceee4a01ca445bde935ca42077f541
2019-05-27 10:28:56 +03:00
Ifat Afek 5d6673e343 Bugfix in add template: the new template_str argument must be last
Change-Id: Icf67750226d379c20dbe9d93df18eeabf88aadfa
2019-03-05 16:54:56 +00:00
Ifat Afek ecd027535d Allow calling template validate and template add with a string
Vitrage template add and template validate can now be called with either
a path or a string that holds the template yaml.

Change-Id: Ieaa372e92d201b46124163b164cc868ae35c86b2
Story: 2004055
Task: 27061
2019-03-05 13:10:04 +00:00
Zuul f9925f002e Merge "Support parameters in Vitrage templates" 2019-02-17 08:53:54 +00:00
Ifat Afek a0e346b6db Support parameters in Vitrage templates
A new optional --params parameter was added to 'vitrage template add'
and 'vitrage template validate' APIs, to allow assigning actual values
to parameters in Vitrage templates.

Story: 2004056
Task: 29134

Depends-On: Iac163aaf6de0e029893386fc4274421df4706c4e
Change-Id: I144f6cb889be6e97e0d4cbcf1fe5820c8d38c716
2019-02-12 13:25:51 +00:00
Eyal c293cbd2d5 add a new service list api
Story: 2004897
Task: 29205
Change-Id: Iecb2ae810dd2a6a6b544c2ed7dbfe6288f393178
2019-02-12 14:31:14 +02:00
Eyal 27c198c20b support graphml format
you can view the graph in graphml format instead of json
using the "-f graphml" in cli command for topology and rca

Change-Id: If364ee51074e5e7e9dc32f54ccb0a06079f6b8ef
2019-01-07 16:46:00 +02:00
Eyal ab81474e38 support dot format
you can view the graph in dot format instead of json
using the "-f dot" in cli command for topology and rca

dot format is very common for visualization of graphs
there are many tools that support this format including
online visualizers

Story: 2004063
Task: 27070

Change-Id: I44779d5d46a6ca279e2766b0d3f8e7ca02706b84
2019-01-01 10:03:35 +02:00
Idan Hefetz 3deddd8ce6 client support for resource api changes
- added support for query in resource list
 - changed call to resource list from GET to POST
 - added support for resource count new api

Story: 2004669
Task: 28652
Task: 28655

Depends-On: https://review.openstack.org/627309
Change-Id: Ib75b67c15c0a175e804fd020958fb7e50ec4df07
2018-12-30 09:23:54 +00:00
Zuul 56e6bc0217 Merge "using default mutable argument is wrong" 2018-09-02 07:43:59 +00:00
Eyal 43b0b79077 using default mutable argument is wrong
we can use a tuple instead

Change-Id: Ic807a8b740e022fc6d4556dd83d999a2395b9748
2018-08-12 13:40:27 +03:00
Zuul 4a60cc1a2d Merge "Template delete-validate uuid format" 2018-08-08 11:10:29 +00:00
Anna Reznikov 76e7198fe9 support for alarm and RCA history
add new history api and pagination in current alarm list api

Change-Id: Ie5ee407855b6aae6e34f316dce12669cfc1c025c
Story: 2002670
Task:  23216
2018-07-26 09:48:25 +00:00
Ifat Afek 33720fc14c Bugfix: support vitrage alarm list for alarm with no resource
Change-Id: I5d0693db2c5bad67bf72606aec90425ea05cd9f1
Story: 2003065
Task: 23107
2018-07-24 07:28:02 +00:00
Idan Kinory c5139d854e Template delete-validate uuid format
check input for valid uuid format before query.

Change-Id: I3e3f4d006381766f8882af1617038bd2e91dfbb5
2018-06-10 07:41:15 +00:00
Eyal 119addb8bf add logger instance to be used
otherwise uses keystoneauth logging that might be disabled

Change-Id: Ie1499f5245fee0ce7998828e2757005ac8270d53
2018-03-27 11:28:05 +03:00
Ifat Afek 717fdc551e Fixed the Vitrage CLI help
Change-Id: If4d0c7982fdbef7c51ace840be414ada8fc9ca16
2018-01-23 13:31:47 +00:00
Idan Hefetz 5df6ff462d allow multiple template deletion
Change-Id: Iba69a504302af1ea33109e186d093da4cb4560ce
Implements: blueprint crud-templates
Depends-On: Icdafe86137b1b2087d7348779cd3fee3d97dfd8f
2018-01-23 08:04:27 +00:00
Idan Hefetz d14cdfd915 template add validate fix client
Change-Id: I9e78471cd2b62298742246b658632790bd0b15b0
2018-01-22 12:48:01 +00:00
Zuul c6333c448e Merge "add template type to template list cli" 2018-01-22 12:47:31 +00:00
Zuul 435d0e2c17 Merge "Order output, add docs, add support for 'all_tenants' flag" 2018-01-21 09:38:11 +00:00
Idan Hefetz bfc34ba8de add template type to template list cli
Change-Id: I170238c7c6bf9a82e6333cefbab1863b9db02f6b
2018-01-21 09:36:38 +00:00
Zuul 293ea2757e Merge "support template add and delete" 2018-01-18 18:32:03 +00:00
Niv Oppenhaim 0a686020a9 Order output, add docs, add support for 'all_tenants' flag
Implements: blueprint configurable-notifications
Change-Id: Idcfa76012370e29eae94a29b4be268f3d0373c00
2018-01-14 13:24:14 +00:00
Eyal 4d0d32f4ec pass the namespace to cliff CommandManager
since the upgrade to cliff passing None wont work

Change-Id: I52db440a82f2e4280ea8f59c11f4ba34566e1da4
2018-01-14 09:17:32 +02:00
idan kinory 91c90350d1 support template add and delete
support for template add and template delete
not in use until vitrage backend support the changes.

Change-Id: I07741ed100b9eb70b303567706b659d10a34b156
Implements: blueprint crud-templates
2018-01-11 10:20:14 +00:00
Zuul 0c398e3704 Merge "add support for webhooks" 2018-01-04 04:02:51 +00:00
Zuul b48fcbbf8e Merge "add alarm show to client" 2018-01-03 13:48:31 +00:00
Niv Oppenhaim ad0cb386d3 add support for webhooks
Change-Id: Ic8f510da15e49df12d7a3d9c7d24c05958f378e6
Implements: blueprint configurable-notifications
2018-01-03 12:52:52 +00:00
Idan Hefetz ed9c28867b add alarm show to client
Depends-On: Ia675c6d74ec947729d4520007eac1423cdf58ce9
Change-Id: I4be7ebc7e977ae8ea0a2daf86777ba08f1d4ad61
Implements: blueprint add-alarm-show-api
2018-01-03 08:53:52 +00:00
Idan Hefetz bbcea6372c nicer cli tables for resource list and alarm list
Change-Id: Icbba61af3c9512dcb8def021b753d6156167cd22
2018-01-03 07:08:07 +00:00
Anna 975e663b9e safe_load doesnt have parameter Loader
Change-Id: I61024dcd098c68600433ef8af2e815456a7cc6ac
2017-10-16 08:59:27 +00:00
Yujun Zhang e4587e85eb Display original result for healthcheck instead of crafting one
This gives more information and has better compatibility

Change-Id: Ia05320dd72822f517f13ddc79fe55721114344f5
Signed-off-by: Yujun Zhang <zhang.yujunz@zte.com.cn>
2017-09-07 22:59:09 +08:00
Jenkins 802d89da48 Merge "Replaces yaml.load() with yaml.safe_load()" 2017-08-24 11:46:34 +00:00
Tyler Smith 86f34ebb30 Changes to support new alarm counts api in vitrage
This change is to support the new api as introduced by the
alarm-counts-api blueprint.
- There is a new cli added as well to expose the new api:
  vitrage alarm count
- The bash completion file was also updated

Change-Id: I47b5b2cbb32c742ca15478ee294d341c0137e0b5
Depends-On: I6061b63c068580dcd25df5c624d9b3bd88f30cca
Implements: blueprint alarm-counts-api
Signed-off-by: Tyler Smith <tyler.smith@windriver.com>
2017-08-14 09:53:38 -04:00
Yujun Zhang 76d348e182 Add blank line to separate osprofiler prompt from results
Change-Id: I98511bd058174481f67df6c756123f9435b603d7
Closes-Bug: #1710471
2017-08-14 12:07:22 +08:00
Jenkins aa73371157 Merge "some exceptions refactoring" 2017-07-30 06:42:15 +00:00
rajat29 d27cd0ea4e Replaces yaml.load() with yaml.safe_load()
Yaml.load() return Python object may be dangerous if you receive
a YAML document from an untrusted source such as the Internet.
The function yaml.safe_load() limits this ability to simple
Python objects like integers or lists.

Reference:
https://security.openstack.org/guidelines/dg_avoid-dangerous-input-parsing-libraries.html

Change-Id: I021bd09d3bbc6d4b9c8965c59c7f4ec4895f8b8b
2017-07-26 12:11:48 +05:30