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/cloudapi/compute/ids.go

38 lines
834 B

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
}