DeleteObjects

最終更新日:2025-08-18 15:52:00

複数ファイルを削除するには、IAM wos:DeleteObject 権限が必要です。

リクエスト構文

POST /?delete HTTP/1.1
Host: Bucket.Endpoint
x-amz-mfa: MFA
x-amz-request-payer: RequestPayer
x-amz-bypass-governance-retention: BypassGovernanceRetention
<?xml version="1.0" encoding="UTF-8"?>
<Delete xmlns=" http://wcs.chinanetcenter.com/document ">
  <Object>
    <Key>string</Key>
  </Object>
  ...
  <Quiet>boolean</Quiet>
</Delete>

URIリクエストパラメータ

なし

リクエストヘッダー

common request headers のみご利用ください。

リクエストボディ

リクエストボディは以下のXML情報となります。

要素名

要素の説明

必須かどうか

Delete

削除情報を定義します。

型: XML

子ノード: Object, Quiet

親ノード: なし

Yes

Object

削除する個々のオブジェクト情報を定義します。

型: XML

親ノード: Delete

子ノード: Key

Yes

Key

削除対象オブジェクトの名前を定義します。

型: String

親ノード: Delete

子ノード: Key

Yes

Quiet

クワイエットモード使用有無(値: true, false)を定義します。

型: Boolean

親ノード: Delete

子ノード: なし

no

レスポンス構文

HTTP/1.1 200 OK
x-amz-request-id: request id
Connection: close
Content-Type: application/xml
Content-Length: 206
Date: date
Server: WS-web-server

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<DeleteResult xmlns="http://wcs.chinanetcenter.com/document">
  <Deleted>
    <Key>string</Key>
  </Deleted>
  <Deleted>
    <Key>string</Key>
  </Deleted>
  <Error>
    <Code>string</Code>
    <Key>string</Key>
    <Message>string</Message>
  </Error>
  <Error>
    <Code>string</Code>
    <Key>string</Key>
    <Message>string</Message>
  </Error>
</DeleteResult>

レスポンスヘッダー

common response headers のみご利用ください。

レスポンス要素

要素名

要素の説明

Deleted

削除済みオブジェクト情報。

型: XML

子ノード: Key

親ノード: なし

Key

削除されたオブジェクト名。

型: String

親ノード: Deleted

子ノード: なし

Error

削除失敗オブジェクト情報。

型: XML

親ノード: なし

子ノード: Code, Key, Message

Code

削除失敗コード。

型: String

親ノード: Error

子ノード: なし

Key

削除に失敗したオブジェクトの名前。

型: String

親ノード: Error

子ノード: なし

Message

削除失敗メッセージ。

型: String

親ノード: Error

子ノード: なし

POST /?delete HTTP/1.1
Host: bucket.s3-cn-east-1.wcsapi.com
Accept-Encoding: identity
User-Agent: aws-cli/1.17.17 Python/3.8.0 Windows/10 botocore/1.14.17
Content-MD5: mno5HqDRSTJY/yusgaPLeQ==
X-Amz-Date: 20200331T055821Z
X-Amz-Content-SHA256: f33ffe2a28873df81b0fac7f39344fbc12127e7b3641b3c9e83346147a694c16
Authorization: AWS4-HMAC-SHA256 Credential=L18Gy5jN4fChwat419iDc0i8divP8nVwQahS/20200331/region98/s3/aws4_request, SignedHeaders=content-md5;host;x-amz-content-sha256;x-amz-date, Signature=3dd0861c930fbdecedfdd764c4f4d322c321ab2738ef7d9dd5a3dec908a7391f
Content-Length: 156

<Delete xmlns="http://wcs.chinanetcenter.com/document">
  <Object>
    <Key>10Mfile</Key>
  </Object>
  <Object>
    <Key>100Mfile</Key>
  </Object>
  <Quiet>false</Quiet>
</Delete>

HTTP/1.1 200 OK

x-amz-request-id: 209822119924133820200331135846tM1lmMCvsampled
Connection: close
Content-Type: application/xml
Content-Length: 206
Date: Tue, 31 Mar 2020 05:58:51 GMT
Server: WS-web-server
      
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<DeleteResult xmlns="http://wcs.chinanetcenter.com/document">
  <Deleted>
    <Key>100Mfile</Key>
  </Deleted>
  <Deleted>
    <Key>10Mfile</Key>
  </Deleted>
</DeleteResult>