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.
To support cAPI.UnitState() for a single unit, we need to do the following:
Add UnitState() to the API interface in client/api.go as well as to the HTTPClient in client/http.go.
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.
Add UnitState() to the UnitRegistry interface in registry/interface.go
Add UnitState() also to both EtcdRegistry and RPCRegistry.
Add GetUnitState() to the Registry service in protobuf/fleet.proto. Of course protobuf/fleet.pb.go needs to be regenerated.
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.To support
cAPI.UnitState()
for a single unit, we need to do the following:UnitState()
to the API interface inclient/api.go
as well as to the HTTPClient inclient/http.go
.UnitStateGetCall
and its necessary methods likeGet()
,Fields()
,Do()
in schema/v1-gen.go. Of course schema/v1-json.go needs to be regenerated.UnitState()
to theUnitRegistry
interface in registry/interface.goUnitState()
also to bothEtcdRegistry
andRPCRegistry
.GetUnitState()
to the Registry service in protobuf/fleet.proto. Of course protobuf/fleet.pb.go needs to be regenerated.Not sure if I've missed anything.
See also https://github.com/coreos/fleet/pull/1667#discussion_r77678587