3.7. Container Metadata and Deleting Containers

You can get at container metadata directly simply by appending the name of the container to a HEAD request:

 

Example 3.11. cURL List Container Metadata

curl –X HEAD -i \
    -H "X-Auth-Token: fc81aaa6-98a1-9ab0-94ba-aba9a89aa9ae" \
    https://storage.swiftdrive.com/v1/CF_xer7_343/dogs
            
				
HTTP/1.1 204 No Content
X-Container-Object-Count: 0
X-Container-Bytes-Used: 0
Accept-Ranges: bytes   
X-Trans-Id: tx3dd984f9482341dd97546e9d49d65e90
Content-Length: 0
Date: Mon, 07 Nov 2011 20:39:41 GMT

		

Not very exciting without any objects in the container, but you get the idea. While you cannot update or delete container metadata, you can delete a container:

 

Example 3.12. cURL Delete Storage Container

curl –X DELETE -i \
    -H "X-Auth-Token: fc81aaa6-98a1-9ab0-94ba-aba9a89aa9ae" \
    https://storage.swiftdrive.com/v1/CF_xer7_343/george
            
				
HTTP/1.1 204 No Content
Content-Length: 0
Content-Type: text/html; charset=UTF-8
X-Trans-Id: tx3fa3857f266f44319d9b8f4bf7ce7fc8
Date: Mon, 07 Nov 2011 20:42:58 GMT

			

Then let's confirm the delete by listing the containers again:

 

Example 3.13. cURL List Containers After a Delete

curl –X GET -i \
    -H "X-Auth-Token: fc81aaa6-98a1-9ab0-94ba-aba9a89aa9ae" \
    https://storage.swiftdrive.com/v1/CF_xer7_343
            
				
HTTP/1.1 200 OK
X-Account-Object-Count: 0
X-Account-Bytes-Used: 0
X-Account-Container-Count: 4
Accept-Ranges: bytes
Content-Length: 24
Content-Type: text/plain; charset=utf-8
X-Trans-Id: tx2475741852b849ce9403e382fe3f8015
Date: Mon, 07 Nov 2011 20:43:08 GMT

cosmo
dogs
elaine
jerry

			



loading table of contents...