MCPcopy
hub / github.com/SwanHubX/SwanLab / get_groups

Method get_groups

swanlab/api/self_hosted.py:136–163  ·  view source on GitHub ↗

分页获取所有空间(管理员限定)。 :param page: 起始页码,默认 1 :param size: 每页大小,默认 100 :param search: 搜索关键词 :param type: 空间类型过滤,PERSON / TEAM :param sort: 排序字段,update(默认) / create / name :param all: 是否获取全部数据,默认 False

(
        self,
        page: int = 1,
        size: int = 100,
        search: Optional[str] = None,
        type: Optional[str] = None,
        sort: Optional[str] = None,
        all: bool = False,
    )

Source from the content-addressed store, hash-verified

134 )
135
136 def get_groups(
137 self,
138 page: int = 1,
139 size: int = 100,
140 search: Optional[str] = None,
141 type: Optional[str] = None,
142 sort: Optional[str] = None,
143 all: bool = False,
144 ) -> Iterator[dict]:
145 """
146 分页获取所有空间(管理员限定)。
147
148 :param page: 起始页码,默认 1
149 :param size: 每页大小,默认 100
150 :param search: 搜索关键词
151 :param type: 空间类型过滤,PERSON / TEAM
152 :param sort: 排序字段,update(默认) / create / name
153 :param all: 是否获取全部数据,默认 False
154 """
155 SelfHosted.validate_root(self._ensure_data())
156 query = PaginatedQuery(page=page, size=size, search=search, sort=sort, all=all)
157 page_info: Dict[str, Any] = {"total": 0, "pages": 0}
158 yield from self._paginate(
159 "/self_hosted/groups",
160 query,
161 page_info=page_info,
162 extra={"type": type},
163 )
164
165 def get_usage_summary(self) -> ApiResponseType:
166 """获取系统内汇总信息(root 限定)"""

Callers 1

list_groupsFunction · 0.80

Calls 4

_ensure_dataMethod · 0.95
PaginatedQueryClass · 0.90
validate_rootMethod · 0.80
_paginateMethod · 0.80

Tested by

no test coverage detected