rb

Prev Next

Available in Classic and VPC

Delete an empty bucket in Ncloud Storage.

Commands

The command statement is as follows:

aws s3 rb <target> --endpoint-url <value> [--options] 

Parameter

The following describes the parameters.

Parameter Type Required Description Restrictions
--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.
--force boolean N Delete all objects in the bucket, including the bucket itself. Objects with a version ID can't be deleted.
--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 call results. Available options
- json
- text
- table
- yaml
- yaml-stream
--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
- on
- off
- auto
--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. -

Examples

This section describes an example of calling and responding to the rb command.

Delete object.

Call examples

Specify an empty bucket to delete, and then call the command to delete the bucket. The following is a call example.

aws s3 rb s3://bucket-a --endpoint-url=http://kr.ncloudstorage.com 

Response example

The response example is as follows:

remove_bucket: bucket-a

If the bucket is not empty, the following error message will be displayed.

remove_bucket failed: s3://bucket-a An error occurred (BucketNotEmpty) when calling the DeleteBucket operation: The bucket you tried to delete is not empty. You must delete all versions in the bucket.

Force delete non-empty bucket

Call examples

If you want to delete the bucket itself, including the objects stored in it, call the command using the --force option to delete the bucket and all objects under it. However, if version control is enabled for the bucket, a delete marker will be added to the objects, and the bucket can't be deleted. The following is a call example.

aws s3 rb s3://bucket-aa --endpoint-url=http://kr.ncloudstorage.com --force

Response example

The response example is as follows:

delete: s3://bucket-aa/ncs_5.png
remove_bucket: bucket-aa