{"action":"closed","number":305,"pull_request":{"url":"https://api.github.com/repos/Azure/azure-sdk-for-go/pulls/305","id":64493737,"html_url":"https://github.com/Azure/azure-sdk-for-go/pull/305","diff_url":"https://github.com/Azure/azure-sdk-for-go/pull/305.diff","patch_url":"https://github.com/Azure/azure-sdk-for-go/pull/305.patch","issue_url":"https://api.github.com/repos/Azure/azure-sdk-for-go/issues/305","number":305,"state":"closed","locked":false,"title":"storage: Add BlobPrefixes and Delimiter to BlobListResponse","user":{"login":"ppanyukov","id":300031,"avatar_url":"https://avatars.githubusercontent.com/u/300031?v=3","gravatar_id":"","url":"https://api.github.com/users/ppanyukov","html_url":"https://github.com/ppanyukov","followers_url":"https://api.github.com/users/ppanyukov/followers","following_url":"https://api.github.com/users/ppanyukov/following{/other_user}","gists_url":"https://api.github.com/users/ppanyukov/gists{/gist_id}","starred_url":"https://api.github.com/users/ppanyukov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ppanyukov/subscriptions","organizations_url":"https://api.github.com/users/ppanyukov/orgs","repos_url":"https://api.github.com/users/ppanyukov/repos","events_url":"https://api.github.com/users/ppanyukov/events{/privacy}","received_events_url":"https://api.github.com/users/ppanyukov/received_events","type":"User","site_admin":false},"body":"Per the MSDN docs, BlobPrefixes and Delimiter would be required in BlobListResponse in order to traverse the blob storage as if it were a file system.\r\n\r\nAs with this example:\r\n\r\n```\r\nfunc traveseBlobs(client storage.BlobStorageClient, prefix string, depth int) {\r\n\tblobParams := storage.ListBlobsParameters{\r\n\t\tDelimiter: \"/\",\r\n\t\tPrefix:    prefix,\r\n\t}\r\n\r\n\tresponse, err := client.ListBlobs(accountContainer, blobParams)\r\n\tcheckError(err)\r\n\r\n\tpad := strings.Repeat(\" \", depth*2)\r\n\r\n\t// Print folders\r\n\tfolders := response.BlobPrefixes\r\n\tfor _, folder := range folders {\r\n\t\tfolderWithoutParent := strings.TrimPrefix(folder, prefix)\r\n\t\tfmt.Printf(\"%sd %s\\n\", pad, folderWithoutParent)\r\n\t\ttraveseBlobs(client, folder, depth+1)\r\n\t}\r\n\r\n\t// Print blob names\r\n\tblobs := response.Blobs\r\n\tfor _, blob := range blobs {\r\n\t\tblobWithoutParent := strings.TrimPrefix(blob.Name, prefix)\r\n\t\tfmt.Printf(\"%s- %s\\n\", pad, blobWithoutParent)\r\n\t}\r\n}\r\n```\r\n\r\nThis would produce (with correct blobs in storage):\r\n\r\n```\r\nd root/\r\n  d folderA/\r\n    - fileAA.txt\r\n    - fileAB.txt\r\n    - fileAC.txt\r\n  d folderB/\r\n    d subfolderC/\r\n      - fileBCA.txt\r\n    - fileBA.txt\r\n    - fileBB.txt\r\n    - fileBC.txt\r\nd some_folder/\r\n  d some_subfolder/\r\n    - xxx.txt\r\n  - bar.txt\r\n```","created_at":"2016-03-29T16:27:21Z","updated_at":"2016-03-30T15:23:41Z","closed_at":"2016-03-30T15:23:41Z","merged_at":"2016-03-30T15:23:41Z","merge_commit_sha":"bb8283f38006fdddbb3c770e98a471c84c1688e0","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Azure/azure-sdk-for-go/pulls/305/commits","review_comments_url":"https://api.github.com/repos/Azure/azure-sdk-for-go/pulls/305/comments","review_comment_url":"https://api.github.com/repos/Azure/azure-sdk-for-go/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Azure/azure-sdk-for-go/issues/305/comments","statuses_url":"https://api.github.com/repos/Azure/azure-sdk-for-go/statuses/0176cb2c37834c8aea5ed81784205493438d0369","head":{"label":"ppanyukov:feature/storage-traversal-support","ref":"feature/storage-traversal-support","sha":"0176cb2c37834c8aea5ed81784205493438d0369","user":{"login":"ppanyukov","id":300031,"avatar_url":"https://avatars.githubusercontent.com/u/300031?v=3","gravatar_id":"","url":"https://api.github.com/users/ppanyukov","html_url":"https://github.com/ppanyukov","followers_url":"https://api.github.com/users/ppanyukov/followers","following_url":"https://api.github.com/users/ppanyukov/following{/other_user}","gists_url":"https://api.github.com/users/ppanyukov/gists{/gist_id}","starred_url":"https://api.github.com/users/ppanyukov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ppanyukov/subscriptions","organizations_url":"https://api.github.com/users/ppanyukov/orgs","repos_url":"https://api.github.com/users/ppanyukov/repos","events_url":"https://api.github.com/users/ppanyukov/events{/privacy}","received_events_url":"https://api.github.com/users/ppanyukov/received_events","type":"User","site_admin":false},"repo":{"id":54985635,"name":"azure-sdk-for-go","full_name":"ppanyukov/azure-sdk-for-go","owner":{"login":"ppanyukov","id":300031,"avatar_url":"https://avatars.githubusercontent.com/u/300031?v=3","gravatar_id":"","url":"https://api.github.com/users/ppanyukov","html_url":"https://github.com/ppanyukov","followers_url":"https://api.github.com/users/ppanyukov/followers","following_url":"https://api.github.com/users/ppanyukov/following{/other_user}","gists_url":"https://api.github.com/users/ppanyukov/gists{/gist_id}","starred_url":"https://api.github.com/users/ppanyukov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ppanyukov/subscriptions","organizations_url":"https://api.github.com/users/ppanyukov/orgs","repos_url":"https://api.github.com/users/ppanyukov/repos","events_url":"https://api.github.com/users/ppanyukov/events{/privacy}","received_events_url":"https://api.github.com/users/ppanyukov/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ppanyukov/azure-sdk-for-go","description":"Microsoft Azure SDK for Go","fork":true,"url":"https://api.github.com/repos/ppanyukov/azure-sdk-for-go","forks_url":"https://api.github.com/repos/ppanyukov/azure-sdk-for-go/forks","keys_url":"https://api.github.com/repos/ppanyukov/azure-sdk-for-go/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ppanyukov/azure-sdk-for-go/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ppanyukov/azure-sdk-for-go/teams","hooks_url":"https://api.github.com/repos/ppanyukov/azure-sdk-for-go/hooks","issue_events_url":"https://api.github.com/repos/ppanyukov/azure-sdk-for-go/issues/events{/number}","events_url":"https://api.github.com/repos/ppanyukov/azure-sdk-for-go/events","assignees_url":"https://api.github.com/repos/ppanyukov/azure-sdk-for-go/assignees{/user}","branches_url":"https://api.github.com/repos/ppanyukov/azure-sdk-for-go/branches{/branch}","tags_url":"https://api.github.com/repos/ppanyukov/azure-sdk-for-go/tags","blobs_url":"https://api.github.com/repos/ppanyukov/azure-sdk-for-go/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ppanyukov/azure-sdk-for-go/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ppanyukov/azure-sdk-for-go/git/refs{/sha}","trees_url":"https://api.github.com/repos/ppanyukov/azure-sdk-for-go/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ppanyukov/azure-sdk-for-go/statuses/{sha}","languages_url":"https://api.github.com/repos/ppanyukov/azure-sdk-for-go/languages","stargazers_url":"https://api.github.com/repos/ppanyukov/azure-sdk-for-go/stargazers","contributors_url":"https://api.github.com/repos/ppanyukov/azure-sdk-for-go/contributors","subscribers_url":"https://api.github.com/repos/ppanyukov/azure-sdk-for-go/subscribers","subscription_url":"https://api.github.com/repos/ppanyukov/azure-sdk-for-go/subscription","commits_url":"https://api.github.com/repos/ppanyukov/azure-sdk-for-go/commits{/sha}","git_commits_url":"https://api.github.com/repos/ppanyukov/azure-sdk-for-go/git/commits{/sha}","comments_url":"https://api.github.com/repos/ppanyukov/azure-sdk-for-go/comments{/number}","issue_comment_url":"https://api.github.com/repos/ppanyukov/azure-sdk-for-go/issues/comments{/number}","contents_url":"https://api.github.com/repos/ppanyukov/azure-sdk-for-go/contents/{+path}","compare_url":"https://api.github.com/repos/ppanyukov/azure-sdk-for-go/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ppanyukov/azure-sdk-for-go/merges","archive_url":"https://api.github.com/repos/ppanyukov/azure-sdk-for-go/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ppanyukov/azure-sdk-for-go/downloads","issues_url":"https://api.github.com/repos/ppanyukov/azure-sdk-for-go/issues{/number}","pulls_url":"https://api.github.com/repos/ppanyukov/azure-sdk-for-go/pulls{/number}","milestones_url":"https://api.github.com/repos/ppanyukov/azure-sdk-for-go/milestones{/number}","notifications_url":"https://api.github.com/repos/ppanyukov/azure-sdk-for-go/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ppanyukov/azure-sdk-for-go/labels{/name}","releases_url":"https://api.github.com/repos/ppanyukov/azure-sdk-for-go/releases{/id}","deployments_url":"https://api.github.com/repos/ppanyukov/azure-sdk-for-go/deployments","created_at":"2016-03-29T15:05:32Z","updated_at":"2016-03-29T15:05:33Z","pushed_at":"2016-03-30T12:18:22Z","git_url":"git://github.com/ppanyukov/azure-sdk-for-go.git","ssh_url":"git@github.com:ppanyukov/azure-sdk-for-go.git","clone_url":"https://github.com/ppanyukov/azure-sdk-for-go.git","svn_url":"https://github.com/ppanyukov/azure-sdk-for-go","homepage":"http://godoc.org/github.com/Azure/azure-sdk-for-go/","size":2430,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"Azure:master","ref":"master","sha":"6d6e30d7668a440666302a72c3b0c86240c594f0","user":{"login":"Azure","id":6844498,"avatar_url":"https://avatars.githubusercontent.com/u/6844498?v=3","gravatar_id":"","url":"https://api.github.com/users/Azure","html_url":"https://github.com/Azure","followers_url":"https://api.github.com/users/Azure/followers","following_url":"https://api.github.com/users/Azure/following{/other_user}","gists_url":"https://api.github.com/users/Azure/gists{/gist_id}","starred_url":"https://api.github.com/users/Azure/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Azure/subscriptions","organizations_url":"https://api.github.com/users/Azure/orgs","repos_url":"https://api.github.com/users/Azure/repos","events_url":"https://api.github.com/users/Azure/events{/privacy}","received_events_url":"https://api.github.com/users/Azure/received_events","type":"Organization","site_admin":false},"repo":{"id":22855240,"name":"azure-sdk-for-go","full_name":"Azure/azure-sdk-for-go","owner":{"login":"Azure","id":6844498,"avatar_url":"https://avatars.githubusercontent.com/u/6844498?v=3","gravatar_id":"","url":"https://api.github.com/users/Azure","html_url":"https://github.com/Azure","followers_url":"https://api.github.com/users/Azure/followers","following_url":"https://api.github.com/users/Azure/following{/other_user}","gists_url":"https://api.github.com/users/Azure/gists{/gist_id}","starred_url":"https://api.github.com/users/Azure/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Azure/subscriptions","organizations_url":"https://api.github.com/users/Azure/orgs","repos_url":"https://api.github.com/users/Azure/repos","events_url":"https://api.github.com/users/Azure/events{/privacy}","received_events_url":"https://api.github.com/users/Azure/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Azure/azure-sdk-for-go","description":"Microsoft Azure SDK for Go","fork":false,"url":"https://api.github.com/repos/Azure/azure-sdk-for-go","forks_url":"https://api.github.com/repos/Azure/azure-sdk-for-go/forks","keys_url":"https://api.github.com/repos/Azure/azure-sdk-for-go/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Azure/azure-sdk-for-go/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Azure/azure-sdk-for-go/teams","hooks_url":"https://api.github.com/repos/Azure/azure-sdk-for-go/hooks","issue_events_url":"https://api.github.com/repos/Azure/azure-sdk-for-go/issues/events{/number}","events_url":"https://api.github.com/repos/Azure/azure-sdk-for-go/events","assignees_url":"https://api.github.com/repos/Azure/azure-sdk-for-go/assignees{/user}","branches_url":"https://api.github.com/repos/Azure/azure-sdk-for-go/branches{/branch}","tags_url":"https://api.github.com/repos/Azure/azure-sdk-for-go/tags","blobs_url":"https://api.github.com/repos/Azure/azure-sdk-for-go/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Azure/azure-sdk-for-go/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Azure/azure-sdk-for-go/git/refs{/sha}","trees_url":"https://api.github.com/repos/Azure/azure-sdk-for-go/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Azure/azure-sdk-for-go/statuses/{sha}","languages_url":"https://api.github.com/repos/Azure/azure-sdk-for-go/languages","stargazers_url":"https://api.github.com/repos/Azure/azure-sdk-for-go/stargazers","contributors_url":"https://api.github.com/repos/Azure/azure-sdk-for-go/contributors","subscribers_url":"https://api.github.com/repos/Azure/azure-sdk-for-go/subscribers","subscription_url":"https://api.github.com/repos/Azure/azure-sdk-for-go/subscription","commits_url":"https://api.github.com/repos/Azure/azure-sdk-for-go/commits{/sha}","git_commits_url":"https://api.github.com/repos/Azure/azure-sdk-for-go/git/commits{/sha}","comments_url":"https://api.github.com/repos/Azure/azure-sdk-for-go/comments{/number}","issue_comment_url":"https://api.github.com/repos/Azure/azure-sdk-for-go/issues/comments{/number}","contents_url":"https://api.github.com/repos/Azure/azure-sdk-for-go/contents/{+path}","compare_url":"https://api.github.com/repos/Azure/azure-sdk-for-go/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Azure/azure-sdk-for-go/merges","archive_url":"https://api.github.com/repos/Azure/azure-sdk-for-go/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Azure/azure-sdk-for-go/downloads","issues_url":"https://api.github.com/repos/Azure/azure-sdk-for-go/issues{/number}","pulls_url":"https://api.github.com/repos/Azure/azure-sdk-for-go/pulls{/number}","milestones_url":"https://api.github.com/repos/Azure/azure-sdk-for-go/milestones{/number}","notifications_url":"https://api.github.com/repos/Azure/azure-sdk-for-go/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Azure/azure-sdk-for-go/labels{/name}","releases_url":"https://api.github.com/repos/Azure/azure-sdk-for-go/releases{/id}","deployments_url":"https://api.github.com/repos/Azure/azure-sdk-for-go/deployments","created_at":"2014-08-11T21:18:43Z","updated_at":"2016-03-25T17:16:50Z","pushed_at":"2016-03-30T15:23:41Z","git_url":"git://github.com/Azure/azure-sdk-for-go.git","ssh_url":"git@github.com:Azure/azure-sdk-for-go.git","clone_url":"https://github.com/Azure/azure-sdk-for-go.git","svn_url":"https://github.com/Azure/azure-sdk-for-go","homepage":"http://godoc.org/github.com/Azure/azure-sdk-for-go/","size":2682,"stargazers_count":148,"watchers_count":148,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":75,"mirror_url":null,"open_issues_count":32,"forks":75,"open_issues":32,"watchers":148,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Azure/azure-sdk-for-go/pulls/305"},"html":{"href":"https://github.com/Azure/azure-sdk-for-go/pull/305"},"issue":{"href":"https://api.github.com/repos/Azure/azure-sdk-for-go/issues/305"},"comments":{"href":"https://api.github.com/repos/Azure/azure-sdk-for-go/issues/305/comments"},"review_comments":{"href":"https://api.github.com/repos/Azure/azure-sdk-for-go/pulls/305/comments"},"review_comment":{"href":"https://api.github.com/repos/Azure/azure-sdk-for-go/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Azure/azure-sdk-for-go/pulls/305/commits"},"statuses":{"href":"https://api.github.com/repos/Azure/azure-sdk-for-go/statuses/0176cb2c37834c8aea5ed81784205493438d0369"}},"merged":true,"mergeable":null,"mergeable_state":"unknown","merged_by":{"login":"ahmetalpbalkan","id":159209,"avatar_url":"https://avatars.githubusercontent.com/u/159209?v=3","gravatar_id":"","url":"https://api.github.com/users/ahmetalpbalkan","html_url":"https://github.com/ahmetalpbalkan","followers_url":"https://api.github.com/users/ahmetalpbalkan/followers","following_url":"https://api.github.com/users/ahmetalpbalkan/following{/other_user}","gists_url":"https://api.github.com/users/ahmetalpbalkan/gists{/gist_id}","starred_url":"https://api.github.com/users/ahmetalpbalkan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ahmetalpbalkan/subscriptions","organizations_url":"https://api.github.com/users/ahmetalpbalkan/orgs","repos_url":"https://api.github.com/users/ahmetalpbalkan/repos","events_url":"https://api.github.com/users/ahmetalpbalkan/events{/privacy}","received_events_url":"https://api.github.com/users/ahmetalpbalkan/received_events","type":"User","site_admin":false},"comments":6,"review_comments":0,"commits":1,"additions":139,"deletions":0,"changed_files":2}}