COPY'> GET'> HEAD'> PUT'> POST'> DELETE'> '> '> ]>
Storage Account Services Perform the following operations at the account level of the URL: Verb URI Description &GET; /account Lists containers. &HEAD; /account Gets account metadata. &POST; /account Creates or updates account metadata. &POST; /account Deletes account metadata. Optional headers for HEAD and GET X-Newest Set the optional X-newest header to True in HEAD and GET requests to have Object Storage return the latest version of the account. If set to True, Object Storage queries all replicas to return the most recent one. Without this header, Object Storage responds faster after it finds one valid replica. Because setting this header to True is more expensive for the back end, use it only when it is absolutely needed. For example, the URL for the requests end with the OpenStack Object Storage account string, as follows: Storage Account Services HTTP Request
List Containers &GET; operations against the X-Storage-Url for an account are performed to list storage containers sorted by name. The sort order for the name is based on a binary comparison, a single built-in collating sequence that compares string data by using the SQLite memcmp() function, regardless of text encoding. The following list describes the optional query parameters that are supported with this request. Query Parameters limit For an integer value n , limits the number of results to n values. marker Given a string value x , return container names greater in value than the specified marker. end_marker Given a string value x , return container names less in value than the specified marker. format Specify either json or xml to return the respective serialized response. At this time, a prefix query parameter is not supported at the account level. List Containers HTTP Request A list of containers is returned in the response body, one container per line. The HTTP response's status code will be 2xx (between 200 and 299, inclusive). List Containers HTTP Response
Serialized List Output If a format=xml or format=json argument is appended to the storage account URL, the service serves extended container information serialized in the chosen format. The sample responses are formatted for readability. The following HTTP request asks for a JSON response, so the response returns an HTTP header and a JSON response. Get Containers Details HTTP and JSON Request Get Containers Details HTTP and JSON Response The following HTTP request asks for an XML response, so the response returns an HTTP header and an XML response. Containers Details HTTP and XML Request Containers Details HTTP and XML Response
Controlling a Large List of Containers The system returns a maximum of 10,000 container names per request. To retrieve subsequent container names, another request must be made with the 'marker' parameter. The marker indicates where the last list left off; the system returns container names greater than this marker, up to 10,000 again. Note that the ‘marker’ value should be URL-encoded prior to sending the HTTP request. If 10,000 is larger than desired, use the 'limit' parameter. If the number of container names returned equals the limit given (or 10,000 if no limit is given), you may assume there are more container names. List Large Number of Containers For example, let's use a listing of five container names: apples bananas kiwis oranges pears We'll use a limit of two to show how things work: apples bananas Because we received two items back, we can assume there are more container names to list, so we make another request with a marker of the last item returned: kiwis oranges Again, two items are returned; there might be more: pears With this one-item response we received less than the limit number of container names, indicating that this is the end of the list. By using end_marker we can limit the result set to container names less than the given value. apples bananas kiwis
Get Account Metadata &HEAD; operations against an account are performed to retrieve the number of containers and the total bytes stored in OpenStack Object Storage for the account. This information is returned in two custom headers, X-Account-Container-Count and X-Account-Bytes-Used. Since the storage system is designed to store large amounts of data, care should be taken when representing the total bytes response as an integer; when possible, convert it to a 64-bit unsigned integer if your platform supports that primitive type. Get Account Metadata HTTP Request The HTTP return code will be 2xx (between 200 and 299, inclusive) if the request succeeds. A 401 (Unauthorized) will be returned for an invalid account or access key. Get Account Metadata HTTP Response
Create or Update Account Metadata You can associate custom metadata headers with the account level URI. These headers must take the format X-Account-Meta-*. To create or update an account metadata header use the &POST; query. Subsequent requests for the same key/value pair overwrite the previous value. Update Account Metadata HTTP Request No response body is returned. A status code of 2xx (between 200 and 299, inclusive) indicates success. Update Account Metadata HTTP Response To confirm your metadata changes, perform a &HEAD; request on the account. Do not send the metadata in your &HEAD; request. View Account Metadata HTTP Request View Account Metadata HTTP Response
Delete Account Metadata To delete a metadata header, send an empty value for that particular header, such as for the X-Account-Meta-Book header. If the tool you use to communicate with Object Storage, such as older versions of cURL, does not support empty headers, send the X-Remove-Account-Meta-name: arbitrary value header. For example, X-Remove-Account-Meta-Book: x. The arbitrary value is ignored. Delete Account Metadata HTTP Request No response body is returned. A status code from 200 to 299 indicates success.