Delete a directory prefix from dataset OSS storage.
(
self,
object_name: str,
dataset_name: str,
namespace: str,
revision: str,
endpoint: Optional[str] = None,
token: Optional[str] = None,
)
| 220 | return body[API_RESPONSE_FIELD_MESSAGE] |
| 221 | |
| 222 | def delete_oss_dataset_dir( |
| 223 | self, |
| 224 | object_name: str, |
| 225 | dataset_name: str, |
| 226 | namespace: str, |
| 227 | revision: str, |
| 228 | endpoint: Optional[str] = None, |
| 229 | token: Optional[str] = None, |
| 230 | ) -> str: |
| 231 | """Delete a directory prefix from dataset OSS storage.""" |
| 232 | if not all([object_name, dataset_name, namespace, revision]): |
| 233 | raise ValueError('Args cannot be empty!') |
| 234 | prefix = object_name.rstrip('/') + '/' |
| 235 | body = self._legacy_request( |
| 236 | 'DELETE', |
| 237 | f'datasets/{namespace}/{dataset_name}/oss/prefix', |
| 238 | params={'Prefix': prefix, 'Revision': revision}, |
| 239 | ) |
| 240 | return body[API_RESPONSE_FIELD_MESSAGE] |
| 241 | |
| 242 | # ------------------------------------------------------------------ |
| 243 | # Meta file download |