This commit is contained in:
2026-09-21 11:51:12 +03:00
parent 9cd93e4277
commit 2b229a84fb
240 changed files with 7735 additions and 3166 deletions

View File

@@ -542,30 +542,16 @@ func externalNetworkPortsComputedSchema() *schema.Schema {
Computed: true,
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"id": {Type: schema.TypeString, Computed: true},
"access_group_id": {Type: schema.TypeString, Computed: true},
"access_group_name": {Type: schema.TypeString, Computed: true},
"bridge_network_name": {Type: schema.TypeString, Computed: true},
"comment": {Type: schema.TypeString, Computed: true},
"default_gateway_ipv4": {Type: schema.TypeString, Computed: true},
"default_gateway_ipv6": {Type: schema.TypeString, Computed: true},
"description": {Type: schema.TypeString, Computed: true},
"enabled": {Type: schema.TypeBool, Computed: true},
"external_network_ports": externalNetworkPortFieldsComputedSchema(),
"hypervisors": {
Type: schema.TypeList,
Computed: true,
Elem: &schema.Schema{Type: schema.TypeString},
},
"ipv4": {Type: schema.TypeString, Computed: true},
"status": statusComputedSchema(),
"version_id": {Type: schema.TypeInt, Computed: true},
"subnet_v4": {Type: schema.TypeString, Computed: true},
"subnet_v6": {Type: schema.TypeString, Computed: true},
"created_at": {Type: schema.TypeString, Computed: true},
"updated_at": {Type: schema.TypeString, Computed: true},
"vlan_tag": {Type: schema.TypeInt, Computed: true},
"mac": {Type: schema.TypeString, Computed: true},
"id": {Type: schema.TypeString, Computed: true},
"access_group_id": {Type: schema.TypeString, Computed: true},
"access_group_name": {Type: schema.TypeString, Computed: true},
"comment": {Type: schema.TypeString, Computed: true},
"display_name": {Type: schema.TypeString, Computed: true},
"enabled": {Type: schema.TypeBool, Computed: true},
"external_network_id": {Type: schema.TypeString, Computed: true},
"ipv4": {Type: schema.TypeString, Computed: true},
"version_id": {Type: schema.TypeInt, Computed: true},
"mac": {Type: schema.TypeString, Computed: true},
},
},
}

View File

@@ -102,6 +102,10 @@ func dataSourceNetworkObjectGroupListSchemaMake() map[string]*schema.Schema {
Type: schema.TypeInt,
Computed: true,
},
"type": {
Type: schema.TypeString,
Optional: true,
},
"items": {
Type: schema.TypeList,
Computed: true,

View File

@@ -405,31 +405,16 @@ func flattenExternalNetworkPortFields(ports netobjgroups.ExternalNetworkPortsFie
func flattenExternalNetworkPorts(ports netobjgroups.ExternalNetworkPorts) []map[string]interface{} {
res := make([]map[string]interface{}, 0, len(ports))
for _, p := range ports {
hypervisors := make([]interface{}, 0, len(p.Hypervisors))
for _, h := range p.Hypervisors {
hypervisors = append(hypervisors, h)
}
res = append(res, map[string]interface{}{
"id": p.ID,
"access_group_id": p.AccessGroupID,
"access_group_name": p.AccessGroupName,
"bridge_network_name": p.BridgeNetworkName,
"comment": p.Comment,
"default_gateway_ipv4": p.DefaultGatewayIPv4,
"default_gateway_ipv6": p.DefaultGatewayIPv6,
"description": p.Description,
"enabled": p.Enabled,
"external_network_ports": flattenExternalNetworkPortFields(p.ExternalNetworkPorts),
"hypervisors": hypervisors,
"ipv4": p.IPv4,
"status": flattenStatus(p.Status),
"version_id": int(p.VersionID),
"subnet_v4": p.SubnetV4,
"subnet_v6": p.SubnetV6,
"created_at": p.CreatedAt,
"updated_at": p.UpdatedAt,
"vlan_tag": p.VLANTag,
"mac": p.MAC,
"id": p.ID,
"access_group_id": p.AccessGroupID,
"access_group_name": p.AccessGroupName,
"comment": p.Comment,
"display_name": p.DisplayName,
"enabled": p.Enabled,
"ipv4": p.IPv4,
"mac": p.MAC,
"version_id": int(p.VersionID),
})
}
return res

View File

@@ -77,6 +77,10 @@ func utilityNetworkObjectGroupListCheckPresence(ctx context.Context, d *schema.R
req.UpdatedTo = updatedTo.(string)
}
if typeObj, ok := d.GetOk("type"); ok {
req.Type = typeObj.(string)
}
log.Debugf("utilityNetworkObjectGroupListCheckPresence")
list, err := c.SDN().NetworkObjectGroups().List(ctx, req)
if err != nil {