{"action":"created","issue":{"url":"https://api.github.com/repos/cockroachdb/cockroach/issues/3828","labels_url":"https://api.github.com/repos/cockroachdb/cockroach/issues/3828/labels{/name}","comments_url":"https://api.github.com/repos/cockroachdb/cockroach/issues/3828/comments","events_url":"https://api.github.com/repos/cockroachdb/cockroach/issues/3828/events","html_url":"https://github.com/cockroachdb/cockroach/pull/3828","id":126568044,"number":3828,"title":"Add 'node' CLI command to list nodes and show their status.","user":{"login":"cuongdo","id":1564582,"avatar_url":"https://avatars.githubusercontent.com/u/1564582?v=3","gravatar_id":"","url":"https://api.github.com/users/cuongdo","html_url":"https://github.com/cuongdo","followers_url":"https://api.github.com/users/cuongdo/followers","following_url":"https://api.github.com/users/cuongdo/following{/other_user}","gists_url":"https://api.github.com/users/cuongdo/gists{/gist_id}","starred_url":"https://api.github.com/users/cuongdo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cuongdo/subscriptions","organizations_url":"https://api.github.com/users/cuongdo/orgs","repos_url":"https://api.github.com/users/cuongdo/repos","events_url":"https://api.github.com/users/cuongdo/events{/privacy}","received_events_url":"https://api.github.com/users/cuongdo/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/cockroachdb/cockroach/labels/ui","name":"ui","color":"d4c5f9"}],"state":"open","locked":false,"assignee":{"login":"petermattis","id":6201335,"avatar_url":"https://avatars.githubusercontent.com/u/6201335?v=3","gravatar_id":"","url":"https://api.github.com/users/petermattis","html_url":"https://github.com/petermattis","followers_url":"https://api.github.com/users/petermattis/followers","following_url":"https://api.github.com/users/petermattis/following{/other_user}","gists_url":"https://api.github.com/users/petermattis/gists{/gist_id}","starred_url":"https://api.github.com/users/petermattis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/petermattis/subscriptions","organizations_url":"https://api.github.com/users/petermattis/orgs","repos_url":"https://api.github.com/users/petermattis/repos","events_url":"https://api.github.com/users/petermattis/events{/privacy}","received_events_url":"https://api.github.com/users/petermattis/received_events","type":"User","site_admin":false},"milestone":null,"comments":16,"created_at":"2016-01-14T03:08:07Z","updated_at":"2016-01-14T20:42:41Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/cockroachdb/cockroach/pulls/3828","html_url":"https://github.com/cockroachdb/cockroach/pull/3828","diff_url":"https://github.com/cockroachdb/cockroach/pull/3828.diff","patch_url":"https://github.com/cockroachdb/cockroach/pull/3828.patch"},"body":"The `node` command has two subcommands, `ls` and `status`.\r\n\r\n`cockroach node ls` provides the NodeID's for all nodes in the cluster. For example:\r\n\r\n```\r\n$ cockroach node ls\r\n+----+\r\n| id |\r\n+----+\r\n|  1 |\r\n|  2 |\r\n|  3 |\r\n+----+\r\n```\r\n\r\n`node status` takes 0 or 1 arguments. With no arguments, `node status` shows the status for all nodes. For example:\r\n\r\n```\r\n$ cockroach node status\r\n+----+-----------------+---------------------+---------------------+------------+-----------+-------------+--------------+--------------+---------------+-------------+--------------+\r\n| id |     address     |     updated_at      |     started_at      | live_bytes | key_bytes | value_bytes | intent_bytes | system_bytes | leader_ranges | repl_ranges | avail_ranges |\r\n+----+-----------------+---------------------+---------------------+------------+-----------+-------------+--------------+--------------+---------------+-------------+--------------+\r\n|  1 | 127.0.0.1:26001 | 2016-01-13 22:05:42 | 2016-01-13 13:06:02 |   12847326 |    144151 |    14393513 |          329 |         2444 |             1 |           1 |            1 |\r\n|  2 | 127.0.0.2:26002 | 2016-01-13 22:05:45 | 2016-01-13 13:06:05 |   12849693 |    144199 |    14396408 |           75 |         6829 |             4 |           4 |            4 |\r\n|  3 | 127.0.0.3:26003 | 2016-01-13 22:05:44 | 2016-01-13 13:07:24 |   12847569 |    144175 |    14394021 |           75 |         6829 |             0 |           0 |            0 |\r\n+----+-----------------+---------------------+---------------------+------------+-----------+-------------+--------------+--------------+---------------+-------------+--------------+\r\n```\r\n\r\n`node status <node ID>` shows the status for a single node. For example:\r\n\r\n```\r\n$ cockroach node status 1\r\n+----+-----------------+---------------------+---------------------+------------+-----------+-------------+--------------+--------------+---------------+-------------+--------------+\r\n| id |     address     |     updated_at      |     started_at      | live_bytes | key_bytes | value_bytes | intent_bytes | system_bytes | leader_ranges | repl_ranges | avail_ranges |\r\n+----+-----------------+---------------------+---------------------+------------+-----------+-------------+--------------+--------------+---------------+-------------+--------------+\r\n|  1 | 127.0.0.1:26001 | 2016-01-13 22:06:42 | 2016-01-13 13:06:02 |   12885558 |    144583 |    14436491 |          329 |         2444 |             1 |           1 |            1 |\r\n+----+-----------------+---------------------+---------------------+------------+-----------+-------------+--------------+--------------+---------------+-------------+--------------+\r\n```\n\n<!-- Reviewable:start -->\n[<img src=\"https://reviewable.io/review_button.png\" height=40 alt=\"Review on Reviewable\"/>](https://reviewable.io/reviews/cockroachdb/cockroach/3828)\n<!-- Reviewable:end -->\n"},"comment":{"url":"https://api.github.com/repos/cockroachdb/cockroach/issues/comments/171773668","html_url":"https://github.com/cockroachdb/cockroach/pull/3828#issuecomment-171773668","issue_url":"https://api.github.com/repos/cockroachdb/cockroach/issues/3828","id":171773668,"user":{"login":"petermattis","id":6201335,"avatar_url":"https://avatars.githubusercontent.com/u/6201335?v=3","gravatar_id":"","url":"https://api.github.com/users/petermattis","html_url":"https://github.com/petermattis","followers_url":"https://api.github.com/users/petermattis/followers","following_url":"https://api.github.com/users/petermattis/following{/other_user}","gists_url":"https://api.github.com/users/petermattis/gists{/gist_id}","starred_url":"https://api.github.com/users/petermattis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/petermattis/subscriptions","organizations_url":"https://api.github.com/users/petermattis/orgs","repos_url":"https://api.github.com/users/petermattis/repos","events_url":"https://api.github.com/users/petermattis/events{/privacy}","received_events_url":"https://api.github.com/users/petermattis/received_events","type":"User","site_admin":false},"created_at":"2016-01-14T20:42:41Z","updated_at":"2016-01-14T20:42:41Z","body":"Why does the test server not have any nodes? I would think you could model this on the `Example_*` style tests. See `Example_basic` in `cli/cli_test.go`.\n\n---\n\nReview status: all files reviewed at latest revision, 4 unresolved discussions, some commit checks failed.\n\n---\n\n\n\n*Comments from the [review on Reviewable.io](https://reviewable.io:443/reviews/cockroachdb/cockroach/3828#-:-K80rfoKXZ8tly70wx3c:-208102566)*\n<!-- Sent from Reviewable.io -->\n"}}