4.10.1
This commit is contained in:
@@ -134,6 +134,10 @@ func vnfInterfaceSchemaMake() map[string]*schema.Schema {
|
||||
Type: schema.TypeBool,
|
||||
Computed: true,
|
||||
},
|
||||
"enable_secgroups": {
|
||||
Type: schema.TypeBool,
|
||||
Computed: true,
|
||||
},
|
||||
"flipgroup_id": {
|
||||
Type: schema.TypeInt,
|
||||
Computed: true,
|
||||
@@ -234,6 +238,13 @@ func vnfInterfaceSchemaMake() map[string]*schema.Schema {
|
||||
Type: schema.TypeString,
|
||||
Computed: true,
|
||||
},
|
||||
"security_groups": {
|
||||
Type: schema.TypeList,
|
||||
Computed: true,
|
||||
Elem: &schema.Schema{
|
||||
Type: schema.TypeInt,
|
||||
},
|
||||
},
|
||||
"target": {
|
||||
Type: schema.TypeString,
|
||||
Computed: true,
|
||||
@@ -327,6 +338,10 @@ func vnfDevSchemaMake() map[string]*schema.Schema {
|
||||
Schema: vnfInterfaceSchemaMake(),
|
||||
},
|
||||
},
|
||||
"live_migration_job_id": {
|
||||
Type: schema.TypeInt,
|
||||
Computed: true,
|
||||
},
|
||||
"lock_status": {
|
||||
Type: schema.TypeString,
|
||||
Computed: true,
|
||||
@@ -362,6 +377,10 @@ func vnfDevSchemaMake() map[string]*schema.Schema {
|
||||
Type: schema.TypeInt,
|
||||
},
|
||||
},
|
||||
"zone_id": {
|
||||
Type: schema.TypeInt,
|
||||
Computed: true,
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
@@ -554,6 +573,10 @@ func dhcpSchemaMake() map[string]*schema.Schema {
|
||||
Type: schema.TypeString,
|
||||
Computed: true,
|
||||
},
|
||||
"zone_id": {
|
||||
Type: schema.TypeInt,
|
||||
Computed: true,
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
@@ -678,6 +701,13 @@ func gwSchemaMake() map[string]*schema.Schema {
|
||||
Type: schema.TypeBool,
|
||||
Computed: true,
|
||||
},
|
||||
"routes": {
|
||||
Type: schema.TypeList,
|
||||
Computed: true,
|
||||
Elem: &schema.Resource{
|
||||
Schema: routesSchemaMake(),
|
||||
},
|
||||
},
|
||||
"status": {
|
||||
Type: schema.TypeString,
|
||||
Computed: true,
|
||||
@@ -690,6 +720,10 @@ func gwSchemaMake() map[string]*schema.Schema {
|
||||
Type: schema.TypeString,
|
||||
Computed: true,
|
||||
},
|
||||
"zone_id": {
|
||||
Type: schema.TypeInt,
|
||||
Computed: true,
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
@@ -810,6 +844,13 @@ func natSchemaMake() map[string]*schema.Schema {
|
||||
Type: schema.TypeBool,
|
||||
Computed: true,
|
||||
},
|
||||
"routes": {
|
||||
Type: schema.TypeList,
|
||||
Computed: true,
|
||||
Elem: &schema.Resource{
|
||||
Schema: routesSchemaMake(),
|
||||
},
|
||||
},
|
||||
"status": {
|
||||
Type: schema.TypeString,
|
||||
Computed: true,
|
||||
@@ -822,6 +863,10 @@ func natSchemaMake() map[string]*schema.Schema {
|
||||
Type: schema.TypeString,
|
||||
Computed: true,
|
||||
},
|
||||
"zone_id": {
|
||||
Type: schema.TypeInt,
|
||||
Computed: true,
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -114,6 +114,11 @@ func dataSourceVinsListSchemaMake() map[string]*schema.Schema {
|
||||
Optional: true,
|
||||
Description: "Page size",
|
||||
},
|
||||
"zone_id": {
|
||||
Type: schema.TypeInt,
|
||||
Optional: true,
|
||||
Description: "Zone ID",
|
||||
},
|
||||
"items": {
|
||||
Type: schema.TypeList,
|
||||
Computed: true,
|
||||
|
||||
@@ -91,6 +91,7 @@ func flattenInterfaces(interfaces []vins.ItemVNFInterface) []map[string]interfac
|
||||
"conn_type": vnfInterface.ConnType,
|
||||
"def_gw": vnfInterface.DefGW,
|
||||
"enabled": vnfInterface.Enabled,
|
||||
"enable_secgroups": vnfInterface.EnableSecGroups,
|
||||
"flipgroup_id": vnfInterface.FLIPGroupID,
|
||||
"guid": vnfInterface.GUID,
|
||||
"ip_address": vnfInterface.IPAddress,
|
||||
@@ -106,6 +107,7 @@ func flattenInterfaces(interfaces []vins.ItemVNFInterface) []map[string]interfac
|
||||
"bus_number": vnfInterface.BusNumber,
|
||||
"qos": flattenQOS(vnfInterface.QOS),
|
||||
"sdn_interface_id": vnfInterface.SDNInterfaceID,
|
||||
"security_groups": vnfInterface.SecGroups,
|
||||
"target": vnfInterface.Target,
|
||||
"type": vnfInterface.Type,
|
||||
"vnfs": vnfInterface.VNFs,
|
||||
@@ -135,25 +137,26 @@ func flattenLibvirtSettings(libvirtSettings vins.LibvirtSettings) []map[string]i
|
||||
func flattenVNFDev(vnfDev vins.RecordVNFDev) []map[string]interface{} {
|
||||
res := make([]map[string]interface{}, 0)
|
||||
temp := map[string]interface{}{
|
||||
"_ckey": vnfDev.CKey,
|
||||
"account_id": vnfDev.AccountID,
|
||||
"capabilities": vnfDev.Capabilities,
|
||||
"config": flattenConfig(vnfDev.Config), //in progress
|
||||
"config_saved": vnfDev.ConfigSaved,
|
||||
"custom_pre_cfg": vnfDev.CustomPreConfig,
|
||||
"desc": vnfDev.Description,
|
||||
"gid": vnfDev.GID,
|
||||
"guid": vnfDev.GUID,
|
||||
"vnf_id": vnfDev.ID,
|
||||
"interfaces": flattenInterfaces(vnfDev.Interfaces),
|
||||
"lock_status": vnfDev.LockStatus,
|
||||
"milestones": vnfDev.Milestones,
|
||||
"vnf_name": vnfDev.Name,
|
||||
"status": vnfDev.Status,
|
||||
"tech_status": vnfDev.TechStatus,
|
||||
"type": vnfDev.Type,
|
||||
"vnc_password": vnfDev.VNCPassword,
|
||||
"vins": vnfDev.VINS,
|
||||
"_ckey": vnfDev.CKey,
|
||||
"account_id": vnfDev.AccountID,
|
||||
"capabilities": vnfDev.Capabilities,
|
||||
"config": flattenConfig(vnfDev.Config), //in progress
|
||||
"config_saved": vnfDev.ConfigSaved,
|
||||
"custom_pre_cfg": vnfDev.CustomPreConfig,
|
||||
"desc": vnfDev.Description,
|
||||
"gid": vnfDev.GID,
|
||||
"guid": vnfDev.GUID,
|
||||
"vnf_id": vnfDev.ID,
|
||||
"interfaces": flattenInterfaces(vnfDev.Interfaces),
|
||||
"live_migration_job_id": vnfDev.LiveMigrationJobID,
|
||||
"lock_status": vnfDev.LockStatus,
|
||||
"milestones": vnfDev.Milestones,
|
||||
"vnf_name": vnfDev.Name,
|
||||
"status": vnfDev.Status,
|
||||
"tech_status": vnfDev.TechStatus,
|
||||
"type": vnfDev.Type,
|
||||
"vnc_password": vnfDev.VNCPassword,
|
||||
"vins": vnfDev.VINS,
|
||||
}
|
||||
|
||||
res = append(res, temp)
|
||||
@@ -249,6 +252,7 @@ func flattenDHCP(dhcp vins.RecordDHCP) []map[string]interface{} {
|
||||
"status": dhcp.Status,
|
||||
"tech_status": dhcp.TechStatus,
|
||||
"type": dhcp.Type,
|
||||
"zone_id": dhcp.ZoneID,
|
||||
}
|
||||
res = append(res, temp)
|
||||
|
||||
@@ -285,9 +289,11 @@ 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,
|
||||
"zone_id": gw.ZoneID,
|
||||
}
|
||||
res = append(res, temp)
|
||||
|
||||
@@ -341,9 +347,11 @@ 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,
|
||||
"zone_id": nat.ZoneID,
|
||||
}
|
||||
res = append(res, temp)
|
||||
|
||||
|
||||
@@ -88,6 +88,9 @@ func utilityVinsListCheckPresence(ctx context.Context, d *schema.ResourceData, m
|
||||
if size, ok := d.GetOk("size"); ok {
|
||||
req.Size = uint64(size.(int))
|
||||
}
|
||||
if zoneID, ok := d.GetOk("zone_id"); ok {
|
||||
req.ZoneID = uint64(zoneID.(int))
|
||||
}
|
||||
|
||||
log.Debugf("utilityVinsListCheckPresence")
|
||||
vinsList, err := c.CloudAPI().VINS().List(ctx, req)
|
||||
|
||||
Reference in New Issue
Block a user