{"action":"created","comment":{"url":"https://api.github.com/repos/brooklyncentral/brooklyn-cli/pulls/comments/46024429","id":46024429,"diff_hunk":"@@ -40,3 +55,48 @@ func (cmd *Effectors) Run(c *cli.Context) {\n \t}\n \ttable.Print()\n }\n+\n+func (cmd *Effectors) invokeEffector(c *cli.Context) error {\n+\tapplicationId := c.Args().First()\n+\tentityId := c.Args()[1]\n+\teffectorName := c.Args()[2]\n+\teffectorArgs := c.Args()[3:]\n+\n+\t// get the effector\n+\teffectors := entity_effectors.EffectorList(cmd.network, c.Args()[0], c.Args()[1])\n+\teffector, err := findEffector(effectorName, effectors)\n+\tif nil != err {\n+\t\treturn err\n+\t}\n+\n+\t// get its parameters and check we have an arg for each","path":"commands/effectors.go","position":57,"original_position":57,"commit_id":"cb02fa2f43e5203ff0a6680c5d0052d79b5fe3c0","original_commit_id":"cb02fa2f43e5203ff0a6680c5d0052d79b5fe3c0","user":{"login":"robertgmoss","id":1054185,"avatar_url":"https://avatars.githubusercontent.com/u/1054185?v=3","gravatar_id":"","url":"https://api.github.com/users/robertgmoss","html_url":"https://github.com/robertgmoss","followers_url":"https://api.github.com/users/robertgmoss/followers","following_url":"https://api.github.com/users/robertgmoss/following{/other_user}","gists_url":"https://api.github.com/users/robertgmoss/gists{/gist_id}","starred_url":"https://api.github.com/users/robertgmoss/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/robertgmoss/subscriptions","organizations_url":"https://api.github.com/users/robertgmoss/orgs","repos_url":"https://api.github.com/users/robertgmoss/repos","events_url":"https://api.github.com/users/robertgmoss/events{/privacy}","received_events_url":"https://api.github.com/users/robertgmoss/received_events","type":"User","site_admin":false},"body":"Some parameters for some effectors are optional","created_at":"2015-11-27T08:05:52Z","updated_at":"2015-11-27T08:05:52Z","html_url":"https://github.com/brooklyncentral/brooklyn-cli/pull/2#discussion_r46024429","pull_request_url":"https://api.github.com/repos/brooklyncentral/brooklyn-cli/pulls/2","_links":{"self":{"href":"https://api.github.com/repos/brooklyncentral/brooklyn-cli/pulls/comments/46024429"},"html":{"href":"https://github.com/brooklyncentral/brooklyn-cli/pull/2#discussion_r46024429"},"pull_request":{"href":"https://api.github.com/repos/brooklyncentral/brooklyn-cli/pulls/2"}}},"pull_request":{"url":"https://api.github.com/repos/brooklyncentral/brooklyn-cli/pulls/2","id":51948834,"html_url":"https://github.com/brooklyncentral/brooklyn-cli/pull/2","diff_url":"https://github.com/brooklyncentral/brooklyn-cli/pull/2.diff","patch_url":"https://github.com/brooklyncentral/brooklyn-cli/pull/2.patch","issue_url":"https://api.github.com/repos/brooklyncentral/brooklyn-cli/issues/2","number":2,"state":"open","locked":false,"title":"Add the ability to invoke effectors.","user":{"login":"geomacy","id":14142759,"avatar_url":"https://avatars.githubusercontent.com/u/14142759?v=3","gravatar_id":"","url":"https://api.github.com/users/geomacy","html_url":"https://github.com/geomacy","followers_url":"https://api.github.com/users/geomacy/followers","following_url":"https://api.github.com/users/geomacy/following{/other_user}","gists_url":"https://api.github.com/users/geomacy/gists{/gist_id}","starred_url":"https://api.github.com/users/geomacy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/geomacy/subscriptions","organizations_url":"https://api.github.com/users/geomacy/orgs","repos_url":"https://api.github.com/users/geomacy/repos","events_url":"https://api.github.com/users/geomacy/events{/privacy}","received_events_url":"https://api.github.com/users/geomacy/received_events","type":"User","site_admin":false},"body":"For a given effector, invoke it with\r\n\r\nbrooklyn-cli effectors APPID ENTITYID EFFECTORNAME [ params ]\r\n\r\nwhere params is a sequence of values for the parameters of the effector, if any.\r\n\r\nFor example see the following sequence (\"brooklyn-cli\" has been aliased to \"bk\"):\r\n\r\n$ bk applications\r\nId   Name   Status   Location\r\n$\r\n$\r\n$ bk create myweb.yaml\r\nresponse Status: 201 Created\r\n...\r\n$ bk applications\r\nId         Name             Status    Location\r\nDRGUqnXs   My Web Cluster   RUNNING   fm7gDUks\r\n$\r\n$ bk entities DRGUqnXs\r\nId         Name     Type\r\ndhwkYGGX   My Web   org.apache.brooklyn.entity.webapp.ControlledDynamicWebAppCluster\r\nTTHOUkbx   My DB    org.apache.brooklyn.entity.database.mysql.MySqlNode\r\n$ bk sensors DRGUqnXs dhwkYGGX | grep webapp.deployedWars\r\n$\r\nwebapp.deployedWars                                    Names of archives/contexts that are currently deployed\r\n$ bk effectors DRGUqnXs dhwkYGGX | grep deploy\r\ndeploy           Deploys the given artifact, from a source URL, to a given deployment filename/context                                                                                                  url,targetName\r\n...\r\n$ bk effectors DRGUqnXs dhwkYGGX deploy https://tomcat.apache.org/tomcat-6.0-doc/appdev/sample/sample.war mysample\r\nresponse Status: 202 Accepted\r\nresponse Headers: map[Content-Length:[0] Set-Cookie:[JSESSIONID_BROOKLYNJLKc8Z=cwjdngii3o919cawdrezzajb;Path=/] Content-Type:[application/json] Vary:[Accept-Encoding] Pragma:[no-cache] Date:[Thu, 26 Nov 2015 22:22:22 GMT] Expires:[Thu, 01 Jan 1970 00:00:00 GMT 0] Cache-Control:[no-cache, no-store] Server:[Jetty(9.2.13.v20150730)]]\r\nresponse Body:\r\n$\r\n$ bk sensors DRGUqnXs dhwkYGGX | grep webapp.deployedWars\r\nwebapp.deployedWars                                    Names of archives/contexts that are currently deployed                                                           [\"/mysample\"]\r\nbk effectors DRGUqnXs DRGUqnXs stop\r\nresponse Status: 202 Accepted\r\nresponse Headers: map[Server:[Jetty(9.2.13.v20150730)] Set-Cookie:[JSESSIONID_BROOKLYNJLKc8Z=6ker7g8hfzmn1gj07i3znbq3l;Path=/] Expires:[Thu, 01 Jan 1970 00:00:00 GMT 0] Vary:[Accept-Encoding] Content-Length:[0] Date:[Thu, 26 Nov 2015 22:27:31 GMT] Content-Type:[application/json] Cache-Control:[no-cache, no-store] Pragma:[no-cache]]\r\nresponse Body:\r\n$\r\n$ bk applications\r\nId   Name   Status   Location\r\n$","created_at":"2015-11-26T22:38:44Z","updated_at":"2015-11-27T08:05:52Z","closed_at":null,"merged_at":null,"merge_commit_sha":"172f4e2940649ccb970221dc97c9ed91e3dda675","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/brooklyncentral/brooklyn-cli/pulls/2/commits","review_comments_url":"https://api.github.com/repos/brooklyncentral/brooklyn-cli/pulls/2/comments","review_comment_url":"https://api.github.com/repos/brooklyncentral/brooklyn-cli/pulls/comments{/number}","comments_url":"https://api.github.com/repos/brooklyncentral/brooklyn-cli/issues/2/comments","statuses_url":"https://api.github.com/repos/brooklyncentral/brooklyn-cli/statuses/cb02fa2f43e5203ff0a6680c5d0052d79b5fe3c0","head":{"label":"brooklyncentral:cli-develop","ref":"cli-develop","sha":"cb02fa2f43e5203ff0a6680c5d0052d79b5fe3c0","user":{"login":"brooklyncentral","id":1587357,"avatar_url":"https://avatars.githubusercontent.com/u/1587357?v=3","gravatar_id":"","url":"https://api.github.com/users/brooklyncentral","html_url":"https://github.com/brooklyncentral","followers_url":"https://api.github.com/users/brooklyncentral/followers","following_url":"https://api.github.com/users/brooklyncentral/following{/other_user}","gists_url":"https://api.github.com/users/brooklyncentral/gists{/gist_id}","starred_url":"https://api.github.com/users/brooklyncentral/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brooklyncentral/subscriptions","organizations_url":"https://api.github.com/users/brooklyncentral/orgs","repos_url":"https://api.github.com/users/brooklyncentral/repos","events_url":"https://api.github.com/users/brooklyncentral/events{/privacy}","received_events_url":"https://api.github.com/users/brooklyncentral/received_events","type":"Organization","site_admin":false},"repo":{"id":33272064,"name":"brooklyn-cli","full_name":"brooklyncentral/brooklyn-cli","owner":{"login":"brooklyncentral","id":1587357,"avatar_url":"https://avatars.githubusercontent.com/u/1587357?v=3","gravatar_id":"","url":"https://api.github.com/users/brooklyncentral","html_url":"https://github.com/brooklyncentral","followers_url":"https://api.github.com/users/brooklyncentral/followers","following_url":"https://api.github.com/users/brooklyncentral/following{/other_user}","gists_url":"https://api.github.com/users/brooklyncentral/gists{/gist_id}","starred_url":"https://api.github.com/users/brooklyncentral/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brooklyncentral/subscriptions","organizations_url":"https://api.github.com/users/brooklyncentral/orgs","repos_url":"https://api.github.com/users/brooklyncentral/repos","events_url":"https://api.github.com/users/brooklyncentral/events{/privacy}","received_events_url":"https://api.github.com/users/brooklyncentral/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/brooklyncentral/brooklyn-cli","description":"Go CLI client for Brooklyn REST API","fork":false,"url":"https://api.github.com/repos/brooklyncentral/brooklyn-cli","forks_url":"https://api.github.com/repos/brooklyncentral/brooklyn-cli/forks","keys_url":"https://api.github.com/repos/brooklyncentral/brooklyn-cli/keys{/key_id}","collaborators_url":"https://api.github.com/repos/brooklyncentral/brooklyn-cli/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/brooklyncentral/brooklyn-cli/teams","hooks_url":"https://api.github.com/repos/brooklyncentral/brooklyn-cli/hooks","issue_events_url":"https://api.github.com/repos/brooklyncentral/brooklyn-cli/issues/events{/number}","events_url":"https://api.github.com/repos/brooklyncentral/brooklyn-cli/events","assignees_url":"https://api.github.com/repos/brooklyncentral/brooklyn-cli/assignees{/user}","branches_url":"https://api.github.com/repos/brooklyncentral/brooklyn-cli/branches{/branch}","tags_url":"https://api.github.com/repos/brooklyncentral/brooklyn-cli/tags","blobs_url":"https://api.github.com/repos/brooklyncentral/brooklyn-cli/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/brooklyncentral/brooklyn-cli/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/brooklyncentral/brooklyn-cli/git/refs{/sha}","trees_url":"https://api.github.com/repos/brooklyncentral/brooklyn-cli/git/trees{/sha}","statuses_url":"https://api.github.com/repos/brooklyncentral/brooklyn-cli/statuses/{sha}","languages_url":"https://api.github.com/repos/brooklyncentral/brooklyn-cli/languages","stargazers_url":"https://api.github.com/repos/brooklyncentral/brooklyn-cli/stargazers","contributors_url":"https://api.github.com/repos/brooklyncentral/brooklyn-cli/contributors","subscribers_url":"https://api.github.com/repos/brooklyncentral/brooklyn-cli/subscribers","subscription_url":"https://api.github.com/repos/brooklyncentral/brooklyn-cli/subscription","commits_url":"https://api.github.com/repos/brooklyncentral/brooklyn-cli/commits{/sha}","git_commits_url":"https://api.github.com/repos/brooklyncentral/brooklyn-cli/git/commits{/sha}","comments_url":"https://api.github.com/repos/brooklyncentral/brooklyn-cli/comments{/number}","issue_comment_url":"https://api.github.com/repos/brooklyncentral/brooklyn-cli/issues/comments{/number}","contents_url":"https://api.github.com/repos/brooklyncentral/brooklyn-cli/contents/{+path}","compare_url":"https://api.github.com/repos/brooklyncentral/brooklyn-cli/compare/{base}...{head}","merges_url":"https://api.github.com/repos/brooklyncentral/brooklyn-cli/merges","archive_url":"https://api.github.com/repos/brooklyncentral/brooklyn-cli/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/brooklyncentral/brooklyn-cli/downloads","issues_url":"https://api.github.com/repos/brooklyncentral/brooklyn-cli/issues{/number}","pulls_url":"https://api.github.com/repos/brooklyncentral/brooklyn-cli/pulls{/number}","milestones_url":"https://api.github.com/repos/brooklyncentral/brooklyn-cli/milestones{/number}","notifications_url":"https://api.github.com/repos/brooklyncentral/brooklyn-cli/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/brooklyncentral/brooklyn-cli/labels{/name}","releases_url":"https://api.github.com/repos/brooklyncentral/brooklyn-cli/releases{/id}","created_at":"2015-04-01T20:45:53Z","updated_at":"2015-10-20T13:43:48Z","pushed_at":"2015-11-26T22:38:44Z","git_url":"git://github.com/brooklyncentral/brooklyn-cli.git","ssh_url":"git@github.com:brooklyncentral/brooklyn-cli.git","clone_url":"https://github.com/brooklyncentral/brooklyn-cli.git","svn_url":"https://github.com/brooklyncentral/brooklyn-cli","homepage":null,"size":84,"stargazers_count":2,"watchers_count":2,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":6,"mirror_url":null,"open_issues_count":2,"forks":6,"open_issues":2,"watchers":2,"default_branch":"master"}},"base":{"label":"brooklyncentral:master","ref":"master","sha":"34a28dd9cc7f62fb9cee55bd886216df8c4c008b","user":{"login":"brooklyncentral","id":1587357,"avatar_url":"https://avatars.githubusercontent.com/u/1587357?v=3","gravatar_id":"","url":"https://api.github.com/users/brooklyncentral","html_url":"https://github.com/brooklyncentral","followers_url":"https://api.github.com/users/brooklyncentral/followers","following_url":"https://api.github.com/users/brooklyncentral/following{/other_user}","gists_url":"https://api.github.com/users/brooklyncentral/gists{/gist_id}","starred_url":"https://api.github.com/users/brooklyncentral/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brooklyncentral/subscriptions","organizations_url":"https://api.github.com/users/brooklyncentral/orgs","repos_url":"https://api.github.com/users/brooklyncentral/repos","events_url":"https://api.github.com/users/brooklyncentral/events{/privacy}","received_events_url":"https://api.github.com/users/brooklyncentral/received_events","type":"Organization","site_admin":false},"repo":{"id":33272064,"name":"brooklyn-cli","full_name":"brooklyncentral/brooklyn-cli","owner":{"login":"brooklyncentral","id":1587357,"avatar_url":"https://avatars.githubusercontent.com/u/1587357?v=3","gravatar_id":"","url":"https://api.github.com/users/brooklyncentral","html_url":"https://github.com/brooklyncentral","followers_url":"https://api.github.com/users/brooklyncentral/followers","following_url":"https://api.github.com/users/brooklyncentral/following{/other_user}","gists_url":"https://api.github.com/users/brooklyncentral/gists{/gist_id}","starred_url":"https://api.github.com/users/brooklyncentral/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brooklyncentral/subscriptions","organizations_url":"https://api.github.com/users/brooklyncentral/orgs","repos_url":"https://api.github.com/users/brooklyncentral/repos","events_url":"https://api.github.com/users/brooklyncentral/events{/privacy}","received_events_url":"https://api.github.com/users/brooklyncentral/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/brooklyncentral/brooklyn-cli","description":"Go CLI client for Brooklyn REST API","fork":false,"url":"https://api.github.com/repos/brooklyncentral/brooklyn-cli","forks_url":"https://api.github.com/repos/brooklyncentral/brooklyn-cli/forks","keys_url":"https://api.github.com/repos/brooklyncentral/brooklyn-cli/keys{/key_id}","collaborators_url":"https://api.github.com/repos/brooklyncentral/brooklyn-cli/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/brooklyncentral/brooklyn-cli/teams","hooks_url":"https://api.github.com/repos/brooklyncentral/brooklyn-cli/hooks","issue_events_url":"https://api.github.com/repos/brooklyncentral/brooklyn-cli/issues/events{/number}","events_url":"https://api.github.com/repos/brooklyncentral/brooklyn-cli/events","assignees_url":"https://api.github.com/repos/brooklyncentral/brooklyn-cli/assignees{/user}","branches_url":"https://api.github.com/repos/brooklyncentral/brooklyn-cli/branches{/branch}","tags_url":"https://api.github.com/repos/brooklyncentral/brooklyn-cli/tags","blobs_url":"https://api.github.com/repos/brooklyncentral/brooklyn-cli/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/brooklyncentral/brooklyn-cli/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/brooklyncentral/brooklyn-cli/git/refs{/sha}","trees_url":"https://api.github.com/repos/brooklyncentral/brooklyn-cli/git/trees{/sha}","statuses_url":"https://api.github.com/repos/brooklyncentral/brooklyn-cli/statuses/{sha}","languages_url":"https://api.github.com/repos/brooklyncentral/brooklyn-cli/languages","stargazers_url":"https://api.github.com/repos/brooklyncentral/brooklyn-cli/stargazers","contributors_url":"https://api.github.com/repos/brooklyncentral/brooklyn-cli/contributors","subscribers_url":"https://api.github.com/repos/brooklyncentral/brooklyn-cli/subscribers","subscription_url":"https://api.github.com/repos/brooklyncentral/brooklyn-cli/subscription","commits_url":"https://api.github.com/repos/brooklyncentral/brooklyn-cli/commits{/sha}","git_commits_url":"https://api.github.com/repos/brooklyncentral/brooklyn-cli/git/commits{/sha}","comments_url":"https://api.github.com/repos/brooklyncentral/brooklyn-cli/comments{/number}","issue_comment_url":"https://api.github.com/repos/brooklyncentral/brooklyn-cli/issues/comments{/number}","contents_url":"https://api.github.com/repos/brooklyncentral/brooklyn-cli/contents/{+path}","compare_url":"https://api.github.com/repos/brooklyncentral/brooklyn-cli/compare/{base}...{head}","merges_url":"https://api.github.com/repos/brooklyncentral/brooklyn-cli/merges","archive_url":"https://api.github.com/repos/brooklyncentral/brooklyn-cli/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/brooklyncentral/brooklyn-cli/downloads","issues_url":"https://api.github.com/repos/brooklyncentral/brooklyn-cli/issues{/number}","pulls_url":"https://api.github.com/repos/brooklyncentral/brooklyn-cli/pulls{/number}","milestones_url":"https://api.github.com/repos/brooklyncentral/brooklyn-cli/milestones{/number}","notifications_url":"https://api.github.com/repos/brooklyncentral/brooklyn-cli/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/brooklyncentral/brooklyn-cli/labels{/name}","releases_url":"https://api.github.com/repos/brooklyncentral/brooklyn-cli/releases{/id}","created_at":"2015-04-01T20:45:53Z","updated_at":"2015-10-20T13:43:48Z","pushed_at":"2015-11-26T22:38:44Z","git_url":"git://github.com/brooklyncentral/brooklyn-cli.git","ssh_url":"git@github.com:brooklyncentral/brooklyn-cli.git","clone_url":"https://github.com/brooklyncentral/brooklyn-cli.git","svn_url":"https://github.com/brooklyncentral/brooklyn-cli","homepage":null,"size":84,"stargazers_count":2,"watchers_count":2,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":6,"mirror_url":null,"open_issues_count":2,"forks":6,"open_issues":2,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/brooklyncentral/brooklyn-cli/pulls/2"},"html":{"href":"https://github.com/brooklyncentral/brooklyn-cli/pull/2"},"issue":{"href":"https://api.github.com/repos/brooklyncentral/brooklyn-cli/issues/2"},"comments":{"href":"https://api.github.com/repos/brooklyncentral/brooklyn-cli/issues/2/comments"},"review_comments":{"href":"https://api.github.com/repos/brooklyncentral/brooklyn-cli/pulls/2/comments"},"review_comment":{"href":"https://api.github.com/repos/brooklyncentral/brooklyn-cli/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/brooklyncentral/brooklyn-cli/pulls/2/commits"},"statuses":{"href":"https://api.github.com/repos/brooklyncentral/brooklyn-cli/statuses/cb02fa2f43e5203ff0a6680c5d0052d79b5fe3c0"}}}}