{"action":"created","comment":{"url":"https://api.github.com/repos/dcos/dcos-core-cli/pulls/comments/217274056","pull_request_review_id":154944583,"id":217274056,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIxNzI3NDA1Ng==","diff_hunk":"@@ -0,0 +1,72 @@\n+package job\n+\n+import (\n+\t\"fmt\"\n+\t\"io\"\n+\t\"os\"\n+\n+\t\"github.com/dcos/dcos-cli/api\"\n+\t\"github.com/dcos/dcos-core-cli/pkg/metronome\"\n+\t\"github.com/spf13/cobra\"\n+\t\"golang.org/x/crypto/ssh/terminal\"\n+)\n+\n+// newCmdClusterAdd creates a new job.\n+func newCmdJobAdd(ctx api.Context) *cobra.Command {\n+\tcmd := &cobra.Command{\n+\t\tUse:   \"add\",\n+\t\tShort: \"add a job\",\n+\t\tRunE: func(cmd *cobra.Command, args []string) error {\n+\t\t\tclient, err := metronomeClient(ctx)\n+\t\t\tif err != nil {\n+\t\t\t\treturn err\n+\t\t\t}\n+\n+\t\t\t// Handling input from file or stdin\n+\t\t\tvar reader io.Reader\n+\t\t\tswitch len(args) {\n+\t\t\tcase 0:\n+\t\t\t\tif terminal.IsTerminal(int(os.Stdin.Fd())) {\n+\t\t\t\t\treturn fmt.Errorf(\"input from the terminal is not accepted\")\n+\t\t\t\t}\n+\t\t\t\treader = os.Stdin\n+\t\t\t\tbreak\n+\t\t\tcase 1:\n+\t\t\t\treader, err = os.Open(args[0])","path":"pkg/cmd/job/job_add.go","position":35,"original_position":35,"commit_id":"fc52a8d6088aeb07d9e0b2371a8a76b1917f2436","original_commit_id":"fc52a8d6088aeb07d9e0b2371a8a76b1917f2436","user":{"login":"bamarni","id":1205386,"node_id":"MDQ6VXNlcjEyMDUzODY=","avatar_url":"https://avatars2.githubusercontent.com/u/1205386?v=4","gravatar_id":"","url":"https://api.github.com/users/bamarni","html_url":"https://github.com/bamarni","followers_url":"https://api.github.com/users/bamarni/followers","following_url":"https://api.github.com/users/bamarni/following{/other_user}","gists_url":"https://api.github.com/users/bamarni/gists{/gist_id}","starred_url":"https://api.github.com/users/bamarni/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bamarni/subscriptions","organizations_url":"https://api.github.com/users/bamarni/orgs","repos_url":"https://api.github.com/users/bamarni/repos","events_url":"https://api.github.com/users/bamarni/events{/privacy}","received_events_url":"https://api.github.com/users/bamarni/received_events","type":"User","site_admin":false},"body":"We have an abstraction for filesystem operations (to ease testing), it relies on the afero library and is in `ctx.Fs()`.","created_at":"2018-09-13T06:38:09Z","updated_at":"2018-09-13T06:46:00Z","html_url":"https://github.com/dcos/dcos-core-cli/pull/30#discussion_r217274056","pull_request_url":"https://api.github.com/repos/dcos/dcos-core-cli/pulls/30","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/dcos/dcos-core-cli/pulls/comments/217274056"},"html":{"href":"https://github.com/dcos/dcos-core-cli/pull/30#discussion_r217274056"},"pull_request":{"href":"https://api.github.com/repos/dcos/dcos-core-cli/pulls/30"}}},"pull_request":{"url":"https://api.github.com/repos/dcos/dcos-core-cli/pulls/30","id":213918006,"node_id":"MDExOlB1bGxSZXF1ZXN0MjEzOTE4MDA2","html_url":"https://github.com/dcos/dcos-core-cli/pull/30","diff_url":"https://github.com/dcos/dcos-core-cli/pull/30.diff","patch_url":"https://github.com/dcos/dcos-core-cli/pull/30.patch","issue_url":"https://api.github.com/repos/dcos/dcos-core-cli/issues/30","number":30,"state":"open","locked":false,"title":"WIP: Added `job add` and `job update` subcommands.","user":{"login":"rgo3","id":16867492,"node_id":"MDQ6VXNlcjE2ODY3NDky","avatar_url":"https://avatars0.githubusercontent.com/u/16867492?v=4","gravatar_id":"","url":"https://api.github.com/users/rgo3","html_url":"https://github.com/rgo3","followers_url":"https://api.github.com/users/rgo3/followers","following_url":"https://api.github.com/users/rgo3/following{/other_user}","gists_url":"https://api.github.com/users/rgo3/gists{/gist_id}","starred_url":"https://api.github.com/users/rgo3/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rgo3/subscriptions","organizations_url":"https://api.github.com/users/rgo3/orgs","repos_url":"https://api.github.com/users/rgo3/repos","events_url":"https://api.github.com/users/rgo3/events{/privacy}","received_events_url":"https://api.github.com/users/rgo3/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-09-07T12:50:13Z","updated_at":"2018-09-13T06:46:00Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7e4b288df0d42ac2ec3e4ffde573e1a92bf640ee","assignee":null,"assignees":[],"requested_reviewers":[{"login":"ArmandGrillet","id":2117580,"node_id":"MDQ6VXNlcjIxMTc1ODA=","avatar_url":"https://avatars0.githubusercontent.com/u/2117580?v=4","gravatar_id":"","url":"https://api.github.com/users/ArmandGrillet","html_url":"https://github.com/ArmandGrillet","followers_url":"https://api.github.com/users/ArmandGrillet/followers","following_url":"https://api.github.com/users/ArmandGrillet/following{/other_user}","gists_url":"https://api.github.com/users/ArmandGrillet/gists{/gist_id}","starred_url":"https://api.github.com/users/ArmandGrillet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ArmandGrillet/subscriptions","organizations_url":"https://api.github.com/users/ArmandGrillet/orgs","repos_url":"https://api.github.com/users/ArmandGrillet/repos","events_url":"https://api.github.com/users/ArmandGrillet/events{/privacy}","received_events_url":"https://api.github.com/users/ArmandGrillet/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/dcos/dcos-core-cli/pulls/30/commits","review_comments_url":"https://api.github.com/repos/dcos/dcos-core-cli/pulls/30/comments","review_comment_url":"https://api.github.com/repos/dcos/dcos-core-cli/pulls/comments{/number}","comments_url":"https://api.github.com/repos/dcos/dcos-core-cli/issues/30/comments","statuses_url":"https://api.github.com/repos/dcos/dcos-core-cli/statuses/fc52a8d6088aeb07d9e0b2371a8a76b1917f2436","head":{"label":"rgo3:DCOS_OSS-4076","ref":"DCOS_OSS-4076","sha":"fc52a8d6088aeb07d9e0b2371a8a76b1917f2436","user":{"login":"rgo3","id":16867492,"node_id":"MDQ6VXNlcjE2ODY3NDky","avatar_url":"https://avatars0.githubusercontent.com/u/16867492?v=4","gravatar_id":"","url":"https://api.github.com/users/rgo3","html_url":"https://github.com/rgo3","followers_url":"https://api.github.com/users/rgo3/followers","following_url":"https://api.github.com/users/rgo3/following{/other_user}","gists_url":"https://api.github.com/users/rgo3/gists{/gist_id}","starred_url":"https://api.github.com/users/rgo3/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rgo3/subscriptions","organizations_url":"https://api.github.com/users/rgo3/orgs","repos_url":"https://api.github.com/users/rgo3/repos","events_url":"https://api.github.com/users/rgo3/events{/privacy}","received_events_url":"https://api.github.com/users/rgo3/received_events","type":"User","site_admin":false},"repo":{"id":145735697,"node_id":"MDEwOlJlcG9zaXRvcnkxNDU3MzU2OTc=","name":"dcos-core-cli","full_name":"rgo3/dcos-core-cli","owner":{"login":"rgo3","id":16867492,"node_id":"MDQ6VXNlcjE2ODY3NDky","avatar_url":"https://avatars0.githubusercontent.com/u/16867492?v=4","gravatar_id":"","url":"https://api.github.com/users/rgo3","html_url":"https://github.com/rgo3","followers_url":"https://api.github.com/users/rgo3/followers","following_url":"https://api.github.com/users/rgo3/following{/other_user}","gists_url":"https://api.github.com/users/rgo3/gists{/gist_id}","starred_url":"https://api.github.com/users/rgo3/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rgo3/subscriptions","organizations_url":"https://api.github.com/users/rgo3/orgs","repos_url":"https://api.github.com/users/rgo3/repos","events_url":"https://api.github.com/users/rgo3/events{/privacy}","received_events_url":"https://api.github.com/users/rgo3/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/rgo3/dcos-core-cli","description":"Core plugin for the DC/OS CLI","fork":true,"url":"https://api.github.com/repos/rgo3/dcos-core-cli","forks_url":"https://api.github.com/repos/rgo3/dcos-core-cli/forks","keys_url":"https://api.github.com/repos/rgo3/dcos-core-cli/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rgo3/dcos-core-cli/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rgo3/dcos-core-cli/teams","hooks_url":"https://api.github.com/repos/rgo3/dcos-core-cli/hooks","issue_events_url":"https://api.github.com/repos/rgo3/dcos-core-cli/issues/events{/number}","events_url":"https://api.github.com/repos/rgo3/dcos-core-cli/events","assignees_url":"https://api.github.com/repos/rgo3/dcos-core-cli/assignees{/user}","branches_url":"https://api.github.com/repos/rgo3/dcos-core-cli/branches{/branch}","tags_url":"https://api.github.com/repos/rgo3/dcos-core-cli/tags","blobs_url":"https://api.github.com/repos/rgo3/dcos-core-cli/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rgo3/dcos-core-cli/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rgo3/dcos-core-cli/git/refs{/sha}","trees_url":"https://api.github.com/repos/rgo3/dcos-core-cli/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rgo3/dcos-core-cli/statuses/{sha}","languages_url":"https://api.github.com/repos/rgo3/dcos-core-cli/languages","stargazers_url":"https://api.github.com/repos/rgo3/dcos-core-cli/stargazers","contributors_url":"https://api.github.com/repos/rgo3/dcos-core-cli/contributors","subscribers_url":"https://api.github.com/repos/rgo3/dcos-core-cli/subscribers","subscription_url":"https://api.github.com/repos/rgo3/dcos-core-cli/subscription","commits_url":"https://api.github.com/repos/rgo3/dcos-core-cli/commits{/sha}","git_commits_url":"https://api.github.com/repos/rgo3/dcos-core-cli/git/commits{/sha}","comments_url":"https://api.github.com/repos/rgo3/dcos-core-cli/comments{/number}","issue_comment_url":"https://api.github.com/repos/rgo3/dcos-core-cli/issues/comments{/number}","contents_url":"https://api.github.com/repos/rgo3/dcos-core-cli/contents/{+path}","compare_url":"https://api.github.com/repos/rgo3/dcos-core-cli/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rgo3/dcos-core-cli/merges","archive_url":"https://api.github.com/repos/rgo3/dcos-core-cli/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rgo3/dcos-core-cli/downloads","issues_url":"https://api.github.com/repos/rgo3/dcos-core-cli/issues{/number}","pulls_url":"https://api.github.com/repos/rgo3/dcos-core-cli/pulls{/number}","milestones_url":"https://api.github.com/repos/rgo3/dcos-core-cli/milestones{/number}","notifications_url":"https://api.github.com/repos/rgo3/dcos-core-cli/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rgo3/dcos-core-cli/labels{/name}","releases_url":"https://api.github.com/repos/rgo3/dcos-core-cli/releases{/id}","deployments_url":"https://api.github.com/repos/rgo3/dcos-core-cli/deployments","created_at":"2018-08-22T16:34:08Z","updated_at":"2018-08-22T16:34:10Z","pushed_at":"2018-09-11T17:02:32Z","git_url":"git://github.com/rgo3/dcos-core-cli.git","ssh_url":"git@github.com:rgo3/dcos-core-cli.git","clone_url":"https://github.com/rgo3/dcos-core-cli.git","svn_url":"https://github.com/rgo3/dcos-core-cli","homepage":"","size":12245,"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":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"dcos:master","ref":"master","sha":"9181fc63d746463d48105f07442ab721e2dedc26","user":{"login":"dcos","id":17648048,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE3NjQ4MDQ4","avatar_url":"https://avatars1.githubusercontent.com/u/17648048?v=4","gravatar_id":"","url":"https://api.github.com/users/dcos","html_url":"https://github.com/dcos","followers_url":"https://api.github.com/users/dcos/followers","following_url":"https://api.github.com/users/dcos/following{/other_user}","gists_url":"https://api.github.com/users/dcos/gists{/gist_id}","starred_url":"https://api.github.com/users/dcos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dcos/subscriptions","organizations_url":"https://api.github.com/users/dcos/orgs","repos_url":"https://api.github.com/users/dcos/repos","events_url":"https://api.github.com/users/dcos/events{/privacy}","received_events_url":"https://api.github.com/users/dcos/received_events","type":"Organization","site_admin":false},"repo":{"id":133795958,"node_id":"MDEwOlJlcG9zaXRvcnkxMzM3OTU5NTg=","name":"dcos-core-cli","full_name":"dcos/dcos-core-cli","owner":{"login":"dcos","id":17648048,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE3NjQ4MDQ4","avatar_url":"https://avatars1.githubusercontent.com/u/17648048?v=4","gravatar_id":"","url":"https://api.github.com/users/dcos","html_url":"https://github.com/dcos","followers_url":"https://api.github.com/users/dcos/followers","following_url":"https://api.github.com/users/dcos/following{/other_user}","gists_url":"https://api.github.com/users/dcos/gists{/gist_id}","starred_url":"https://api.github.com/users/dcos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dcos/subscriptions","organizations_url":"https://api.github.com/users/dcos/orgs","repos_url":"https://api.github.com/users/dcos/repos","events_url":"https://api.github.com/users/dcos/events{/privacy}","received_events_url":"https://api.github.com/users/dcos/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/dcos/dcos-core-cli","description":"Core plugin for the DC/OS CLI","fork":false,"url":"https://api.github.com/repos/dcos/dcos-core-cli","forks_url":"https://api.github.com/repos/dcos/dcos-core-cli/forks","keys_url":"https://api.github.com/repos/dcos/dcos-core-cli/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dcos/dcos-core-cli/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dcos/dcos-core-cli/teams","hooks_url":"https://api.github.com/repos/dcos/dcos-core-cli/hooks","issue_events_url":"https://api.github.com/repos/dcos/dcos-core-cli/issues/events{/number}","events_url":"https://api.github.com/repos/dcos/dcos-core-cli/events","assignees_url":"https://api.github.com/repos/dcos/dcos-core-cli/assignees{/user}","branches_url":"https://api.github.com/repos/dcos/dcos-core-cli/branches{/branch}","tags_url":"https://api.github.com/repos/dcos/dcos-core-cli/tags","blobs_url":"https://api.github.com/repos/dcos/dcos-core-cli/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dcos/dcos-core-cli/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dcos/dcos-core-cli/git/refs{/sha}","trees_url":"https://api.github.com/repos/dcos/dcos-core-cli/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dcos/dcos-core-cli/statuses/{sha}","languages_url":"https://api.github.com/repos/dcos/dcos-core-cli/languages","stargazers_url":"https://api.github.com/repos/dcos/dcos-core-cli/stargazers","contributors_url":"https://api.github.com/repos/dcos/dcos-core-cli/contributors","subscribers_url":"https://api.github.com/repos/dcos/dcos-core-cli/subscribers","subscription_url":"https://api.github.com/repos/dcos/dcos-core-cli/subscription","commits_url":"https://api.github.com/repos/dcos/dcos-core-cli/commits{/sha}","git_commits_url":"https://api.github.com/repos/dcos/dcos-core-cli/git/commits{/sha}","comments_url":"https://api.github.com/repos/dcos/dcos-core-cli/comments{/number}","issue_comment_url":"https://api.github.com/repos/dcos/dcos-core-cli/issues/comments{/number}","contents_url":"https://api.github.com/repos/dcos/dcos-core-cli/contents/{+path}","compare_url":"https://api.github.com/repos/dcos/dcos-core-cli/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dcos/dcos-core-cli/merges","archive_url":"https://api.github.com/repos/dcos/dcos-core-cli/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dcos/dcos-core-cli/downloads","issues_url":"https://api.github.com/repos/dcos/dcos-core-cli/issues{/number}","pulls_url":"https://api.github.com/repos/dcos/dcos-core-cli/pulls{/number}","milestones_url":"https://api.github.com/repos/dcos/dcos-core-cli/milestones{/number}","notifications_url":"https://api.github.com/repos/dcos/dcos-core-cli/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dcos/dcos-core-cli/labels{/name}","releases_url":"https://api.github.com/repos/dcos/dcos-core-cli/releases{/id}","deployments_url":"https://api.github.com/repos/dcos/dcos-core-cli/deployments","created_at":"2018-05-17T10:12:27Z","updated_at":"2018-09-12T12:47:02Z","pushed_at":"2018-09-12T23:18:48Z","git_url":"git://github.com/dcos/dcos-core-cli.git","ssh_url":"git@github.com:dcos/dcos-core-cli.git","clone_url":"https://github.com/dcos/dcos-core-cli.git","svn_url":"https://github.com/dcos/dcos-core-cli","homepage":"","size":12278,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":6,"mirror_url":null,"archived":false,"open_issues_count":3,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":6,"open_issues":3,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/dcos/dcos-core-cli/pulls/30"},"html":{"href":"https://github.com/dcos/dcos-core-cli/pull/30"},"issue":{"href":"https://api.github.com/repos/dcos/dcos-core-cli/issues/30"},"comments":{"href":"https://api.github.com/repos/dcos/dcos-core-cli/issues/30/comments"},"review_comments":{"href":"https://api.github.com/repos/dcos/dcos-core-cli/pulls/30/comments"},"review_comment":{"href":"https://api.github.com/repos/dcos/dcos-core-cli/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/dcos/dcos-core-cli/pulls/30/commits"},"statuses":{"href":"https://api.github.com/repos/dcos/dcos-core-cli/statuses/fc52a8d6088aeb07d9e0b2371a8a76b1917f2436"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"bamarni"}}