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 { |
Dmitry Kalashnik | 4b70b46 | 2017-06-01 20:46:04 +0400 | [diff] [blame] | 6 | AdminStateUp bool `json:"admin_state_up"` |
Krzysztof Szukiełojć | ab14998 | 2017-05-10 14:49:39 +0200 | [diff] [blame] | 7 | Alive bool `json:"alive"` |
Ildar Svetlov | 790e9f2 | 2019-03-24 22:33:37 +0400 | [diff] [blame^] | 8 | AvailabilityZone string `json:"availability_zone"` |
| 9 | Binary string `json:"binary"` |
| 10 | Host string `json:"host"` |
| 11 | ID string `json:"id"` |
| 12 | Type string `json:"agent_type"` |
Krzysztof Szukiełojć | ab14998 | 2017-05-10 14:49:39 +0200 | [diff] [blame] | 13 | } |
| 14 | |
| 15 | type AgentPage struct { |
Dmitry Kalashnik | 4b70b46 | 2017-06-01 20:46:04 +0400 | [diff] [blame] | 16 | pagination.SinglePageBase |
Krzysztof Szukiełojć | ab14998 | 2017-05-10 14:49:39 +0200 | [diff] [blame] | 17 | } |
| 18 | |
| 19 | func ExtractAgents(r pagination.Page) ([]Agent, error) { |
| 20 | var s struct { |
| 21 | Agents []Agent `json:"agents"` |
| 22 | } |
| 23 | err := (r.(AgentPage)).ExtractInto(&s) |
| 24 | return s.Agents, err |
| 25 | } |