GetContainerList
  • PDF

GetContainerList

  • PDF

Overview

Searches the list of containers (buckets).

Statement

GET https://{endpoint}/swift/v1

Request

Request header

Header name Description
x-ncp-apigw-timestamp This is the number of milliseconds that have elapsed since January 1, 1970 00:00:00 UTC.
If the time difference compared to the API Gateway server is more than 5 minutes, then the request is considered invalid.
x-ncp-iam-access-key This is the access key ID issued by the NCP portal or Sub Account.
x-ncp-apigw-signature-v2 Signature used to encrypt the body of the above example with the SecretKey that maps with the access key ID.
The HMAC encryption algorithm is HMACSHA256.
x-ncp-region_code The region code of where the bucket of the data to be migrated from another cloud to NAVER Cloud is located

Request parameter

Parameter name Requirement status Type Restrictions Description
limit (Optional) - integer - Maximum limit for the number of call results
marker (Optional) - string - Gets the list after a specific container
end_marker (Optional) - string - Gets the list before a specific container
prefix (Optional) - string - Calls the container list starting with the string
reverse (Optional) - string - Prints the list sorted by the container name
Default: false (descending)

Response

Response header

Name In Type Description
X-Account-Meta-name header string - Metadata information for the account
- The name part of the header name serves as the metadata's key.
Content-Length header string Length of the response result (bytes)
X-Container-Object-Count header integer Number of objects in the container (bucket)
X-Container-Bytes-Used header integer Total capacity size used by the container (bucket) (bytes)
X-Container-Meta-Temp-URL-Key (Optional) header string Secret key value for the temporary URL
X-Container-Meta-Temp-URL-Key-2 (Optional) header string Second secret key value for the temporary URL
X-Timestamp header integer Creation time of the container (bucket) (Unix time)
X-Trans-Id header string Transaction ID of the request
X-Openstack-Request-Id header string Transaction ID of the request (same as X-Trans-Id)
Content-Type header string Format of the response result
Date header string Response time of the request (UTC)
last_modified body string Time when the object was last changed (UTC)
bytes body integer Size of the object (bytes)
name body string Name of the object

Examples

Request examples (JSON)

curl -X GET "https://archivestorage.apigw.ntruss.com/swift/v1/?limit=1&marker=test" -H "accept: application/json" -H "x-ncp-region-code: {regionCode}"
-H "x-ncp-iam-access-key: {AccessKey} " 
-H "x-ncp-apigw-timestamp: {current timestamp}" 
-H "x-ncp-apigw-signature-v2: {generated signature}"

Response examples

HTTP/1.1 200 OK
Accept: application/json
connection: keep-alive
Content-Length: 2577
Keep-alive: timeout=60
X-Account-Bytes-Used: 786133
X-Account-Container-Count: 6
X-Account-Object-Count: 1
X-Timestamp: 1634538594.09393
Content-Type: application/json; charset=utf-8
X-Trans-Id: tx274a77a8975c4a66aeb24-0052d95365
X-Openstack-Request-Id: tx274a77a8975c4a66aeb24-0052d95365
Date: Mon, 18 Apr 2022 11:07:18 GMT
[
    {
	“name”: “test”,
	“count”: 0,
	“bytes”: 0,
	“last_modified”: “2022-04-20T01:10:10.123456”
	}
]

Was this article helpful?

What's Next