{"action":"created","comment":{"url":"https://api.github.com/repos/Tendrl/alerting/pulls/comments/100671237","pull_request_review_id":21389276,"id":100671237,"diff_hunk":"@@ -0,0 +1,125 @@\n+from tendrl.alerting.objects \\\n+    import AlertingBaseObject\n+from tendrl.commons.etcdobj import EtcdObj\n+from tendrl.commons.singleton import to_singleton\n+\n+alert_severity_map = {\n+    'INFO': 0,\n+    'WARNING': 1,\n+    'CRITICAL': 2\n+}\n+\n+\n+class Alert(AlertingBaseObject):\n+    def __init__(\n+        self,\n+        alert_id,\n+        node_id=None,\n+        time_stamp=None,\n+        resource=None,\n+        current_value=None,\n+        tags=None,\n+        alert_type=None,\n+        severity=None,\n+        significance=None,\n+        ackedby=None,\n+        acked=None,\n+        pid=None,\n+        source=None,\n+        *args,\n+        **kwargs\n+    ):\n+        super(Alert, self).__init__(*args, **kwargs)\n+        self.alert_id = alert_id\n+        self.node_id = node_id\n+        self.time_stamp = time_stamp\n+        self.resource = resource\n+        self.current_value = current_value\n+        self.tags = tags\n+        self.alert_type = alert_type\n+        self.severity = severity\n+        self.significance = significance\n+        self.ackedby = ackedby\n+        self.acked = acked\n+        self.pid = pid\n+        self.source = source\n+\n+\n+class _Alert(EtcdObj):\n+    \"\"\"A table of the node context, lazily updated\n+\n+    \"\"\"\n+    __name__ = 'alerting/alerts/%s'\n+    _tendrl_cls = Alert\n+\n+    def render(self):\n+        self.__name__ = self.__name__ % self.alert_id\n+        return super(_Alert, self).render()\n+\n+\n+@to_singleton\n+class AlertUtils(object):\n+    def __init__(self):\n+        self.etcd_client = tendrl_ns.etcd_orm.client","path":"tendrl/alerting/objects/alert/__init__.py","position":63,"original_position":63,"commit_id":"cbadaaa4a88af3f9d8305cfa7b87e5d801891fae","original_commit_id":"cbadaaa4a88af3f9d8305cfa7b87e5d801891fae","user":{"login":"anmolbabu","id":3525639,"avatar_url":"https://avatars.githubusercontent.com/u/3525639?v=3","gravatar_id":"","url":"https://api.github.com/users/anmolbabu","html_url":"https://github.com/anmolbabu","followers_url":"https://api.github.com/users/anmolbabu/followers","following_url":"https://api.github.com/users/anmolbabu/following{/other_user}","gists_url":"https://api.github.com/users/anmolbabu/gists{/gist_id}","starred_url":"https://api.github.com/users/anmolbabu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/anmolbabu/subscriptions","organizations_url":"https://api.github.com/users/anmolbabu/orgs","repos_url":"https://api.github.com/users/anmolbabu/repos","events_url":"https://api.github.com/users/anmolbabu/events{/privacy}","received_events_url":"https://api.github.com/users/anmolbabu/received_events","type":"User","site_admin":false},"body":"@shtripat You are right this was just WIP I pushed so that I don't loose the changes and this needs more refinement","created_at":"2017-02-11T16:52:45Z","updated_at":"2017-02-11T16:52:45Z","html_url":"https://github.com/Tendrl/alerting/pull/35#discussion_r100671237","pull_request_url":"https://api.github.com/repos/Tendrl/alerting/pulls/35","_links":{"self":{"href":"https://api.github.com/repos/Tendrl/alerting/pulls/comments/100671237"},"html":{"href":"https://github.com/Tendrl/alerting/pull/35#discussion_r100671237"},"pull_request":{"href":"https://api.github.com/repos/Tendrl/alerting/pulls/35"}}},"pull_request":{"url":"https://api.github.com/repos/Tendrl/alerting/pulls/35","id":104296792,"html_url":"https://github.com/Tendrl/alerting/pull/35","diff_url":"https://github.com/Tendrl/alerting/pull/35.diff","patch_url":"https://github.com/Tendrl/alerting/pull/35.patch","issue_url":"https://api.github.com/repos/Tendrl/alerting/issues/35","number":35,"state":"open","locked":false,"title":"Alerting namespacing + logging related changes","user":{"login":"anmolbabu","id":3525639,"avatar_url":"https://avatars.githubusercontent.com/u/3525639?v=3","gravatar_id":"","url":"https://api.github.com/users/anmolbabu","html_url":"https://github.com/anmolbabu","followers_url":"https://api.github.com/users/anmolbabu/followers","following_url":"https://api.github.com/users/anmolbabu/following{/other_user}","gists_url":"https://api.github.com/users/anmolbabu/gists{/gist_id}","starred_url":"https://api.github.com/users/anmolbabu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/anmolbabu/subscriptions","organizations_url":"https://api.github.com/users/anmolbabu/orgs","repos_url":"https://api.github.com/users/anmolbabu/repos","events_url":"https://api.github.com/users/anmolbabu/events{/privacy}","received_events_url":"https://api.github.com/users/anmolbabu/received_events","type":"User","site_admin":false},"body":"Signed-off-by: anmolbabu <anmolbudugutta@gmail.com>","created_at":"2017-02-02T09:00:03Z","updated_at":"2017-02-11T16:52:45Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e7cb5b67afe2ebd1ffb8c737ccd2b6fd2ec620af","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/Tendrl/alerting/pulls/35/commits","review_comments_url":"https://api.github.com/repos/Tendrl/alerting/pulls/35/comments","review_comment_url":"https://api.github.com/repos/Tendrl/alerting/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Tendrl/alerting/issues/35/comments","statuses_url":"https://api.github.com/repos/Tendrl/alerting/statuses/cbadaaa4a88af3f9d8305cfa7b87e5d801891fae","head":{"label":"anmolbabu:namespace_and_logging_changes","ref":"namespace_and_logging_changes","sha":"cbadaaa4a88af3f9d8305cfa7b87e5d801891fae","user":{"login":"anmolbabu","id":3525639,"avatar_url":"https://avatars.githubusercontent.com/u/3525639?v=3","gravatar_id":"","url":"https://api.github.com/users/anmolbabu","html_url":"https://github.com/anmolbabu","followers_url":"https://api.github.com/users/anmolbabu/followers","following_url":"https://api.github.com/users/anmolbabu/following{/other_user}","gists_url":"https://api.github.com/users/anmolbabu/gists{/gist_id}","starred_url":"https://api.github.com/users/anmolbabu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/anmolbabu/subscriptions","organizations_url":"https://api.github.com/users/anmolbabu/orgs","repos_url":"https://api.github.com/users/anmolbabu/repos","events_url":"https://api.github.com/users/anmolbabu/events{/privacy}","received_events_url":"https://api.github.com/users/anmolbabu/received_events","type":"User","site_admin":false},"repo":{"id":72927057,"name":"alerting","full_name":"anmolbabu/alerting","owner":{"login":"anmolbabu","id":3525639,"avatar_url":"https://avatars.githubusercontent.com/u/3525639?v=3","gravatar_id":"","url":"https://api.github.com/users/anmolbabu","html_url":"https://github.com/anmolbabu","followers_url":"https://api.github.com/users/anmolbabu/followers","following_url":"https://api.github.com/users/anmolbabu/following{/other_user}","gists_url":"https://api.github.com/users/anmolbabu/gists{/gist_id}","starred_url":"https://api.github.com/users/anmolbabu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/anmolbabu/subscriptions","organizations_url":"https://api.github.com/users/anmolbabu/orgs","repos_url":"https://api.github.com/users/anmolbabu/repos","events_url":"https://api.github.com/users/anmolbabu/events{/privacy}","received_events_url":"https://api.github.com/users/anmolbabu/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/anmolbabu/alerting","description":"Alerting application for the core stack","fork":true,"url":"https://api.github.com/repos/anmolbabu/alerting","forks_url":"https://api.github.com/repos/anmolbabu/alerting/forks","keys_url":"https://api.github.com/repos/anmolbabu/alerting/keys{/key_id}","collaborators_url":"https://api.github.com/repos/anmolbabu/alerting/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/anmolbabu/alerting/teams","hooks_url":"https://api.github.com/repos/anmolbabu/alerting/hooks","issue_events_url":"https://api.github.com/repos/anmolbabu/alerting/issues/events{/number}","events_url":"https://api.github.com/repos/anmolbabu/alerting/events","assignees_url":"https://api.github.com/repos/anmolbabu/alerting/assignees{/user}","branches_url":"https://api.github.com/repos/anmolbabu/alerting/branches{/branch}","tags_url":"https://api.github.com/repos/anmolbabu/alerting/tags","blobs_url":"https://api.github.com/repos/anmolbabu/alerting/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/anmolbabu/alerting/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/anmolbabu/alerting/git/refs{/sha}","trees_url":"https://api.github.com/repos/anmolbabu/alerting/git/trees{/sha}","statuses_url":"https://api.github.com/repos/anmolbabu/alerting/statuses/{sha}","languages_url":"https://api.github.com/repos/anmolbabu/alerting/languages","stargazers_url":"https://api.github.com/repos/anmolbabu/alerting/stargazers","contributors_url":"https://api.github.com/repos/anmolbabu/alerting/contributors","subscribers_url":"https://api.github.com/repos/anmolbabu/alerting/subscribers","subscription_url":"https://api.github.com/repos/anmolbabu/alerting/subscription","commits_url":"https://api.github.com/repos/anmolbabu/alerting/commits{/sha}","git_commits_url":"https://api.github.com/repos/anmolbabu/alerting/git/commits{/sha}","comments_url":"https://api.github.com/repos/anmolbabu/alerting/comments{/number}","issue_comment_url":"https://api.github.com/repos/anmolbabu/alerting/issues/comments{/number}","contents_url":"https://api.github.com/repos/anmolbabu/alerting/contents/{+path}","compare_url":"https://api.github.com/repos/anmolbabu/alerting/compare/{base}...{head}","merges_url":"https://api.github.com/repos/anmolbabu/alerting/merges","archive_url":"https://api.github.com/repos/anmolbabu/alerting/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/anmolbabu/alerting/downloads","issues_url":"https://api.github.com/repos/anmolbabu/alerting/issues{/number}","pulls_url":"https://api.github.com/repos/anmolbabu/alerting/pulls{/number}","milestones_url":"https://api.github.com/repos/anmolbabu/alerting/milestones{/number}","notifications_url":"https://api.github.com/repos/anmolbabu/alerting/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/anmolbabu/alerting/labels{/name}","releases_url":"https://api.github.com/repos/anmolbabu/alerting/releases{/id}","deployments_url":"https://api.github.com/repos/anmolbabu/alerting/deployments","created_at":"2016-11-05T13:13:46Z","updated_at":"2016-12-16T06:32:31Z","pushed_at":"2017-02-05T12:59:42Z","git_url":"git://github.com/anmolbabu/alerting.git","ssh_url":"git@github.com:anmolbabu/alerting.git","clone_url":"https://github.com/anmolbabu/alerting.git","svn_url":"https://github.com/anmolbabu/alerting","homepage":null,"size":69,"stargazers_count":0,"watchers_count":0,"language":"Python","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":"Tendrl:master","ref":"master","sha":"f631521b398a26aab66f12662ab18b563d777e82","user":{"login":"Tendrl","id":19151627,"avatar_url":"https://avatars.githubusercontent.com/u/19151627?v=3","gravatar_id":"","url":"https://api.github.com/users/Tendrl","html_url":"https://github.com/Tendrl","followers_url":"https://api.github.com/users/Tendrl/followers","following_url":"https://api.github.com/users/Tendrl/following{/other_user}","gists_url":"https://api.github.com/users/Tendrl/gists{/gist_id}","starred_url":"https://api.github.com/users/Tendrl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Tendrl/subscriptions","organizations_url":"https://api.github.com/users/Tendrl/orgs","repos_url":"https://api.github.com/users/Tendrl/repos","events_url":"https://api.github.com/users/Tendrl/events{/privacy}","received_events_url":"https://api.github.com/users/Tendrl/received_events","type":"Organization","site_admin":false},"repo":{"id":72830965,"name":"alerting","full_name":"Tendrl/alerting","owner":{"login":"Tendrl","id":19151627,"avatar_url":"https://avatars.githubusercontent.com/u/19151627?v=3","gravatar_id":"","url":"https://api.github.com/users/Tendrl","html_url":"https://github.com/Tendrl","followers_url":"https://api.github.com/users/Tendrl/followers","following_url":"https://api.github.com/users/Tendrl/following{/other_user}","gists_url":"https://api.github.com/users/Tendrl/gists{/gist_id}","starred_url":"https://api.github.com/users/Tendrl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Tendrl/subscriptions","organizations_url":"https://api.github.com/users/Tendrl/orgs","repos_url":"https://api.github.com/users/Tendrl/repos","events_url":"https://api.github.com/users/Tendrl/events{/privacy}","received_events_url":"https://api.github.com/users/Tendrl/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Tendrl/alerting","description":"Alerting application for the core stack","fork":false,"url":"https://api.github.com/repos/Tendrl/alerting","forks_url":"https://api.github.com/repos/Tendrl/alerting/forks","keys_url":"https://api.github.com/repos/Tendrl/alerting/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Tendrl/alerting/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Tendrl/alerting/teams","hooks_url":"https://api.github.com/repos/Tendrl/alerting/hooks","issue_events_url":"https://api.github.com/repos/Tendrl/alerting/issues/events{/number}","events_url":"https://api.github.com/repos/Tendrl/alerting/events","assignees_url":"https://api.github.com/repos/Tendrl/alerting/assignees{/user}","branches_url":"https://api.github.com/repos/Tendrl/alerting/branches{/branch}","tags_url":"https://api.github.com/repos/Tendrl/alerting/tags","blobs_url":"https://api.github.com/repos/Tendrl/alerting/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Tendrl/alerting/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Tendrl/alerting/git/refs{/sha}","trees_url":"https://api.github.com/repos/Tendrl/alerting/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Tendrl/alerting/statuses/{sha}","languages_url":"https://api.github.com/repos/Tendrl/alerting/languages","stargazers_url":"https://api.github.com/repos/Tendrl/alerting/stargazers","contributors_url":"https://api.github.com/repos/Tendrl/alerting/contributors","subscribers_url":"https://api.github.com/repos/Tendrl/alerting/subscribers","subscription_url":"https://api.github.com/repos/Tendrl/alerting/subscription","commits_url":"https://api.github.com/repos/Tendrl/alerting/commits{/sha}","git_commits_url":"https://api.github.com/repos/Tendrl/alerting/git/commits{/sha}","comments_url":"https://api.github.com/repos/Tendrl/alerting/comments{/number}","issue_comment_url":"https://api.github.com/repos/Tendrl/alerting/issues/comments{/number}","contents_url":"https://api.github.com/repos/Tendrl/alerting/contents/{+path}","compare_url":"https://api.github.com/repos/Tendrl/alerting/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Tendrl/alerting/merges","archive_url":"https://api.github.com/repos/Tendrl/alerting/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Tendrl/alerting/downloads","issues_url":"https://api.github.com/repos/Tendrl/alerting/issues{/number}","pulls_url":"https://api.github.com/repos/Tendrl/alerting/pulls{/number}","milestones_url":"https://api.github.com/repos/Tendrl/alerting/milestones{/number}","notifications_url":"https://api.github.com/repos/Tendrl/alerting/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Tendrl/alerting/labels{/name}","releases_url":"https://api.github.com/repos/Tendrl/alerting/releases{/id}","deployments_url":"https://api.github.com/repos/Tendrl/alerting/deployments","created_at":"2016-11-04T09:00:33Z","updated_at":"2017-01-29T14:19:32Z","pushed_at":"2017-02-02T09:00:04Z","git_url":"git://github.com/Tendrl/alerting.git","ssh_url":"git@github.com:Tendrl/alerting.git","clone_url":"https://github.com/Tendrl/alerting.git","svn_url":"https://github.com/Tendrl/alerting","homepage":null,"size":60,"stargazers_count":2,"watchers_count":2,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":5,"mirror_url":null,"open_issues_count":21,"forks":5,"open_issues":21,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Tendrl/alerting/pulls/35"},"html":{"href":"https://github.com/Tendrl/alerting/pull/35"},"issue":{"href":"https://api.github.com/repos/Tendrl/alerting/issues/35"},"comments":{"href":"https://api.github.com/repos/Tendrl/alerting/issues/35/comments"},"review_comments":{"href":"https://api.github.com/repos/Tendrl/alerting/pulls/35/comments"},"review_comment":{"href":"https://api.github.com/repos/Tendrl/alerting/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Tendrl/alerting/pulls/35/commits"},"statuses":{"href":"https://api.github.com/repos/Tendrl/alerting/statuses/cbadaaa4a88af3f9d8305cfa7b87e5d801891fae"}}}}
{"actor":{"display_login":"anmolbabu"}}