{"action":"closed","issue":{"url":"https://api.github.com/repos/coreos/fleet/issues/1675","repository_url":"https://api.github.com/repos/coreos/fleet","labels_url":"https://api.github.com/repos/coreos/fleet/issues/1675/labels{/name}","comments_url":"https://api.github.com/repos/coreos/fleet/issues/1675/comments","events_url":"https://api.github.com/repos/coreos/fleet/issues/1675/events","html_url":"https://github.com/coreos/fleet/issues/1675","id":175709679,"number":1675,"title":"Introduce cAPI.UnitState() for a single unit","user":{"login":"dongsupark","id":10096906,"avatar_url":"https://avatars.githubusercontent.com/u/10096906?v=3","gravatar_id":"","url":"https://api.github.com/users/dongsupark","html_url":"https://github.com/dongsupark","followers_url":"https://api.github.com/users/dongsupark/followers","following_url":"https://api.github.com/users/dongsupark/following{/other_user}","gists_url":"https://api.github.com/users/dongsupark/gists{/gist_id}","starred_url":"https://api.github.com/users/dongsupark/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dongsupark/subscriptions","organizations_url":"https://api.github.com/users/dongsupark/orgs","repos_url":"https://api.github.com/users/dongsupark/repos","events_url":"https://api.github.com/users/dongsupark/events{/privacy}","received_events_url":"https://api.github.com/users/dongsupark/received_events","type":"User","site_admin":false},"labels":[{"id":140106065,"url":"https://api.github.com/repos/coreos/fleet/labels/area/api","name":"area/api","color":"bfe5bf","default":false},{"id":60523758,"url":"https://api.github.com/repos/coreos/fleet/labels/kind/enhancement","name":"kind/enhancement","color":"c7def8","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-09-08T09:43:11Z","updated_at":"2016-11-10T09:56:42Z","closed_at":"2016-11-10T09:56:42Z","body":"At the moment cAPI doesn't support any possibility for retrieving unit states of a single unit. Instead fleet needs to call `cAPI.UnitStates()` to fetch states for all units, which is of course not efficient.\n\nTo support `cAPI.UnitState()` for a single unit, we need to do the following:\n- Add `UnitState()` to the API interface in `client/api.go` as well as to the HTTPClient in `client/http.go`.\n- Add a struct `UnitStateGetCall` and its necessary methods like `Get()`, `Fields()`, `Do()` in schema/v1-gen.go. Of course schema/v1-json.go needs to be regenerated.\n- Add `UnitState()` to the `UnitRegistry` interface in registry/interface.go\n- Add `UnitState()` also to both `EtcdRegistry` and `RPCRegistry`.\n- Add `GetUnitState()` to the Registry service in protobuf/fleet.proto. Of course protobuf/fleet.pb.go needs to be regenerated.\n\nNot sure if I've missed anything.\n\nSee also https://github.com/coreos/fleet/pull/1667#discussion_r77678587\n"}}
{"actor":{"display_login":"dongsupark"}}