Krzysztof Szukiełojć | ab14998 | 2017-05-10 14:49:39 +0200 | [diff] [blame] | 1 | package agents |
| 2 | |
| 3 | import "gerrit.mcp.mirantis.net/debian/gophercloud.git/pagination" |
| 4 | |
| 5 | type Agent struct { |
| 6 | Host string `json:"host"` |
Krzysztof Szukiełojć | 2f61685 | 2017-05-12 16:24:00 +0200 | [diff] [blame] | 7 | Binary string `json:"binary"` |
Krzysztof Szukiełojć | ab14998 | 2017-05-10 14:49:39 +0200 | [diff] [blame] | 8 | AvailabilityZone string `json:"availability_zone"` |
Dmitry Kalashnik | 4b70b46 | 2017-06-01 20:46:04 +0400 | [diff] [blame] | 9 | AdminStateUp bool `json:"admin_state_up"` |
Krzysztof Szukiełojć | ab14998 | 2017-05-10 14:49:39 +0200 | [diff] [blame] | 10 | Alive bool `json:"alive"` |
| 11 | } |
| 12 | |
| 13 | type AgentPage struct { |
Dmitry Kalashnik | 4b70b46 | 2017-06-01 20:46:04 +0400 | [diff] [blame] | 14 | pagination.SinglePageBase |
Krzysztof Szukiełojć | ab14998 | 2017-05-10 14:49:39 +0200 | [diff] [blame] | 15 | } |
| 16 | |
| 17 | func 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 | } |