{"action":"created","comment":{"url":"https://api.github.com/repos/Azure/device-telemetry-java/pulls/comments/198558582","pull_request_review_id":132509050,"id":198558582,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDE5ODU1ODU4Mg==","diff_hunk":"@@ -168,6 +173,60 @@ public AlarmServiceModel update(String id, String status) throws Exception {\n         return new AlarmServiceModel(document);\n     }\n \n+    @Override\n+    public void delete(ArrayList<String> ids) throws Throwable {\n+        CompletableFuture[] tasks = new CompletableFuture[ids.size()];\n+        for (int i = 0; i < ids.size(); i++) {\n+            String id = ids.get(i);\n+            tasks[i] = CompletableFuture.runAsync(() -> {\n+                try {\n+                    this.delete(id);\n+                } catch (Exception e) {\n+                    throw new CompletionException(e);\n+                }\n+            });\n+        }\n+\n+        CompletableFuture result = CompletableFuture.allOf(tasks);\n+        try {\n+            result.get();\n+        } catch (ExecutionException ex) {\n+            throw ex.getCause();\n+        }\n+    }\n+\n+    @Override\n+    public void delete(String id) throws Exception {\n+        int retryCount = 0;\n+        while (retryCount < this.maxDeleteRetryCount) {\n+            try {\n+                this.storageClient.deleteDocument(this.databaseName, this.collectionId, id);\n+                return;\n+","path":"app/com/microsoft/azure/iotsolutions/devicetelemetry/services/Alarms.java","position":70,"original_position":70,"commit_id":"10a11bd8ca575c7e7b8d5d1641837664652898c0","original_commit_id":"10a11bd8ca575c7e7b8d5d1641837664652898c0","user":{"login":"ppathan","id":16170750,"node_id":"MDQ6VXNlcjE2MTcwNzUw","avatar_url":"https://avatars2.githubusercontent.com/u/16170750?v=4","gravatar_id":"","url":"https://api.github.com/users/ppathan","html_url":"https://github.com/ppathan","followers_url":"https://api.github.com/users/ppathan/followers","following_url":"https://api.github.com/users/ppathan/following{/other_user}","gists_url":"https://api.github.com/users/ppathan/gists{/gist_id}","starred_url":"https://api.github.com/users/ppathan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ppathan/subscriptions","organizations_url":"https://api.github.com/users/ppathan/orgs","repos_url":"https://api.github.com/users/ppathan/repos","events_url":"https://api.github.com/users/ppathan/events{/privacy}","received_events_url":"https://api.github.com/users/ppathan/received_events","type":"User","site_admin":false},"body":"nit: extra line","created_at":"2018-06-27T16:27:09Z","updated_at":"2018-06-27T16:36:43Z","html_url":"https://github.com/Azure/device-telemetry-java/pull/117#discussion_r198558582","pull_request_url":"https://api.github.com/repos/Azure/device-telemetry-java/pulls/117","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/Azure/device-telemetry-java/pulls/comments/198558582"},"html":{"href":"https://github.com/Azure/device-telemetry-java/pull/117#discussion_r198558582"},"pull_request":{"href":"https://api.github.com/repos/Azure/device-telemetry-java/pulls/117"}}},"pull_request":{"url":"https://api.github.com/repos/Azure/device-telemetry-java/pulls/117","id":196576347,"node_id":"MDExOlB1bGxSZXF1ZXN0MTk2NTc2MzQ3","html_url":"https://github.com/Azure/device-telemetry-java/pull/117","diff_url":"https://github.com/Azure/device-telemetry-java/pull/117.diff","patch_url":"https://github.com/Azure/device-telemetry-java/pull/117.patch","issue_url":"https://api.github.com/repos/Azure/device-telemetry-java/issues/117","number":117,"state":"open","locked":false,"title":"Delete alarms by id","user":{"login":"molly-moen","id":33666587,"node_id":"MDQ6VXNlcjMzNjY2NTg3","avatar_url":"https://avatars1.githubusercontent.com/u/33666587?v=4","gravatar_id":"","url":"https://api.github.com/users/molly-moen","html_url":"https://github.com/molly-moen","followers_url":"https://api.github.com/users/molly-moen/followers","following_url":"https://api.github.com/users/molly-moen/following{/other_user}","gists_url":"https://api.github.com/users/molly-moen/gists{/gist_id}","starred_url":"https://api.github.com/users/molly-moen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/molly-moen/subscriptions","organizations_url":"https://api.github.com/users/molly-moen/orgs","repos_url":"https://api.github.com/users/molly-moen/repos","events_url":"https://api.github.com/users/molly-moen/events{/privacy}","received_events_url":"https://api.github.com/users/molly-moen/received_events","type":"User","site_admin":false},"body":"# Type of change? <!-- [x] all the boxes that apply -->\r\n\r\n- [ ] Bug fix\r\n- [x] New feature\r\n- [ ] Enhancement\r\n- [ ] Breaking change (breaks backward compatibility)\r\n\r\n# Description, Context, Motivation <!-- Please help us reviewing your PR -->\r\n\r\nAdd API to alarms to delete alarms by a list of alarm ids, up to a maximum of 1000 alarms. Also added single delete by id api.\r\n\r\nSample request:\r\nPOST .../telemetry/v1/alarms/delete\r\nBody:\r\n{\r\n\"Ids\": [\"977b5193-9e0f-410a-f57a-a1363cc4b87c\", \"a36d4da6-a0d9-366b-4fb9-f4d10439c2c5\", \"870f182d-3aac-bc07-6894-674bf7977192\", \"03d80e5f-93e7-205c-1074-7a51143d54d2\"]\r\n}\r\n\r\nResponse: 200 OK\r\n\r\nThis is the same content as https://github.com/Azure/device-telemetry-dotnet/pull/84\r\n**Checklist:**\r\n\r\n- [x] All tests passed\r\n- [x] The code follows the code style and conventions of this project\r\n- [x] The change requires a change to the documentation\r\n- [ ] I have updated the documentation accordingly\r\nWill update wiki after check in.","created_at":"2018-06-21T21:09:15Z","updated_at":"2018-06-27T16:36:43Z","closed_at":null,"merged_at":null,"merge_commit_sha":"3158a3ea97459d64b7eeea32d80cf40b730b620e","assignee":null,"assignees":[],"requested_reviewers":[{"login":"dluc","id":371009,"node_id":"MDQ6VXNlcjM3MTAwOQ==","avatar_url":"https://avatars2.githubusercontent.com/u/371009?v=4","gravatar_id":"","url":"https://api.github.com/users/dluc","html_url":"https://github.com/dluc","followers_url":"https://api.github.com/users/dluc/followers","following_url":"https://api.github.com/users/dluc/following{/other_user}","gists_url":"https://api.github.com/users/dluc/gists{/gist_id}","starred_url":"https://api.github.com/users/dluc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dluc/subscriptions","organizations_url":"https://api.github.com/users/dluc/orgs","repos_url":"https://api.github.com/users/dluc/repos","events_url":"https://api.github.com/users/dluc/events{/privacy}","received_events_url":"https://api.github.com/users/dluc/received_events","type":"User","site_admin":false},{"login":"jillcary","id":3317135,"node_id":"MDQ6VXNlcjMzMTcxMzU=","avatar_url":"https://avatars1.githubusercontent.com/u/3317135?v=4","gravatar_id":"","url":"https://api.github.com/users/jillcary","html_url":"https://github.com/jillcary","followers_url":"https://api.github.com/users/jillcary/followers","following_url":"https://api.github.com/users/jillcary/following{/other_user}","gists_url":"https://api.github.com/users/jillcary/gists{/gist_id}","starred_url":"https://api.github.com/users/jillcary/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jillcary/subscriptions","organizations_url":"https://api.github.com/users/jillcary/orgs","repos_url":"https://api.github.com/users/jillcary/repos","events_url":"https://api.github.com/users/jillcary/events{/privacy}","received_events_url":"https://api.github.com/users/jillcary/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/Azure/device-telemetry-java/pulls/117/commits","review_comments_url":"https://api.github.com/repos/Azure/device-telemetry-java/pulls/117/comments","review_comment_url":"https://api.github.com/repos/Azure/device-telemetry-java/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Azure/device-telemetry-java/issues/117/comments","statuses_url":"https://api.github.com/repos/Azure/device-telemetry-java/statuses/10a11bd8ca575c7e7b8d5d1641837664652898c0","head":{"label":"Azure:momoe/delete-alarms-by-id","ref":"momoe/delete-alarms-by-id","sha":"10a11bd8ca575c7e7b8d5d1641837664652898c0","user":{"login":"Azure","id":6844498,"node_id":"MDEyOk9yZ2FuaXphdGlvbjY4NDQ0OTg=","avatar_url":"https://avatars0.githubusercontent.com/u/6844498?v=4","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":94933761,"node_id":"MDEwOlJlcG9zaXRvcnk5NDkzMzc2MQ==","name":"device-telemetry-java","full_name":"Azure/device-telemetry-java","owner":{"login":"Azure","id":6844498,"node_id":"MDEyOk9yZ2FuaXphdGlvbjY4NDQ0OTg=","avatar_url":"https://avatars0.githubusercontent.com/u/6844498?v=4","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/device-telemetry-java","description":"Java implementation for device telemetry for PCS","fork":false,"url":"https://api.github.com/repos/Azure/device-telemetry-java","forks_url":"https://api.github.com/repos/Azure/device-telemetry-java/forks","keys_url":"https://api.github.com/repos/Azure/device-telemetry-java/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Azure/device-telemetry-java/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Azure/device-telemetry-java/teams","hooks_url":"https://api.github.com/repos/Azure/device-telemetry-java/hooks","issue_events_url":"https://api.github.com/repos/Azure/device-telemetry-java/issues/events{/number}","events_url":"https://api.github.com/repos/Azure/device-telemetry-java/events","assignees_url":"https://api.github.com/repos/Azure/device-telemetry-java/assignees{/user}","branches_url":"https://api.github.com/repos/Azure/device-telemetry-java/branches{/branch}","tags_url":"https://api.github.com/repos/Azure/device-telemetry-java/tags","blobs_url":"https://api.github.com/repos/Azure/device-telemetry-java/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Azure/device-telemetry-java/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Azure/device-telemetry-java/git/refs{/sha}","trees_url":"https://api.github.com/repos/Azure/device-telemetry-java/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Azure/device-telemetry-java/statuses/{sha}","languages_url":"https://api.github.com/repos/Azure/device-telemetry-java/languages","stargazers_url":"https://api.github.com/repos/Azure/device-telemetry-java/stargazers","contributors_url":"https://api.github.com/repos/Azure/device-telemetry-java/contributors","subscribers_url":"https://api.github.com/repos/Azure/device-telemetry-java/subscribers","subscription_url":"https://api.github.com/repos/Azure/device-telemetry-java/subscription","commits_url":"https://api.github.com/repos/Azure/device-telemetry-java/commits{/sha}","git_commits_url":"https://api.github.com/repos/Azure/device-telemetry-java/git/commits{/sha}","comments_url":"https://api.github.com/repos/Azure/device-telemetry-java/comments{/number}","issue_comment_url":"https://api.github.com/repos/Azure/device-telemetry-java/issues/comments{/number}","contents_url":"https://api.github.com/repos/Azure/device-telemetry-java/contents/{+path}","compare_url":"https://api.github.com/repos/Azure/device-telemetry-java/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Azure/device-telemetry-java/merges","archive_url":"https://api.github.com/repos/Azure/device-telemetry-java/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Azure/device-telemetry-java/downloads","issues_url":"https://api.github.com/repos/Azure/device-telemetry-java/issues{/number}","pulls_url":"https://api.github.com/repos/Azure/device-telemetry-java/pulls{/number}","milestones_url":"https://api.github.com/repos/Azure/device-telemetry-java/milestones{/number}","notifications_url":"https://api.github.com/repos/Azure/device-telemetry-java/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Azure/device-telemetry-java/labels{/name}","releases_url":"https://api.github.com/repos/Azure/device-telemetry-java/releases{/id}","deployments_url":"https://api.github.com/repos/Azure/device-telemetry-java/deployments","created_at":"2017-06-20T20:48:07Z","updated_at":"2018-06-27T16:21:40Z","pushed_at":"2018-06-27T16:22:08Z","git_url":"git://github.com/Azure/device-telemetry-java.git","ssh_url":"git@github.com:Azure/device-telemetry-java.git","clone_url":"https://github.com/Azure/device-telemetry-java.git","svn_url":"https://github.com/Azure/device-telemetry-java","homepage":null,"size":1336,"stargazers_count":4,"watchers_count":4,"language":"Java","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"archived":false,"open_issues_count":15,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":3,"open_issues":15,"watchers":4,"default_branch":"master"}},"base":{"label":"Azure:master","ref":"master","sha":"b9a5071c77f530556230d21054beb9af41add410","user":{"login":"Azure","id":6844498,"node_id":"MDEyOk9yZ2FuaXphdGlvbjY4NDQ0OTg=","avatar_url":"https://avatars0.githubusercontent.com/u/6844498?v=4","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":94933761,"node_id":"MDEwOlJlcG9zaXRvcnk5NDkzMzc2MQ==","name":"device-telemetry-java","full_name":"Azure/device-telemetry-java","owner":{"login":"Azure","id":6844498,"node_id":"MDEyOk9yZ2FuaXphdGlvbjY4NDQ0OTg=","avatar_url":"https://avatars0.githubusercontent.com/u/6844498?v=4","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/device-telemetry-java","description":"Java implementation for device telemetry for PCS","fork":false,"url":"https://api.github.com/repos/Azure/device-telemetry-java","forks_url":"https://api.github.com/repos/Azure/device-telemetry-java/forks","keys_url":"https://api.github.com/repos/Azure/device-telemetry-java/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Azure/device-telemetry-java/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Azure/device-telemetry-java/teams","hooks_url":"https://api.github.com/repos/Azure/device-telemetry-java/hooks","issue_events_url":"https://api.github.com/repos/Azure/device-telemetry-java/issues/events{/number}","events_url":"https://api.github.com/repos/Azure/device-telemetry-java/events","assignees_url":"https://api.github.com/repos/Azure/device-telemetry-java/assignees{/user}","branches_url":"https://api.github.com/repos/Azure/device-telemetry-java/branches{/branch}","tags_url":"https://api.github.com/repos/Azure/device-telemetry-java/tags","blobs_url":"https://api.github.com/repos/Azure/device-telemetry-java/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Azure/device-telemetry-java/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Azure/device-telemetry-java/git/refs{/sha}","trees_url":"https://api.github.com/repos/Azure/device-telemetry-java/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Azure/device-telemetry-java/statuses/{sha}","languages_url":"https://api.github.com/repos/Azure/device-telemetry-java/languages","stargazers_url":"https://api.github.com/repos/Azure/device-telemetry-java/stargazers","contributors_url":"https://api.github.com/repos/Azure/device-telemetry-java/contributors","subscribers_url":"https://api.github.com/repos/Azure/device-telemetry-java/subscribers","subscription_url":"https://api.github.com/repos/Azure/device-telemetry-java/subscription","commits_url":"https://api.github.com/repos/Azure/device-telemetry-java/commits{/sha}","git_commits_url":"https://api.github.com/repos/Azure/device-telemetry-java/git/commits{/sha}","comments_url":"https://api.github.com/repos/Azure/device-telemetry-java/comments{/number}","issue_comment_url":"https://api.github.com/repos/Azure/device-telemetry-java/issues/comments{/number}","contents_url":"https://api.github.com/repos/Azure/device-telemetry-java/contents/{+path}","compare_url":"https://api.github.com/repos/Azure/device-telemetry-java/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Azure/device-telemetry-java/merges","archive_url":"https://api.github.com/repos/Azure/device-telemetry-java/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Azure/device-telemetry-java/downloads","issues_url":"https://api.github.com/repos/Azure/device-telemetry-java/issues{/number}","pulls_url":"https://api.github.com/repos/Azure/device-telemetry-java/pulls{/number}","milestones_url":"https://api.github.com/repos/Azure/device-telemetry-java/milestones{/number}","notifications_url":"https://api.github.com/repos/Azure/device-telemetry-java/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Azure/device-telemetry-java/labels{/name}","releases_url":"https://api.github.com/repos/Azure/device-telemetry-java/releases{/id}","deployments_url":"https://api.github.com/repos/Azure/device-telemetry-java/deployments","created_at":"2017-06-20T20:48:07Z","updated_at":"2018-06-27T16:21:40Z","pushed_at":"2018-06-27T16:22:08Z","git_url":"git://github.com/Azure/device-telemetry-java.git","ssh_url":"git@github.com:Azure/device-telemetry-java.git","clone_url":"https://github.com/Azure/device-telemetry-java.git","svn_url":"https://github.com/Azure/device-telemetry-java","homepage":null,"size":1336,"stargazers_count":4,"watchers_count":4,"language":"Java","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"archived":false,"open_issues_count":15,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":3,"open_issues":15,"watchers":4,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Azure/device-telemetry-java/pulls/117"},"html":{"href":"https://github.com/Azure/device-telemetry-java/pull/117"},"issue":{"href":"https://api.github.com/repos/Azure/device-telemetry-java/issues/117"},"comments":{"href":"https://api.github.com/repos/Azure/device-telemetry-java/issues/117/comments"},"review_comments":{"href":"https://api.github.com/repos/Azure/device-telemetry-java/pulls/117/comments"},"review_comment":{"href":"https://api.github.com/repos/Azure/device-telemetry-java/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Azure/device-telemetry-java/pulls/117/commits"},"statuses":{"href":"https://api.github.com/repos/Azure/device-telemetry-java/statuses/10a11bd8ca575c7e7b8d5d1641837664652898c0"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"ppathan"}}