This commit is contained in:
2023-12-19 16:37:50 +03:00
parent 20050bc169
commit f49d9f8860
150 changed files with 12582 additions and 11709 deletions

View File

@@ -90,6 +90,7 @@ func flattenInterfaces(interfaces []vins.ItemVNFInterface) []map[string]interfac
"conn_id": vnfInterface.ConnID,
"conn_type": vnfInterface.ConnType,
"def_gw": vnfInterface.DefGW,
"enabled": vnfInterface.Enabled,
"flipgroup_id": vnfInterface.FLIPGroupID,
"guid": vnfInterface.GUID,
"ip_address": vnfInterface.IPAddress,
@@ -226,6 +227,7 @@ func flattenDHCP(dhcp vins.RecordDHCP) []map[string]interface{} {
"owner_id": dhcp.OwnerID,
"owner_type": dhcp.OwnerType,
"pure_virtual": dhcp.PureVirtual,
"routes": flattenStaticRoute(dhcp.Routes),
"status": dhcp.Status,
"tech_status": dhcp.TechStatus,
"type": dhcp.Type,
@@ -265,6 +267,7 @@ func flattenGW(gw vins.RecordGW) []map[string]interface{} {
"owner_id": gw.OwnerID,
"owner_type": gw.OwnerType,
"pure_virtual": gw.PureVirtual,
"routes": flattenStaticRoute(gw.Routes),
"status": gw.Status,
"tech_status": gw.TechStatus,
"type": gw.Type,
@@ -321,6 +324,7 @@ func flattenNAT(nat vins.RecordNAT) []map[string]interface{} {
"owner_id": nat.OwnerID,
"owner_type": nat.OwnerType,
"pure_virtual": nat.PureVirtual,
"routes": flattenStaticRoute(nat.Routes),
"status": nat.Status,
"tech_status": nat.TechStatus,
"type": nat.Type,
@@ -508,7 +512,7 @@ func flattenVinsList(vl *vins.ListVINS) []map[string]interface{} {
// /4.4.0
func flattenStaticRouteList(sr *vins.ListStaticRoutes) []map[string]interface{} {
res := make([]map[string]interface{}, 0)
res := make([]map[string]interface{}, 0, len(sr.Data))
for _, staticRoute := range sr.Data {
temp := map[string]interface{}{
"route_id": staticRoute.ID,
@@ -533,6 +537,22 @@ func flattenStaticRouteData(d *schema.ResourceData, route *vins.ItemRoutes) {
d.Set("route_id", route.ID)
}
func flattenStaticRoute(sr vins.ListRoutes) []map[string]interface{} {
res := make([]map[string]interface{}, 0, len(sr))
for _, staticRoute := range sr {
temp := map[string]interface{}{
"route_id": staticRoute.ID,
"destination": staticRoute.Destination,
"gateway": staticRoute.Gateway,
"guid": staticRoute.GUID,
"netmask": staticRoute.Netmask,
"compute_ids": staticRoute.ComputeIds,
}
res = append(res, temp)
}
return res
}
///
func flattenVinsNatRuleList(natRules *vins.ListNATRules) []map[string]interface{} {