forked from mindjiver/gopherstack
- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvolume.go
More file actions
Latest commit
54 lines (48 loc) · 2.03 KB
/
Copy pathvolume.go
File metadata and controls
54 lines (48 loc) · 2.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
package gopherstack
import (
"net/url"
)
// List volumes for Virtual Machine by it's ID
func (cCloudstackClient) ListVolumes(vmidstring) (ListVolumesResponse, error) {
varrespListVolumesResponse
params:= url.Values{}
params.Set("virtualmachineid", vmid)
response, err:=NewRequest(c, "listVolumes", params)
iferr!=nil {
returnresp, err
}
resp=response.(ListVolumesResponse)
returnresp, err
}
typeVolumestruct {
Accountstring`json:"account"`
Createdstring`json:"created"`
Destroyedbool`json:"destroyed"`
Deviceidfloat64`json:"deviceid"`
Domainstring`json:"domain"`
Domainidstring`json:"domainid"`
IDstring`json:"id"`
Isextractablebool`json:"isextractable"`
Namestring`json:"name"`
Serviceofferingdisplaytextstring`json:"serviceofferingdisplaytext"`
Serviceofferingidstring`json:"serviceofferingid"`
Serviceofferingnamestring`json:"serviceofferingname"`
Sizefloat64`json:"size"`
Statestring`json:"state"`
Storagestring`json:"storage"`
Storagetypestring`json:"storagetype"`
Tags []interface{} `json:"tags"`
Typestring`json:"type"`
Virtualmachineidstring`json:"virtualmachineid"`
Vmdisplaynamestring`json:"vmdisplayname"`
Vmnamestring`json:"vmname"`
Vmstatestring`json:"vmstate"`
Zoneidstring`json:"zoneid"`
Zonenamestring`json:"zonename"`
}
typeListVolumesResponsestruct {
Listvolumesresponsestruct {
Countfloat64`json:"count"`
Volume []Volume`json:"volume"`
} `json:"listvolumesresponse"`
}