blob: 2f09cf1375fccfde1f73e6cbc11c69acf277a16c [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 {
Dmitry Kalashnik4b70b462017-06-01 20:46:04 +04006 AdminStateUp bool `json:"admin_state_up"`
Krzysztof Szukiełojćab149982017-05-10 14:49:39 +02007 Alive bool `json:"alive"`
Ildar Svetlov790e9f22019-03-24 22:33:37 +04008 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ćab149982017-05-10 14:49:39 +020013}
14
15type AgentPage struct {
Dmitry Kalashnik4b70b462017-06-01 20:46:04 +040016 pagination.SinglePageBase
Krzysztof Szukiełojćab149982017-05-10 14:49:39 +020017}
18
19func 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}