Skip to content

Commit 961eb64

Browse files
authored
[Resource] [Data source] Remove access config and jumbo fields, deprecate network-peer fields (#6319)
* Remove deprecated jumbo fields In addition we need to deprecate the Network Peer fields since this feature will not be shipping in July and will be implemented differently in the future. The access-config field has not been deprecated long enough to be removed. * Remove deprecated access-config field
1 parent be1ee0c commit 961eb64

File tree

8 files changed

+96
-146
lines changed

8 files changed

+96
-146
lines changed

ibm/service/power/data_source_ibm_pi_network.go

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,6 @@ func DataSourceIBMPINetwork() *schema.Resource {
3535
},
3636

3737
// Attributes
38-
Attr_AccessConfig: {
39-
Computed: true,
40-
Deprecated: "This field is deprecated please use peer_id instead.",
41-
Description: "The network communication configuration option of the network (for on prem locations only). Use `peer_id` instead.",
42-
Type: schema.TypeString,
43-
},
4438
Attr_AvailableIPCount: {
4539
Computed: true,
4640
Description: "The total number of IP addresses that you have in your network.",
@@ -67,12 +61,6 @@ func DataSourceIBMPINetwork() *schema.Resource {
6761
Description: "The network gateway that is attached to your network.",
6862
Type: schema.TypeString,
6963
},
70-
Attr_Jumbo: {
71-
Computed: true,
72-
Deprecated: "This field is deprecated, use mtu instead.",
73-
Description: "MTU Jumbo option of the network (for multi-zone locations only).",
74-
Type: schema.TypeBool,
75-
},
7664
Attr_MTU: {
7765
Computed: true,
7866
Description: "Maximum Transmission Unit option of the network.",
@@ -100,6 +88,7 @@ func DataSourceIBMPINetwork() *schema.Resource {
10088
},
10189
Attr_PeerID: {
10290
Computed: true,
91+
Deprecated: "This field is deprecated",
10392
Description: "Network peer ID (for on prem locations only).",
10493
Type: schema.TypeString,
10594
},
@@ -149,7 +138,6 @@ func dataSourceIBMPINetworkRead(ctx context.Context, d *schema.ResourceData, met
149138
}
150139

151140
d.SetId(*networkdata.NetworkID)
152-
d.Set(Attr_AccessConfig, networkdata.AccessConfig)
153141
if networkdata.IPAddressMetrics.Available != nil {
154142
d.Set(Attr_AvailableIPCount, networkdata.IPAddressMetrics.Available)
155143
}
@@ -168,7 +156,6 @@ func dataSourceIBMPINetworkRead(ctx context.Context, d *schema.ResourceData, met
168156
d.Set(Attr_DNS, networkdata.DNSServers)
169157
}
170158
d.Set(Attr_Gateway, networkdata.Gateway)
171-
d.Set(Attr_Jumbo, networkdata.Jumbo)
172159
d.Set(Attr_MTU, networkdata.Mtu)
173160
if networkdata.Name != nil {
174161
d.Set(Attr_Name, networkdata.Name)

ibm/service/power/data_source_ibm_pi_networks.go

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,6 @@ func DataSourceIBMPINetworks() *schema.Resource {
3535
Description: "List of all networks.",
3636
Elem: &schema.Resource{
3737
Schema: map[string]*schema.Schema{
38-
Attr_AccessConfig: {
39-
Computed: true,
40-
Deprecated: "This field is deprecated please use peer_id instead.",
41-
Description: "The network communication configuration option of the network (for on-prem locations only). Use `peer_id` instead.",
42-
Type: schema.TypeString,
43-
},
4438
Attr_CRN: {
4539
Computed: true,
4640
Description: "The CRN of this resource.",
@@ -73,6 +67,7 @@ func DataSourceIBMPINetworks() *schema.Resource {
7367
},
7468
Attr_PeerID: {
7569
Computed: true,
70+
Deprecated: "This field is deprecated",
7671
Description: "Network Peer ID.",
7772
Type: schema.TypeString,
7873
},
@@ -126,15 +121,14 @@ func flattenNetworks(list []*models.NetworkReference, meta interface{}) []map[st
126121
result := make([]map[string]interface{}, 0, len(list))
127122
for _, i := range list {
128123
l := map[string]interface{}{
129-
Attr_AccessConfig: i.AccessConfig,
130-
Attr_DhcpManaged: i.DhcpManaged,
131-
Attr_Href: *i.Href,
132-
Attr_MTU: i.Mtu,
133-
Attr_Name: *i.Name,
134-
Attr_NetworkID: *i.NetworkID,
135-
Attr_PeerID: i.PeerID,
136-
Attr_Type: *i.Type,
137-
Attr_VLanID: *i.VlanID,
124+
Attr_DhcpManaged: i.DhcpManaged,
125+
Attr_Href: *i.Href,
126+
Attr_MTU: i.Mtu,
127+
Attr_Name: *i.Name,
128+
Attr_NetworkID: *i.NetworkID,
129+
Attr_PeerID: i.PeerID,
130+
Attr_Type: *i.Type,
131+
Attr_VLanID: *i.VlanID,
138132
}
139133

140134
if i.Crn != "" {

ibm/service/power/ibm_pi_constants.go

Lines changed: 62 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -81,12 +81,10 @@ const (
8181
Arg_Memory = "pi_memory"
8282
Arg_Name = "pi_name"
8383
Arg_Network = "pi_network"
84-
Arg_NetworkAccessConfig = "pi_network_access_config"
8584
Arg_NetworkAddressGroupID = "pi_network_address_group_id"
8685
Arg_NetworkAddressGroupMemberID = "pi_network_address_group_member_id"
8786
Arg_NetworkID = "pi_network_id"
8887
Arg_NetworkInterfaceID = "pi_network_interface_id"
89-
Arg_NetworkJumbo = "pi_network_jumbo"
9088
Arg_NetworkMTU = "pi_network_mtu"
9189
Arg_NetworkName = "pi_network_name"
9290
Arg_NetworkPeer = "pi_network_peer"
@@ -168,7 +166,6 @@ const (
168166

169167
// Attributes
170168
Attr_Access = "access"
171-
Attr_AccessConfig = "access_config"
172169
Attr_Action = "action"
173170
Attr_Addresses = "addresses"
174171
Attr_AllocatedCores = "allocated_cores"
@@ -297,7 +294,6 @@ const (
297294
Attr_IPaddress = "ipaddress"
298295
Attr_IPOctet = "ipoctet"
299296
Attr_IsActive = "is_active"
300-
Attr_Jumbo = "jumbo"
301297
Attr_Key = "key"
302298
Attr_KeyCreationDate = "creation_date"
303299
Attr_KeyID = "key_id"
@@ -513,73 +509,68 @@ const (
513509
StockVTL = "stock-vtl"
514510

515511
// Allowed Values
516-
Affinity = "affinity"
517-
All = "all"
518-
Allow = "allow"
519-
AntiAffinity = "anti-affinity"
520-
Attach = "attach"
521-
AutoAssign = "auto-assign"
522-
Aux = "aux"
523-
Bidirectional_BGP = "bidirectional-bgp"
524-
Bidirectional_L2Out = "bidirectional-l2out"
525-
Bidirectional_Static_Route = "bidirectional-static-route"
526-
Both = "both"
527-
BYOL = "byol"
528-
Capped = "capped"
529-
CloudStorage = "cloud-storage"
530-
Create = "create"
531-
Critical = "CRITICAL"
532-
CUSTOM_VIRTUAL_CORES = "custom-virtualcores"
533-
Dedicated = "dedicated"
534-
DefaultNAG = "default-network-address-group"
535-
Deny = "deny"
536-
DeploymentTypeEpic = "EPIC"
537-
DeploymentTypeVMNoStorage = "VMNoStorage"
538-
DestinationUnreach = "destination-unreach"
539-
Detach = "detach"
540-
DHCPVlan = "dhcp-vlan"
541-
Disable = "disable"
542-
Echo = "echo"
543-
EchoReply = "echo-reply"
544-
Enable = "enable"
545-
Hana = "Hana"
546-
Hard = "hard"
547-
Host = "host"
548-
HostGroup = "hostGroup"
549-
ICMP = "icmp"
550-
ImageCatalog = "image-catalog"
551-
Internal_Only = "internal-only"
552-
IPV4_Address = "ipv4-address"
553-
L2 = "L2"
554-
L3BGP = "L3BGP"
555-
L3Static = "L3Static"
556-
Master = "master"
557-
MaxVolumeSupport = "maxVolumeSupport"
558-
NAG = "network-address-group"
559-
Netweaver = "Netweaver"
560-
Network_Interface = "network-interface"
561-
None = "none"
562-
NSG = "network-security-group"
563-
OK = "OK"
564-
Outbound_Only = "outbound-only"
565-
PER = "power-edge-router"
566-
Prefix = "prefix"
567-
Private = "private"
568-
Public = "public"
569-
PubVlan = "pub-vlan"
570-
SAP = "SAP"
571-
Shared = "shared"
572-
Soft = "soft"
573-
SourceQuench = "source-quench"
574-
Suffix = "suffix"
575-
TCP = "tcp"
576-
TimeExceeded = "time-exceeded"
577-
UDP = "udp"
578-
Update = "update"
579-
UserTagType = "user"
580-
Vlan = "vlan"
581-
vSCSI = "vSCSI"
582-
Warning = "WARNING"
512+
Affinity = "affinity"
513+
All = "all"
514+
Allow = "allow"
515+
AntiAffinity = "anti-affinity"
516+
Attach = "attach"
517+
AutoAssign = "auto-assign"
518+
Aux = "aux"
519+
Both = "both"
520+
BYOL = "byol"
521+
Capped = "capped"
522+
CloudStorage = "cloud-storage"
523+
Create = "create"
524+
Critical = "CRITICAL"
525+
CUSTOM_VIRTUAL_CORES = "custom-virtualcores"
526+
Dedicated = "dedicated"
527+
DefaultNAG = "default-network-address-group"
528+
Deny = "deny"
529+
DeploymentTypeEpic = "EPIC"
530+
DeploymentTypeVMNoStorage = "VMNoStorage"
531+
DestinationUnreach = "destination-unreach"
532+
Detach = "detach"
533+
DHCPVlan = "dhcp-vlan"
534+
Disable = "disable"
535+
Echo = "echo"
536+
EchoReply = "echo-reply"
537+
Enable = "enable"
538+
Hana = "Hana"
539+
Hard = "hard"
540+
Host = "host"
541+
HostGroup = "hostGroup"
542+
ICMP = "icmp"
543+
ImageCatalog = "image-catalog"
544+
IPV4_Address = "ipv4-address"
545+
L2 = "L2"
546+
L3BGP = "L3BGP"
547+
L3Static = "L3Static"
548+
Master = "master"
549+
MaxVolumeSupport = "maxVolumeSupport"
550+
NAG = "network-address-group"
551+
Netweaver = "Netweaver"
552+
Network_Interface = "network-interface"
553+
None = "none"
554+
NSG = "network-security-group"
555+
OK = "OK"
556+
PER = "power-edge-router"
557+
Prefix = "prefix"
558+
Private = "private"
559+
Public = "public"
560+
PubVlan = "pub-vlan"
561+
SAP = "SAP"
562+
Shared = "shared"
563+
Soft = "soft"
564+
SourceQuench = "source-quench"
565+
Suffix = "suffix"
566+
TCP = "tcp"
567+
TimeExceeded = "time-exceeded"
568+
UDP = "udp"
569+
Update = "update"
570+
UserTagType = "user"
571+
Vlan = "vlan"
572+
vSCSI = "vSCSI"
573+
Warning = "WARNING"
583574

584575
// Actions
585576
Action_HardReboot = "hard-reboot"

ibm/service/power/resource_ibm_pi_network.go

Lines changed: 13 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -96,28 +96,11 @@ func ResourceIBMPINetwork() *schema.Resource {
9696
Optional: true,
9797
Type: schema.TypeList,
9898
},
99-
Arg_NetworkAccessConfig: {
100-
Computed: true,
101-
Deprecated: "This field is deprecated please use pi_network_peer instead",
102-
Description: "The network communication configuration option of the network (for satellite locations only).",
103-
Optional: true,
104-
Type: schema.TypeString,
105-
ValidateFunc: validate.ValidateAllowedStringValues([]string{Internal_Only, Outbound_Only, Bidirectional_Static_Route, Bidirectional_BGP, Bidirectional_L2Out}),
106-
},
107-
Arg_NetworkJumbo: {
108-
Computed: true,
109-
ConflictsWith: []string{Arg_NetworkMTU},
110-
Deprecated: "This field is deprecated, use pi_network_mtu instead.",
111-
Description: "MTU Jumbo option of the network (for multi-zone locations only).",
112-
Optional: true,
113-
Type: schema.TypeBool,
114-
},
11599
Arg_NetworkMTU: {
116-
Computed: true,
117-
ConflictsWith: []string{Arg_NetworkJumbo},
118-
Description: "Maximum Transmission Unit option of the network. Minimum is 1450 and maximum is 9000.",
119-
Optional: true,
120-
Type: schema.TypeInt,
100+
Computed: true,
101+
Description: "Maximum Transmission Unit option of the network. Minimum is 1450 and maximum is 9000.",
102+
Optional: true,
103+
Type: schema.TypeInt,
121104
},
122105
Arg_NetworkName: {
123106
Description: "The name of the network.",
@@ -126,19 +109,23 @@ func ResourceIBMPINetwork() *schema.Resource {
126109
ValidateFunc: validation.NoZeroValues,
127110
},
128111
Arg_NetworkPeer: {
112+
Deprecated: "This field is deprecated",
129113
Description: "Network peer information.",
130114
Elem: &schema.Resource{
131115
Schema: map[string]*schema.Schema{
132116
Attr_ID: {
117+
Deprecated: "This field is deprecated",
133118
Description: "ID of the network peer.",
134119
Required: true,
135120
Type: schema.TypeString,
136121
},
137122
Attr_NetworkAddressTranslation: {
123+
Deprecated: "This field is deprecated",
138124
Description: "Contains the network address translation Details.",
139125
Elem: &schema.Resource{
140126
Schema: map[string]*schema.Schema{
141127
Attr_SourceIP: {
128+
Deprecated: "This field is deprecated",
142129
Description: "source IP address, required if network peer type is L3BGP or L3STATIC and if NAT is enabled.",
143130
Required: true,
144131
Type: schema.TypeString,
@@ -150,6 +137,7 @@ func ResourceIBMPINetwork() *schema.Resource {
150137
Type: schema.TypeList,
151138
},
152139
Attr_Type: {
140+
Deprecated: "This field is deprecated",
153141
Description: "Type of the network peer.",
154142
Optional: true,
155143
Type: schema.TypeString,
@@ -177,19 +165,21 @@ func ResourceIBMPINetwork() *schema.Resource {
177165
Type: schema.TypeSet,
178166
},
179167

180-
//Computed Attributes
168+
// Computed Attributes
181169
Attr_CRN: {
182170
Computed: true,
183171
Description: "The CRN of this resource.",
184172
Type: schema.TypeString,
185173
},
186174
Attr_NetworkAddressTranslation: {
187175
Computed: true,
176+
Deprecated: "This field is deprecated",
188177
Description: "Contains the Network Address Translation Details (for on-prem locations only).",
189178
Elem: &schema.Resource{
190179
Schema: map[string]*schema.Schema{
191180
Attr_SourceIP: {
192181
Computed: true,
182+
Deprecated: "This field is deprecated",
193183
Description: "source IP address, required if network peer type is L3BGP or L3STATIC and if NAT is enabled.",
194184
Type: schema.TypeString,
195185
},
@@ -204,6 +194,7 @@ func ResourceIBMPINetwork() *schema.Resource {
204194
},
205195
Attr_PeerID: {
206196
Computed: true,
197+
Deprecated: "This field is deprecated",
207198
Description: "Network Peer ID (for on-prem locations only).",
208199
Type: schema.TypeString,
209200
},
@@ -239,16 +230,10 @@ func resourceIBMPINetworkCreate(ctx context.Context, d *schema.ResourceData, met
239230
if tags, ok := d.GetOk(Arg_UserTags); ok {
240231
body.UserTags = flex.FlattenSet(tags.(*schema.Set))
241232
}
242-
if v, ok := d.GetOk(Arg_NetworkJumbo); ok {
243-
body.Jumbo = v.(bool)
244-
}
245233
if v, ok := d.GetOk(Arg_NetworkMTU); ok {
246234
var mtu int64 = int64(v.(int))
247235
body.Mtu = &mtu
248236
}
249-
if v, ok := d.GetOk(Arg_NetworkAccessConfig); ok {
250-
body.AccessConfig = models.AccessConfig(v.(string))
251-
}
252237
if _, ok := d.GetOk(Arg_NetworkPeer); ok {
253238
peerModel := networkMapToNetworkCreatePeer(d.Get(Arg_NetworkPeer + ".0").(map[string]interface{}))
254239
body.Peer = peerModel
@@ -355,8 +340,6 @@ func resourceIBMPINetworkRead(ctx context.Context, d *schema.ResourceData, meta
355340
d.Set(Arg_Cidr, networkdata.Cidr)
356341
d.Set(Arg_DNS, networkdata.DNSServers)
357342
d.Set(Arg_Gateway, networkdata.Gateway)
358-
d.Set(Arg_NetworkAccessConfig, networkdata.AccessConfig)
359-
d.Set(Arg_NetworkJumbo, networkdata.Jumbo)
360343
d.Set(Arg_NetworkMTU, networkdata.Mtu)
361344
d.Set(Arg_NetworkName, networkdata.Name)
362345
d.Set(Arg_NetworkType, networkdata.Type)

ibm/service/power/resource_ibm_pi_network_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,7 @@ func TestAccIBMPINetworkPeerOnPrem(t *testing.T) {
208208
},
209209
})
210210
}
211+
211212
func testAccCheckIBMPINetworkDestroy(s *terraform.State) error {
212213
sess, err := acc.TestAccProvider.Meta().(conns.ClientSession).IBMPISession()
213214
if err != nil {
@@ -303,7 +304,6 @@ func testAccCheckIBMPINetworkGatewayConfigSatellite(name string) string {
303304
pi_network_type = "vlan"
304305
pi_cidr = "192.168.17.0/24"
305306
pi_network_mtu = 6500
306-
pi_network_access_config = "outbound-only"
307307
}
308308
`, acc.Pi_cloud_instance_id, name)
309309
}

0 commit comments

Comments
 (0)