v1.6.8
This commit is contained in:
37
pkg/cloudapi/compute/ids.go
Normal file
37
pkg/cloudapi/compute/ids.go
Normal file
@@ -0,0 +1,37 @@
|
||||
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 (li ListInfoDisks) IDs() []uint64 {
|
||||
res := make([]uint64, 0, len(li))
|
||||
for _, i := range li {
|
||||
res = append(res, i.ID)
|
||||
}
|
||||
return res
|
||||
}
|
||||
|
||||
// IDs gets array of PFWsIDs from ListPFWs struct
|
||||
func (lp ListPFWs) IDs() []uint64 {
|
||||
res := make([]uint64, 0, len(lp.Data))
|
||||
for _, p := range lp.Data {
|
||||
res = append(res, p.ID)
|
||||
}
|
||||
return res
|
||||
}
|
||||
|
||||
// IDs gets array of DiskIDs from ListComputeDisks struct
|
||||
func (lcd ListComputeDisks) IDs() []uint64 {
|
||||
res := make([]uint64, 0, len(lcd))
|
||||
for _, cd := range lcd {
|
||||
res = append(res, cd.ID)
|
||||
}
|
||||
return res
|
||||
}
|
||||
@@ -819,7 +819,7 @@ type ItemCompute struct {
|
||||
Devices interface{} `json:"devices"`
|
||||
|
||||
// List disk items
|
||||
Disks []InfoDisk `json:"disks"`
|
||||
Disks ListInfoDisks `json:"disks"`
|
||||
|
||||
// Driver
|
||||
Driver string `json:"driver"`
|
||||
@@ -918,6 +918,9 @@ type ItemCompute struct {
|
||||
VirtualImageID uint64 `json:"virtualImageId"`
|
||||
}
|
||||
|
||||
// ListInfoDisks
|
||||
type ListInfoDisks []InfoDisk
|
||||
|
||||
// Information Disk
|
||||
type InfoDisk struct {
|
||||
// ID
|
||||
|
||||
Reference in New Issue
Block a user