v1.6.8
This commit is contained in:
28
pkg/cloudapi/disks/ids.go
Normal file
28
pkg/cloudapi/disks/ids.go
Normal file
@@ -0,0 +1,28 @@
|
||||
package disks
|
||||
|
||||
// IDs gets array of DiskIDs from ListDisks struct
|
||||
func (ld ListDisks) IDs() []uint64 {
|
||||
res := make([]uint64, 0, len(ld.Data))
|
||||
for _, d := range ld.Data {
|
||||
res = append(res, d.ID)
|
||||
}
|
||||
return res
|
||||
}
|
||||
|
||||
// IDs gets array of DiskIDs from ListDisksUnattached struct
|
||||
func (ldu ListDisksUnattached) IDs() []uint64 {
|
||||
res := make([]uint64, 0, len(ldu.Data))
|
||||
for _, d := range ldu.Data {
|
||||
res = append(res, d.ID)
|
||||
}
|
||||
return res
|
||||
}
|
||||
|
||||
// IDs gets array of DiskIDs from ListSearchDisks struct
|
||||
func (lsd ListSearchDisks) IDs() []uint64 {
|
||||
res := make([]uint64, 0, len(lsd))
|
||||
for _, d := range lsd {
|
||||
res = append(res, d.ID)
|
||||
}
|
||||
return res
|
||||
}
|
||||
Reference in New Issue
Block a user