summaryrefslogtreecommitdiff
path: root/troveclient/tests/test_instances.py
diff options
context:
space:
mode:
authorBartosz Zurkowski <b.zurkowski@samsung.com>2018-10-08 14:17:40 +0200
committerBartosz Zurkowski <b.zurkowski@samsung.com>2018-10-12 15:28:37 +0200
commitd2220578ffeaf59532ab3e29cd7ad38cef6c7eb7 (patch)
treeb2a577b8147fe399e08439083a648a790bfb1ca9 /troveclient/tests/test_instances.py
parent84b1b0ae6255bf35e02d4659336f40bf30250b07 (diff)
downloadpython-troveclient-d2220578ffeaf59532ab3e29cd7ad38cef6c7eb7.tar.gz
Add detailed list for instances
Currently, listing instances only allows to get basic information about entities. To get the details, one need to query instance "show" endpoint for each instance separately. This is inefficient and exposes API to a heavier load. There are use cases in which we want to obtain detailed information about all instances. In particular, in services integrating with Trove. For example, Vitrage project requires this information to build vertices and edges in the resource graph for RCA analysis. This change extends Trove client by optional parameter allowing user to specify whether API should include more instance details in the response. Change-Id: Iecea2f711a3e23fd63167beb6cab4cecc63bcabe Signed-off-by: Bartosz Zurkowski <b.zurkowski@samsung.com>
Diffstat (limited to 'troveclient/tests/test_instances.py')
-rw-r--r--troveclient/tests/test_instances.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/troveclient/tests/test_instances.py b/troveclient/tests/test_instances.py
index b65583d..2f21cac 100644
--- a/troveclient/tests/test_instances.py
+++ b/troveclient/tests/test_instances.py
@@ -124,6 +124,16 @@ class InstancesTest(testtools.TestCase):
page_mock.assert_called_with("/instances", "instances", limit, marker,
include_clustered)
+ def test_detailed_list(self):
+ page_mock = mock.Mock()
+ self.instances._paginated = page_mock
+ limit = "test-limit"
+ marker = "test-marker"
+ include_clustered = {'include_clustered': False}
+ self.instances.list(limit, marker, detailed=True)
+ page_mock.assert_called_with("/instances/detail", "instances", limit,
+ marker, include_clustered)
+
def test_get(self):
def side_effect_func(path, inst):
return path, inst