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 | |
Eugene Yakubovich | b3a4f33 | 2016-10-13 11:01:06 -0700 | [diff] [blame] | 10 | // BeginDetachingResult contains the response body and error from a Get request. |
| 11 | type BeginDetachingResult struct { |
| 12 | gophercloud.ErrResult |
| 13 | } |
| 14 | |
feisky | cf0c7fe | 2015-11-05 22:06:17 +0800 | [diff] [blame] | 15 | // DetachResult contains the response body and error from a Get request. |
| 16 | type DetachResult 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 | |
Joe Topjian | 48f36ae | 2017-02-20 14:36:44 -0700 | [diff] [blame] | 20 | // UploadImageResult contains the response body and error from a UploadImage request. |
| 21 | type UploadImageResult struct { |
| 22 | gophercloud.ErrResult |
| 23 | } |
| 24 | |
feisky | cf0c7fe | 2015-11-05 22:06:17 +0800 | [diff] [blame] | 25 | // ReserveResult contains the response body and error from a Get request. |
| 26 | type ReserveResult 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 | |
| 30 | // UnreserveResult contains the response body and error from a Get request. |
| 31 | type UnreserveResult struct { |
Jamie Hannaford | 531e0cc | 2016-05-13 13:03:39 +0200 | [diff] [blame] | 32 | gophercloud.ErrResult |
feisky | cf0c7fe | 2015-11-05 22:06:17 +0800 | [diff] [blame] | 33 | } |
| 34 | |
feisky | cf0c7fe | 2015-11-05 22:06:17 +0800 | [diff] [blame] | 35 | // TerminateConnectionResult contains the response body and error from a Get request. |
| 36 | type TerminateConnectionResult struct { |
Jamie Hannaford | 531e0cc | 2016-05-13 13:03:39 +0200 | [diff] [blame] | 37 | gophercloud.ErrResult |
feisky | cf0c7fe | 2015-11-05 22:06:17 +0800 | [diff] [blame] | 38 | } |
| 39 | |
jrperritt | 9b7b9e6 | 2016-07-11 22:30:50 -0500 | [diff] [blame] | 40 | type commonResult struct { |
| 41 | gophercloud.Result |
| 42 | } |
| 43 | |
feisky | cf0c7fe | 2015-11-05 22:06:17 +0800 | [diff] [blame] | 44 | // Extract will get the Volume object out of the commonResult object. |
| 45 | func (r commonResult) Extract() (map[string]interface{}, error) { |
jrperritt | 9b7b9e6 | 2016-07-11 22:30:50 -0500 | [diff] [blame] | 46 | var s struct { |
| 47 | ConnectionInfo map[string]interface{} `json:"connection_info"` |
feisky | cf0c7fe | 2015-11-05 22:06:17 +0800 | [diff] [blame] | 48 | } |
jrperritt | 9b7b9e6 | 2016-07-11 22:30:50 -0500 | [diff] [blame] | 49 | err := r.ExtractInto(&s) |
| 50 | return s.ConnectionInfo, err |
| 51 | } |
feisky | cf0c7fe | 2015-11-05 22:06:17 +0800 | [diff] [blame] | 52 | |
jrperritt | 9b7b9e6 | 2016-07-11 22:30:50 -0500 | [diff] [blame] | 53 | // InitializeConnectionResult contains the response body and error from a Get request. |
| 54 | type InitializeConnectionResult struct { |
| 55 | commonResult |
feisky | cf0c7fe | 2015-11-05 22:06:17 +0800 | [diff] [blame] | 56 | } |
Mario Luan | a4d4930 | 2016-09-02 11:37:24 -0400 | [diff] [blame] | 57 | |
| 58 | // ExtendSizeResult contains the response body and error from an ExtendSize request. |
| 59 | type ExtendSizeResult struct { |
| 60 | gophercloud.ErrResult |
| 61 | } |