@@ -35,8 +35,6 @@ type switchPortSettingsModel struct {
35
35
Description types.String `tfsdk:"description"`
36
36
Addresses []switchPortSettingsAddressModel `tfsdk:"addresses"`
37
37
BGPPeers []switchPortSettingsBGPPeerModel `tfsdk:"bgp_peers"`
38
- Groups []types.String `tfsdk:"groups"`
39
- Interfaces []switchPortSettingsInterfaceModel `tfsdk:"interfaces"`
40
38
Links []switchPortSettingsLinkModel `tfsdk:"links"`
41
39
PortConfig * switchPortSettingsPortConfigModel `tfsdk:"port_config"`
42
40
Routes []switchPortSettingsRouteModel `tfsdk:"routes"`
@@ -92,17 +90,6 @@ type switchPortSettingsBGPPeerPeerAllowedImportModel struct {
92
90
Value []types.String `tfsdk:"value"`
93
91
}
94
92
95
- type switchPortSettingsInterfaceModel struct {
96
- Kind * switchPortSettingsInterfaceKindModel `tfsdk:"kind"`
97
- LinkName types.String `tfsdk:"link_name"`
98
- V6Enabled types.Bool `tfsdk:"v6_enabled"`
99
- }
100
-
101
- type switchPortSettingsInterfaceKindModel struct {
102
- Type types.String `tfsdk:"type"`
103
- VID types.Int32 `tfsdk:"vid"`
104
- }
105
-
106
93
type switchPortSettingsLinkModel struct {
107
94
Autoneg types.Bool `tfsdk:"autoneg"`
108
95
FEC types.String `tfsdk:"fec"`
@@ -342,48 +329,6 @@ func (r *switchPortSettingsResource) Schema(ctx context.Context, _ resource.Sche
342
329
Required : true ,
343
330
Description : "Human-readable description of the switch port settings." ,
344
331
},
345
- "groups" : schema.SetAttribute {
346
- Optional : true ,
347
- ElementType : types .StringType ,
348
- Description : "Set of port settings group IDs to include in these settings." ,
349
- },
350
- "interfaces" : schema.SetNestedAttribute {
351
- Optional : true ,
352
- Description : "Interface configuration for the switch port." ,
353
- NestedObject : schema.NestedAttributeObject {
354
- Attributes : map [string ]schema.Attribute {
355
- "kind" : schema.SingleNestedAttribute {
356
- Required : true ,
357
- Description : "The kind of interface this configuration represents." ,
358
- Attributes : map [string ]schema.Attribute {
359
- "type" : schema.StringAttribute {
360
- Required : true ,
361
- Description : "Type of the interface." ,
362
- Validators : []validator.String {
363
- stringvalidator .OneOf (
364
- string (oxide .SwitchInterfaceKindTypePrimary ),
365
- string (oxide .SwitchInterfaceKindTypeVlan ),
366
- string (oxide .SwitchInterfaceKindTypeLoopback ),
367
- ),
368
- },
369
- },
370
- "vid" : schema.Int32Attribute {
371
- Optional : true ,
372
- Description : "VLAN ID for the interfaces." ,
373
- },
374
- },
375
- },
376
- "link_name" : schema.StringAttribute {
377
- Required : true ,
378
- Description : "Name of the link this interface is associated with." ,
379
- },
380
- "v6_enabled" : schema.BoolAttribute {
381
- Optional : true ,
382
- Description : "Enable IPv6 on this interface." ,
383
- },
384
- },
385
- },
386
- },
387
332
"links" : schema.SetNestedAttribute {
388
333
Required : true ,
389
334
Description : "Link configuration for the switch port." ,
@@ -664,8 +609,6 @@ func (r *switchPortSettingsResource) Read(ctx context.Context, req resource.Read
664
609
// types.
665
610
state .Addresses = model .Addresses
666
611
state .BGPPeers = model .BGPPeers
667
- state .Groups = model .Groups
668
- state .Interfaces = model .Interfaces
669
612
state .Links = model .Links
670
613
state .PortConfig = model .PortConfig
671
614
state .Routes = model .Routes
@@ -965,36 +908,6 @@ func toSwitchPortSettingsModel(settings *oxide.SwitchPortSettings) (switchPortSe
965
908
model .BGPPeers = bgpPeersModels
966
909
}
967
910
968
- //
969
- // Groups
970
- //
971
- if len (settings .Groups ) > 0 {
972
- groupModels := make ([]types.String , 0 )
973
- for _ , group := range settings .Groups {
974
- groupModel := types .StringValue (group .PortSettingsGroupId )
975
- groupModels = append (groupModels , groupModel )
976
- }
977
- model .Groups = groupModels
978
- }
979
-
980
- //
981
- // Interfaces
982
- //
983
- if len (settings .Interfaces ) > 0 {
984
- interfaceModels := make ([]switchPortSettingsInterfaceModel , 0 )
985
- for _ , iface := range settings .Interfaces {
986
- interfaceModel := switchPortSettingsInterfaceModel {
987
- Kind : & switchPortSettingsInterfaceKindModel {
988
- Type : types .StringValue (string (iface .Kind )),
989
- },
990
- LinkName : types .StringValue (string (iface .InterfaceName )),
991
- V6Enabled : types .BoolPointerValue (iface .V6Enabled ),
992
- }
993
- interfaceModels = append (interfaceModels , interfaceModel )
994
- }
995
- model .Interfaces = interfaceModels
996
- }
997
-
998
911
//
999
912
// Links
1000
913
//
@@ -1174,6 +1087,8 @@ func toNetworkingSwitchPortSettingsCreateParams(model switchPortSettingsModel) (
1174
1087
PortConfig : oxide.SwitchPortConfigCreate {
1175
1088
Geometry : oxide .SwitchPortGeometry (model .PortConfig .Geometry .ValueString ()),
1176
1089
},
1090
+ Groups : []oxide.NameOrId {},
1091
+ Interfaces : []oxide.SwitchInterfaceConfigCreate {},
1177
1092
},
1178
1093
}
1179
1094
@@ -1309,38 +1224,6 @@ func toNetworkingSwitchPortSettingsCreateParams(model switchPortSettingsModel) (
1309
1224
}
1310
1225
params .Body .BgpPeers = bgpPeerConfigs
1311
1226
1312
- //
1313
- // Groups
1314
- //
1315
- groups := make ([]oxide.NameOrId , 0 )
1316
- for _ , group := range model .Groups {
1317
- groups = append (groups , oxide .NameOrId (group .ValueString ()))
1318
- }
1319
- params .Body .Groups = groups
1320
-
1321
- //
1322
- // Interfaces
1323
- //
1324
- interfaceConfigs := make ([]oxide.SwitchInterfaceConfigCreate , 0 )
1325
- for _ , interfaceModel := range model .Interfaces {
1326
- interfaceConfig := oxide.SwitchInterfaceConfigCreate {
1327
- Kind : oxide.SwitchInterfaceKind {
1328
- Type : oxide .SwitchInterfaceKindType (interfaceModel .Kind .Type .ValueString ()),
1329
- Vid : func () * int {
1330
- if interfaceModel .Kind .VID .IsNull () {
1331
- return nil
1332
- }
1333
- return oxide .NewPointer (int (interfaceModel .Kind .VID .ValueInt32 ()))
1334
- }(),
1335
- },
1336
- LinkName : oxide .Name (interfaceModel .LinkName .ValueString ()),
1337
- V6Enabled : oxide .NewPointer (interfaceModel .V6Enabled .ValueBool ()),
1338
- }
1339
-
1340
- interfaceConfigs = append (interfaceConfigs , interfaceConfig )
1341
- }
1342
- params .Body .Interfaces = interfaceConfigs
1343
-
1344
1227
//
1345
1228
// Links
1346
1229
//
0 commit comments