{"action":"closed","number":735,"pull_request":{"url":"https://api.github.com/repos/kytos/kytos/pulls/735","id":188577124,"html_url":"https://github.com/kytos/kytos/pull/735","diff_url":"https://github.com/kytos/kytos/pull/735.diff","patch_url":"https://github.com/kytos/kytos/pull/735.patch","issue_url":"https://api.github.com/repos/kytos/kytos/issues/735","number":735,"state":"closed","locked":false,"title":"Added send_event on controller.py","user":{"login":"viniciusarcanjo","id":1010796,"avatar_url":"https://avatars2.githubusercontent.com/u/1010796?v=4","gravatar_id":"","url":"https://api.github.com/users/viniciusarcanjo","html_url":"https://github.com/viniciusarcanjo","followers_url":"https://api.github.com/users/viniciusarcanjo/followers","following_url":"https://api.github.com/users/viniciusarcanjo/following{/other_user}","gists_url":"https://api.github.com/users/viniciusarcanjo/gists{/gist_id}","starred_url":"https://api.github.com/users/viniciusarcanjo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/viniciusarcanjo/subscriptions","organizations_url":"https://api.github.com/users/viniciusarcanjo/orgs","repos_url":"https://api.github.com/users/viniciusarcanjo/repos","events_url":"https://api.github.com/users/viniciusarcanjo/events{/privacy}","received_events_url":"https://api.github.com/users/viniciusarcanjo/received_events","type":"User","site_admin":false},"body":"Hi team, whenever a NApp developer wanted to send an event to other NApp, he needed to import KytosEvent and put the event in the queue. I believe this detail of putting the event in the queue should be abstracted to the NApp developer. So, this PR adds a function `send_event(name, content)` to address this. The developer only needs to write a single line to send a KytosEvent to other Napps now:\r\n\r\n```\r\nself.controller.send_event(event_name, content)\r\n```\r\n\r\nFor example, on these three NApps (topology, flow_manager and mef_eline) you can see this repeated pattern:\r\n\r\n```\r\nkytos/topology/main.py\r\n6:from kytos.core import KytosEvent, KytosNApp, log, rest\r\n414:        event = KytosEvent(name=name, content={'topology':\r\n416:        self.controller.buffers.app.put(event)\r\n431:        event = KytosEvent(name=name, content={entity: obj,\r\n433:        self.controller.buffers.app.put(event)\r\n\r\nkytos/flow_manager/main.py\r\n135:        event_app = KytosEvent(name, content)\r\n136:        self.controller.buffers.app.put(event_app)\r\n\r\nkytos/mef_eline/main.py\r\n12:from kytos.core.events import KytosEvent\r\n242:        event = KytosEvent(name=name, content=content)\r\n243:        self.controller.buffers.app.put(event)\r\n268:        event = KytosEvent(name=name, content=content)\r\n269:        self.controller.buffers.app.put(event)\r\n292:        event = KytosEvent(name=name, content=content)\r\n293:        self.controller.buffers.app.put(event)\r\n367:        event = KytosEvent(name=name, content=content)\r\n368:        self.controller.buffers.app.put(event)\r\n```\r\n","created_at":"2018-05-16T22:21:46Z","updated_at":"2018-05-17T21:09:06Z","closed_at":"2018-05-17T21:09:06Z","merged_at":null,"merge_commit_sha":"0bad69c0980702516081edc2a6877a565eedf1ed","assignee":null,"assignees":[],"requested_reviewers":[{"login":"hdiogenes","id":3139,"avatar_url":"https://avatars1.githubusercontent.com/u/3139?v=4","gravatar_id":"","url":"https://api.github.com/users/hdiogenes","html_url":"https://github.com/hdiogenes","followers_url":"https://api.github.com/users/hdiogenes/followers","following_url":"https://api.github.com/users/hdiogenes/following{/other_user}","gists_url":"https://api.github.com/users/hdiogenes/gists{/gist_id}","starred_url":"https://api.github.com/users/hdiogenes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hdiogenes/subscriptions","organizations_url":"https://api.github.com/users/hdiogenes/orgs","repos_url":"https://api.github.com/users/hdiogenes/repos","events_url":"https://api.github.com/users/hdiogenes/events{/privacy}","received_events_url":"https://api.github.com/users/hdiogenes/received_events","type":"User","site_admin":false},{"login":"beraldoleal","id":49336,"avatar_url":"https://avatars2.githubusercontent.com/u/49336?v=4","gravatar_id":"","url":"https://api.github.com/users/beraldoleal","html_url":"https://github.com/beraldoleal","followers_url":"https://api.github.com/users/beraldoleal/followers","following_url":"https://api.github.com/users/beraldoleal/following{/other_user}","gists_url":"https://api.github.com/users/beraldoleal/gists{/gist_id}","starred_url":"https://api.github.com/users/beraldoleal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/beraldoleal/subscriptions","organizations_url":"https://api.github.com/users/beraldoleal/orgs","repos_url":"https://api.github.com/users/beraldoleal/repos","events_url":"https://api.github.com/users/beraldoleal/events{/privacy}","received_events_url":"https://api.github.com/users/beraldoleal/received_events","type":"User","site_admin":false},{"login":"macartur","id":2965806,"avatar_url":"https://avatars1.githubusercontent.com/u/2965806?v=4","gravatar_id":"","url":"https://api.github.com/users/macartur","html_url":"https://github.com/macartur","followers_url":"https://api.github.com/users/macartur/followers","following_url":"https://api.github.com/users/macartur/following{/other_user}","gists_url":"https://api.github.com/users/macartur/gists{/gist_id}","starred_url":"https://api.github.com/users/macartur/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/macartur/subscriptions","organizations_url":"https://api.github.com/users/macartur/orgs","repos_url":"https://api.github.com/users/macartur/repos","events_url":"https://api.github.com/users/macartur/events{/privacy}","received_events_url":"https://api.github.com/users/macartur/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/kytos/kytos/pulls/735/commits","review_comments_url":"https://api.github.com/repos/kytos/kytos/pulls/735/comments","review_comment_url":"https://api.github.com/repos/kytos/kytos/pulls/comments{/number}","comments_url":"https://api.github.com/repos/kytos/kytos/issues/735/comments","statuses_url":"https://api.github.com/repos/kytos/kytos/statuses/ae650b1c9d27ac088328a2df19017163a80086e4","head":{"label":"viniciusarcanjo:send_event_method","ref":"send_event_method","sha":"ae650b1c9d27ac088328a2df19017163a80086e4","user":{"login":"viniciusarcanjo","id":1010796,"avatar_url":"https://avatars2.githubusercontent.com/u/1010796?v=4","gravatar_id":"","url":"https://api.github.com/users/viniciusarcanjo","html_url":"https://github.com/viniciusarcanjo","followers_url":"https://api.github.com/users/viniciusarcanjo/followers","following_url":"https://api.github.com/users/viniciusarcanjo/following{/other_user}","gists_url":"https://api.github.com/users/viniciusarcanjo/gists{/gist_id}","starred_url":"https://api.github.com/users/viniciusarcanjo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/viniciusarcanjo/subscriptions","organizations_url":"https://api.github.com/users/viniciusarcanjo/orgs","repos_url":"https://api.github.com/users/viniciusarcanjo/repos","events_url":"https://api.github.com/users/viniciusarcanjo/events{/privacy}","received_events_url":"https://api.github.com/users/viniciusarcanjo/received_events","type":"User","site_admin":false},"repo":{"id":98823934,"name":"kytos","full_name":"viniciusarcanjo/kytos","owner":{"login":"viniciusarcanjo","id":1010796,"avatar_url":"https://avatars2.githubusercontent.com/u/1010796?v=4","gravatar_id":"","url":"https://api.github.com/users/viniciusarcanjo","html_url":"https://github.com/viniciusarcanjo","followers_url":"https://api.github.com/users/viniciusarcanjo/followers","following_url":"https://api.github.com/users/viniciusarcanjo/following{/other_user}","gists_url":"https://api.github.com/users/viniciusarcanjo/gists{/gist_id}","starred_url":"https://api.github.com/users/viniciusarcanjo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/viniciusarcanjo/subscriptions","organizations_url":"https://api.github.com/users/viniciusarcanjo/orgs","repos_url":"https://api.github.com/users/viniciusarcanjo/repos","events_url":"https://api.github.com/users/viniciusarcanjo/events{/privacy}","received_events_url":"https://api.github.com/users/viniciusarcanjo/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/viniciusarcanjo/kytos","description":"Kytos SDN Platform (kytos heart) ","fork":true,"url":"https://api.github.com/repos/viniciusarcanjo/kytos","forks_url":"https://api.github.com/repos/viniciusarcanjo/kytos/forks","keys_url":"https://api.github.com/repos/viniciusarcanjo/kytos/keys{/key_id}","collaborators_url":"https://api.github.com/repos/viniciusarcanjo/kytos/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/viniciusarcanjo/kytos/teams","hooks_url":"https://api.github.com/repos/viniciusarcanjo/kytos/hooks","issue_events_url":"https://api.github.com/repos/viniciusarcanjo/kytos/issues/events{/number}","events_url":"https://api.github.com/repos/viniciusarcanjo/kytos/events","assignees_url":"https://api.github.com/repos/viniciusarcanjo/kytos/assignees{/user}","branches_url":"https://api.github.com/repos/viniciusarcanjo/kytos/branches{/branch}","tags_url":"https://api.github.com/repos/viniciusarcanjo/kytos/tags","blobs_url":"https://api.github.com/repos/viniciusarcanjo/kytos/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/viniciusarcanjo/kytos/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/viniciusarcanjo/kytos/git/refs{/sha}","trees_url":"https://api.github.com/repos/viniciusarcanjo/kytos/git/trees{/sha}","statuses_url":"https://api.github.com/repos/viniciusarcanjo/kytos/statuses/{sha}","languages_url":"https://api.github.com/repos/viniciusarcanjo/kytos/languages","stargazers_url":"https://api.github.com/repos/viniciusarcanjo/kytos/stargazers","contributors_url":"https://api.github.com/repos/viniciusarcanjo/kytos/contributors","subscribers_url":"https://api.github.com/repos/viniciusarcanjo/kytos/subscribers","subscription_url":"https://api.github.com/repos/viniciusarcanjo/kytos/subscription","commits_url":"https://api.github.com/repos/viniciusarcanjo/kytos/commits{/sha}","git_commits_url":"https://api.github.com/repos/viniciusarcanjo/kytos/git/commits{/sha}","comments_url":"https://api.github.com/repos/viniciusarcanjo/kytos/comments{/number}","issue_comment_url":"https://api.github.com/repos/viniciusarcanjo/kytos/issues/comments{/number}","contents_url":"https://api.github.com/repos/viniciusarcanjo/kytos/contents/{+path}","compare_url":"https://api.github.com/repos/viniciusarcanjo/kytos/compare/{base}...{head}","merges_url":"https://api.github.com/repos/viniciusarcanjo/kytos/merges","archive_url":"https://api.github.com/repos/viniciusarcanjo/kytos/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/viniciusarcanjo/kytos/downloads","issues_url":"https://api.github.com/repos/viniciusarcanjo/kytos/issues{/number}","pulls_url":"https://api.github.com/repos/viniciusarcanjo/kytos/pulls{/number}","milestones_url":"https://api.github.com/repos/viniciusarcanjo/kytos/milestones{/number}","notifications_url":"https://api.github.com/repos/viniciusarcanjo/kytos/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/viniciusarcanjo/kytos/labels{/name}","releases_url":"https://api.github.com/repos/viniciusarcanjo/kytos/releases{/id}","deployments_url":"https://api.github.com/repos/viniciusarcanjo/kytos/deployments","created_at":"2017-07-30T20:48:26Z","updated_at":"2018-05-16T22:19:00Z","pushed_at":"2018-05-16T22:19:50Z","git_url":"git://github.com/viniciusarcanjo/kytos.git","ssh_url":"git@github.com:viniciusarcanjo/kytos.git","clone_url":"https://github.com/viniciusarcanjo/kytos.git","svn_url":"https://github.com/viniciusarcanjo/kytos","homepage":"https://kytos.io/","size":7564,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"kytos:master","ref":"master","sha":"ac62bd13dd2b423fb623de7a2bff063243d73380","user":{"login":"kytos","id":16357103,"avatar_url":"https://avatars1.githubusercontent.com/u/16357103?v=4","gravatar_id":"","url":"https://api.github.com/users/kytos","html_url":"https://github.com/kytos","followers_url":"https://api.github.com/users/kytos/followers","following_url":"https://api.github.com/users/kytos/following{/other_user}","gists_url":"https://api.github.com/users/kytos/gists{/gist_id}","starred_url":"https://api.github.com/users/kytos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kytos/subscriptions","organizations_url":"https://api.github.com/users/kytos/orgs","repos_url":"https://api.github.com/users/kytos/repos","events_url":"https://api.github.com/users/kytos/events{/privacy}","received_events_url":"https://api.github.com/users/kytos/received_events","type":"Organization","site_admin":false},"repo":{"id":60872406,"name":"kytos","full_name":"kytos/kytos","owner":{"login":"kytos","id":16357103,"avatar_url":"https://avatars1.githubusercontent.com/u/16357103?v=4","gravatar_id":"","url":"https://api.github.com/users/kytos","html_url":"https://github.com/kytos","followers_url":"https://api.github.com/users/kytos/followers","following_url":"https://api.github.com/users/kytos/following{/other_user}","gists_url":"https://api.github.com/users/kytos/gists{/gist_id}","starred_url":"https://api.github.com/users/kytos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kytos/subscriptions","organizations_url":"https://api.github.com/users/kytos/orgs","repos_url":"https://api.github.com/users/kytos/repos","events_url":"https://api.github.com/users/kytos/events{/privacy}","received_events_url":"https://api.github.com/users/kytos/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/kytos/kytos","description":"Kytos SDN Platform (kytos heart) ","fork":false,"url":"https://api.github.com/repos/kytos/kytos","forks_url":"https://api.github.com/repos/kytos/kytos/forks","keys_url":"https://api.github.com/repos/kytos/kytos/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kytos/kytos/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kytos/kytos/teams","hooks_url":"https://api.github.com/repos/kytos/kytos/hooks","issue_events_url":"https://api.github.com/repos/kytos/kytos/issues/events{/number}","events_url":"https://api.github.com/repos/kytos/kytos/events","assignees_url":"https://api.github.com/repos/kytos/kytos/assignees{/user}","branches_url":"https://api.github.com/repos/kytos/kytos/branches{/branch}","tags_url":"https://api.github.com/repos/kytos/kytos/tags","blobs_url":"https://api.github.com/repos/kytos/kytos/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kytos/kytos/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kytos/kytos/git/refs{/sha}","trees_url":"https://api.github.com/repos/kytos/kytos/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kytos/kytos/statuses/{sha}","languages_url":"https://api.github.com/repos/kytos/kytos/languages","stargazers_url":"https://api.github.com/repos/kytos/kytos/stargazers","contributors_url":"https://api.github.com/repos/kytos/kytos/contributors","subscribers_url":"https://api.github.com/repos/kytos/kytos/subscribers","subscription_url":"https://api.github.com/repos/kytos/kytos/subscription","commits_url":"https://api.github.com/repos/kytos/kytos/commits{/sha}","git_commits_url":"https://api.github.com/repos/kytos/kytos/git/commits{/sha}","comments_url":"https://api.github.com/repos/kytos/kytos/comments{/number}","issue_comment_url":"https://api.github.com/repos/kytos/kytos/issues/comments{/number}","contents_url":"https://api.github.com/repos/kytos/kytos/contents/{+path}","compare_url":"https://api.github.com/repos/kytos/kytos/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kytos/kytos/merges","archive_url":"https://api.github.com/repos/kytos/kytos/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kytos/kytos/downloads","issues_url":"https://api.github.com/repos/kytos/kytos/issues{/number}","pulls_url":"https://api.github.com/repos/kytos/kytos/pulls{/number}","milestones_url":"https://api.github.com/repos/kytos/kytos/milestones{/number}","notifications_url":"https://api.github.com/repos/kytos/kytos/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kytos/kytos/labels{/name}","releases_url":"https://api.github.com/repos/kytos/kytos/releases{/id}","deployments_url":"https://api.github.com/repos/kytos/kytos/deployments","created_at":"2016-06-10T19:37:43Z","updated_at":"2018-05-17T17:30:03Z","pushed_at":"2018-05-17T20:14:33Z","git_url":"git://github.com/kytos/kytos.git","ssh_url":"git@github.com:kytos/kytos.git","clone_url":"https://github.com/kytos/kytos.git","svn_url":"https://github.com/kytos/kytos","homepage":"https://kytos.io/","size":7572,"stargazers_count":16,"watchers_count":16,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":18,"mirror_url":null,"archived":false,"open_issues_count":67,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":18,"open_issues":67,"watchers":16,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/kytos/kytos/pulls/735"},"html":{"href":"https://github.com/kytos/kytos/pull/735"},"issue":{"href":"https://api.github.com/repos/kytos/kytos/issues/735"},"comments":{"href":"https://api.github.com/repos/kytos/kytos/issues/735/comments"},"review_comments":{"href":"https://api.github.com/repos/kytos/kytos/pulls/735/comments"},"review_comment":{"href":"https://api.github.com/repos/kytos/kytos/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/kytos/kytos/pulls/735/commits"},"statuses":{"href":"https://api.github.com/repos/kytos/kytos/statuses/ae650b1c9d27ac088328a2df19017163a80086e4"}},"author_association":"MEMBER","merged":false,"mergeable":true,"rebaseable":true,"mergeable_state":"clean","merged_by":null,"comments":3,"review_comments":0,"maintainer_can_modify":false,"commits":1,"additions":10,"deletions":0,"changed_files":1}}
{"actor":{"display_login":"viniciusarcanjo"}}