Added /strategies endpoint in Watcher API

In this changeset, I added the /strategies endpoint to the Watcher
API service.
This also includes the related Tempest tests.

Partially Implements: blueprint get-goal-from-strategy

Change-Id: I1b70836e0df2082ab0016ecc207e89fdcb0fc8b9
This commit is contained in:
Vincent Françoise
2016-03-31 11:42:53 +02:00
parent 673642e436
commit 81765b9aa5
8 changed files with 545 additions and 4 deletions

View File

@@ -259,3 +259,24 @@ class InfraOptimClientJSON(base.BaseInfraOptimClient):
:return: Serialized action as a dictionary
"""
return self._show_request('/actions', action_uuid)
# ### STRATEGIES ### #
@base.handle_errors
def list_strategies(self, **kwargs):
"""List all existing strategies"""
return self._list_request('/strategies', **kwargs)
@base.handle_errors
def list_strategies_detail(self, **kwargs):
"""Lists details of all existing strategies"""
return self._list_request('/strategies/detail', **kwargs)
@base.handle_errors
def show_strategy(self, strategy):
"""Gets a specific strategy
:param strategy_id: Name of the strategy
:return: Serialized strategy as a dictionary
"""
return self._show_request('/strategies', strategy)