Deleting a partially uploaded object
You can upload an object in parts using multipart upload.
Note
To automatically delete partially loaded objects in Object Storage, configure a lifecycle rule.
To manually delete a partially uploaded object:
- In the management console
, select a folder. - Go to Object Storage.
- In the row with the bucket, in the Number of objects column, hover over the yellow field with the number of partially uploaded objects.
- In the window that opens, click Show uploads.
- Select incomplete uploads you want to delete.
- Click Delete.
- Confirm the deletion.
In the management console, the information about the number of objects and storage space used in the bucket is updated with a few minutes' delay.
If you do not have the Yandex Cloud CLI installed yet, install and initialize it.
By default, the CLI uses the folder specified when creating the profile. To change the default folder, use the yc config set folder-id <folder_ID> command. You can also set a different folder for any specific command using the --folder-name or --folder-id parameter.
-
Get a list of incomplete multipart uploads:
-
See the description of the CLI command to get a list of incomplete multipart uploads in a bucket:
yc storage s3api list-multipart-uploads --help -
Get a list of buckets in the default folder:
yc storage bucket listResult:
+------------------+----------------------+-------------+-----------------------+---------------------+ | NAME | FOLDER ID | MAX SIZE | DEFAULT STORAGE CLASS | CREATED AT | +------------------+----------------------+-------------+-----------------------+---------------------+ | first-bucket | b1gmit33ngp6******** | 53687091200 | STANDARD | 2022-12-16 13:58:18 | +------------------+----------------------+-------------+-----------------------+---------------------+ -
Run the command below by specifying the bucket name:
yc storage s3api list-multipart-uploads \ --bucket <bucket_name>Result:
bucket: first-bucket max_uploads: "1000" uploads: - key: video.mp4 upload_id: 000629B7******** initiator: id: ajeol2afu1js******** display_name: ajeol2afu1js******** owner: id: ajeol2afu1js******** display_name: ajeol2afu1js******** storage_class: STANDARD initiated_at: "2024-12-20T18:05:07.312Z" - key: video1.mp4 upload_id: 000629B7******** initiator: id: ajeol2afu1js******** display_name: ajeol2afu1js******** owner: id: ajeol2afu1js******** display_name: ajeol2afu1js******** storage_class: STANDARD initiated_at: "2024-12-20T18:20:15.747Z" request_id: 75dbac97********Save the multipart upload ID (
uploads.upload_id) value of the partially uploaded object you want to delete. You will need this value in the next step.For more information about the
yc storage s3api list-multipart-uploadscommand, see the CLI reference.
-
-
Delete the partially uploaded object:
-
See the description of the CLI command to delete a partially uploaded object:
yc storage s3api abort-multipart-upload --help -
Run this command:
yc storage s3api abort-multipart-upload \ --bucket <bucket_name> \ --key <object_key> \ --upload-id <multipart_upload_ID>Where:
--bucket: Name of the bucket in which you want to delete the partially uploaded object.--key: Key of the object to delete.--upload-id: Multipart upload ID obtained in the previous step.
Result:
request_id: 573ea6e2********For more information about the
yc storage s3api abort-multipart-uploadcommand, see the CLI reference.
-
If you do not have the AWS CLI yet, install and configure it.
-
Get a list of incomplete multipart uploads:
-
Get a list of available buckets:
aws s3api list-buckets \ --endpoint-url=https://storage.yandexcloud.netResult:
{ "Buckets": [ { "Name": "new-bucket", "CreationDate": "2024-12-20T17:48:17+00:00" }, { "Name": "first-bucket", "CreationDate": "2023-12-28T12:20:49.538000+00:00" } ], "Owner": { "DisplayName": "", "ID": "" } } -
Run the command below by specifying the bucket name:
aws s3api list-multipart-uploads \ --endpoint-url=https://storage.yandexcloud.net \ --bucket <bucket_name>Result:
{ "Uploads": [ { "UploadId": "000629C2********", "Key": "video.mp4", "Initiated": "2024-12-21T07:40:03.562000+00:00", "StorageClass": "STANDARD", "Owner": { "DisplayName": "ajegtlf2q28a********", "ID": "ajegtlf2q28a********" }, "Initiator": { "ID": "ajegtlf2q28a********", "DisplayName": "ajegtlf2q28a********" } }, { "UploadId": "000629C2********", "Key": "video1.mp4", "Initiated": "2024-12-21T07:42:39.492000+00:00", "StorageClass": "STANDARD", "Owner": { "DisplayName": "ajegtlf2q28a********", "ID": "ajegtlf2q28a********" }, "Initiator": { "ID": "ajegtlf2q28a********", "DisplayName": "ajegtlf2q28a********" } } ], "RequestCharged": null }Save the multipart upload ID (
Uploads.UploadId) value of the partially uploaded object you want to delete. You will need this value in the next step.
-
-
Delete the partially uploaded object:
aws s3api abort-multipart-upload \ --endpoint-url=https://storage.yandexcloud.net \ --bucket <bucket_name> \ --key <object_key> \ --upload-id <multipart_upload_ID>Where:
--bucket: Name of the bucket in which you want to delete the partially uploaded object.--key: Key of the object to delete.--upload-id: Multipart upload ID obtained in the previous step.
To get a list of multipart uploads, use the listUploads S3 API method.
To delete a partially uploaded object, use the abortUpload S3 API method.