Skip to content

Commit d463e2d

Browse files
committed
add list_config_workspaces
1 parent 9163aa3 commit d463e2d

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

kbcstorage/configurations.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,22 @@ def list(self, component_id):
7979
url = '{}/{}/configs'.format(self.base_url, component_id)
8080
return self._get(url)
8181

82+
def list_config_workspaces(self, component_id, config_id):
83+
"""
84+
Lists workspaces for component configuration.
85+
86+
Args:
87+
component_id (str): The id of the component.
88+
config_id (str): The id of the configuration.
89+
90+
Raises:
91+
requests.HTTPError: If the API request fails.
92+
"""
93+
if not isinstance(component_id, str) or component_id == '':
94+
raise ValueError("Invalid component_id '{}'.".format(component_id))
95+
url = '{}/{}/configs/{}/workspaces'.format(self.base_url, component_id, config_id)
96+
return self._get(url)
97+
8298
def create(self, component_id, name, description='', configuration=None, state=None, change_description='',
8399
is_disabled=False, configuration_id=None):
84100
"""

0 commit comments

Comments
 (0)