~annegentle/openstack-devel/working

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html
  PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:exsl="http://exslt.org/common" xmlns:ng="http://docbook.org/docbook-ng" xmlns:db="http://docbook.org/ns/docbook"><head>
<meta http-equiv="X-UA-Compatible" content="IE=7"/>
<title>Storage Container Services</title><meta name="generator" content="DocBook XSL Stylesheets V1.76.1"/><link rel="home" href="index.html" title="OpenStack Object Storage Developer Guide"/><link rel="up" href="ch03.html" title="Chapter 3. API Operations for Storage Services"/><link rel="prev" href="ch03s01.html" title="Storage Account Services"/><link rel="next" href="ch03s03.html" title="Storage Object Services"/><meta http-equiv="Content-Type" content="text/html; charset=utf-8"/><script type="text/javascript">
            //The id for tree cookie
            var treeCookieId = "treeview-2458";
            var language = "en";
            var w = new Object();
            //Localization
            txt_filesfound = 'Results';
            txt_enter_at_least_1_char = "You must enter at least one character.";
            txt_browser_not_supported = "Your browser is not supported. Use of Mozilla Firefox is recommended.";
            txt_please_wait = "Please wait. Search in progress...";
            txt_results_for = "Results for: ";
        </script><style type="text/css">
            input {
            margin-bottom: 5px;
            margin-top: 2px;
            }

            .folder {
            display: block;
            height: 22px;
            padding-left: 20px;
            background: transparent url(../common/jquery/treeview/images/folder.gif) 0 0px no-repeat;
            }
            
        </style><link rel="shortcut icon" href="../favicon.ico" type="image/x-icon"/><link rel="stylesheet" type="text/css" href="../common/css/positioning.css"/><link rel="stylesheet" type="text/css" href="../common/jquery/theme-redmond/jquery-ui-1.8.2.custom.css"/><link rel="stylesheet" type="text/css" href="../common/jquery/treeview/jquery.treeview.css"/><script type="text/javascript" src="../common/jquery/jquery-1.4.2.min.js"><!----></script><script type="text/javascript" src="../common/jquery/jquery-ui-1.8.2.custom.min.js"><!----></script><script type="text/javascript" src="../common/jquery/jquery.cookie.js"><!----></script><script type="text/javascript" src="../common/jquery/treeview/jquery.treeview.min.js"><!----></script><script type="text/javascript" src="search/htmlFileList.js"><!----></script><script type="text/javascript" src="search/htmlFileInfoList.js"><!----></script><script type="text/javascript" src="search/nwSearchFnt.js"><!----></script><script type="text/javascript" src="search/stemmers/en_stemmer.js"/><script type="text/javascript" src="search/index-1.js"><!----></script><script type="text/javascript" src="search/index-2.js"><!----></script><script type="text/javascript" src="search/index-3.js"><!----></script></head><body><div id="header"><img src="../common/images/openstack-logo.png" alt="OpenStack Documentation" width="157" height="47"/><p class="breadcrumbs"><a href="#">OpenStack Manuals</a><a href="#">Object Storage</a></p><h1>Storage Container Services<br/>Chapter 3. API Operations for Storage Services</h1><div id="navheader" align="right"><!----><table class="navLinks"><tr><td><a id="showHideButton" onclick="showHideToc();" class="pointLeft" title="Hide TOC tree">Sidebar
                            </a></td><td><a accesskey="p" class="navLinkPrevious" href="ch03s01.html">Prev</a>
                                        |
                                        <a accesskey="u" class="navLinkUp" href="ch03.html">Up</a>
                                    |
                                    <a accesskey="n" class="navLinkNext" href="ch03s03.html">Next</a></td></tr></table></div></div><div id="content"><!----><div class="section" title="Storage Container Services"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="d5e395"/>Storage Container Services</h2></div></div></div>
        
        <p>This section documents the ReST operations that can be performed on containers. All
          operations are valid HTTP request methods and will resemble this format:</p>
        <div class="example"><a id="d5e398"/><p class="title"><strong>Example 3.11. Storage Container HTTP Request: General Structure</strong></p><div class="example-contents">
          
          <pre class="literallayout">
  METHOD /v1/&lt;account&gt;/&lt;container&gt; HTTP/1.1
                </pre>
        </div></div><br class="example-break"/>
 <div class="section" title="List Objects"><div class="titlepage"><div><div><h3 class="title"><a id="d5e401"/>List Objects</h3></div></div></div>
          
          <p><span class="command"><strong>GET</strong></span> operations against a storage container name are performed to
            retrieve a list of objects stored in the container. Additionally, there are a number of
            optional query parameters that can be used to refine the list results.</p>
          <p>A request with no query parameters will return the full list of object names stored
            in the container, up to 10,000 names. Optionally specifying the query parameters will
            filter the full list and return a subset of objects.</p>
          <div class="variablelist" title="Query Parameters"><p class="title"><strong>Query Parameters</strong></p><dl><dt><span class="term"><code class="code">limit</code></span></dt><dd>
                <p>For an integer value 
                    <span class="mathphrase"><span class="emphasis"><em>n</em></span></span>
                  , limits the number of results to at most 
                    <span class="mathphrase"><span class="emphasis"><em>n</em></span></span>
                   values.</p>
              </dd><dt><span class="term"><code class="code">marker</code></span></dt><dd>
                <p>Given a string value 
                    <span class="mathphrase"><span class="emphasis"><em>x</em></span></span>
                  , return object names greater in value than the specified
                  marker.</p>
              </dd><dt><span class="term"><code class="code">prefix</code></span></dt><dd>
                <p>For a string value 
                    <span class="mathphrase"><span class="emphasis"><em>x</em></span></span>
                  , causes the results to be limited to object names beginning with
                  the substring 
                    <span class="mathphrase"><span class="emphasis"><em>x</em></span></span>
                  .</p>
              </dd><dt><span class="term"><code class="code">format</code></span></dt><dd>
                <p>Specify either <code class="code">json</code> or <code class="code">xml</code> to return the respective
                  serialized response.</p>
              </dd><dt><span class="term"><code class="code">path</code></span></dt><dd>
                <p>For a string value 
                    <span class="mathphrase"><span class="emphasis"><em>x</em></span></span>
                  , return the object names nested in the pseudo path (assuming
                  preconditions are met - see below).</p>
              </dd><dt><span class="term"><code class="code">delimiter</code></span></dt><dd>
                <p>For a character 
                    <span class="mathphrase"><span class="emphasis"><em>c</em></span></span>
                  , return all the object names nested in the container (without
                  the need for the directory marker objects).</p>
              </dd></dl></div>
          <div class="example"><a id="d5e461"/><p class="title"><strong>Example 3.12. Objects List Request</strong></p><div class="example-contents">
            
            <pre class="literallayout">
  GET /&lt;api version&gt;/&lt;account&gt;/&lt;container&gt;[?parm=value] HTTP/1.1
  Host: storage.swiftdrive.com
  X-Auth-Token: eaaafd18-0fed-4b3a-81b4-663c99ec1cbb
                    </pre>
          </div></div><br class="example-break"/>
          <p>A list of objects is returned in the response body, one object name per line. A 204
            (No Content) HTTP return code will be passed back if the container is empty or does not
            exist for the specified account. If an incorrect account is specified, the HTTP return
            code will be 404 (Not Found).</p>
          <div class="example"><a id="d5e465"/><p class="title"><strong>Example 3.13. Objects List Response</strong></p><div class="example-contents">
            
            <pre class="literallayout">
  HTTP/1.1 200 Ok
  Date: Thu, 07 Jun 2010 18:50:19 GMT
  Server: Apache
  Content-Type: text/plain; charset=UTF-8
  Content-Length: 171
                    </pre>
            <pre class="literallayout">
  kate_beckinsale.jpg
  How To Win Friends And Influence People.pdf
  moms_birthday.jpg
  poodle_strut.mov
  Disturbed - Down With The Sickness.mp3
  army_of_darkness.avi
  the_mad.avi
                    </pre>
          </div></div><br class="example-break"/>
          <div class="section" title="Serialized List Output"><div class="titlepage"><div><div><h4 class="title"><a id="d5e469"/>Serialized List Output</h4></div></div></div>
            
            <p>If a <code class="code">format=xml</code> or <code class="code">format=json</code> argument is appended to
            the storage account URL, the service will serve extended object information serialized
            in the chosen format. Other than the <code class="code">?format=xml|json</code> param, it will return
            the same status/errors codes. The sample responses below are formatted for
            readability.</p>
            <div class="example"><a id="d5e475"/><p class="title"><strong>Example 3.14. Objects Details Request: JSON </strong></p><div class="example-contents">
              
              <pre class="literallayout">
  GET /&lt;api version&gt;/&lt;account&gt;/&lt;container&gt;?format=json HTTP/1.1
  Host: storage.swiftdrive.com
  Content-Length: 0
  X-Storage-Token: 182f9c0af0e828cfe3281767d29d19f4
                      </pre>
            </div></div><br class="example-break"/>
            <div class="example"><a id="d5e478"/><p class="title"><strong>Example 3.15. Objects Details Response: JSON </strong></p><div class="example-contents">
              
              <pre class="literallayout">
  HTTP/1.1 200 OK
  Date: Tue, 25 Nov 2008 19:39:13 GMT
  Server: Apache
  Content-Length: 387
  Content-Type: application/json; charset=utf-8
                    </pre>
              <pre class="programlisting">
 [
   {"name":"test_obj_1",
    "hash":"4281c348eaf83e70ddce0e07221c3d28",
    "bytes":14,
    "content_type":"application\/octet-stream",
    "last_modified":"2009-02-03T05:26:32.612278"},
   {"name":"test_obj_2",
    "hash":"b039efe731ad111bc1b0ef221c3849d0",
    "bytes":64,
    "content_type":"application\/octet-stream",
    "last_modified":"2009-02-03T05:26:32.612278"},
 ]
					</pre>
            </div></div><br class="example-break"/>
            <div class="example"><a id="d5e482"/><p class="title"><strong>Example 3.16. Objects Details Request: XML</strong></p><div class="example-contents">
              
              <pre class="literallayout">
  GET /&lt;api version&gt;/&lt;account&gt;/&lt;container&gt;?format=xml HTTP/1.1
  Host: storage.swiftdrive.com
  X-Storage-Token: 182f9c0af0e828cfe3281767d29d19f4
                    </pre>
            </div></div><br class="example-break"/>
            <div class="example"><a id="d5e485"/><p class="title"><strong>Example 3.17. Objects Details Request: XML </strong></p><div class="example-contents">
              
              <pre class="literallayout">
  HTTP/1.1 200 OK
  Date: Tue, 25 Nov 2008 19:42:35 GMT
  Server: Apache
  Content-Length: 643
  Content-Type: application/xml; charset=utf-8
                    </pre>
              <pre class="programlisting">
  &lt;?xml version="1.0" encoding="UTF-8"?&gt;

  &lt;container name="test_container_1"&gt;
    &lt;object&gt;
      &lt;name&gt;test_object_1&lt;/name&gt;
      &lt;hash&gt;4281c348eaf83e70ddce0e07221c3d28&lt;/hash&gt;
      &lt;bytes&gt;14&lt;/bytes&gt;
      &lt;content_type&gt;application/octet-stream&lt;/content_type&gt;
      &lt;last_modified&gt;2009-02-03T05:26:32.612278&lt;/last_modified&gt;
    &lt;/object&gt;
    &lt;object&gt;
      &lt;name&gt;test_object_2&lt;/name&gt;
      &lt;hash&gt;b039efe731ad111bc1b0ef221c3849d0&lt;/hash&gt;
      &lt;bytes&gt;64&lt;/bytes&gt;
      &lt;content_type&gt;application/octet-stream&lt;/content_type&gt;
      &lt;last_modified&gt;2009-02-03T05:26:32.612278&lt;/last_modified&gt;
    &lt;/object&gt;
  &lt;/container&gt;
                    </pre>
            </div></div><br class="example-break"/>
          </div>
          <div class="section" title="List Large Number of Objects"><div class="titlepage"><div><div><h4 class="title"><a id="d5e489"/>List Large Number of Objects</h4></div></div></div>
            
            <p>The system will return a maximum of 10,000 object names per request. To retrieve
              subsequent object names, another request must be made with a 'marker' parameter. The
              marker indicates where the last list left off and the system will return object 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.</p>
            <p>If 10,000 is larger than desired, a 'limit' parameter may be given.</p>
            <p>If the number of object names returned equals the limit given (or 10,000 if no
              limit is given), it can be assumed there are more object names to be listed. If the
              container name list is exactly divisible by the limit, the last request will simply
              have no content.</p>
            <div class="example"><a id="d5e494"/><p class="title"><strong>Example 3.18. List Large Number of Objects</strong></p><div class="example-contents">
              
              <p>For an example, let's use a listing of five object names:</p>
              <pre class="literallayout">
  gala
  grannysmith
  honeycrisp
  jonagold
  reddelicious
                    </pre>
              <p>We'll use a limit of two to show how things work:</p>
              <pre class="literallayout">
  GET /&lt;api version&gt;/&lt;account&gt;/&lt;container&gt;?limit=2
  Host: storage.swiftdrive.com
  X-Auth-Token: eaaafd18-0fed-4b3a-81b4-663c99ec1cbb
                    </pre>
              <pre class="literallayout">
  gala
  grannysmith
                    </pre>
              <p>Since we received two items back, we can assume there are more object names to
                list. So, we make another request with a marker of the last item returned:</p>
              <pre class="literallayout">
  GET /&lt;api version&gt;/&lt;account&gt;/&lt;container&gt;?limit=2&amp;marker=grannysmith
  Host: storage.swiftdrive.com
  X-Auth-Token: eaaafd18-0fed-4b3a-81b4-663c99ec1cbb
                    </pre>
              <pre class="literallayout">
  honeycrisp
  jonagold
                    </pre>
              <p>Again we have two items returned; there may be more:</p>
              <pre class="literallayout">
  GET /&lt;api version&gt;/&lt;account&gt;/&lt;container&gt;?limit=2&amp;marker=oranges
  Host: storage.swiftdrive.com
  X-Auth-Token: eaaafd18-0fed-4b3a-81b4-663c99ec1cbb
                    </pre>
              <pre class="literallayout">
  reddelicious
                    </pre>
              <p>Now we received less than the limit number of container names, indicating that we
                have the complete list.</p>
            </div></div><br class="example-break"/>
          </div>
          <div class="section" title="Pseudo-Hierarchical Folders/Directories"><div class="titlepage"><div><div><h4 class="title"><a id="d5e508"/>Pseudo-Hierarchical Folders/Directories</h4></div></div></div>
            
            <p>You can simulate a hierarchical structure in OpenStack Object Storage by following a few
            guidelines. Object names must contain the forward slash character <code class="code">/</code> as a
            path element separator and also create <em class="firstterm">directory marker</em> objects;
            then they will be able to traverse this nested structure with the new
              <span class="emphasis"><em>path</em></span> query parameter. This can best be illustrated by
            example:</p>
            <div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3>
              <p>For the purposes of this example, the container where the objects reside is
              called <code class="code">backups</code>. All objects in this example start with a prefix of
                <code class="code">photos</code> and should <span class="strong"><strong>NOT</strong></span> be confused
              with the container name. In the example, the full URI of the <code class="code">me.jpg</code> file
              would be
                <code class="uri">https://storage.swiftdrive.com/v1/CF_xer7_343/backups/photos/me.jpg</code>
            </p>
            </div>
            <div class="example"><a id="d5e521"/><p class="title"><strong>Example 3.19. Pseudo-Hierarchical Folders/Directories</strong></p><div class="example-contents">
              
              <p>In the example, the following <span class="emphasis"><em>real</em></span> objects are uploaded to
                the storage system with names representing their full filesystem path:</p>
              <pre class="literallayout">
  photos/animals/dogs/poodle.jpg
  photos/animals/dogs/terrier.jpg
  photos/animals/cats/persian.jpg
  photos/animals/cats/siamese.jpg
  photos/plants/fern.jpg
  photos/plants/rose.jpg
  photos/me.jpg
                    </pre>
              <p>To take advantage of this feature, the <span class="emphasis"><em>directory marker</em></span>
                objects must also be created to represent the appropriate directories. The following
                additional objects need to be created. A good convention would be to create these as
                zero- or one-byte files with a Content-Type of
                <code class="code">application/directory</code>.</p>
              <pre class="literallayout">
  photos/animals/dogs
  photos/animals/cats
  photos/animals
  photos/plants
  photos
                    </pre>
              <p>Now issuing a <span class="command"><strong>GET</strong></span> request against the container name coupled with
                the <code class="code">path</code> query parameter of the directory to list can traverse these
                  <span class="emphasis"><em>directories</em></span>. Only the request line and results are depicted
                below excluding other request/response headers.</p>
              <pre class="literallayout">
  GET /v1/AccountString/backups?path=photos HTTP/1.1
  Host: storage.swiftdrive.com
  X-Auth-Token: eaaafd18-0fed-4b3a-81b4-663c99ec1cbb
                    </pre>
              <pre class="literallayout">
  photos/animals
  photos/cats
  photos/me.jpg
                    </pre>
              <p>To traverse down into the <code class="code">animals</code> directory, specify that
                path.</p>
              <pre class="literallayout">
  GET /v1/AccountString/backups?path=photos/animals
  Host: storage.swiftdrive.com
  X-Auth-Token: eaaafd18-0fed-4b3a-81b4-663c99ec1cbb
                    </pre>
              <pre class="literallayout">
  photos/animals/dogs
  photos/animals/cats
                    </pre>
            </div></div><br class="example-break"/>
            <p>By combining this <code class="code">path</code> query parameter with the <code class="code">format</code>
              query parameter, users will be able to easily distinguish between virtual
              folders/directories by Content-Type and build interfaces that allow traversal of the
              pseudo-nested structure.</p>
            <p>You can also use a delimiter parameter to represent a nested directory
              hierarchy without the need for the directory marker objects. You can use any single
              character as a delimiter. The listings can return virtual directories - they are
              virtual in that they don't actually represent real objects. like the directory
              markers, though, they will have a content-type of application/directory and be in a
              subdir section of json and xml results.</p>
            <p>If you have the following objects—photos/photo1, photos/photo2,
              movieobject, videos/movieobj4—in a container, your delimiter parameter query using slash (/) would
              give you photos, movieobject,
              videos.</p>
              <pre class="literallayout">
