Description
5Gより大きいファイルをアップロードする際に、使用します。
DLOと比べ完全性、信頼性が向上します。
Request URL
Swift API v1.0
PUT /v1/nc_{account}/{container}/{object}
Request Parameters
| Parameter | Value | Style | Description |
|---|---|---|---|
| X-Auth-Token | Userトークン | header | |
| account | tenant ID | URI | |
| container | コンテナ名 | URI | |
| object | オブジェクト名 | URI |
Request Json
This operation does not accept a request body.
Normal response code
100,201
Example
curl -i -X PUT \
-H "Accept: application/json" \
-H "X-Auth-Token: 2c6f2de2126a4102b38368c32e7043db" \
-d '[{"path" : "slo_container_segments/segment_6000M_file_aa", "etag": "62faa641bcc02a5a04238191a4848383", "size_bytes": 1048576000},
{"path" : "slo_container_segments/segment_6000M_file_ab", "etag": "0473f527ee1d85eb279074ab9c7abf0c", "size_bytes": 1048576000},
{"path" : "slo_container_segments/segment_6000M_file_ac", "etag": "1772c18a2477df7d228f5e0a4a9f7e1d", "size_bytes": 1048576000},
{"path" : "slo_container_segments/segment_6000M_file_ad", "etag": "6b1511af893f7f10076bf2df578d9750", "size_bytes": 1048576000},
{"path" : "slo_container_segments/segment_6000M_file_ae", "etag": "b32690b420990c423d08a03460f2d198", "size_bytes": 1048576000},
{"path" : "slo_container_segments/segment_6000M_file_af", "etag": "c9cabb22f216a234ceec20fe29273df6", "size_bytes": 1048576000}]' \
https://object-storage.tyo1.cloud.z.com/v1/nc_cc54f7476b8e444bad238a943a94ccdf/slo_container/6000M_file?multipart-manifest=putHTTP/1.1 100 Continue HTTP/1.1 201 Created Last-Modified: Fri, 08 May 2015 02:49:07 GMT Content-Length: 0 Etag: "ad4ffe07d98a5b97c75557b23ed85dd3" Content-Type: text/html; charset=UTF-8 X-Trans-Id: tx4e19550f65e14b4da6663-00554c2422 Date: Fri, 08 May 2015 02:49:06 GMT
1.ファイルを分割
split -b 1000m 6000M_file segment_6000M_file_
2.コンテナ作成
curl -i -X PUT \ -H "Accept: application/json" \ -H "X-Auth-Token: 2c6f2de2126a4102b38368c32e7043db" \ https://object-storage.tyo1.cloud.z.com/v1/nc_cc54f7476b8e444bad238a943a94ccdf/slo_container
3.セグメントファイル用コンテナ作成
curl -i -X PUT \ -H "Accept: application/json" \ -H "X-Auth-Token: 2c6f2de2126a4102b38368c32e7043db" \ https://object-storage.tyo1.cloud.z.com/v1/nc_cc54f7476b8e444bad238a943a94ccdf/slo_container_segments
4.セグメントファイルアップロード
curl -i -X PUT -H "X-Auth-Token: 2c6f2de2126a4102b38368c32e7043db" https://object-storage.tyo1.cloud.z.com/v1/nc_cc54f7476b8e444bad238a943a94ccdf/slo_container_segments -T segment_6000M_file_aa curl -i -X PUT -H "X-Auth-Token: 2c6f2de2126a4102b38368c32e7043db" https://object-storage.tyo1.cloud.z.com/v1/nc_cc54f7476b8e444bad238a943a94ccdf/slo_container_segments -T segment_6000M_file_ab curl -i -X PUT -H "X-Auth-Token: 2c6f2de2126a4102b38368c32e7043db" https://object-storage.tyo1.cloud.z.com/v1/nc_cc54f7476b8e444bad238a943a94ccdf/slo_container_segments -T segment_6000M_file_ac curl -i -X PUT -H "X-Auth-Token: 2c6f2de2126a4102b38368c32e7043db" https://object-storage.tyo1.cloud.z.com/v1/nc_cc54f7476b8e444bad238a943a94ccdf/slo_container_segments -T segment_6000M_file_ad curl -i -X PUT -H "X-Auth-Token: 2c6f2de2126a4102b38368c32e7043db" https://object-storage.tyo1.cloud.z.com/v1/nc_cc54f7476b8e444bad238a943a94ccdf/slo_container_segments -T segment_6000M_file_ae curl -i -X PUT -H "X-Auth-Token: 2c6f2de2126a4102b38368c32e7043db" https://object-storage.tyo1.cloud.z.com/v1/nc_cc54f7476b8e444bad238a943a94ccdf/slo_container_segments -T segment_6000M_file_af
5.MD5確認
md5sum segment_6000M_file_a* 62faa641bcc02a5a04238191a4848383 segment_6000M_file_aa 0473f527ee1d85eb279074ab9c7abf0c segment_6000M_file_ab 1772c18a2477df7d228f5e0a4a9f7e1d segment_6000M_file_ac 6b1511af893f7f10076bf2df578d9750 segment_6000M_file_ad b32690b420990c423d08a03460f2d198 segment_6000M_file_ae c9cabb22f216a234ceec20fe29273df6 segment_6000M_file_af
6.マニフェストファイル作成
▼manifestの形式(-dで指定しているjson)
json:
[{"path": "/cont/object", ← 分割オブジェクトのパス
"etag": "etagoftheobjectsegment", ← オブジェクトのMD5ハッシュ値
"size_bytes": 1048576}, ←オブジェクトのサイズ ...]
curl -i -X PUT \
-H "Accept: application/json" \
-H "X-Auth-Token: 2c6f2de2126a4102b38368c32e7043db" \
-d '[{"path" : "slo_container_segments/segment_6000M_file_aa", "etag": "62faa641bcc02a5a04238191a4848383", "size_bytes": 1048576000},
{"path" : "slo_container_segments/segment_6000M_file_ab", "etag": "0473f527ee1d85eb279074ab9c7abf0c", "size_bytes": 1048576000},
{"path" : "slo_container_segments/segment_6000M_file_ac", "etag": "1772c18a2477df7d228f5e0a4a9f7e1d", "size_bytes": 1048576000},
{"path" : "slo_container_segments/segment_6000M_file_ad", "etag": "6b1511af893f7f10076bf2df578d9750", "size_bytes": 1048576000},
{"path" : "slo_container_segments/segment_6000M_file_ae", "etag": "b32690b420990c423d08a03460f2d198", "size_bytes": 1048576000},
{"path" : "slo_container_segments/segment_6000M_file_af", "etag": "c9cabb22f216a234ceec20fe29273df6", "size_bytes": 1048576000}]' \
https://object-storage.tyo1.cloud.z.com/v1/nc_cc54f7476b8e444bad238a943a94ccdf/slo_container/6000M_file?multipart-manifest=put