List all workspaces in the self-hosted instance.
(page_num: int, page_size: int, fetch_all: bool, search: Optional[str], save_name: str, api: Api)
| 168 | ) |
| 169 | @with_custom_host |
| 170 | def list_groups(page_num: int, page_size: int, fetch_all: bool, search: Optional[str], save_name: str, api: Api): |
| 171 | """List all workspaces in the self-hosted instance.""" |
| 172 | sh = api.self_hosted() |
| 173 | try: |
| 174 | workspaces = list( |
| 175 | sh.get_groups( |
| 176 | page=page_num, |
| 177 | size=page_size, |
| 178 | all=fetch_all, |
| 179 | search=search, |
| 180 | ) |
| 181 | ) |
| 182 | except ValueError as e: |
| 183 | payload = format_output(ApiResponseType(ok=False, errmsg=str(e))) |
| 184 | else: |
| 185 | if sh._errors: |
| 186 | payload = format_output(ApiResponseType(ok=False, errmsg="; ".join(sh._errors))) |
| 187 | else: |
| 188 | resp = ApiResponseType(ok=True, data={"list": workspaces}) |
| 189 | payload = format_output(resp) |
| 190 | if save_name is not None: |
| 191 | save_output(orjson.dumps(payload, option=orjson.OPT_INDENT_2), name=save_name) |
nothing calls this directly
no test coverage detected
searching dependent graphs…