어카운트 오퍼레이션
어카운트 및 컨테이너(버킷) 목록 조회
구문
GET /v1/AUTH_{project_id}
요청 예
curl -i -X GET -H "X-Auth-Token: $token" https://kr.archive.ncloudstorage.com/v1/AUTH_{project_id}
응답 예
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-container-0
ncloud-container-1
요청 예 (JSON)
curl -i -X GET -H "X-Auth-Token: $token" https://kr.archive.ncloudstorage.com/v1/AUTH_{project_id}?format=json
응답 예
HTTP/1.1 200 OK
Content-Length: 206
Accept-Ranges: bytes
X-Timestamp: 1535685069.28154
X-Account-Bytes-Used: 0
X-Account-Container-Count: 2
Content-Type: application/json; charset=utf-8
X-Account-Object-Count: 0
x-account-project-domain-id: default
X-Trans-Id: txddbf20f97d1043128d032-005b97260f
X-Openstack-Request-Id: txddbf20f97d1043128d032-005b97260f
Date: Tue, 11 Sep 2018 02:18:55 GMT
[
{
"count":0,
"last_modified":"2018-09-11T02:11:35.010250",
"bytes":0,
"name":"ncloud-container-0"
},
{
"count":0,
"last_modified":"2018-09-11T02:11:41.481410",
"bytes":0,
"name":"ncloud-container-1"
}
]
요청 예 (XML)
curl -i -X GET -H "X-Auth-Token: $token" https://kr.archive.ncloudstorage.com/v1/AUTH_{project_id}?format=xml
응답 예
HTTP/1.1 200 OK
Content-Length: 392
Accept-Ranges: bytes
X-Timestamp: 1535685069.28154
X-Account-Bytes-Used: 0
X-Account-Container-Count: 2
Content-Type: application/xml; charset=utf-8
X-Account-Object-Count: 0
x-account-project-domain-id: default
X-Trans-Id: tx1a6fca0d191645c186b35-005b9726d3
X-Openstack-Request-Id: tx1a6fca0d191645c186b35-005b9726d3
Date: Tue, 11 Sep 2018 02:22:11 GMT
<?xml version="1.0" encoding="UTF-8"?>
<account name="AUTH_5942771066a0482bb6aaf7f5bc792b00">
<container>
<name>ncloud-container-0</name>
<count>0</count>
<bytes>0</bytes>
<last_modified>2018-09-11T02:11:35.010250</last_modified>
</container>
<container>
<name>ncloud-container-1</name>
<count>0</count>
<bytes>0</bytes>
<last_modified>2018-09-11T02:11:41.481410</last_modified>
</container>
</account>
요청이 성공하게 되면 OK (200), No Content (204) 상태 코드를 응답합니다. No Content (204)인 경우는 Content-Type이 plain 이고, 요청에 해당되는 내용이 없는 경우 발생합니다.
요청 파라미터
Name | In | Type | Description |
---|---|---|---|
project_id (Optional) | path | string | 프로젝트 ID를 입력합니다. |
limit (Optional) | query | integer | 호출 결과의 최대 개수를 제한 합니다. |
marker (Optional) | query | string | 특정 컨테이너(버킷) 이후 목록을 가져옵니다. |
end_marker (Optional) | query | string | 특정 컨테이너(버킷) 이전 목록을 가져옵니다. |
format (Optional) | query | string | 호출 결과의 포맷을 지정합니다. (json, xml, plain) |
prefix (Optional) | query | string | 해당 문자열로 시작하는 컨테이너(버킷) 목록을 호출 합니다. |
delimiter (Optional) | query | string | 해당 문자열을 구분자로 사용하여, 컨테이버(버킷) 이름에 포함되는 경우, sub-dir 결과를 보여줍니다. |
X-Auth-Token (Optional) | header | string | 발급한 Token 값을 입력합니다. |
X-Newest (Optional) | header | boolean | true인 경우, 모든 복제본에 대해 질의를 하고 가장 최근 복제본의 정보로 응답합니다. 해당 헤더가 생략된 경우, 가장 응답이 빠른 정보로 응답합니다. |
Accept (Optional) | header | string | 호출 결과의 포맷을 지정합니다. (application/json, application/xml, text/xml) |
응답 파라미터
Name | In | Type | Description |
---|---|---|---|
Content-Length | header | string | 응답 결과의 길이입니다. (Bytes) |
X-Account-Meta-{name} (Optional) | header | string | 어카운트의 메타데이터를입니다.. 헤더명의 name 부분이 메타데이터의 키 역할을 합니다. |
X-Account-Meta-Temp-URL-Key (Optional) | header | string | temporary URL을 위한 Secret Key 값입니다. |
X-Account-Meta-Temp-URL-Key-2 (Optional) | header | string | temporary URL을 위한 두 번째 Secret Key 값입니다. |
X-Timestamp | header | integer | Account가 처음으로 생성된 시각을입니다. (UNIX Time) |
X-Trans-Id | header | string | 해당 요청의 트랜젝션 ID입니다. |
X-Openstack-Request-Id | header | string | 해당 요청의 트랜젝션 ID입니다. (X-Trans-Id와 동일합니다.) |
Date | header | string | 해당 요청의 응답 시간입니다. (UTC) |
X-Account-Bytes-Used | header | integer | 해당 어카운트가 사용하는 전체 크기입니다. (Bytes) |
X-Account-Container-Count | header | integer | 해당 어카운트에 있는 전체 컨테이너(버킷) 개수입니다. |
X-Account-Object-Count | header | integer | 해당 어카운트의 전체 오브젝트 개수입니다. |
X-Account-Storage-Policy-name-Bytes-Used | header | integer | not supported |
X-Account-Storage-Policy-name-Container-Count | header | integer | not supported |
X-Account-Storage-Policy-name-Object-Count | header | integer | not supported |
X-Account-Meta-Quota-Bytes (Optional) | header | string | 해당 어카운트의 용량 제한값입니다. (Bytes) |
Content-Type | header | string | 응답 결과의 MIME 타입입니다. (text/plain, application/json, application/xml, text/xml ) |
count | body | integer | 해당 컨테이너에 있는 오브젝트 개수입니다. |
bytes | body | integer | 해당 컨테이너에 있는 전체 오브젝트의 크기입니다. (Bytes) |
name | body | string | 해당 컨테이너의 이름입니다. |
어카운트 메타데이터 설정
구문
POST /v1/AUTH_{project_id}
POST request header contains | Result |
---|---|
요청 헤더에 어카운트 메타데이터의 값이 없고 키만 존재하며, 어카운트에 키는 이미 존재하는 경우 | API는 해당 메타데이터 아이템을 삭제합니다. |
요청 헤더에 어카운트 메타데이터의 값이 없고 키만 존재하며, 어카운트에 키가 존재 하지 않는 경우 | API는 해당 메타데이터 키를 무시합니다. |
요청 헤더에 어카운트 메타데이터의 키와 값이 모두 존재하며, 어카운트에 키가 이미 존재하는 경우 | API는 해당 메타데이터를 업데이트합니다. |
요청 헤더에 어카운트 메타데이터의 키와 값이 모두 존재하며, 어카운트에 키가 존재 하지 않는 경우 | API는 해당 메타데이터를 추가합니다. |
요청 헤더에 어카운트 메타데이터들이 생략되어 있고, 어카운트에는 이미 메타데이터들이 존재하는 경우 | API는 이미 존재하는 메타데이터를 변경하지 않습니다. |
메타데이터 헤더에 빈값을 입력하면 삭제 요청을 할 수 있지만, 헤더에 빈값 입력을 허용하지 않는 툴이 있을 수 있습니다. 이러한 경우 X-Account-Meta-{name}으로 빈값을 요청하는 대신, X-Remove-Account-Meta-{name}으로 요청하면 됩니다.
메타데이터 키는 대소문자를 구분하지 않으며, ASCII 7-bit 문자들로 구성이 가능합니다. (ASCII 0-31 문자, DEL 문자 등 제외) underscore 문자(_)는 hyphen 문자(-)로 변환됩니다. 자세한 내용은 해당 문서 참조 : HTTP/1.1
메타데이터 값은 UTF-8로 인코딩 한 다음 URL 인코딩 해야 합니다. 이는 HTTP/1.1 기본 룰의 직접적인 위반입니다.
요청 예 (메타데이터 생성)
curl -i -X POST -H "X-Auth-Token: $token" -H "X-Account-Meta-Book: ncloud-test-book" -H "X-Account-Meta-Subject: ncloud-test-subject" https://kr.archive.ncloudstorage.com/v1/AUTH_{project_id}
응답 예
HTTP/1.1 204 No Content
Content-Length: 0
Content-Type: text/html; charset=UTF-8
X-Trans-Id: txad3702ae436640d1a9897-005b975c51
X-Openstack-Request-Id: txad3702ae436640d1a9897-005b975c51
Date: Tue, 11 Sep 2018 06:10:25 GMT
요청 예 (메타데이터 수정)
curl -i -X POST -H "X-Auth-Token: $token" -H "X-Account-Meta-Subject: ncloud-test-sconedSubject" https://kr.archive.ncloudstorage.com/v1/AUTH_{project_id}
응답 예
HTTP/1.1 204 No Content
Content-Length: 0
Content-Type: text/html; charset=UTF-8
X-Trans-Id: txc5a65e1d20074023912c6-005b975c97
X-Openstack-Request-Id: txc5a65e1d20074023912c6-005b975c97
Date: Tue, 11 Sep 2018 06:11:35 GMT
요청 예 (메타데이터 삭제)
curl -i -X POST -H "X-Auth-Token: $token" -H "X-Remove-Account-Meta-Subject: x" https://kr.archive.ncloudstorage.com/v1/AUTH_{project_id}
응답 예
HTTP/1.1 204 No Content
Content-Length: 0
Content-Type: text/html; charset=UTF-8
X-Trans-Id: txf2874df785bd470eaf3b8-005b975d40
X-Openstack-Request-Id: txf2874df785bd470eaf3b8-005b975d40
Date: Tue, 11 Sep 2018 06:14:24 GMT
요청이 성공하게 되면 No Content (204) 상태 코드를 응답합니다.
요청 파라미터
Name | In | Type | Description |
---|---|---|---|
project_id (Optional) | path | string | 프로젝트 ID를 입력합니다. |
X-Auth-Token (Optional) | header | string | 발급한 Token 값을 입력합니다발급한 Token 값을 입력합니다. |
X-Account-Meta-Temp-URL-Key (Optional) | header | string | temporary URL을 위한 Secret Key 값을 입력합니다. |
X-Account-Meta-Temp-URL-Key-2 (Optional) | header | string | temporary URL을 위한 두 번째 Secret Key 값을 입력합니다. |
X-Account-Meta-{name} (Optional) | header | string | 어카운트의 메타데이터를 설정합니다. 헤더명의 name 부분이 메타데이터의 키 역할을 합니다. |
X-Remove-Account-name (Optional) | header | string | 어카운트의 메타데이터를 삭제합니다. 헤더명의 name 부분이 메타데이터의 키 역할을 합니다. |
응답 파라미터
Name | In | Type | Description |
---|---|---|---|
Date | header | string | 해당 요청의 응답 시간입니다. (UTC) |
X-Timestamp | header | integer | 어카운트가 처음으로 생성된 시각을입니다. (UNIX Time) |
Content-Length | header | string | 응답 결과의 길이입니다. 해당 요청은 Response Body의 내용이 없으므로, 요청 성공 시 0입니다. |
Content-Type (Optional) | header | string | 응답 결과의 MIME 타입입니다. |
X-Trans-Id | header | string | 해당 요청의 트랜젝션 ID입니다. |
X-Openstack-Request-Id | header | string | 해당 요청의 트랜젝션 ID입니다. (X-Trans-Id와 동일합니다.) |
어카운트 메타데이터 조회
구문
HEAD /v1/AUTH_{project_id}
요청 예
curl -i -X HEAD -H "X-Auth-Token: $token" https://kr.archive.ncloudstorage.com/v1/AUTH_{project_id}
응답 예
HTTP/1.1 204 No Content
Content-Length: 0
Accept-Ranges: bytes
X-Account-Meta-Book: ncloud-test-book
X-Timestamp: 1535685069.28154
X-Account-Bytes-Used: 420024
X-Account-Container-Count: 2
Content-Type: text/plain; charset=utf-8
X-Account-Object-Count: 2
x-account-project-domain-id: default
X-Trans-Id: tx9001d378488c4e5dbc64a-005b975d96
X-Openstack-Request-Id: tx9001d378488c4e5dbc64a-005b975d96
Date: Tue, 11 Sep 2018 06:15:50 GMT
요청 파라미터
Name | In | Type | Description |
---|---|---|---|
project_id (Optional) | path | string | 프로젝트 ID를 입력합니다. |
X-Auth-Token (Optional) | header | string | 발급한 Token 값을 입력합니다. |
X-Newest (Optional) | header | boolean | true인 경우, 모든 복제본에 대해 질의를 하고 가장 최근 복제본의 정보로 응답합니다. 해당 헤더가 생략된 경우, 가장 응답이 빠른 정보로 응답합니다. |
응답 파라미터
Name | In | Type | Description |
---|---|---|---|
Content-Length | header | string | 응답 결과의 길이입니다. 해당 요청은 Response Body의 내용이 없으므로, 요청 성공 시 0입니다. |
X-Account-Meta-name (Optional) | header | string | 해당 어카운트의 메타데이터 정보입니다. 헤더명의 name 부분이 메타데이터의 키 역할을 합니다. |
X-Account-Meta-Temp-URL-Key (Optional) | header | string | temporary URL을 위한 Secret Key 값입니다. |
X-Account-Meta-Temp-URL-Key-2 (Optional) | header | string | temporary URL을 위한 두 번째 Secret Key 값입니다. |
X-Timestamp | header | integer | 어카운트가 처음으로 생성된 시각입니다. (UNIX Time) |
X-Trans-Id | header | string | 해당 요청의 트랜젝션 ID입니다. |
X-Openstack-Request-Id | header | string | 해당 요청의 트랜젝션 ID입니다. (X-Trans-Id와 동일합니다.) |
Date | header | string | 해당 요청의 응답 시간입니다. (UTC) |
X-Account-Bytes-Used | header | integer | 해당 Account가 사용하는 전체 용량 크기입니다. (Bytes) |
X-Account-Object-Count | header | integer | 해당 Account의 전체 오브젝트 개수입니다. |
X-Account-Container-Count | header | integer | 해당 Account의 전체 컨테이너(버킷) 개수입니다. |
X-Account-Meta-Quota-Bytes (Optional) | header | string | 해당 어카운트의 용량 제한값입니다. (Bytes) |
Content-Type (Optional) | header | string | 응답 결과의 MIME 타입입니다. |