v1.6.8
This commit is contained in:
55
pkg/cloudbroker/vins/ids.go
Normal file
55
pkg/cloudbroker/vins/ids.go
Normal file
@@ -0,0 +1,55 @@
|
||||
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 NATRuleIDs from ListNATRules struct
|
||||
func (lnr ListNATRules) IDs() []uint64 {
|
||||
res := make([]uint64, 0, len(lnr.Data))
|
||||
for _, nrc := range lnr.Data {
|
||||
res = append(res, nrc.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
|
||||
}
|
||||
|
||||
// IDs gets array of NATRuleConfigIDs from ListNatRule struct
|
||||
func (lnrc ListNatRule) IDs() []uint64 {
|
||||
res := make([]uint64, 0, len(lnrc))
|
||||
for _, nrc := range lnrc {
|
||||
res = append(res, nrc.ID)
|
||||
}
|
||||
return res
|
||||
}
|
||||
@@ -336,6 +336,9 @@ type RecordGW struct {
|
||||
InfoVNF
|
||||
}
|
||||
|
||||
// List NATRules
|
||||
type ListNatRule []ItemNATRule
|
||||
|
||||
// NAT config
|
||||
type NATConfig struct {
|
||||
// Network mask
|
||||
@@ -345,7 +348,7 @@ type NATConfig struct {
|
||||
Network string `json:"network"`
|
||||
|
||||
// Rules
|
||||
Rules []ItemNATRule `json:"rules"`
|
||||
Rules ListNatRule `json:"rules"`
|
||||
}
|
||||
|
||||
// Main information about NAT
|
||||
|
||||
Reference in New Issue
Block a user