{"action":"created","comment":{"url":"https://api.github.com/repos/edx-ops/edx-cloudmanager-sdk/pulls/comments/44701198","id":44701198,"diff_hunk":"@@ -0,0 +1,133 @@\n+from cm_sdk.client import CloudManagerClient\n+from cm_sdk.models.alert_config import alert_config\n+from cm_sdk.models.host import host\n+from cm_sdk.models.backup_config import backup_config\n+\n+class Api(object):\n+    \"\"\"\n+    MongoDB CloudManager API wrapper for CRUD operations on AlertConfigurations.\n+    https://docs.cloud.mongodb.com/reference/api/alert-configurations/\n+\n+    Expected usage is as follows\n+\n+    import json\n+    import pprint\n+    from cm_sdk.models.alert_config import AlertConfig\n+    from cm_sdk.api.alert_config import AlertConfigApi\n+    import cm_sdk.client\n+\n+    # keys and ids have been changed to representative,\n+    # but not reals, values\n+    group_id = \"JBAE4urukmv1GY3pukguksSZ8\"\n+\n+    c = cm_sdk.client.CloudManagerClient(\n+         \"https://cloud.mongodb.com\",\n+         group_id,\n+         \"me@example.com\",\n+         \"9705abe4-6d10-11e5-a3c6-ecf4bb625d2e\")\n+\n+    api = AlertConfigApi(c)\n+\n+    fetched = api.get_alert_configs()\n+    \"\"\"\n+    IMPLEMENTED_APIS = [\n+        {\"name\": \"AlertConfig\", \"status\": \"beta\"},\n+        {\"name\": \"Alert\", \"status\": \"alpha\"},\n+        {\"name\": \"BackupConfig\", \"status\": \"alpha\"},\n+        {\"name\": \"Host\", \"status\": \"alpha\"}]\n+\n+\n+    def __init__(self, group_id, api_user, api_key, api_host=\"https://cloud.mongodb.com\"):\n+        self.client = CloudManagerClient(group_id, api_user, api_key, api_host)\n+\n+\n+    def get_alert_configs(self):\n+        \"\"\"\n+        Return all the CloudManager AlertConfig objects as a list of\n+        cm_sdk.models.alert_config.AlertConfig instances.\n+        \"\"\"\n+        to_return = []\n+\n+        alert_configs = self.client.get(\"/groups/{group_id}/alertConfigs\")\n+        for ac in alert_configs['results']:","path":"cm_sdk/api/cm_api.py","position":52,"original_position":52,"commit_id":"66a1c6ea2e1f6bc8c21e074a0384e4445db4510b","original_commit_id":"66a1c6ea2e1f6bc8c21e074a0384e4445db4510b","user":{"login":"maxrothman","id":2607086,"avatar_url":"https://avatars.githubusercontent.com/u/2607086?v=3","gravatar_id":"","url":"https://api.github.com/users/maxrothman","html_url":"https://github.com/maxrothman","followers_url":"https://api.github.com/users/maxrothman/followers","following_url":"https://api.github.com/users/maxrothman/following{/other_user}","gists_url":"https://api.github.com/users/maxrothman/gists{/gist_id}","starred_url":"https://api.github.com/users/maxrothman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maxrothman/subscriptions","organizations_url":"https://api.github.com/users/maxrothman/orgs","repos_url":"https://api.github.com/users/maxrothman/repos","events_url":"https://api.github.com/users/maxrothman/events{/privacy}","received_events_url":"https://api.github.com/users/maxrothman/received_events","type":"User","site_admin":false},"body":"`return [alert_config.AlertConfig.from_dict(ac) for ac in alert_configs['results']`\r\n\r\nNot only is that more idiomatic, it's also more performant.","created_at":"2015-11-12T19:18:33Z","updated_at":"2015-11-12T19:18:33Z","html_url":"https://github.com/edx-ops/edx-cloudmanager-sdk/pull/6#discussion_r44701198","pull_request_url":"https://api.github.com/repos/edx-ops/edx-cloudmanager-sdk/pulls/6","_links":{"self":{"href":"https://api.github.com/repos/edx-ops/edx-cloudmanager-sdk/pulls/comments/44701198"},"html":{"href":"https://github.com/edx-ops/edx-cloudmanager-sdk/pull/6#discussion_r44701198"},"pull_request":{"href":"https://api.github.com/repos/edx-ops/edx-cloudmanager-sdk/pulls/6"}}},"pull_request":{"url":"https://api.github.com/repos/edx-ops/edx-cloudmanager-sdk/pulls/6","id":50137030,"html_url":"https://github.com/edx-ops/edx-cloudmanager-sdk/pull/6","diff_url":"https://github.com/edx-ops/edx-cloudmanager-sdk/pull/6.diff","patch_url":"https://github.com/edx-ops/edx-cloudmanager-sdk/pull/6.patch","issue_url":"https://api.github.com/repos/edx-ops/edx-cloudmanager-sdk/issues/6","number":6,"state":"open","locked":false,"title":"E0d/updated review","user":{"login":"e0d","id":1270274,"avatar_url":"https://avatars.githubusercontent.com/u/1270274?v=3","gravatar_id":"","url":"https://api.github.com/users/e0d","html_url":"https://github.com/e0d","followers_url":"https://api.github.com/users/e0d/followers","following_url":"https://api.github.com/users/e0d/following{/other_user}","gists_url":"https://api.github.com/users/e0d/gists{/gist_id}","starred_url":"https://api.github.com/users/e0d/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/e0d/subscriptions","organizations_url":"https://api.github.com/users/e0d/orgs","repos_url":"https://api.github.com/users/e0d/repos","events_url":"https://api.github.com/users/e0d/events{/privacy}","received_events_url":"https://api.github.com/users/e0d/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-11-09T15:39:23Z","updated_at":"2015-11-12T19:18:33Z","closed_at":null,"merged_at":null,"merge_commit_sha":"863b8d42eb3b720eb9117f6628cce91ac722d865","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/edx-ops/edx-cloudmanager-sdk/pulls/6/commits","review_comments_url":"https://api.github.com/repos/edx-ops/edx-cloudmanager-sdk/pulls/6/comments","review_comment_url":"https://api.github.com/repos/edx-ops/edx-cloudmanager-sdk/pulls/comments{/number}","comments_url":"https://api.github.com/repos/edx-ops/edx-cloudmanager-sdk/issues/6/comments","statuses_url":"https://api.github.com/repos/edx-ops/edx-cloudmanager-sdk/statuses/66a1c6ea2e1f6bc8c21e074a0384e4445db4510b","head":{"label":"edx-ops:e0d/updated-review","ref":"e0d/updated-review","sha":"66a1c6ea2e1f6bc8c21e074a0384e4445db4510b","user":{"login":"edx-ops","id":6493955,"avatar_url":"https://avatars.githubusercontent.com/u/6493955?v=3","gravatar_id":"","url":"https://api.github.com/users/edx-ops","html_url":"https://github.com/edx-ops","followers_url":"https://api.github.com/users/edx-ops/followers","following_url":"https://api.github.com/users/edx-ops/following{/other_user}","gists_url":"https://api.github.com/users/edx-ops/gists{/gist_id}","starred_url":"https://api.github.com/users/edx-ops/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edx-ops/subscriptions","organizations_url":"https://api.github.com/users/edx-ops/orgs","repos_url":"https://api.github.com/users/edx-ops/repos","events_url":"https://api.github.com/users/edx-ops/events{/privacy}","received_events_url":"https://api.github.com/users/edx-ops/received_events","type":"Organization","site_admin":false},"repo":{"id":41836491,"name":"edx-cloudmanager-sdk","full_name":"edx-ops/edx-cloudmanager-sdk","owner":{"login":"edx-ops","id":6493955,"avatar_url":"https://avatars.githubusercontent.com/u/6493955?v=3","gravatar_id":"","url":"https://api.github.com/users/edx-ops","html_url":"https://github.com/edx-ops","followers_url":"https://api.github.com/users/edx-ops/followers","following_url":"https://api.github.com/users/edx-ops/following{/other_user}","gists_url":"https://api.github.com/users/edx-ops/gists{/gist_id}","starred_url":"https://api.github.com/users/edx-ops/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edx-ops/subscriptions","organizations_url":"https://api.github.com/users/edx-ops/orgs","repos_url":"https://api.github.com/users/edx-ops/repos","events_url":"https://api.github.com/users/edx-ops/events{/privacy}","received_events_url":"https://api.github.com/users/edx-ops/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/edx-ops/edx-cloudmanager-sdk","description":"A Basic SDK for interacting with the the MMS/Cloudmanager API from Python.  ","fork":false,"url":"https://api.github.com/repos/edx-ops/edx-cloudmanager-sdk","forks_url":"https://api.github.com/repos/edx-ops/edx-cloudmanager-sdk/forks","keys_url":"https://api.github.com/repos/edx-ops/edx-cloudmanager-sdk/keys{/key_id}","collaborators_url":"https://api.github.com/repos/edx-ops/edx-cloudmanager-sdk/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/edx-ops/edx-cloudmanager-sdk/teams","hooks_url":"https://api.github.com/repos/edx-ops/edx-cloudmanager-sdk/hooks","issue_events_url":"https://api.github.com/repos/edx-ops/edx-cloudmanager-sdk/issues/events{/number}","events_url":"https://api.github.com/repos/edx-ops/edx-cloudmanager-sdk/events","assignees_url":"https://api.github.com/repos/edx-ops/edx-cloudmanager-sdk/assignees{/user}","branches_url":"https://api.github.com/repos/edx-ops/edx-cloudmanager-sdk/branches{/branch}","tags_url":"https://api.github.com/repos/edx-ops/edx-cloudmanager-sdk/tags","blobs_url":"https://api.github.com/repos/edx-ops/edx-cloudmanager-sdk/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/edx-ops/edx-cloudmanager-sdk/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/edx-ops/edx-cloudmanager-sdk/git/refs{/sha}","trees_url":"https://api.github.com/repos/edx-ops/edx-cloudmanager-sdk/git/trees{/sha}","statuses_url":"https://api.github.com/repos/edx-ops/edx-cloudmanager-sdk/statuses/{sha}","languages_url":"https://api.github.com/repos/edx-ops/edx-cloudmanager-sdk/languages","stargazers_url":"https://api.github.com/repos/edx-ops/edx-cloudmanager-sdk/stargazers","contributors_url":"https://api.github.com/repos/edx-ops/edx-cloudmanager-sdk/contributors","subscribers_url":"https://api.github.com/repos/edx-ops/edx-cloudmanager-sdk/subscribers","subscription_url":"https://api.github.com/repos/edx-ops/edx-cloudmanager-sdk/subscription","commits_url":"https://api.github.com/repos/edx-ops/edx-cloudmanager-sdk/commits{/sha}","git_commits_url":"https://api.github.com/repos/edx-ops/edx-cloudmanager-sdk/git/commits{/sha}","comments_url":"https://api.github.com/repos/edx-ops/edx-cloudmanager-sdk/comments{/number}","issue_comment_url":"https://api.github.com/repos/edx-ops/edx-cloudmanager-sdk/issues/comments{/number}","contents_url":"https://api.github.com/repos/edx-ops/edx-cloudmanager-sdk/contents/{+path}","compare_url":"https://api.github.com/repos/edx-ops/edx-cloudmanager-sdk/compare/{base}...{head}","merges_url":"https://api.github.com/repos/edx-ops/edx-cloudmanager-sdk/merges","archive_url":"https://api.github.com/repos/edx-ops/edx-cloudmanager-sdk/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/edx-ops/edx-cloudmanager-sdk/downloads","issues_url":"https://api.github.com/repos/edx-ops/edx-cloudmanager-sdk/issues{/number}","pulls_url":"https://api.github.com/repos/edx-ops/edx-cloudmanager-sdk/pulls{/number}","milestones_url":"https://api.github.com/repos/edx-ops/edx-cloudmanager-sdk/milestones{/number}","notifications_url":"https://api.github.com/repos/edx-ops/edx-cloudmanager-sdk/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/edx-ops/edx-cloudmanager-sdk/labels{/name}","releases_url":"https://api.github.com/repos/edx-ops/edx-cloudmanager-sdk/releases{/id}","created_at":"2015-09-03T01:31:31Z","updated_at":"2015-11-05T15:14:04Z","pushed_at":"2015-11-10T14:56:19Z","git_url":"git://github.com/edx-ops/edx-cloudmanager-sdk.git","ssh_url":"git@github.com:edx-ops/edx-cloudmanager-sdk.git","clone_url":"https://github.com/edx-ops/edx-cloudmanager-sdk.git","svn_url":"https://github.com/edx-ops/edx-cloudmanager-sdk","homepage":null,"size":264,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"edx-ops:master","ref":"master","sha":"ea693d16c740fb4988ce79a131d1733b6ccd6fb4","user":{"login":"edx-ops","id":6493955,"avatar_url":"https://avatars.githubusercontent.com/u/6493955?v=3","gravatar_id":"","url":"https://api.github.com/users/edx-ops","html_url":"https://github.com/edx-ops","followers_url":"https://api.github.com/users/edx-ops/followers","following_url":"https://api.github.com/users/edx-ops/following{/other_user}","gists_url":"https://api.github.com/users/edx-ops/gists{/gist_id}","starred_url":"https://api.github.com/users/edx-ops/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edx-ops/subscriptions","organizations_url":"https://api.github.com/users/edx-ops/orgs","repos_url":"https://api.github.com/users/edx-ops/repos","events_url":"https://api.github.com/users/edx-ops/events{/privacy}","received_events_url":"https://api.github.com/users/edx-ops/received_events","type":"Organization","site_admin":false},"repo":{"id":41836491,"name":"edx-cloudmanager-sdk","full_name":"edx-ops/edx-cloudmanager-sdk","owner":{"login":"edx-ops","id":6493955,"avatar_url":"https://avatars.githubusercontent.com/u/6493955?v=3","gravatar_id":"","url":"https://api.github.com/users/edx-ops","html_url":"https://github.com/edx-ops","followers_url":"https://api.github.com/users/edx-ops/followers","following_url":"https://api.github.com/users/edx-ops/following{/other_user}","gists_url":"https://api.github.com/users/edx-ops/gists{/gist_id}","starred_url":"https://api.github.com/users/edx-ops/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edx-ops/subscriptions","organizations_url":"https://api.github.com/users/edx-ops/orgs","repos_url":"https://api.github.com/users/edx-ops/repos","events_url":"https://api.github.com/users/edx-ops/events{/privacy}","received_events_url":"https://api.github.com/users/edx-ops/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/edx-ops/edx-cloudmanager-sdk","description":"A Basic SDK for interacting with the the MMS/Cloudmanager API from Python.  ","fork":false,"url":"https://api.github.com/repos/edx-ops/edx-cloudmanager-sdk","forks_url":"https://api.github.com/repos/edx-ops/edx-cloudmanager-sdk/forks","keys_url":"https://api.github.com/repos/edx-ops/edx-cloudmanager-sdk/keys{/key_id}","collaborators_url":"https://api.github.com/repos/edx-ops/edx-cloudmanager-sdk/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/edx-ops/edx-cloudmanager-sdk/teams","hooks_url":"https://api.github.com/repos/edx-ops/edx-cloudmanager-sdk/hooks","issue_events_url":"https://api.github.com/repos/edx-ops/edx-cloudmanager-sdk/issues/events{/number}","events_url":"https://api.github.com/repos/edx-ops/edx-cloudmanager-sdk/events","assignees_url":"https://api.github.com/repos/edx-ops/edx-cloudmanager-sdk/assignees{/user}","branches_url":"https://api.github.com/repos/edx-ops/edx-cloudmanager-sdk/branches{/branch}","tags_url":"https://api.github.com/repos/edx-ops/edx-cloudmanager-sdk/tags","blobs_url":"https://api.github.com/repos/edx-ops/edx-cloudmanager-sdk/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/edx-ops/edx-cloudmanager-sdk/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/edx-ops/edx-cloudmanager-sdk/git/refs{/sha}","trees_url":"https://api.github.com/repos/edx-ops/edx-cloudmanager-sdk/git/trees{/sha}","statuses_url":"https://api.github.com/repos/edx-ops/edx-cloudmanager-sdk/statuses/{sha}","languages_url":"https://api.github.com/repos/edx-ops/edx-cloudmanager-sdk/languages","stargazers_url":"https://api.github.com/repos/edx-ops/edx-cloudmanager-sdk/stargazers","contributors_url":"https://api.github.com/repos/edx-ops/edx-cloudmanager-sdk/contributors","subscribers_url":"https://api.github.com/repos/edx-ops/edx-cloudmanager-sdk/subscribers","subscription_url":"https://api.github.com/repos/edx-ops/edx-cloudmanager-sdk/subscription","commits_url":"https://api.github.com/repos/edx-ops/edx-cloudmanager-sdk/commits{/sha}","git_commits_url":"https://api.github.com/repos/edx-ops/edx-cloudmanager-sdk/git/commits{/sha}","comments_url":"https://api.github.com/repos/edx-ops/edx-cloudmanager-sdk/comments{/number}","issue_comment_url":"https://api.github.com/repos/edx-ops/edx-cloudmanager-sdk/issues/comments{/number}","contents_url":"https://api.github.com/repos/edx-ops/edx-cloudmanager-sdk/contents/{+path}","compare_url":"https://api.github.com/repos/edx-ops/edx-cloudmanager-sdk/compare/{base}...{head}","merges_url":"https://api.github.com/repos/edx-ops/edx-cloudmanager-sdk/merges","archive_url":"https://api.github.com/repos/edx-ops/edx-cloudmanager-sdk/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/edx-ops/edx-cloudmanager-sdk/downloads","issues_url":"https://api.github.com/repos/edx-ops/edx-cloudmanager-sdk/issues{/number}","pulls_url":"https://api.github.com/repos/edx-ops/edx-cloudmanager-sdk/pulls{/number}","milestones_url":"https://api.github.com/repos/edx-ops/edx-cloudmanager-sdk/milestones{/number}","notifications_url":"https://api.github.com/repos/edx-ops/edx-cloudmanager-sdk/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/edx-ops/edx-cloudmanager-sdk/labels{/name}","releases_url":"https://api.github.com/repos/edx-ops/edx-cloudmanager-sdk/releases{/id}","created_at":"2015-09-03T01:31:31Z","updated_at":"2015-11-05T15:14:04Z","pushed_at":"2015-11-10T14:56:19Z","git_url":"git://github.com/edx-ops/edx-cloudmanager-sdk.git","ssh_url":"git@github.com:edx-ops/edx-cloudmanager-sdk.git","clone_url":"https://github.com/edx-ops/edx-cloudmanager-sdk.git","svn_url":"https://github.com/edx-ops/edx-cloudmanager-sdk","homepage":null,"size":264,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/edx-ops/edx-cloudmanager-sdk/pulls/6"},"html":{"href":"https://github.com/edx-ops/edx-cloudmanager-sdk/pull/6"},"issue":{"href":"https://api.github.com/repos/edx-ops/edx-cloudmanager-sdk/issues/6"},"comments":{"href":"https://api.github.com/repos/edx-ops/edx-cloudmanager-sdk/issues/6/comments"},"review_comments":{"href":"https://api.github.com/repos/edx-ops/edx-cloudmanager-sdk/pulls/6/comments"},"review_comment":{"href":"https://api.github.com/repos/edx-ops/edx-cloudmanager-sdk/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/edx-ops/edx-cloudmanager-sdk/pulls/6/commits"},"statuses":{"href":"https://api.github.com/repos/edx-ops/edx-cloudmanager-sdk/statuses/66a1c6ea2e1f6bc8c21e074a0384e4445db4510b"}}}}