Put Bucket cors#
バケットにCors(Cross-Origin Resource Sharing)構成情報を設定します。
APIエンドポイント#
リージョン | APIエンドポイント |
---|---|
西日本リージョン3の場合 | https://objectstorage-s.jp-west-3.cloud.global.fujitsu.com |
東日本リージョン3の場合 | https://objectstorage-s.jp-east-3.cloud.global.fujitsu.com |
HTTPメソッドとURI#
PUT
/{bucket}?cors
HTTPステータスコード#
正常時:200
エラー時:400, 403, 404, 405, 409, 411, 412, 416, 422, 500, 501, 503
リクエストパラメータの説明#
名前 | In | Type | デフォルト値 /必須指定 |
Description |
---|---|---|---|---|
Bucket | path | string | 必須 | バケット名 |
x-amz-content-sha256 | header | string | 必須 | ペイロード全体の計算されたSHA256チェックサム |
x-amz-date | header | string | 必須 | リクエスト側で生成した現在日時 |
Authorization | header | string | 必須 | リクエスト認証に用いる文字列 |
Content-Length | header | string | 必須 | リクエストボディのバイト数 |
CORSConfiguration | body | container | 必須 | CORSRules要素用のコンテナ |
CORSRule | body | container | 必須 | クロスサイトリクエストを許可するための条件 |
ID | body | string | 任意 | 条件設定を一意に識別するためのID |
AllowedOrigin | body | string | 必須 | クロスサイトリクエストを許可するオリジン |
AllowedHeader | body | string | 任意 | クロスサイトリクエストに含めることができるヘッダ |
AllowedMethod | body | enum | 必須 | クロスサイトリクエストで許可するHTTPメソッド |
MaxAgeSeconds | body | integer | 任意 | プリフライトリクエストをブラウザでキャッシュできる時間 |
ExposeHeader | body | string | 任意 | Access-Control-Expose-Headers としてクライアント に示すクロスサイトリクエストで指定可能なヘッダ |
レスポンスヘッダーの説明#
名前 | Type | Description |
---|---|---|
Date | string | トランザクションが実行された日時 |
Content-Length | string | レスポンスボディのバイト数 |
Connection | string | 持続接続の状態を表示します。 |
x-amz-request-id | string | このリクエストに付与されるID トラブルについて問い合わせる際に利用されます。 |
x-amz-id-2 | string | このリクエストに対する処理ID トラブルについて問い合わせる際に利用されます。 |
x-ntap-sg-trace-id | string | このリクエストに対する処理ID トラブルについて問い合わせる際に利用されます。 |
X-Fcx-Endpoint-Request | string | APIエンドポイントとしてリクエストを受け付けたことを示す番号 |
リクエスト例#
リクエストヘッダー
PUT /general-bucket?cors HTTP/1.1 User-Agent: curl/7.29.0 Host: objectstorage-s.jp-east-3.cloud.global.fujitsu.com Accept: */* x-amz-content-sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 x-amz-date:20190604T022452Z Authorization:AWS4-HMAC-SHA256 Credential=XK8Z3830NBL1BT9WD3HD/20190604/jp-east-3/s3/aws4_request,SignedHeaders=host;x-amz-content-sha256;x-amz-date,Signature=ba9e9550ce44df39135e9eb15d355427841546f6e9725c722ca7041c24fba893 Content-Length: 557 Content-Type: application/x-www-form-urlencoded
リクエストボディ
<CORSConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/"> <CORSRule> <AllowedOrigin>http://www.example.com</AllowedOrigin> <AllowedHeader>*</AllowedHeader> <AllowedMethod>PUT</AllowedMethod> <AllowedMethod>POST</AllowedMethod> <AllowedMethod>DELETE</AllowedMethod> <MaxAgeSeconds>3000</MaxAgeSeconds> <ExposeHeader>x-amz-server-side-encryption</ExposeHeader> </CORSRule> <CORSRule> <AllowedOrigin>*</AllowedOrigin> <AllowedHeader>Authorization</AllowedHeader> <AllowedMethod>GET</AllowedMethod> <MaxAgeSeconds>3000</MaxAgeSeconds> </CORSRule> </CORSConfiguration>
レスポンス例#
レスポンスヘッダ
HTTP/1.1 200 OK Date: Tue, 04 Jun 2019 02:25:02 GMT Content-Length: 0 Connection: keep-alive x-amz-request-id: 322948696 x-amz-id-2: 12174498 x-ntap-sg-trace-id: a885941abae2bd0c X-Fcx-Endpoint-Request: EXECUTED_api2-rmp1.management.jp-east-3.local-28163-754038-1_200