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.
67 lines
1.6 KiB
67 lines
1.6 KiB
package rg
|
|
|
|
// IDs gets array of ResourceGroupIDs from ListResourceGroups struct
|
|
func (lrg ListResourceGroups) IDs() []uint64 {
|
|
res := make([]uint64, 0, len(lrg.Data))
|
|
for _, rg := range lrg.Data {
|
|
res = append(res, rg.ID)
|
|
}
|
|
return res
|
|
}
|
|
|
|
// IDs gets array of ComputeIDs from ListAffinityGroupsComputes struct
|
|
func (lag ListAffinityGroupsComputes) IDs() []uint64 {
|
|
res := make([]uint64, 0, len(lag))
|
|
for _, ag := range lag {
|
|
res = append(res, ag.ComputeID)
|
|
}
|
|
return res
|
|
}
|
|
|
|
// 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 LBIDs from ListLB struct
|
|
func (llb ListLB) IDs() []uint64 {
|
|
res := make([]uint64, 0, len(llb.Data))
|
|
for _, lb := range llb.Data {
|
|
res = append(res, lb.ID)
|
|
}
|
|
return res
|
|
}
|
|
|
|
// IDs gets array of VINSIDs from ListVINS struct
|
|
func (llb ListVINS) IDs() []uint64 {
|
|
res := make([]uint64, 0, len(llb.Data))
|
|
for _, lb := range llb.Data {
|
|
res = append(res, lb.ID)
|
|
}
|
|
return res
|
|
}
|
|
|
|
// IDs gets array of ResourceGroupIDs from ListResourceConsumption struct
|
|
func (lrc ListResourceConsumption) IDs() []uint64 {
|
|
res := make([]uint64, 0, len(lrc.Data))
|
|
for _, rc := range lrc.Data {
|
|
res = append(res, rc.RGID)
|
|
}
|
|
return res
|
|
}
|
|
|
|
// IDs gets array of ResourceGroupIDs from ListAffinityGroup struct
|
|
func (lag ListAffinityGroups) IDs() []uint64 {
|
|
res := make([]uint64, 0, len(lag.Data))
|
|
for _, ag := range lag.Data {
|
|
for _, v := range ag {
|
|
res = append(res, v...)
|
|
}
|
|
}
|
|
return res
|
|
}
|