feisky | cf0c7fe | 2015-11-05 22:06:17 +0800 | [diff] [blame] | 1 | package volumeactions |
| 2 | |
jrperritt | 9b7b9e6 | 2016-07-11 22:30:50 -0500 | [diff] [blame] | 3 | import "github.com/gophercloud/gophercloud" |
feisky | cf0c7fe | 2015-11-05 22:06:17 +0800 | [diff] [blame] | 4 | |
| 5 | // AttachResult contains the response body and error from a Get request. |
| 6 | type AttachResult struct { |
Jamie Hannaford | 531e0cc | 2016-05-13 13:03:39 +0200 | [diff] [blame] | 7 | gophercloud.ErrResult |
feisky | cf0c7fe | 2015-11-05 22:06:17 +0800 | [diff] [blame] | 8 | } |
| 9 | |
| 10 | // DetachResult contains the response body and error from a Get request. |
| 11 | type DetachResult struct { |
Jamie Hannaford | 531e0cc | 2016-05-13 13:03:39 +0200 | [diff] [blame] | 12 | gophercloud.ErrResult |
feisky | cf0c7fe | 2015-11-05 22:06:17 +0800 | [diff] [blame] | 13 | } |
| 14 | |
| 15 | // ReserveResult contains the response body and error from a Get request. |
| 16 | type ReserveResult struct { |
Jamie Hannaford | 531e0cc | 2016-05-13 13:03:39 +0200 | [diff] [blame] | 17 | gophercloud.ErrResult |
feisky | cf0c7fe | 2015-11-05 22:06:17 +0800 | [diff] [blame] | 18 | } |
| 19 | |
| 20 | // UnreserveResult contains the response body and error from a Get request. |
| 21 | type UnreserveResult struct { |
Jamie Hannaford | 531e0cc | 2016-05-13 13:03:39 +0200 | [diff] [blame] | 22 | gophercloud.ErrResult |
feisky | cf0c7fe | 2015-11-05 22:06:17 +0800 | [diff] [blame] | 23 | } |
| 24 | |
feisky | cf0c7fe | 2015-11-05 22:06:17 +0800 | [diff] [blame] | 25 | // TerminateConnectionResult contains the response body and error from a Get request. |
| 26 | type TerminateConnectionResult struct { |
Jamie Hannaford | 531e0cc | 2016-05-13 13:03:39 +0200 | [diff] [blame] | 27 | gophercloud.ErrResult |
feisky | cf0c7fe | 2015-11-05 22:06:17 +0800 | [diff] [blame] | 28 | } |
| 29 | |
jrperritt | 9b7b9e6 | 2016-07-11 22:30:50 -0500 | [diff] [blame] | 30 | type commonResult struct { |
| 31 | gophercloud.Result |
| 32 | } |
| 33 | |
feisky | cf0c7fe | 2015-11-05 22:06:17 +0800 | [diff] [blame] | 34 | // Extract will get the Volume object out of the commonResult object. |
| 35 | func (r commonResult) Extract() (map[string]interface{}, error) { |
jrperritt | 9b7b9e6 | 2016-07-11 22:30:50 -0500 | [diff] [blame] | 36 | var s struct { |
| 37 | ConnectionInfo map[string]interface{} `json:"connection_info"` |
feisky | cf0c7fe | 2015-11-05 22:06:17 +0800 | [diff] [blame] | 38 | } |
jrperritt | 9b7b9e6 | 2016-07-11 22:30:50 -0500 | [diff] [blame] | 39 | err := r.ExtractInto(&s) |
| 40 | return s.ConnectionInfo, err |
| 41 | } |
feisky | cf0c7fe | 2015-11-05 22:06:17 +0800 | [diff] [blame] | 42 | |
jrperritt | 9b7b9e6 | 2016-07-11 22:30:50 -0500 | [diff] [blame] | 43 | // InitializeConnectionResult contains the response body and error from a Get request. |
| 44 | type InitializeConnectionResult struct { |
| 45 | commonResult |
feisky | cf0c7fe | 2015-11-05 22:06:17 +0800 | [diff] [blame] | 46 | } |