v1.6.8
This commit is contained in:
46
pkg/cloudbroker/compute/ids.go
Normal file
46
pkg/cloudbroker/compute/ids.go
Normal file
@@ -0,0 +1,46 @@
|
||||
package compute
|
||||
|
||||
// IDs gets array of ComputeIDs from ListComputes struct
|
||||
func (lc ListComputes) IDs() []uint64 {
|
||||
res := make([]uint64, 0, len(lc.Data))
|
||||
for _, c := range lc.Data {
|
||||
res = append(res, c.ID)
|
||||
}
|
||||
return res
|
||||
}
|
||||
|
||||
// IDs gets array of DiskIDs from ListInfoDisks struct
|
||||
func (lid ListInfoDisks) IDs() []uint64 {
|
||||
res := make([]uint64, 0, len(lid))
|
||||
for _, d := range lid {
|
||||
res = append(res, d.ID)
|
||||
}
|
||||
return res
|
||||
}
|
||||
|
||||
// IDs gets array of PFWsIDs from ListPFW struct
|
||||
func (lp ListPFW) IDs() []uint64 {
|
||||
res := make([]uint64, 0, len(lp))
|
||||
for _, p := range lp {
|
||||
res = append(res, p.ID)
|
||||
}
|
||||
return res
|
||||
}
|
||||
|
||||
// IDs gets array of DiskIDs from ListDisks struct
|
||||
func (ld ListDisks) IDs() []uint64 {
|
||||
res := make([]uint64, 0, len(ld))
|
||||
for _, d := range ld {
|
||||
res = append(res, d.ID)
|
||||
}
|
||||
return res
|
||||
}
|
||||
|
||||
// IDs gets array of PCIDeviceIDs from ListPCIDevices struct
|
||||
func (lpd ListPCIDevices) IDs() []uint64 {
|
||||
res := make([]uint64, 0, len(lpd.Data))
|
||||
for _, pd := range lpd.Data {
|
||||
res = append(res, pd.ID)
|
||||
}
|
||||
return res
|
||||
}
|
||||
@@ -720,10 +720,13 @@ type RecordCompute struct {
|
||||
InfoCompute
|
||||
}
|
||||
|
||||
// Information about of disk IDs
|
||||
type ListInfoDisks []InfoDisk
|
||||
|
||||
// Main information about compute for list
|
||||
type ItemCompute struct {
|
||||
// List of disk IDs
|
||||
Disks []InfoDisk `json:"disks"`
|
||||
Disks ListInfoDisks `json:"disks"`
|
||||
|
||||
// Main information about compute
|
||||
InfoCompute
|
||||
|
||||
Reference in New Issue
Block a user