{"action":"created","comment":{"url":"https://api.github.com/repos/ncclient/ncclient/pulls/comments/244810206","pull_request_review_id":188772715,"id":244810206,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDI0NDgxMDIwNg==","diff_hunk":"@@ -1,9 +1,500 @@\n from lxml import etree\n-\n from ncclient.xml_ import *\n from ncclient.operations.rpc import RPC\n+from ncclient.operations.rpc import RPCReply\n+from ncclient.operations.errors import AlreadyHasEventListener\n+from ncclient.transport import SessionListener\n+from dateutil.parser import parse\n+import logging\n+\n+\n+logger = logging.getLogger(\"ncclient.operations.rpc\")\n \n class SaveConfig(RPC):\n     def request(self):\n         node = etree.Element(qualify('save-config', \"http://cisco.com/yang/cisco-ia\"))\n         return self._request(node)\n+\n+\n+#\n+# Message with period specified\n+#\n+# - msgid\n+# - streamxpath\n+# - period\n+#\n+period_template = '''<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n+<rpc message-id=\"{msgid}\" xmlns=\"urn:ietf:params:xml:ns:netconf:base:1.0\">\n+ <establish-subscription xmlns=\"urn:ietf:params:xml:ns:yang:ietf-event-notifications\"\n+   xmlns:yp=\"urn:ietf:params:xml:ns:yang:ietf-yang-push\">\n+  <stream>yp:yang-push</stream>\n+  <yp:xpath-filter>{streamxpath}</yp:xpath-filter>\n+  <yp:period>{period}</yp:period>\n+ </establish-subscription>\n+</rpc>'''\n+\n+\n+#\n+# Message with dampening-period specified\n+#\n+# - msgid\n+# - streamxpath\n+# - dampeningperiod\n+#\n+dampening_period_template = '''<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n+<rpc message-id=\"{msgid}\" xmlns=\"urn:ietf:params:xml:ns:netconf:base:1.0\">\n+ <establish-subscription xmlns=\"urn:ietf:params:xml:ns:yang:ietf-event-notifications\"\n+   xmlns:yp=\"urn:ietf:params:xml:ns:yang:ietf-yang-push\">\n+  <stream>yp:yang-push</stream>\n+  <yp:xpath-filter>{streamxpath}</yp:xpath-filter>\n+  <yp:dampening-period>{dampeningperiod}</yp:dampening-period>\n+ </establish-subscription>\n+</rpc>'''\n+\n+\n+#\n+# Message for stream subscription to yang-notif-native\n+#\n+# - msgid\n+# - streamns\n+# - streamident\n+# - streamxpath\n+#\n+stream_subscription_template = '''<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n+<rpc message-id=\"{msgid}\" xmlns=\"urn:ietf:params:xml:ns:netconf:base:1.0\">\n+ <establish-subscription xmlns=\"urn:ietf:params:xml:ns:yang:ietf-event-notifications\"\n+   xmlns:yp=\"urn:ietf:params:xml:ns:yang:ietf-yang-push\">\n+  <stream xmlns:ns1=\"{streamns}\">ns1:{streamident}</stream>\n+  <yp:xpath-filter>{streamxpath}</yp:xpath-filter>\n+ </establish-subscription>\n+</rpc>'''\n+\n+\n+class EstablishSubscriptionReply(RPCReply):\n+\n+    \"\"\"Establish Subscription Result RPCReply Class.\"\"\"\n+    \n+    def _parsing_hook(self, root):\n+        self._result = None\n+        self._subscription_id = None\n+        self._message_id = root.get('message-id')\n+        if not self._errors:\n+            self._subscription_result = root.find(\n+                qualify(\"subscription-result\", IETF_EVENT_NOTIFICATIONS_NS))\n+            self._subscription_id = root.find(\n+                qualify(\"subscription-id\", IETF_EVENT_NOTIFICATIONS_NS))\n+\n+    def _post_process(self, original_rpc):\n+        if self._subscription_id is not None:\n+            original_rpc.session.yang_push_listener.rekey_subscription_listener(\n+                self._message_id, int(self._subscription_id.text))\n+        else:\n+            original_rpc.session.yang_push_listener.remove_subscription_listener(\n+                        self._message_id)\n+\n+    @property\n+    def subscription_result(self):\n+        \"*subscription-result* element as an :class:`~xml.etree.ElementTree.Element`\"","path":"ncclient/operations/third_party/iosxe/rpc.py","position":98,"original_position":98,"commit_id":"588ed805548ba6e95e7b343a9cd6aff09cc1bd52","original_commit_id":"588ed805548ba6e95e7b343a9cd6aff09cc1bd52","user":{"login":"einarnn","id":5408368,"node_id":"MDQ6VXNlcjU0MDgzNjg=","avatar_url":"https://avatars3.githubusercontent.com/u/5408368?v=4","gravatar_id":"","url":"https://api.github.com/users/einarnn","html_url":"https://github.com/einarnn","followers_url":"https://api.github.com/users/einarnn/followers","following_url":"https://api.github.com/users/einarnn/following{/other_user}","gists_url":"https://api.github.com/users/einarnn/gists{/gist_id}","starred_url":"https://api.github.com/users/einarnn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/einarnn/subscriptions","organizations_url":"https://api.github.com/users/einarnn/orgs","repos_url":"https://api.github.com/users/einarnn/repos","events_url":"https://api.github.com/users/einarnn/events{/privacy}","received_events_url":"https://api.github.com/users/einarnn/received_events","type":"User","site_admin":false},"body":"Updated.","created_at":"2019-01-02T18:15:49Z","updated_at":"2019-01-02T18:15:49Z","html_url":"https://github.com/ncclient/ncclient/pull/297#discussion_r244810206","pull_request_url":"https://api.github.com/repos/ncclient/ncclient/pulls/297","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/ncclient/ncclient/pulls/comments/244810206"},"html":{"href":"https://github.com/ncclient/ncclient/pull/297#discussion_r244810206"},"pull_request":{"href":"https://api.github.com/repos/ncclient/ncclient/pulls/297"}},"in_reply_to_id":244743883},"pull_request":{"url":"https://api.github.com/repos/ncclient/ncclient/pulls/297","id":240708701,"node_id":"MDExOlB1bGxSZXF1ZXN0MjQwNzA4NzAx","html_url":"https://github.com/ncclient/ncclient/pull/297","diff_url":"https://github.com/ncclient/ncclient/pull/297.diff","patch_url":"https://github.com/ncclient/ncclient/pull/297.patch","issue_url":"https://api.github.com/repos/ncclient/ncclient/issues/297","number":297,"state":"open","locked":false,"title":"Support for draft IETF YANG Push functionality in IOS XE device handler","user":{"login":"einarnn","id":5408368,"node_id":"MDQ6VXNlcjU0MDgzNjg=","avatar_url":"https://avatars3.githubusercontent.com/u/5408368?v=4","gravatar_id":"","url":"https://api.github.com/users/einarnn","html_url":"https://github.com/einarnn","followers_url":"https://api.github.com/users/einarnn/followers","following_url":"https://api.github.com/users/einarnn/following{/other_user}","gists_url":"https://api.github.com/users/einarnn/gists{/gist_id}","starred_url":"https://api.github.com/users/einarnn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/einarnn/subscriptions","organizations_url":"https://api.github.com/users/einarnn/orgs","repos_url":"https://api.github.com/users/einarnn/repos","events_url":"https://api.github.com/users/einarnn/events{/privacy}","received_events_url":"https://api.github.com/users/einarnn/received_events","type":"User","site_admin":false},"body":"This is an initial pull request for pre-RFC IETF YANG Push drafts support, implemented in the Cisco IOS XE device handler. Once the YANG Push drafts are approved **and** there are devices supporting it, this functionality will be added to core of ncclient.\r\n\r\nFurther, included initial support for making notification handlers that would process the same namespace mutually exclusive. In this case, if `create-subscription` is used before `establish-subscription`, then `establish-subscription will fail, and vice-versa.\r\n","created_at":"2018-12-24T01:05:14Z","updated_at":"2019-01-02T18:15:49Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d70aaee80fca8332f3bea332179eab07609de28e","assignee":{"login":"einarnn","id":5408368,"node_id":"MDQ6VXNlcjU0MDgzNjg=","avatar_url":"https://avatars3.githubusercontent.com/u/5408368?v=4","gravatar_id":"","url":"https://api.github.com/users/einarnn","html_url":"https://github.com/einarnn","followers_url":"https://api.github.com/users/einarnn/followers","following_url":"https://api.github.com/users/einarnn/following{/other_user}","gists_url":"https://api.github.com/users/einarnn/gists{/gist_id}","starred_url":"https://api.github.com/users/einarnn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/einarnn/subscriptions","organizations_url":"https://api.github.com/users/einarnn/orgs","repos_url":"https://api.github.com/users/einarnn/repos","events_url":"https://api.github.com/users/einarnn/events{/privacy}","received_events_url":"https://api.github.com/users/einarnn/received_events","type":"User","site_admin":false},"assignees":[{"login":"einarnn","id":5408368,"node_id":"MDQ6VXNlcjU0MDgzNjg=","avatar_url":"https://avatars3.githubusercontent.com/u/5408368?v=4","gravatar_id":"","url":"https://api.github.com/users/einarnn","html_url":"https://github.com/einarnn","followers_url":"https://api.github.com/users/einarnn/followers","following_url":"https://api.github.com/users/einarnn/following{/other_user}","gists_url":"https://api.github.com/users/einarnn/gists{/gist_id}","starred_url":"https://api.github.com/users/einarnn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/einarnn/subscriptions","organizations_url":"https://api.github.com/users/einarnn/orgs","repos_url":"https://api.github.com/users/einarnn/repos","events_url":"https://api.github.com/users/einarnn/events{/privacy}","received_events_url":"https://api.github.com/users/einarnn/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/ncclient/ncclient/pulls/297/commits","review_comments_url":"https://api.github.com/repos/ncclient/ncclient/pulls/297/comments","review_comment_url":"https://api.github.com/repos/ncclient/ncclient/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ncclient/ncclient/issues/297/comments","statuses_url":"https://api.github.com/repos/ncclient/ncclient/statuses/588ed805548ba6e95e7b343a9cd6aff09cc1bd52","head":{"label":"ncclient:einarnn-iosxe-yangpush","ref":"einarnn-iosxe-yangpush","sha":"588ed805548ba6e95e7b343a9cd6aff09cc1bd52","user":{"login":"ncclient","id":12877522,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEyODc3NTIy","avatar_url":"https://avatars2.githubusercontent.com/u/12877522?v=4","gravatar_id":"","url":"https://api.github.com/users/ncclient","html_url":"https://github.com/ncclient","followers_url":"https://api.github.com/users/ncclient/followers","following_url":"https://api.github.com/users/ncclient/following{/other_user}","gists_url":"https://api.github.com/users/ncclient/gists{/gist_id}","starred_url":"https://api.github.com/users/ncclient/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ncclient/subscriptions","organizations_url":"https://api.github.com/users/ncclient/orgs","repos_url":"https://api.github.com/users/ncclient/repos","events_url":"https://api.github.com/users/ncclient/events{/privacy}","received_events_url":"https://api.github.com/users/ncclient/received_events","type":"Organization","site_admin":false},"repo":{"id":1706198,"node_id":"MDEwOlJlcG9zaXRvcnkxNzA2MTk4","name":"ncclient","full_name":"ncclient/ncclient","private":false,"owner":{"login":"ncclient","id":12877522,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEyODc3NTIy","avatar_url":"https://avatars2.githubusercontent.com/u/12877522?v=4","gravatar_id":"","url":"https://api.github.com/users/ncclient","html_url":"https://github.com/ncclient","followers_url":"https://api.github.com/users/ncclient/followers","following_url":"https://api.github.com/users/ncclient/following{/other_user}","gists_url":"https://api.github.com/users/ncclient/gists{/gist_id}","starred_url":"https://api.github.com/users/ncclient/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ncclient/subscriptions","organizations_url":"https://api.github.com/users/ncclient/orgs","repos_url":"https://api.github.com/users/ncclient/repos","events_url":"https://api.github.com/users/ncclient/events{/privacy}","received_events_url":"https://api.github.com/users/ncclient/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/ncclient/ncclient","description":"Python library for NETCONF clients","fork":false,"url":"https://api.github.com/repos/ncclient/ncclient","forks_url":"https://api.github.com/repos/ncclient/ncclient/forks","keys_url":"https://api.github.com/repos/ncclient/ncclient/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ncclient/ncclient/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ncclient/ncclient/teams","hooks_url":"https://api.github.com/repos/ncclient/ncclient/hooks","issue_events_url":"https://api.github.com/repos/ncclient/ncclient/issues/events{/number}","events_url":"https://api.github.com/repos/ncclient/ncclient/events","assignees_url":"https://api.github.com/repos/ncclient/ncclient/assignees{/user}","branches_url":"https://api.github.com/repos/ncclient/ncclient/branches{/branch}","tags_url":"https://api.github.com/repos/ncclient/ncclient/tags","blobs_url":"https://api.github.com/repos/ncclient/ncclient/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ncclient/ncclient/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ncclient/ncclient/git/refs{/sha}","trees_url":"https://api.github.com/repos/ncclient/ncclient/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ncclient/ncclient/statuses/{sha}","languages_url":"https://api.github.com/repos/ncclient/ncclient/languages","stargazers_url":"https://api.github.com/repos/ncclient/ncclient/stargazers","contributors_url":"https://api.github.com/repos/ncclient/ncclient/contributors","subscribers_url":"https://api.github.com/repos/ncclient/ncclient/subscribers","subscription_url":"https://api.github.com/repos/ncclient/ncclient/subscription","commits_url":"https://api.github.com/repos/ncclient/ncclient/commits{/sha}","git_commits_url":"https://api.github.com/repos/ncclient/ncclient/git/commits{/sha}","comments_url":"https://api.github.com/repos/ncclient/ncclient/comments{/number}","issue_comment_url":"https://api.github.com/repos/ncclient/ncclient/issues/comments{/number}","contents_url":"https://api.github.com/repos/ncclient/ncclient/contents/{+path}","compare_url":"https://api.github.com/repos/ncclient/ncclient/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ncclient/ncclient/merges","archive_url":"https://api.github.com/repos/ncclient/ncclient/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ncclient/ncclient/downloads","issues_url":"https://api.github.com/repos/ncclient/ncclient/issues{/number}","pulls_url":"https://api.github.com/repos/ncclient/ncclient/pulls{/number}","milestones_url":"https://api.github.com/repos/ncclient/ncclient/milestones{/number}","notifications_url":"https://api.github.com/repos/ncclient/ncclient/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ncclient/ncclient/labels{/name}","releases_url":"https://api.github.com/repos/ncclient/ncclient/releases{/id}","deployments_url":"https://api.github.com/repos/ncclient/ncclient/deployments","created_at":"2011-05-05T13:02:44Z","updated_at":"2018-12-27T00:10:27Z","pushed_at":"2018-12-27T00:11:04Z","git_url":"git://github.com/ncclient/ncclient.git","ssh_url":"git@github.com:ncclient/ncclient.git","clone_url":"https://github.com/ncclient/ncclient.git","svn_url":"https://github.com/ncclient/ncclient","homepage":"","size":2966,"stargazers_count":283,"watchers_count":283,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":236,"mirror_url":null,"archived":false,"open_issues_count":44,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":236,"open_issues":44,"watchers":283,"default_branch":"master"}},"base":{"label":"ncclient:master","ref":"master","sha":"afcee58015996556dc24bb5ac1f4e57d9d2deefc","user":{"login":"ncclient","id":12877522,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEyODc3NTIy","avatar_url":"https://avatars2.githubusercontent.com/u/12877522?v=4","gravatar_id":"","url":"https://api.github.com/users/ncclient","html_url":"https://github.com/ncclient","followers_url":"https://api.github.com/users/ncclient/followers","following_url":"https://api.github.com/users/ncclient/following{/other_user}","gists_url":"https://api.github.com/users/ncclient/gists{/gist_id}","starred_url":"https://api.github.com/users/ncclient/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ncclient/subscriptions","organizations_url":"https://api.github.com/users/ncclient/orgs","repos_url":"https://api.github.com/users/ncclient/repos","events_url":"https://api.github.com/users/ncclient/events{/privacy}","received_events_url":"https://api.github.com/users/ncclient/received_events","type":"Organization","site_admin":false},"repo":{"id":1706198,"node_id":"MDEwOlJlcG9zaXRvcnkxNzA2MTk4","name":"ncclient","full_name":"ncclient/ncclient","private":false,"owner":{"login":"ncclient","id":12877522,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEyODc3NTIy","avatar_url":"https://avatars2.githubusercontent.com/u/12877522?v=4","gravatar_id":"","url":"https://api.github.com/users/ncclient","html_url":"https://github.com/ncclient","followers_url":"https://api.github.com/users/ncclient/followers","following_url":"https://api.github.com/users/ncclient/following{/other_user}","gists_url":"https://api.github.com/users/ncclient/gists{/gist_id}","starred_url":"https://api.github.com/users/ncclient/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ncclient/subscriptions","organizations_url":"https://api.github.com/users/ncclient/orgs","repos_url":"https://api.github.com/users/ncclient/repos","events_url":"https://api.github.com/users/ncclient/events{/privacy}","received_events_url":"https://api.github.com/users/ncclient/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/ncclient/ncclient","description":"Python library for NETCONF clients","fork":false,"url":"https://api.github.com/repos/ncclient/ncclient","forks_url":"https://api.github.com/repos/ncclient/ncclient/forks","keys_url":"https://api.github.com/repos/ncclient/ncclient/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ncclient/ncclient/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ncclient/ncclient/teams","hooks_url":"https://api.github.com/repos/ncclient/ncclient/hooks","issue_events_url":"https://api.github.com/repos/ncclient/ncclient/issues/events{/number}","events_url":"https://api.github.com/repos/ncclient/ncclient/events","assignees_url":"https://api.github.com/repos/ncclient/ncclient/assignees{/user}","branches_url":"https://api.github.com/repos/ncclient/ncclient/branches{/branch}","tags_url":"https://api.github.com/repos/ncclient/ncclient/tags","blobs_url":"https://api.github.com/repos/ncclient/ncclient/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ncclient/ncclient/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ncclient/ncclient/git/refs{/sha}","trees_url":"https://api.github.com/repos/ncclient/ncclient/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ncclient/ncclient/statuses/{sha}","languages_url":"https://api.github.com/repos/ncclient/ncclient/languages","stargazers_url":"https://api.github.com/repos/ncclient/ncclient/stargazers","contributors_url":"https://api.github.com/repos/ncclient/ncclient/contributors","subscribers_url":"https://api.github.com/repos/ncclient/ncclient/subscribers","subscription_url":"https://api.github.com/repos/ncclient/ncclient/subscription","commits_url":"https://api.github.com/repos/ncclient/ncclient/commits{/sha}","git_commits_url":"https://api.github.com/repos/ncclient/ncclient/git/commits{/sha}","comments_url":"https://api.github.com/repos/ncclient/ncclient/comments{/number}","issue_comment_url":"https://api.github.com/repos/ncclient/ncclient/issues/comments{/number}","contents_url":"https://api.github.com/repos/ncclient/ncclient/contents/{+path}","compare_url":"https://api.github.com/repos/ncclient/ncclient/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ncclient/ncclient/merges","archive_url":"https://api.github.com/repos/ncclient/ncclient/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ncclient/ncclient/downloads","issues_url":"https://api.github.com/repos/ncclient/ncclient/issues{/number}","pulls_url":"https://api.github.com/repos/ncclient/ncclient/pulls{/number}","milestones_url":"https://api.github.com/repos/ncclient/ncclient/milestones{/number}","notifications_url":"https://api.github.com/repos/ncclient/ncclient/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ncclient/ncclient/labels{/name}","releases_url":"https://api.github.com/repos/ncclient/ncclient/releases{/id}","deployments_url":"https://api.github.com/repos/ncclient/ncclient/deployments","created_at":"2011-05-05T13:02:44Z","updated_at":"2018-12-27T00:10:27Z","pushed_at":"2018-12-27T00:11:04Z","git_url":"git://github.com/ncclient/ncclient.git","ssh_url":"git@github.com:ncclient/ncclient.git","clone_url":"https://github.com/ncclient/ncclient.git","svn_url":"https://github.com/ncclient/ncclient","homepage":"","size":2966,"stargazers_count":283,"watchers_count":283,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":236,"mirror_url":null,"archived":false,"open_issues_count":44,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":236,"open_issues":44,"watchers":283,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ncclient/ncclient/pulls/297"},"html":{"href":"https://github.com/ncclient/ncclient/pull/297"},"issue":{"href":"https://api.github.com/repos/ncclient/ncclient/issues/297"},"comments":{"href":"https://api.github.com/repos/ncclient/ncclient/issues/297/comments"},"review_comments":{"href":"https://api.github.com/repos/ncclient/ncclient/pulls/297/comments"},"review_comment":{"href":"https://api.github.com/repos/ncclient/ncclient/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ncclient/ncclient/pulls/297/commits"},"statuses":{"href":"https://api.github.com/repos/ncclient/ncclient/statuses/588ed805548ba6e95e7b343a9cd6aff09cc1bd52"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"einarnn"}}