GET /v1/acct/container?delimiter=/
Host: storage.swiftdrive.com
X-Auth-Token: eaaafd18-0fed-4b3a-81b4-663c99ec1cbb
              </pre>
          </div>
        </div>
        <div class="section" title="Create Container"><div class="titlepage"><div><div><h3 class="title"><a id="d5e546"/>Create Container</h3></div></div></div>
        
          <p><span class="command"><strong>PUT</strong></span> operations against a storage container are used to create that
            container.</p>
          <p>Containers are storage compartments for your data. The URL encoded name must be less
            than 256 bytes and cannot contain a forward slash '/' character.</p>
          <div class="example"><a id="d5e551"/><p class="title"><strong>Example 3.20. Container Create Request </strong></p><div class="example-contents">
            
            <pre class="literallayout">
  PUT /&lt;api version&gt;/&lt;account&gt;/&lt;container&gt; HTTP/1.1
  Host: storage.swiftdrive.com
  X-Auth-Token: eaaafd18-0fed-4b3a-81b4-663c99ec1cbb
                    </pre>
          </div></div><br class="example-break"/>
          <p>No content is returned. A status code of 201 (Created) indicates that the container
            was created as requested. Container <span class="command"><strong>PUT</strong></span> requests are idempotent and a code
            of 202 (Accepted) is returned when the container already existed.</p>
          <div class="example"><a id="d5e556"/><p class="title"><strong>Example 3.21. Container Create Response</strong></p><div class="example-contents">
            
            <pre class="literallayout">
  HTTP/1.1 201 Created
  Date: Thu, 07 Jun 2010 18:50:19 GMT
  Server: Apache
  Content-Type: text/plain; charset=UTF-8
                    </pre>
          </div></div><br class="example-break"/>
        </div>
        <div class="section" title="Delete Container"><div class="titlepage"><div><div><h3 class="title"><a id="d5e559"/>Delete Container</h3></div></div></div>
          
          <p><span class="command"><strong>DELETE</strong></span> operations against a storage container are used to permanently
            remove that container. The container must be empty before it can be deleted.</p>
          <p>A <code class="code">HEAD</code> request against the container can be used to determine if it
            contains any objects.</p>
          <div class="example"><a id="d5e565"/><p class="title"><strong>Example 3.22. Container Delete Request</strong></p><div class="example-contents">
            
            <pre class="literallayout">
  DELETE /&lt;api version&gt;/&lt;account&gt;/&lt;container&gt; HTTP/1.1
  Host: storage.swiftdrive.com
  X-Auth-Token: eaaafd18-0fed-4b3a-81b4-663c99ec1cbb
                    </pre>
          </div></div><br class="example-break"/>
          <p>
            <span class="italic">'Response '</span>
          </p>
          <p>No content is returned. A status code of 204 (No Content) indicates success, 404
            (Not Found) is returned if the requested container was not found, and a 409 (Conflict)
            if the container is not empty. No response body will be generated.</p>
          <div class="example"><a id="d5e571"/><p class="title"><strong>Example 3.23. Container Delete Response</strong></p><div class="example-contents">
            
            <pre class="literallayout">
  HTTP/1.1 204 No Content
  Date: Thu, 07 Jun 2010 18:57:07 GMT
  Server: Apache
  Content-Length: 0
  Content-Type: text/plain; charset=UTF-8
                    </pre>
          </div></div><br class="example-break"/>
        </div>
        <div class="section" title="Retrieve Container Metadata"><div class="titlepage"><div><div><h3 class="title"><a id="d5e574"/>Retrieve Container Metadata</h3></div></div></div>
          
          <p><code class="code">HEAD</code> operations against a storage
          container are used to determine the number of objects, and
          the total bytes of all objects stored in the
          container. 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.</p>
          <div class="example"><a id="d5e578"/><p class="title"><strong>Example 3.24. Container Metadata Request</strong></p><div class="example-contents">
            
            <pre class="literallayout">
  HEAD /&lt;api version&gt;/&lt;account&gt;/&lt;container&gt; HTTP/1.1
  Host: storage.swiftdrive.com
  X-Auth-Token: eaaafd18-0fed-4b3a-81b4-663c99ec1cbb
                    </pre>
          </div></div><br class="example-break"/>
          <p>The HTTP return code will be 204 (No Content) if the container exists, and 404 (Not
            Found) if it does not. The object count and utilization are returned in the
              <code class="code">X-Container-Object-Count</code> and <code class="code">X-Container-Bytes-Used</code> headers
            respectively.</p>
          <div class="example"><a id="d5e584"/><p class="title"><strong>Example 3.25. Container Metadata Response</strong></p><div class="example-contents">
            
            <pre class="literallayout">
  HTTP/1.1 204 No Content
  Date: Wed, 11 Jul 2010 19:37:41 GMT
  Content-type: text/html
  X-Container-Object-Count: 7
  X-Container-Bytes-Used: 413
                    </pre>
          </div></div><br class="example-break"/>
        </div>
      </div><script type="text/javascript" src="../common/main.js"><!----></script><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ch03s01.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="ch03.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="ch03s03.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top"> </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> </td></tr></table></div></div><div><div id="leftnavigation" style="padding-top:3px; background-color:white;"><div id="tabs"><ul><li><a href="#treeDiv"><span class="contentsTab">Contents</span></a></li><li><a href="#searchDiv"><span class="searchTab">Search</span></a></li></ul><div id="treeDiv"><img src="../common/images/loading.gif" alt="loading table of contents..." id="tocLoading" style="display:block;"/><div id="ulTreeDiv" style="display:none"><ul id="tree" class="filetree"><li><span class="file"><a href="ch01.html">Overview</a></span><ul><li><span class="file"><a href="ch01s01.html">Intended Audience</a></span></li><li><span class="file"><a href="ch01s02.html">Document Change History</a></span></li><li><span class="file"><a href="ch01s03.html">Additional Resources</a></span></li></ul></li><li><span class="file"><a href="ch02.html">General API Information</a></span><ul><li><span class="file"><a href="ch02s01.html">Authentication</a></span><ul><li><span class="file"><a href="ch02s01.html#d5e215">Request</a></span></li><li><span class="file"><a href="ch02s01.html#d5e230">Response</a></span></li></ul></li><li><span class="file"><a href="ch02s02.html">Overview of API Operations</a></span></li></ul></li><li><span class="file"><a href="ch03.html">API Operations for Storage Services</a></span><ul><li><span class="file"><a href="ch03s01.html">Storage Account Services</a></span><ul><li><span class="file"><a href="ch03s01.html#d5e301">List Containers</a></span><ul><li><span class="file"><a href="ch03s01.html#d5e344">Serialized List Output</a></span></li><li><span class="file"><a href="ch03s01.html#d5e363">List Large Number of Containers</a></span></li></ul></li><li><span class="file"><a href="ch03s01.html#d5e382">Retrieve Account Metadata</a></span></li></ul></li><li id="webhelp-currentid"><span class="file"><a href="ch03s02.html">Storage Container Services</a></span><ul><li><span class="file"><a href="ch03s02.html#d5e401">List Objects</a></span><ul><li><span class="file"><a href="ch03s02.html#d5e469">Serialized List Output</a></span></li><li><span class="file"><a href="ch03s02.html#d5e489">List Large Number of Objects</a></span></li><li><span class="file"><a href="ch03s02.html#d5e508">Pseudo-Hierarchical Folders/Directories</a></span></li></ul></li><li><span class="file"><a href="ch03s02.html#d5e546">Create Container</a></span></li><li><span class="file"><a href="ch03s02.html#d5e559">Delete Container</a></span></li><li><span class="file"><a href="ch03s02.html#d5e574">Retrieve Container Metadata</a></span></li></ul></li><li><span class="file"><a href="ch03s03.html">Storage Object Services</a></span><ul><li><span class="file"><a href="ch03s03.html#d5e590">Retrieve Object</a></span></li><li><span class="file"><a href="ch03s03.html#d5e629">Create/Update Object</a></span><ul><li><span class="file"><a href="ch03s03.html#d5e649">Chunked Transfer Encoding</a></span></li></ul></li><li><span class="file"><a href="ch03s03.html#d5e658">Copy Object</a></span></li><li><span class="file"><a href="ch03s03.html#d5e666">Delete Object</a></span></li><li><span class="file"><a href="ch03s03.html#d5e682">Retrieve Object Metadata</a></span></li><li><span class="file"><a href="ch03s03.html#d5e694">Update Object Metadata</a></span></li></ul></li></ul></li><li><span class="file"><a href="ch04.html">Troubleshooting</a></span><ul><li><span class="file"><a href="ch04s01.html">Using cURL</a></span><ul><li><span class="file"><a href="ch04s01.html#d5e741">Authentication</a></span></li><li><span class="file"><a href="ch04s01.html#d5e761">Determining Storage Usage</a></span></li><li><span class="file"><a href="ch04s01.html#d5e778">Creating a Storage Container</a></span></li><li><span class="file"><a href="ch04s01.html#d5e793">Uploading a Storage Object</a></span></li><li><span class="file"><a href="ch04s01.html#d5e812">CDN-Enabling the Container</a></span></li><li><span class="file"><a href="ch04s01.html#d5e846">Other cURL Commands</a></span></li></ul></li></ul></li></ul></div></div><div id="searchDiv"><div id="search"><form onsubmit="Verifie(ditaSearch_Form);return false" name="ditaSearch_Form" class="searchForm"><fieldset class="searchFieldSet"><legend>Search</legend><center><input id="textToSearch" name="textToSearch" type="text" class="searchText"/> &nbsp; <input onclick="Verifie(ditaSearch_Form)" type="button" class="searchButton" value="Go" id="doSearch"/></center></fieldset></form></div><div id="searchResults"><center/></div><p class="searchHighlight"><a href="#" onclick="toggleHighlight()">Search Highlighter (On/Off)</a></p></div></div></div></div></body></html>