How to get at hoststats && containerstats with go-rancher

I’m working on an autoscaling service for rancher and would like to use go-rancher to interact with the api as much as possible.

is there an example anywhere of getting at the hoststats and containerstats with go-rancher

I thought this would get me the websocket links and tokens needed

	resp, err := a.StatsAccess.List(&rclient.ListOpts{
		Filters: map[string]interface{}{},

but it says its not listable. Im confident I can piece together the params needed for the websocket connection using other methods but would much rather use the shortest approved route if there is one.

We don’t have any examples and in fact this part of the API is not fully fleshed out in go-rancher. I asked a colleague and he said:

there is a package hostaccess that i think helps with the API, but then you just get back a stream

Great, then I can confidently break some new ground here without worrying that I’m not doing it right :slight_smile:

Good luck! If you get something useful working in Golang and feel like sharing, feel free to post back here. Others might find it useful.