From c73da37d2ae5bfdb3ef311a239f96a99c8e1a84f Mon Sep 17 00:00:00 2001 From: Dima Spivak Date: Tue, 10 Oct 2017 14:46:21 -0700 Subject: [PATCH] Fix cluster start method --- ambariclient/models.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/ambariclient/models.py b/ambariclient/models.py index b69cefc..ab12f45 100644 --- a/ambariclient/models.py +++ b/ambariclient/models.py @@ -684,10 +684,13 @@ class Service(base.QueryableModel): class ClusterServiceCollection(base.QueryableModelCollection): def start(self): """Start all services on a cluster.""" - url = self.url + "/?ServiceInfo/state=INSTALLED" - self.load(self.client.put(url, data={ + self.load(self.client.put(self.url, data={ "RequestInfo": { - "context": "Start All Services" + "context": "_PARSE_.START.ALL_SERVICES", + "operation_level": { + "level": "CLUSTER", + "cluster_name": self.parent.cluster_name + } }, "Body": { "ServiceInfo": { @@ -697,6 +700,7 @@ def start(self): })) return self.request + class ClusterService(Service): collection_class = ClusterServiceCollection relationships = {