PutContainer
    • PDF

    PutContainer

    • PDF

    Article Summary

    概要

    コンテナ(バケット)を作成します。

    構文

    PUT /v1/AUTH_{project_id}/{container}
    

    リクエスト

    NameInTypeDescription
    project_idpathstringプロジェクトIDを入力します。
    containerpathstring作成するコンテナ(バケット)名を入力します。最小3文字以上、最大30文字までのみ入力できます。slash(/)が含まれたら{container}/{object}に認識するので注意が必要
    X-Auth-Token (Optional)headerstring発行したToken値を入力します。
    X-Container-Read (Optional)headerstring該当コンテナのREAD ACLです。
    X-Container-Write (Optional)headerstring該当コンテナのWRITE ACLです。
    X-Container-Sync-Key (Optional)headerstringnot supported
    X-Container-Sync-To (Optional)headerstringnot supported
    X-Versions-Location (Optional)headerstringnot supported
    X-History-Location (Optional)headerstringnot supported
    X-Container-Meta-name (Optional)headerstring該当コンテナ(バケット)のメタデータを設定します。ヘッダ名のname 部分がメタデータのキーの役割をします。追加、アップデート、削除が可能であり、削除は空の値でリクエストすれば実行されます。
    X-Container-Meta-Access-Control-Allow-Origin (Optional)headerstringCORS
    X-Container-Meta-Access-Control-Max-Age (Optional)headerstringCORS
    X-Container-Meta-Access-Control-Expose-Headers (Optional)headerstringCORS
    X-Container-Meta-Quota-Bytes (Optional)headerstring該当コンテナ(バケット)の容量制限値を入力します。 (bytes)容量制限を超えてから制限します。
    X-Container-Meta-Quota-Count (Optional)headerstring該当コンテナ(バケット)のオブジェクト数の制限値を入力します。
    X-Container-Meta-Temp-URL-Key (Optional)headerstringtemporary URLのためのSecret Key値を入力します。
    X-Container-Meta-Temp-URL-Key-2 (Optional)headerstringtemporary URLのための2番目のSecret Key値を入力します。

    レスポンス

    NameInTypeDescription
    Dateheaderstring該当リクエストのレスポンス時間です。 (UTC)
    Content-Lengthheaderstringレスポンス結果の長さです。 (Bytes)
    Content-Type (Optional)headerstringレスポンス結果のMIMEタイプです。
    X-Trans-Idheaderstring該当リクエストのトランザクションIDです。
    X-Openstack-Request-Idheaderstring該当リクエストのトランザクションIDです。(X-Trans-Idと同じです。)

    例示

    リクエスト例示(コンテナ作成)

    curl -i -X PUT -H "X-Auth-Token: $token" https://kr.archive.ncloudstorage.com/v1/AUTH_{project_id}/{container}
    

    レスポンス例示

    HTTP/1.1 201 Created
    Content-Length: 0
    Content-Type: text/html; charset=UTF-8
    X-Trans-Id: txa8b5404ac864437293727-005b9878d1
    X-Openstack-Request-Id: txa8b5404ac864437293727-005b9878d1
    Date: Wed, 12 Sep 2018 02:24:17 GMT
    

    リクエスト例示(コンテナ作成、メタデータ含む)

    curl -i -X PUT -H "X-Auth-Token: $token" -H "X-Container-Meta-Book: ncloud-book" -H "X-Container-Meta-Subject: ncloud-test-subject" https://kr.archive.ncloudstorage.com/v1/AUTH_{project_id}/{container}
    

    レスポンス例示

    HTTP/1.1 201 Created
    Content-Length: 0
    Content-Type: text/html; charset=UTF-8
    X-Trans-Id: tx8282719a30554e2b8e0c7-005b987946
    X-Openstack-Request-Id: tx8282719a30554e2b8e0c7-005b987946
    Date: Wed, 12 Sep 2018 02:26:14 GMT
    

    リクエスト例示(コンテナ作成、ACL含む)

    curl -i -X PUT -H "X-Auth-Token: $token" -H "X-Container-Read: .r:* https://kr.archive.ncloudstorage.com/v1/AUTH_{project_id}/{container}
    

    レスポンス例示

    HTTP/1.1 201 Created
    Content-Length: 0
    Content-Type: text/html; charset=UTF-8
    X-Trans-Id: tx691a8ed48a3f4152ae904-005b98799c
    X-Openstack-Request-Id: tx691a8ed48a3f4152ae904-005b98799c
    Date: Wed, 12 Sep 2018 02:27:41 GMT
    

    リクエストが成功するとCreated (201), Accepted (202)ステータスコードをレスポンスします。
    Accepted (202)である場合は既に該当コンテナ(バケット)が存在し、メタデータなどを変更する時に発生します。
    コンテナ(バケット)が存在しない場合はNot Found (404)ステータスコードをレスポンスします。


    この記事は役に立ちましたか?

    What's Next
    Changing your password will log you out immediately. Use the new password to log back in.
    First name must have atleast 2 characters. Numbers and special characters are not allowed.
    Last name must have atleast 1 characters. Numbers and special characters are not allowed.
    Enter a valid email
    Enter a valid password
    Your profile has been successfully updated.