You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
decort-golang-sdk/pkg/cloudbroker/compute/ids.go

47 lines
1.0 KiB

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.Data))
for _, p := range lp.Data {
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
}