Available in Classic and VPC
Bulk delete 2 or more objects stored in a Ncloud Storage bucket at the same time.
For a Sub Account user to execute this command, they must have the Change/DeleteObject action permission. If you bypass GOVERNANCE retention to delete an item (--bypass-governance-retention), you will need the additional Change/BypassGovernanceretention action permission.
Syntax
The delete-objects syntax is as follows:
aws s3api delete-objects \
--bucket <bucket> \
--delete <delete> \
[--bypass-governance-retention | --no-bypass-governance-retention] \
--endpoint-url <endpoint-url>
Options
This section describes the options available when running delete-objects.
Required options
The following options are required for delete-objects.
| Options | Type | Required | Description |
|---|---|---|---|
--bucket |
String | Required | Bucket name |
--delete |
String | Required | List of objects to delete
|
--delete syntax
- Shorthand syntax
Objects=[{Key=string,VersionId=string,ETag=string,LastModifiedTime=timestamp,Size=long},{Key=string,VersionId=string,ETag=string,LastModifiedTime=timestamp,Size=long}],Quiet=boolean
- JSON syntax
{
"Objects": [
{
"Key": "string",
"VersionId": "string",
"ETag": "string",
"LastModifiedTime": timestamp,
"Size": long
}
...
],
"Quiet": true|false
}
Optional options
These are the optional options for delete-objects. Options that are not specified will use their default values.
| Options | Type | Required | Description |
|---|---|---|---|
--bypass-governance-retention |
Boolean | Optional | Bypasses the GOVERNANCE mode retention settings
|
--no-bypass-governance-retention |
Boolean | Optional | Does not bypass GOVERNANCE mode preservation settings. |
Common options
For information about the options common to all aws subcommands, see Ncloud Storage options.
Examples
If the object deletion request is successful, the identification information for each deleted object is returned.
Command
The command example is as follows:
aws s3api delete-objects --bucket my-test-bucket \
--delete '{"Objects":[{"Key":"synced/report.txt"}],"Quiet":false}' \
--endpoint-url=https://kr.ncloudstorage.com
Output
The output example is as follows:
{
"Deleted": [
{
"Key": "synced/report.txt"
}
]
}
Related commands
Related commands are as follows: