百度智能云

All Product Document

          Object Storage

          Delete Multiple Objects

          Interface Description

          This command is used to delete multiple objects in the same bucket by making an HTTP request.

          • You can delete up to 1,000 objects by making a request.
          • The message body cannot exceed 2 MB.
          • The returned message body only contains incorrect object results during deletion. If successful in deleting all objects, no message body exists.

          Request URI

          POST /v1/{bucketName}/?delete

          Parameter Name Parameter Type Required? Description Example Value Parameter Position
          bucketName String Yes Bucket name "bucketName_example" Path

          Request Body Parameters

          Description of Data Structure for Request Body Field

          Parameter name Parameter type Required Description Example value
          objects List Yes Container for storing object information to delete, which contains one or more object elements.

          Data Structure Description of Objects Field

          Parameter Name Parameter Type Required Description Example Value
          key String No my-object2

          Response Body Parameters

          Description of Data Structure for Response Body Field

          Parameter Name Parameter Type Description Example Value
          errors List The container for storing incorrect object messages during the deletion, which contains one or more object elements.

          Description of Data Structure for Errors Field

          Parameter Name Parameter type Description Example value
          key String Incorrect object name during deletion. my-object2
          code String Error code. InvalidArgument
          message String Error message. Invalid Argument.

          Request Example

          POST /v1/bucketName_example/?delete
          Common Request Header
          
          
          {
            "objects" : [ {
              "key" : "my-object2"
            } ]
          }

          Response Example

          HTTP/1.1 200 OK
          <Common response header>
          
          {
            "errors" : [ {
              "code" : "InvalidArgument",
              "message" : "Invalid Argument.",
              "key" : "my-object2"
            }, {
              "code" : "InvalidArgument",
              "message" : "Invalid Argument.",
              "key" : "my-object2"
            } ]
          }

          Error Code

          Refer to the universal error code.

          Previous
          Delete Object
          Next
          Access Control