{"action":"created","issue":{"url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/issues/920","labels_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/issues/920/labels{/name}","comments_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/issues/920/comments","events_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/issues/920/events","html_url":"https://github.com/GoogleCloudPlatform/gcloud-python/issues/920","id":86460907,"number":920,"title":"List subdirectories","user":{"login":"samskillman","id":3792514,"avatar_url":"https://avatars.githubusercontent.com/u/3792514?v=3","gravatar_id":"","url":"https://api.github.com/users/samskillman","html_url":"https://github.com/samskillman","followers_url":"https://api.github.com/users/samskillman/followers","following_url":"https://api.github.com/users/samskillman/following{/other_user}","gists_url":"https://api.github.com/users/samskillman/gists{/gist_id}","starred_url":"https://api.github.com/users/samskillman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/samskillman/subscriptions","organizations_url":"https://api.github.com/users/samskillman/orgs","repos_url":"https://api.github.com/users/samskillman/repos","events_url":"https://api.github.com/users/samskillman/events{/privacy}","received_events_url":"https://api.github.com/users/samskillman/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/labels/storage","name":"storage","color":"bfe5bf"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-06-09T05:47:33Z","updated_at":"2015-06-09T14:42:38Z","closed_at":null,"body":"In order to navigate (potentially broad) directory hierarchies in buckets, it would be useful to be able to list the sub-directories in a bucket at a given prefix. Happy to attempt to implement such a method if someone points me in the correct direction. Seems like perhaps a new Iterator?"},"comment":{"url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/issues/comments/110385802","html_url":"https://github.com/GoogleCloudPlatform/gcloud-python/issues/920#issuecomment-110385802","issue_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/issues/920","id":110385802,"user":{"login":"jgeewax","id":112928,"avatar_url":"https://avatars.githubusercontent.com/u/112928?v=3","gravatar_id":"","url":"https://api.github.com/users/jgeewax","html_url":"https://github.com/jgeewax","followers_url":"https://api.github.com/users/jgeewax/followers","following_url":"https://api.github.com/users/jgeewax/following{/other_user}","gists_url":"https://api.github.com/users/jgeewax/gists{/gist_id}","starred_url":"https://api.github.com/users/jgeewax/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jgeewax/subscriptions","organizations_url":"https://api.github.com/users/jgeewax/orgs","repos_url":"https://api.github.com/users/jgeewax/repos","events_url":"https://api.github.com/users/jgeewax/events{/privacy}","received_events_url":"https://api.github.com/users/jgeewax/received_events","type":"User","site_admin":false},"created_at":"2015-06-09T14:42:38Z","updated_at":"2015-06-09T14:42:38Z","body":"The docs are a bit clarifying: https://cloud.google.com/storage/docs/json_api/v1/objects/list\r\n\r\nIf you want \"just the stuff immediately in the directory `A/`\", this translates to \"Give me the stuff that starts with `A/` but doesn't have any other `/` characters in the name, which you do with:\r\n\r\n```python\r\nfrom gcloud import storage\r\nbucket = storage.Bucket(...)\r\nblob_iter = bucket.list_blobs(delimiter='/', prefix='A/')\r\n```\r\n\r\nThis will return all stuff that *starts* with `A/` however in the rest of the name, there can't be another `/`. So `A/foo.txt` would come back in the list, but `A/sub/foo.txt` would *not* come back."}}