This commit is contained in:
2025-08-04 16:11:16 +03:00
parent bae25296bb
commit 4b3f21d9be
239 changed files with 6585 additions and 784 deletions

View File

@@ -167,6 +167,10 @@ func dataSourceExtnetSchemaMake() map[string]*schema.Schema {
Type: schema.TypeInt,
Computed: true,
},
"zone_id": {
Type: schema.TypeInt,
Computed: true,
},
"ipcidr": {
Type: schema.TypeString,
Computed: true,
@@ -183,9 +187,21 @@ func dataSourceExtnetSchemaMake() map[string]*schema.Schema {
Type: schema.TypeString,
Computed: true,
},
"network_id": {
Type: schema.TypeInt,
"network_ids": {
Type: schema.TypeList,
Computed: true,
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"primary": {
Type: schema.TypeInt,
Computed: true,
},
"secondary": {
Type: schema.TypeInt,
Computed: true,
},
},
},
},
"pre_reservations_num": {
Type: schema.TypeInt,
@@ -277,6 +293,62 @@ func dataSourceExtnetSchemaMake() map[string]*schema.Schema {
Type: schema.TypeString,
},
},
"redundant": {
Type: schema.TypeBool,
Computed: true,
},
"sec_vnfdev_id": {
Type: schema.TypeInt,
Computed: true,
},
"mtu": {
Type: schema.TypeInt,
Computed: true,
},
"pre_reservations": {
Type: schema.TypeList,
Computed: true,
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"account_id": {
Type: schema.TypeInt,
Computed: true,
},
"client_type": {
Type: schema.TypeString,
Computed: true,
},
"domain_name": {
Type: schema.TypeString,
Computed: true,
},
"hostname": {
Type: schema.TypeString,
Computed: true,
},
"desc": {
Type: schema.TypeString,
Computed: true,
},
"ip": {
Type: schema.TypeString,
Computed: true,
},
"mac": {
Type: schema.TypeString,
Computed: true,
},
"type": {
Type: schema.TypeString,
Computed: true,
},
"vm_id": {
Type: schema.TypeInt,
Computed: true,
},
},
},
},
}
return res
}

View File

@@ -23,7 +23,7 @@ func flattenExtnet(d *schema.ResourceData, e *extnet.RecordExtNet) {
d.Set("milestones", e.Milestones)
d.Set("net_name", e.Name)
d.Set("network", e.Network)
d.Set("network_id", e.NetworkID)
d.Set("network_ids", flattenNetworkIDs(e.NetworkIDs))
d.Set("ntp", e.NTP)
d.Set("pre_reservations_num", e.PreReservationsNum)
d.Set("prefix", e.Prefix)
@@ -33,6 +33,11 @@ func flattenExtnet(d *schema.ResourceData, e *extnet.RecordExtNet) {
d.Set("status", e.Status)
d.Set("vlan_id", e.VLANID)
d.Set("vnfs", flattenExtnetVNFS(e.VNFs))
d.Set("zone_id", e.ZoneID)
d.Set("pre_reservations", flattenExtnetReservations(e.PreReservations))
d.Set("sec_vnfdev_id", e.SecVNFDevID)
d.Set("redundant", e.Redundant)
d.Set("mtu", e.MTU)
}
func flattenExcluded(ex []extnet.Excluded) []map[string]interface{} {
@@ -163,3 +168,14 @@ func flattenExtnetReservedIp(el []extnet.RecordReservedIP) []map[string]interfac
}
return res
}
func flattenNetworkIDs(ex extnet.NetworkIDs) []map[string]interface{} {
res := make([]map[string]interface{}, 0, 1)
temp := map[string]interface{}{
"primary": ex.Primary,
"secondary": ex.Secondary,
}
res = append(res, temp)
return res
}