{"action":"created","issue":{"url":"https://api.github.com/repos/hashicorp/nomad/issues/2207","repository_url":"https://api.github.com/repos/hashicorp/nomad","labels_url":"https://api.github.com/repos/hashicorp/nomad/issues/2207/labels{/name}","comments_url":"https://api.github.com/repos/hashicorp/nomad/issues/2207/comments","events_url":"https://api.github.com/repos/hashicorp/nomad/issues/2207/events","html_url":"https://github.com/hashicorp/nomad/issues/2207","id":201357657,"number":2207,"title":"[enhancement] Add CLI method to fetch allocation ids based on job name","user":{"login":"etki","id":1909762,"avatar_url":"https://avatars1.githubusercontent.com/u/1909762?v=4","gravatar_id":"","url":"https://api.github.com/users/etki","html_url":"https://github.com/etki","followers_url":"https://api.github.com/users/etki/followers","following_url":"https://api.github.com/users/etki/following{/other_user}","gists_url":"https://api.github.com/users/etki/gists{/gist_id}","starred_url":"https://api.github.com/users/etki/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/etki/subscriptions","organizations_url":"https://api.github.com/users/etki/orgs","repos_url":"https://api.github.com/users/etki/repos","events_url":"https://api.github.com/users/etki/events{/privacy}","received_events_url":"https://api.github.com/users/etki/received_events","type":"User","site_admin":false},"labels":[{"id":273199146,"url":"https://api.github.com/repos/hashicorp/nomad/labels/cli","name":"cli","color":"009800","default":false},{"id":218895785,"url":"https://api.github.com/repos/hashicorp/nomad/labels/enhancement","name":"enhancement","color":"84b6eb","default":true}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2017-01-17T17:45:15Z","updated_at":"2018-03-08T04:10:46Z","closed_at":"2018-03-07T21:39:16Z","author_association":"NONE","body":"Hi.\r\n\r\nI was trying to build a simple CI pipeline, and then i stumbled upon a need to get IP/port pair of allocation. It seems that it is not possible to get that using current CLI commands: you can either get allocation by id or job by name, but can't get allocations of a job; `inspect` command provides a `-short` flag, but i can't see any allocation info in JSON output even if it is not present. I've seen that it is done trivially via API (and via Consul API if service is registered properly), but implementing proper API is a bit more challenging task rather than automate CLI output processing.\r\n\r\nSo, basically, i suggest implementing CLI new command or enhance existing command to output job allocation ids in JSON or other parseable format."},"comment":{"url":"https://api.github.com/repos/hashicorp/nomad/issues/comments/371372871","html_url":"https://github.com/hashicorp/nomad/issues/2207#issuecomment-371372871","issue_url":"https://api.github.com/repos/hashicorp/nomad/issues/2207","id":371372871,"user":{"login":"shantanugadgil","id":2508915,"avatar_url":"https://avatars1.githubusercontent.com/u/2508915?v=4","gravatar_id":"","url":"https://api.github.com/users/shantanugadgil","html_url":"https://github.com/shantanugadgil","followers_url":"https://api.github.com/users/shantanugadgil/followers","following_url":"https://api.github.com/users/shantanugadgil/following{/other_user}","gists_url":"https://api.github.com/users/shantanugadgil/gists{/gist_id}","starred_url":"https://api.github.com/users/shantanugadgil/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shantanugadgil/subscriptions","organizations_url":"https://api.github.com/users/shantanugadgil/orgs","repos_url":"https://api.github.com/users/shantanugadgil/repos","events_url":"https://api.github.com/users/shantanugadgil/events{/privacy}","received_events_url":"https://api.github.com/users/shantanugadgil/received_events","type":"User","site_admin":false},"created_at":"2018-03-08T04:10:46Z","updated_at":"2018-03-08T04:10:46Z","author_association":"CONTRIBUTOR","body":"My two cents: (agreeing with the op)\r\nIt isn't easy to get to the current allocation id of a job, which may have multiple allocations over time.\r\n\r\nMy simple use case has 1 task in 1 job, so maybe not as same as large scale deployments with multiple tasks, etc."}}
{"actor":{"display_login":"shantanugadgil"}}