Skip to content

Commit cb3b522

Browse files
committed
ListVolumes
1 parent 4e1adef commit cb3b522

File tree

1 file changed

+146
-0
lines changed

1 file changed

+146
-0
lines changed
Lines changed: 146 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,146 @@
1+
package disk
2+
3+
type ListVolumesRequest struct {
4+
//
5+
Marker string `q:"marker,omitempty"`
6+
//
7+
Name string `q:"name,omitempty"`
8+
//
9+
Limit int32 `q:"limit,omitempty"`
10+
//
11+
SortKey string `q:"sort_key,omitempty"`
12+
//
13+
Offset int32 `q:"offset,omitempty"`
14+
//
15+
SortDir string `q:"sort_dir,omitempty"`
16+
//
17+
Status string `q:"status,omitempty"`
18+
//
19+
Metadata string `q:"metadata,omitempty"`
20+
//
21+
AvailabilityZone string `q:"availability_zone,omitempty"`
22+
//
23+
Multiattach bool `q:"multiattach,omitempty"`
24+
//
25+
ServiceType string `q:"service_type,omitempty"`
26+
//
27+
DedicatedStorageId string `q:"dedicated_storage_id,omitempty"`
28+
//
29+
DedicatedStorageName string `q:"dedicated_storage_name,omitempty"`
30+
//
31+
VolumeTypeId string `q:"volume_type_id,omitempty"`
32+
//
33+
Id string `q:"id,omitempty"`
34+
//
35+
Ids string `q:"ids,omitempty"`
36+
//
37+
EnterpriseProjectId string `q:"enterprise_project_id,omitempty"`
38+
//
39+
ServerId string `q:"server_id,omitempty"`
40+
}
41+
42+
// GET /v2/{project_id}/cloudvolumes/detail
43+
44+
type ListVolumesResponse struct {
45+
//
46+
Count int32 `json:"count,omitempty"`
47+
//
48+
VolumesLinks []Link `json:"volumes_links,omitempty"`
49+
//
50+
Volumes []VolumeDetail `json:"volumes,omitempty"`
51+
}
52+
53+
type Link struct {
54+
//
55+
Href string `json:"href,omitempty"`
56+
//
57+
Rel string `json:"rel,omitempty"`
58+
}
59+
60+
type VolumeDetail struct {
61+
//
62+
Id string `json:"id"`
63+
//
64+
Links []Link `json:"links"`
65+
//
66+
Name string `json:"name"`
67+
//
68+
Status string `json:"status"`
69+
//
70+
Attachments []Attachment `json:"attachments"`
71+
//
72+
AvailabilityZone string `json:"availability_zone"`
73+
//
74+
OsVolHostAttrhost string `json:"os-vol-host-attr:host"`
75+
//
76+
SourceVolid string `json:"source_volid,omitempty"`
77+
//
78+
SnapshotId string `json:"snapshot_id"`
79+
//
80+
Description string `json:"description"`
81+
//
82+
CreatedAt string `json:"created_at"`
83+
//
84+
OsVolTenantAttrtenantId string `json:"os-vol-tenant-attr:tenant_id"`
85+
//
86+
VolumeImageMetadata map[string]interface{} `json:"volume_image_metadata"`
87+
//
88+
VolumeType string `json:"volume_type"`
89+
//
90+
Size int32 `json:"size"`
91+
//
92+
ConsistencygroupId string `json:"consistencygroup_id,omitempty"`
93+
//
94+
Bootable string `json:"bootable"`
95+
//
96+
Metadata map[string]interface{} `json:"metadata"`
97+
//
98+
UpdatedAt string `json:"updated_at"`
99+
//
100+
Encrypted bool `json:"encrypted,omitempty"`
101+
//
102+
ReplicationStatus string `json:"replication_status"`
103+
//
104+
OsVolumeReplicationextendedStatus string `json:"os-volume-replication:extended_status"`
105+
//
106+
OsVolMigStatusAttrmigstat string `json:"os-vol-mig-status-attr:migstat"`
107+
//
108+
OsVolMigStatusAttrnameId string `json:"os-vol-mig-status-attr:name_id"`
109+
//
110+
Shareable string `json:"shareable"`
111+
//
112+
UserId string `json:"user_id"`
113+
//
114+
ServiceType string `json:"service_type"`
115+
//
116+
Multiattach bool `json:"multiattach"`
117+
//
118+
DedicatedStorageId string `json:"dedicated_storage_id,omitempty"`
119+
//
120+
DedicatedStorageName string `json:"dedicated_storage_name,omitempty"`
121+
//
122+
Tags map[string]string `json:"tags"`
123+
//
124+
Wwn string `json:"wwn,omitempty"`
125+
//
126+
EnterpriseProjectId string `json:"enterprise_project_id,omitempty"`
127+
//
128+
SerialNumber string `json:"serial_number,omitempty"`
129+
}
130+
131+
type Attachment struct {
132+
//
133+
AttachedAt string `json:"attached_at"`
134+
//
135+
AttachmentId string `json:"attachment_id"`
136+
//
137+
Device string `json:"device"`
138+
//
139+
HostName string `json:"host_name"`
140+
//
141+
Id string `json:"id"`
142+
//
143+
ServerId string `json:"server_id"`
144+
//
145+
VolumeId string `json:"volume_id"`
146+
}

0 commit comments

Comments
 (0)