MCPcopy Create free account
hub / github.com/modelscope/modelscope / list_oss_dataset_objects

Method list_oss_dataset_objects

modelscope/hub/api.py:177–201  ·  view source on GitHub ↗

List objects in a dataset's OSS storage.

(
        self,
        dataset_name: str,
        namespace: str,
        max_limit: int,
        is_recursive: bool,
        is_filter_dir: bool,
        revision: str,
        endpoint: Optional[str] = None,
        token: Optional[str] = None,
    )

Source from the content-addressed store, hash-verified

175 # OSS dataset operations
176 # ------------------------------------------------------------------
177 def list_oss_dataset_objects(
178 self,
179 dataset_name: str,
180 namespace: str,
181 max_limit: int,
182 is_recursive: bool,
183 is_filter_dir: bool,
184 revision: str,
185 endpoint: Optional[str] = None,
186 token: Optional[str] = None,
187 ) -> list:
188 """List objects in a dataset's OSS storage."""
189 params = {
190 'MaxLimit': max_limit,
191 'Revision': revision,
192 'Recursive': is_recursive,
193 'FilterDir': is_filter_dir,
194 }
195 body = self._legacy_request(
196 'GET',
197 f'datasets/{namespace}/{dataset_name}/oss/tree/',
198 params=params,
199 timeout=1800,
200 )
201 return body.get(API_RESPONSE_FIELD_DATA, [])
202
203 def delete_oss_dataset_object(
204 self,

Callers 1

list_dataset_objectsFunction · 0.80

Calls 2

_legacy_requestMethod · 0.95
getMethod · 0.45

Tested by

no test coverage detected