Krzysztof Szukiełojć | 6b2d29f | 2017-05-15 11:55:02 +0200 | [diff] [blame] | 1 | package os_services |
| 2 | |
| 3 | import "gerrit.mcp.mirantis.net/debian/gophercloud.git/pagination" |
| 4 | |
| 5 | type OsService struct { |
| 6 | ID string `json:"id"` |
| 7 | Host string `json:"host"` |
| 8 | State string `json:"state"` |
| 9 | Status string `json:"status"` |
| 10 | Zone string `json:"zone"` |
| 11 | Binary string `json:"binary"` |
| 12 | } |
| 13 | |
| 14 | type OsServicePage struct { |
| 15 | pagination.SinglePageBase |
| 16 | } |
| 17 | |
| 18 | func ExtractOsServices(r pagination.Page) ([]OsService, error) { |
| 19 | var s struct { |
| 20 | OsServices []OsService `json:"agents"` |
| 21 | } |
| 22 | err := (r.(OsServicePage)).ExtractInto(&s) |
| 23 | return s.OsServices, err |
| 24 | } |