GetContainer
    • PDF

    GetContainer

    • PDF

    Article Summary

    Classic/VPC 환경에서 이용 가능합니다.

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

    요청

    요청 형식을 설명합니다. 요청 형식은 다음과 같습니다.

    메서드URI
    GET/v1/AUTH_{project_id}/{container}

    요청 헤더

    헤더에 대한 설명은 다음과 같습니다.

    필드타입필수 여부설명
    X-Auth-TokenStringRequired발급한 토큰(Token) 값
    X-NewestBooleanOptional가장 최근 복제본의 정보로 응답할지 여부를 설정
    • true | false
      • true: 모든 복제본에 대해 질의를 하고 가장 최근 복제본의 정보로 응답
    • 헤더가 생략된 경우, 응답이 가장 빠른 정보로 응답
    AcceptStringOptional호출 결과의 포맷 지정
    • application/json |application/xml |text/xml
    X-Account-Meta-Temp-URL-KeyStringOptionaltemporary URL을 위한 Secret Key 값
    X-Account-Meta-Temp-URL-Key-2StringOptionaltemporary URL을 위한 두 번째 Secret Key 값

    요청 경로 파라미터

    파라미터에 대한 설명은 다음과 같습니다.

    필드타입필수 여부설명
    project_idStringRequired프로젝트 ID
    containerStringRequired컨테이너(버킷) 이름

    요청 쿼리 파라미터

    파라미터에 대한 설명은 다음과 같습니다.

    필드타입필수 여부설명
    limitIntegerOptional호출 결과의 최대 개수 제한
    markerStringOptional특정 컨테이너(버킷) 이후 목록을 반환
    end_markerStringOptional특정 컨테이너(버킷) 이전 목록을 반환
    prefixStringOptional해당 문자열로 시작하는 컨테이너(버킷) 목록 반환
    formatStringOptional호출 결과의 포맷 지정 (json, xml, plain)
    delimiterStringOptional해당 문자열을 구분자로 사용하여, 컨테이너(버킷) 목록을 계층 구조로 표현
    pathStringOptional해당 경로 내부의 오브젝트 목록을 반환
    • path 옵션보다는 prefix, delimiter 옵션 권장

    요청 예시

    요청 예시는 다음과 같습니다.

    format 쿼리 파라미터 없이 요청

    format 쿼리 파라미터 없이 요청하는 예시는 다음과 같습니다.

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

    format 쿼리 파라미터를 JSON으로 요청

    format 쿼리 파라미터를 JSON으로 요청하는 예시는 다음과 같습니다.

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

    format 쿼리 파라미터를 XML로 요청

    format 쿼리 파라미터를 JSON으로 요청하는 예시는 다음과 같습니다.

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

    응답

    응답 형식을 설명합니다.

    응답 헤더

    헤더에 대한 설명은 다음과 같습니다.

    필드타입필수 여부설명
    Content-TypeString-응답 결과의 MIME 타입
    X-Container-Object-CountInteger-해당 컨테이너(버킷)의 전체 오브젝트 개수
    X-Container-Bytes-UsedInteger-해당 컨테이너(버킷)가 사용하는 전체 용량 크기(Byte)
    X-TimestampInteger-컨테이너(버킷)가 생성된 시각(Unix Timestamp)
    Last-ModifiedString-해당 컨테이너(버킷)의 가장 최근 수정 시간(UTC)
    Accept-RangesString-해당 컨테이너(버킷)가 허용하는 Range 타입
    Content-LengthString-응답 결과의 길이 (Bytes)
    X-Storage-PolicyStringOptional해당 컨테이너(버킷)의 storage policy 값
    X-Trans-IdString-해당 요청의 트랜잭션 ID
    X-Openstack-Request-IdString-해당 요청의 트랜잭션 ID
    • X-Trans-Id와 동일
    X-Container-Meta-nameString해당 컨테이너(버킷)의 메타데이터
    • 헤더명의 name 부분이 메타데이터의 키 역할을 함
    X-Container-Meta-Temp-URL-KeyStringOptionaltemporary URL을 위한 Secret Key 값
    X-Container-Meta-Temp-URL-Key-2StringOptionaltemporary URL을 위한 두 번째 Secret Key 값
    X-Container-Meta-Quota-CountStringOptional해당 컨테이너(버킷)의 오브젝트 수의 제한값
    X-Container-Meta-Quota-BytesStringOptional해당 컨테이너(버킷)의 용량 제한값
    X-Container-ReadStringOptional해당 컨테이너(버킷)의 READ ACL(접근 권한)
    X-Container-WriteStringOptional해당 컨테이너(버킷)의 WRITE ACL(접근 권한)
    X-Container-Sync-KeyStringOptional사용하지 않음
    X-Container-Sync-ToStringOptional사용하지 않음
    X-Versions-LocationStringOptional사용하지 않음
    X-History-LocationStringOptional사용하지 않음
    DateString-해당 요청의 응답 시간(UTC)

    응답 상태 코드

    응답 상태 코드에 대한 설명은 다음과 같습니다.

    HTTP 상태 코드코드메시지설명
    200-OK요청 성공
    204-No ContentContent-Type이 plain이고, 요청에 해당되는 내용이 없는 경우 발생
    404-Not Found컨테이너(버킷)이 존재하지 않는 경우 발생

    응답 구문

    응답 구문은 다음과 같습니다.

    format 쿼리 파라미터 없이 요청한 경우에는 컨테이너(버킷)에 속한 오브젝트의 이름만 plain 텍스트 포맷으로 응답합니다.

    "string"
    
    [
       {
          "hash":"string",
          "last_modified":"string",
          "bytes":"number",
          "name":"string",
          "content_type":"string"
       }
    ]
    
    <?xml version="1.0" encoding="UTF-8"?>
    <container name="string">
       <object>
          <name>"string"</name>
          <hash>"string"</hash>
          <bytes>"number"</bytes>
          <content_type>"string"</content_type>
          <last_modified>"string"</last_modified>
       </object>
    </container>
    

    응답 바디

    응답 바디에 대한 설명은 다음과 같습니다.

    필드타입필수 여부설명
    hashString-해당 오브젝트의 MD5 체크섬 값
    nameString-해당 컨테이너(버킷)의 이름
    countInteger-해당 컨테이너(버킷)에 있는 오브젝트 개수
    bytesInteger-해당 컨테이너(버킷)에 있는 전체 오브젝트의 크기(Byte)
    content_typeString-응답 결과의 MIME 타입
    last_modifiedString-최 수정 수정 일시

    응답 예시

    응답 예시는 다음과 같습니다.

    format 쿼리 파라미터 없이 요청한 경우의 응답

    format 쿼리 파라미터 없이 요청했을 때의 응답 예시는 다음과 같습니다.

    HTTP/1.1 200 OK
    Content-Length: 38
    Accept-Ranges: bytes
    X-Timestamp: 1535685069.28154
    X-Account-Bytes-Used: 0
    X-Account-Container-Count: 2
    Content-Type: text/plain; charset=utf-8
    X-Account-Object-Count: 0
    x-account-project-domain-id: default
    X-Trans-Id: tx928992622dd248ee9b3e8-005b972569
    X-Openstack-Request-Id: tx928992622dd248ee9b3e8-005b972569
    Date: Tue, 11 Sep 2018 02:16:09 GMT
    
    ncloud-test-object-0.txt
    ncloud-test-object-1.txt
    

    format 쿼리 파라미터를 JSON으로 요청한 경우의 응답

    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"
       }
    ]
    

    format 쿼리 파라미터를 XML로 요청한 경우의 응답

    format 쿼리 파라미터를 JSON으로 요청하는 예시는 다음과 같습니다.

    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>
    

    이 문서가 도움이 되었습니까?

    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.