Skip to content

Commit c385539

Browse files
committed
[api] OPSAPS-32658. Add pools refresh endpoint
Nothing special. It's been MIA for a while. >>> from cm_api.api_client import ApiResource >>> api=ApiResource("nightly-1.gce.cloudera.com", username="admin", password="admin") >>> cluster=api.get_cluster("Cluster 1") >>> cmd = cluster.pools_refresh()
1 parent 2151df0 commit c385539

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

python/src/cm_api/endpoints/clusters.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -621,6 +621,15 @@ def export(self, export_auto_config=False):
621621
return self._get("export", ApiClusterTemplate, False,
622622
params=dict(exportAutoConfig=export_auto_config), api_version=12)
623623

624+
def pools_refresh(self):
625+
"""
626+
Refresh Dynamic Pools configurations for relevant services..
627+
628+
@return: Reference to the submitted command.
629+
@since: API v12
630+
"""
631+
return self._cmd('poolsRefresh')
632+
624633
def list_dfs_services(self, view=None):
625634
"""
626635
List available DFS (distributed file system) services in a cluster.

python/src/cm_api_tests/test_clusters.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,15 @@ def test_export_cluster_template(self):
115115
retdata=ApiClusterTemplate(resource).to_json_dict())
116116
cluster.export(export_auto_config=True)
117117

118+
def test_pools_refresh(self):
119+
resource = utils.MockResource(self)
120+
cluster = ApiCluster(resource, name="foo")
121+
122+
resource.expect("POST", "/clusters/foo/commands/poolsRefresh",
123+
data=None,
124+
retdata={ 'name' : 'foo'})
125+
cluster.pools_refresh()
126+
118127
def test_list_dfs_services(self):
119128
resource = utils.MockResource(self)
120129
cluster = ApiCluster(resource, name="foo")

0 commit comments

Comments
 (0)