GetContainer
    • PDF

    GetContainer

    • PDF

    Article Summary

    개요

    컨테이너(버킷)에 속한 오브젝트 목록과 컨테이너(버킷)의 메타데이터를 조회합니다.

    구문

    GET /v1/AUTH_{project_id}/{container}
    

    요청

    NameInTypeDescription
    project_idpathstring프로젝트 ID 입력
    containerpathstring컨테이너 이름 입력
    limit (Optional)queryinteger호출 결과의 최대 개수 제한
    marker (Optional)querystring특정 오브젝트 이후 목록을 가져옴
    end_marker (Optional)querystring특정 오브젝트 이전 목록을 가져옴
    prefix (Optional)querystring해당 문자열로 시작하는 오브젝트 목록 호출
    format (Optional)querystring호출 결과의 포맷 지정 (json, xml, plain)
    delimiter (Optional)querystring해당 문자열을 구분자로 사용하여, 오브젝트 목록을 계층구조로 표현 가능
    path (Optional)querystring- 해당 경로 내부의 오브젝트 목록을 보여줌
    - path 옵션보다 prefix/delimiter 옵션 권장
    X-Auth-Token (Optional)headerstring발급한 Token 값 입력
    X-Newest (Optional)headerboolean- true인 경우 모든 복제본에 대해 질의를 하고 가장 최근 복제본의 정보로 응답
    - 해당 헤더가 생략된 경우 가장 응답이 빠른 정보로 응답
    Accept (Optional)headerstring호출 결과의 포맷 지정 (application/json, application/xml, text/xml)
    X-Container-Meta-Temp-URL-Key (Optional)headerstringtemporary URL을 위한 Secret Key 값 입력
    X-Container-Meta-Temp-URL-Key-2 (Optional)headerstringtemporary URL을 위한 두 번째 Secret Key 값 입력

    응답

    NameInTypeDescription
    X-Container-Meta-nameheaderstring- 해당 컨테이너(버킷)의 메타데이터 정보
    - 헤더명의 name 부분이 메타데이터의 키 역할을 함
    Content-Lengthheaderstring응답 결과의 길이 (Bytes)
    X-Container-Object-Countheaderinteger해당 컨테이너(버킷)의 오브젝트 개수
    X-Container-Bytes-Usedheaderinteger해당 컨테이너(버킷)가 사용하는 전체 용량 크기 (Bytes)
    X-Container-Meta-Temp-URL-Key (Optional)headerstringtemporary URL을 위한 Secret Key 값
    X-Container-Meta-Temp-URL-Key-2 (Optional)headerstringtemporary URL을 위한 두 번째 Secret Key 값
    X-Container-Meta-Quota-Count (Optional)headerstring해당 컨테이너(버킷)의 오브젝트 수의 제한값
    X-Container-Meta-Quota-Bytes (Optional)headerstring해당 컨테이너(버킷)의 용량 제한값
    X-Storage-Policy (Optional)headerstring해당 컨테이너(버킷)의 storage policy 값
    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-Timestampheaderinteger해당 컨테이너(버킷)가 생성된 시각 (UNIX Time)
    X-Trans-Idheaderstring해당 요청의 트랜젝션 ID
    X-Openstack-Request-Idheaderstring해당 요청의 트랜젝션 ID (X-Trans-Id와 동일)
    Content-Typeheaderstring응답 결과의 포맷
    Dateheaderstring해당 요청의 응답 시간 (UTC)
    hashbodystring해당 오브젝트의 MD5 체크섬 값
    last_modifiedbodystring해당 오브젝트가 마지막으로 변경된 시각 (UTC)
    content_typebodystring해당 오브젝트의 타입
    bytesbodyinteger해당 오브젝트의 크기 (bytes)
    namebodystring해당 오브젝트의 이름

    예시

    요청 예시(JSON)

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

    응답 예시

    HTTP/1.1 200 OK
    Content-Length: 352
    X-Container-Object-Count: 2
    X-Timestamp: 1536631895.01856
    Accept-Ranges: bytes
    X-Storage-Policy: standard01
    Last-Modified: Tue, 11 Sep 2018 02:11:36 GMT
    X-Container-Bytes-Used: 420024
    Content-Type: application/json; charset=utf-8
    X-Trans-Id: tx6bb706abe32b4ae5a49e8-005b978263
    X-Openstack-Request-Id: tx6bb706abe32b4ae5a49e8-005b978263
    Date: Tue, 11 Sep 2018 08:52:51 GMT
    
    [
       {
          "hash":"9bd5b4f25faf491080654a34d57c3636",
          "last_modified":"2018-09-11T02:12:29.991410",
          "bytes":210012,
          "name":"ncloud-test-object-0.txt",
          "content_type":"text/plain"
       },
       {
          "hash":"9bd5b4f25faf491080654a34d57c3636",
          "last_modified":"2018-09-11T02:12:29.992600",
          "bytes":210012,
          "name":"ncloud-test-object-1.txt",
          "content_type":"text/plain"
       }
    ]
    

    요청 예시(XML)

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

    응답 예시

    HTTP/1.1 200 OK
    Content-Length: 520
    X-Container-Object-Count: 2
    X-Timestamp: 1536631895.01856
    Accept-Ranges: bytes
    X-Storage-Policy: standard01
    Last-Modified: Tue, 11 Sep 2018 02:11:36 GMT
    X-Container-Bytes-Used: 420024
    Content-Type: application/xml; charset=utf-8
    X-Trans-Id: txfff4e8574d7e43f38b8e8-005b9782ef
    X-Openstack-Request-Id: txfff4e8574d7e43f38b8e8-005b9782ef
    Date: Tue, 11 Sep 2018 08:55:11 GMT
    
    <?xml version="1.0" encoding="UTF-8"?>
    <container name="ncloud-container-0">
       <object>
          <name>ncloud-test-object-0.txt</name>
          <hash>9bd5b4f25faf491080654a34d57c3636</hash>
          <bytes>210012</bytes>
          <content_type>text/plain</content_type>
          <last_modified>2018-09-11T02:12:29.991410</last_modified>
       </object>
       <object>
          <name>ncloud-test-object-1.txt</name>
          <hash>9bd5b4f25faf491080654a34d57c3636</hash>
          <bytes>210012</bytes>
          <content_type>text/plain</content_type>
          <last_modified>2018-09-11T02:12:29.992600</last_modified>
       </object>
    </container>
    

    요청이 성공하게 되면 OK (200), No Content (204) 상태 코드를 응답합니다.
    No Content (204)인 경우는 Content-Type이 plain 이고 요청에 해당되는 내용이 없는 경우 발생합니다.
    컨테이너(버킷)이 존재하지 않는 경우는 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.