Object Store: Sub directory listing is not supported

Registered by pushpesh

Description of problem:

A Sub directory under a container can be created using the headers 'Content-Type: application/directory' and 'Content-Length: 0'. A GET request on a container results in all objects under that container,So It is a general user expectation that a GET request on the sub directory created using above headers should also list all objects under the sub directory.

However the current behaviour of object store is it just return 200 OK on a GET request on sub directory but this does not include a list of all object under that sub directory.It will be good to have this feature.

Version-Release number of selected component (if applicable):

glusterfs-openstack-swift-1.10.0-0.27.fc19.noarch

How reproducible:

Steps to Reproduce:

1. # curl -v -X PUT -H -k http://localhost:8080/v1/AUTH_test/container
* About to connect() to localhost port 8080 (#0)
* Trying 127.0.0.1... connected
* Connected to localhost (127.0.0.1) port 8080 (#0)
> PUT /v1/AUTH_test/container HTTP/1.1
> User-Agent: curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.14.3.0 zlib/1.2.3 libidn/1.18 libssh2/1.4.2
> Host: localhost:8080
> Accept: */*
>
< HTTP/1.1 201 Created
< Content-Length: 0
< Content-Type: text/html; charset=UTF-8
< X-Trans-Id: txa97163f565644d5b9f582-0052bc6acb
< Date: Thu, 26 Dec 2013 17:43:39 GMT
<
* Connection #0 to host localhost left intact
* Closing connection #0

2. # curl -v -X PUT -H 'Content-Type: application/directory' -H 'Content-Length: 0' -k http://localhost:8080/v1/AUTH_test/container/dir1
* About to connect() to localhost port 8080 (#0)
* Trying 127.0.0.1... connected
* Connected to localhost (127.0.0.1) port 8080 (#0)
> PUT /v1/AUTH_test/container/dir1 HTTP/1.1
> User-Agent: curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.14.3.0 zlib/1.2.3 libidn/1.18 libssh2/1.4.2
> Host: localhost:8080
> Accept: */*
> Content-Type: application/directory
> Content-Length: 0
>
< HTTP/1.1 201 Created
< Last-Modified: Thu, 26 Dec 2013 17:44:11 GMT
< Content-Length: 0
< Etag: d41d8cd98f00b204e9800998ecf8427e
< Content-Type: text/html; charset=UTF-8
< X-Trans-Id: tx48a4022d743c4d469e354-0052bc6aeb
< Date: Thu, 26 Dec 2013 17:44:11 GMT
<
* Connection #0 to host localhost left intact
* Closing connection #0

3. # curl -v -X PUT -H 'Content-Type: application/directory' -H 'Content-Length: 0' -k http://localhost:8080/v1/AUTH_test/container/dir2
< HTTP/1.1 201 Created

4. # curl -v -X PUT -T install.log -k http://localhost:8080/v1/AUTH_test/container/dir1/install1.txt
< HTTP/1.1 201 Created

5. # curl -v -X PUT -T install.log -k http://localhost:8080/v1/AUTH_test/container/dir1/install2.txt
< HTTP/1.1 201 Created

6. # curl -v -X GET -k http://localhost:8080/v1/AUTH_test/container
* About to connect() to localhost port 8080 (#0)
* Trying 127.0.0.1... connected
* Connected to localhost (127.0.0.1) port 8080 (#0)
> GET /v1/AUTH_test/container HTTP/1.1
> User-Agent: curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.14.3.0 zlib/1.2.3 libidn/1.18 libssh2/1.4.2
> Host: localhost:8080
> Accept: */*
>
< HTTP/1.1 200 OK
< Content-Length: 46
< X-Container-Object-Count: 0
< Accept-Ranges: bytes
< X-Timestamp: 1
< X-Container-Bytes-Used: 0
< Content-Type: text/plain; charset=utf-8
< X-Trans-Id: txa4407dd4cbce4d64bff1d-0052bc6b3a
< Date: Thu, 26 Dec 2013 17:45:30 GMT
<
dir1
dir1/install1.txt
dir1/install2.txt
dir2
* Connection #0 to host localhost left intact
* Closing connection #0

7. # curl -v -X GET -k http://localhost:8080/v1/AUTH_test/container/dir1
* About to connect() to localhost port 8080 (#0)
* Trying 127.0.0.1... connected
* Connected to localhost (127.0.0.1) port 8080 (#0)
> GET /v1/AUTH_test/container/dir1 HTTP/1.1
> User-Agent: curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.14.3.0 zlib/1.2.3 libidn/1.18 libssh2/1.4.2
> Host: localhost:8080
> Accept: */*
>
< HTTP/1.1 200 OK
< Content-Length: 0
< Accept-Ranges: bytes
< Last-Modified: Thu, 26 Dec 2013 17:44:11 GMT
< Etag: d41d8cd98f00b204e9800998ecf8427e
< X-Timestamp: 1388079851.42453
< Content-Type: application/directory
< X-Trans-Id: txe93cb06e47674a2b80316-0052bc6b4e
< Date: Thu, 26 Dec 2013 17:45:50 GMT
<
* Connection #0 to host localhost left intact
* Closing connection #0

Blueprint information

Status:
Not started
Approver:
Luis Pabón
Priority:
Undefined
Drafter:
pushpesh
Direction:
Needs approval
Assignee:
None
Definition:
New
Series goal:
None
Implementation:
Unknown
Milestone target:
None

Related branches

Sprints

Whiteboard

This is a much needed feature. I'll look into this.

(?)

Work Items

This blueprint contains Public information 
Everyone can see this information.

Subscribers

No subscribers.