blob: c767307486d6740ae0ab5a5d7b33616e01d73abd [file] [log] [blame]
feiskycf0c7fe2015-11-05 22:06:17 +08001package volumeactions
2
3import (
4 "github.com/mitchellh/mapstructure"
5 "github.com/rackspace/gophercloud"
6)
7
8type commonResult struct {
9 gophercloud.Result
10}
11
12// AttachResult contains the response body and error from a Get request.
13type AttachResult struct {
14 commonResult
15}
16
17// DetachResult contains the response body and error from a Get request.
18type DetachResult struct {
19 commonResult
20}
21
22// ReserveResult contains the response body and error from a Get request.
23type ReserveResult struct {
24 commonResult
25}
26
27// UnreserveResult contains the response body and error from a Get request.
28type UnreserveResult struct {
29 commonResult
30}
31
32// InitializeConnectionResult contains the response body and error from a Get request.
33type InitializeConnectionResult struct {
34 commonResult
35}
36
37// TerminateConnectionResult contains the response body and error from a Get request.
38type TerminateConnectionResult struct {
39 commonResult
40}
41
42// Extract will get the Volume object out of the commonResult object.
43func (r commonResult) Extract() (map[string]interface{}, error) {
44 if r.Err != nil {
45 return nil, r.Err
46 }
47
48 var res map[string]interface{}
49
50 err := mapstructure.Decode(r.Body, &res)
51
52 return res, err
53}