{"action":"created","issue":{"url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/issues/920","repository_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python","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":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":16,"created_at":"2015-06-09T05:47:33Z","updated_at":"2016-07-04T06:26:17Z","closed_at":"2015-06-23T19:43:08Z","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/230214336","html_url":"https://github.com/GoogleCloudPlatform/gcloud-python/issues/920#issuecomment-230214336","issue_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/issues/920","id":230214336,"user":{"login":"VelizarVESSELINOV","id":8209940,"avatar_url":"https://avatars.githubusercontent.com/u/8209940?v=3","gravatar_id":"","url":"https://api.github.com/users/VelizarVESSELINOV","html_url":"https://github.com/VelizarVESSELINOV","followers_url":"https://api.github.com/users/VelizarVESSELINOV/followers","following_url":"https://api.github.com/users/VelizarVESSELINOV/following{/other_user}","gists_url":"https://api.github.com/users/VelizarVESSELINOV/gists{/gist_id}","starred_url":"https://api.github.com/users/VelizarVESSELINOV/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/VelizarVESSELINOV/subscriptions","organizations_url":"https://api.github.com/users/VelizarVESSELINOV/orgs","repos_url":"https://api.github.com/users/VelizarVESSELINOV/repos","events_url":"https://api.github.com/users/VelizarVESSELINOV/events{/privacy}","received_events_url":"https://api.github.com/users/VelizarVESSELINOV/received_events","type":"User","site_admin":false},"created_at":"2016-07-04T06:26:17Z","updated_at":"2016-07-04T06:26:17Z","body":"Very basic operation in other cloud providers ``folders = bucket.list(\"\",\"/\")``, using Google Cloud it is too complex to need to have function with several lines of code:\r\n\r\n```python\r\ndef extract_prefixes(bucket, prefix=None, delimiter='/'):\r\n    \"\"\"Function Option A.\"\"\"\r\n    iterator = bucket.list_blobs(delimiter=\"/\")\r\n    response = iterator.get_next_page_response()\r\n    blobs = list(iterator.get_items_from_response(response))\r\n    dirs = iterator.prefixes\r\n    return dirs\r\n\r\n\r\ndef list_prefixes(self, prefix=None):\r\n    \"\"\"Function Option B.\"\"\"\r\n    iterator = self.list_blobs(delimiter='/', prefix=prefix)\r\n    list(iterator)  # Necessary to populate iterator.prefixes\r\n    for p in iterator.prefixes:\r\n        yield p\r\n```\r\n\r\nWe understand that you don't want to upset the old users that are use to this, but for new users this looks bad quality API."}}
{"actor":{"display_login":"VelizarVESSELINOV"}}