Available in Classic and VPC
Delete an object stored in Ncloud Storage.Commands
The command statement is as follows:
aws s3api delete-object --bucket <value> --key <value> [--options]
Note
The behavior may vary depending on the version control settings of the bucket where the target object is stored.
- If version control is not enabled for the bucket, the object will be permanently deleted.
- If version control is enabled, a delete marker will be inserted into the object, and this version will become the latest version of the object. If you wish to permanently delete the object, delete it by specifying the version ID.
- If version control is paused, calling the command without specifying a version ID will only delete objects with a version ID of NULL. If an object with a version ID is the current version, a delete marker with a version ID of NULL is inserted, and this delete marker becomes the current version of the object. To delete a specific version of the object, specify the version ID to delete that version.
Parameter
The following describes the parameters.
Parameter | Type | Required | Description | Restrictions |
---|---|---|---|---|
--bucket <value> | string | Y | Name of the bucket where the object is stored | - |
--key <value> | string | Y | Name (key value) of the object to delete | - |
--endpoint-url <value> | string | Y | Specify the default URL for command calls. | It is only available for the KR Region. See Ncloud Storage overview for call domain information. |
--version-id <value> | string | N | When deleting a specific version of an object in a bucket with version control enabled, specify the version ID. | - |
--cli-input-json | --cli-input-yaml | string | N | Enter arguments from the provided json or yaml string. | You can't specify json and yaml together. |
--generate-cli-skeleton <value> | integer | N | Create a parameter template that can be used as input later without executing the API command. | - |
--debug | boolean | N | Use debug logging. | - |
--no-verify-ssl | boolean | N | Redefine the default behavior for validating SSL certificates. | - |
--no-paginate | boolean | N | Disable automatic pagination, call only the first page for results. | - |
--output <value> | string | N | Specify the format of response results. | Available options
|
--query <value> | string | N | JMESPath query to use for filtering response data | - |
--profile <value> | string | N | Use a specific profile in the credentials file. | - |
--region <value> | string | N | Specify the Region. | Only KR is supported. |
--color <value> | string | N | Set output color. | Available options
|
--no-sign-request | boolean | N | Disable credential loading. | - |
--ca-bundle <value> | string | N | Specify the CA certificate to use when verifying SSL certificates. | - |
--cli-read-timeout <value> | int | N | Maximum read time; entering 0 changes it to a blocked status instead of a timeout. | It is set to 60 seconds by default. |
--cli-connect-timeout <value> | int | N | Maximum connection time; entering 0 changes it to a blocked status instead of a timeout. | It is set to 60 seconds by default. |
--no-cli-pager | boolean | N | Disable the CLI pager for response values. | - |
--cli-auto-prompt | boolean | N | Enable automatic prompting for CLI input parameters. | - |
--no-cli-auto-prompt | boolean | N | Disable automatic prompting for CLI input parameters. | - |
Permission
If a sub account user wants to use this command, they need the Change/DeleteObject action permission.
Examples
This section describes an example of calling and responding to the delete-object command.
Delete object.
Call examples
You can delete an object by specifying the bucket where the object is stored and the object name when calling the command. The following is a call example.
aws s3api delete-object --bucket bucket-a --key img.png --endpoint-url=https://kr.ncloudstorage.com
Related commands
Related commands are as follows: