v1.6.8
This commit is contained in:
64
pkg/cloudapi/vins/ids.go
Normal file
64
pkg/cloudapi/vins/ids.go
Normal file
@@ -0,0 +1,64 @@
|
||||
package vins
|
||||
|
||||
// IDs gets array of VINSIDs from ListVINS struct
|
||||
func (lv ListVINS) IDs() []uint64 {
|
||||
res := make([]uint64, 0, len(lv.Data))
|
||||
for _, v := range lv.Data {
|
||||
res = append(res, v.ID)
|
||||
}
|
||||
return res
|
||||
}
|
||||
|
||||
// IDs gets array of ExtNetIDs from ListExtNets struct
|
||||
func (le ListExtNets) IDs() []uint64 {
|
||||
res := make([]uint64, 0, len(le.Data))
|
||||
for _, e := range le.Data {
|
||||
res = append(res, e.ExtNetID)
|
||||
}
|
||||
return res
|
||||
}
|
||||
|
||||
// IDs gets array of ComputeIDs from ListVINSComputes struct
|
||||
func (lvc ListVINSComputes) IDs() []uint64 {
|
||||
res := make([]uint64, 0, len(lvc))
|
||||
for _, vc := range lvc {
|
||||
res = append(res, vc.ID)
|
||||
}
|
||||
return res
|
||||
}
|
||||
|
||||
// IDs gets array of NATRuleConfigIDs from ListNATRulesConfig struct
|
||||
func (lnrc ListNATRulesConfig) IDs() []uint64 {
|
||||
res := make([]uint64, 0, len(lnrc))
|
||||
for _, nrc := range lnrc {
|
||||
res = append(res, nrc.ID)
|
||||
}
|
||||
return res
|
||||
}
|
||||
|
||||
// IDs gets array of NATRuleIDs from ListNATRules struct
|
||||
func (lnr ListNATRules) IDs() []uint64 {
|
||||
res := make([]uint64, 0, len(lnr.Data))
|
||||
for _, nr := range lnr.Data {
|
||||
res = append(res, nr.ID)
|
||||
}
|
||||
return res
|
||||
}
|
||||
|
||||
// IDs gets array of StaticRouteIDs from ListStaticRoutes struct
|
||||
func (lsr ListStaticRoutes) IDs() []uint64 {
|
||||
res := make([]uint64, 0, len(lsr.Data))
|
||||
for _, sr := range lsr.Data {
|
||||
res = append(res, sr.ID)
|
||||
}
|
||||
return res
|
||||
}
|
||||
|
||||
// IDs gets array of RouteIDs from ListRoutes struct
|
||||
func (lr ListRoutes) IDs() []uint64 {
|
||||
res := make([]uint64, 0, len(lr))
|
||||
for _, r := range lr {
|
||||
res = append(res, r.ID)
|
||||
}
|
||||
return res
|
||||
}
|
||||
Reference in New Issue
Block a user