dcloud s3 bucket-objects delete-prefix

Delete everything under a folder; with prefix "" and allVersions, empty the bucket

IAM s3:DeleteObjectChanges stateAsks before it deletes (-y skips)

allVersions: true needs s3:DeleteObjectVersion and deletes every version and delete marker for good. Each call works ~20 seconds and answers { deleted, failed, errors, done, cursor }; while done is false, call again with cursor. A key your policies keep is reported in errors and stays.

Synopsis

dcloud s3 bucket-objects delete-prefix name --prefix prefix --all-versions allVersions [flags]

Arguments

  • <name>Required

    string

    Also accepted as --name. Constraints: 3-63 chars, /^[a-z0-9][a-z0-9-]*[a-z0-9]$/

Flags

  • --prefixRequired

    string

    A folder ending in /; "" is the whole bucket

    Constraints: max 1024 chars

  • --all-versionsRequired

    boolean (--all-versions / --no-all-versions)

    true: every version and delete marker, for good (Empty bucket). false: the current objects, as Delete does (a versioned bucket keeps them as old versions)

  • --cursorOptional

    object

    From the previous answer, when it said done: false

    Constraints: JSON

Example

dcloud s3 bucket-objects delete-prefix name --prefix example --all-versions

Generated from the API description, the same one the API checks requests against and the CLI is built from.