blob: 344e675f55b8c5cbf08e389121b2855d3ae8148c [file] [log] [blame]
Krzysztof Szukiełojćab149982017-05-10 14:49:39 +02001package agents
2
3import "gerrit.mcp.mirantis.net/debian/gophercloud.git/pagination"
4
5type Agent struct {
6 Host string `json:"host"`
Krzysztof Szukiełojć2f616852017-05-12 16:24:00 +02007 Binary string `json:"binary"`
Krzysztof Szukiełojćab149982017-05-10 14:49:39 +02008 AvailabilityZone string `json:"availability_zone"`
Dmitry Kalashnik4b70b462017-06-01 20:46:04 +04009 AdminStateUp bool `json:"admin_state_up"`
Krzysztof Szukiełojćab149982017-05-10 14:49:39 +020010 Alive bool `json:"alive"`
11}
12
13type AgentPage struct {
Dmitry Kalashnik4b70b462017-06-01 20:46:04 +040014 pagination.SinglePageBase
Krzysztof Szukiełojćab149982017-05-10 14:49:39 +020015}
16
17func ExtractAgents(r pagination.Page) ([]Agent, error) {
18 var s struct {
19 Agents []Agent `json:"agents"`
20 }
21 err := (r.(AgentPage)).ExtractInto(&s)
22 return s.Agents, err
23}