Skip to content

Commit 1a1bfac

Browse files
committed
Deprecate macaddress for mac_address
1 parent 08ea659 commit 1a1bfac

File tree

6 files changed

+37
-11
lines changed

6 files changed

+37
-11
lines changed

ibm/service/power/data_source_ibm_pi_instance_ip.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,12 @@ func DataSourceIBMPIInstanceIP() *schema.Resource {
5757
Type: schema.TypeString,
5858
},
5959
Attr_Macaddress: {
60+
Computed: true,
61+
Deprecated: "Deprecated, use mac_address instead",
62+
Description: "The MAC address of the network that is attached to this instance.",
63+
Type: schema.TypeString,
64+
},
65+
Attr_MacAddress: {
6066
Computed: true,
6167
Description: "The MAC address of the network that is attached to this instance.",
6268
Type: schema.TypeString,
@@ -97,6 +103,7 @@ func dataSourceIBMPIInstancesIPRead(ctx context.Context, d *schema.ResourceData,
97103
d.Set(Attr_ExternalIP, network.ExternalIP)
98104
d.Set(Attr_IP, network.IPAddress)
99105
d.Set(Attr_Macaddress, network.MacAddress)
106+
d.Set(Attr_MacAddress, network.MacAddress)
100107
d.Set(Attr_NetworkID, network.NetworkID)
101108
d.Set(Attr_Type, network.Type)
102109

ibm/service/power/data_source_ibm_pi_network_port.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,12 @@ func DataSourceIBMPINetworkPort() *schema.Resource {
5757
Type: schema.TypeString,
5858
},
5959
Attr_Macaddress: {
60+
Computed: true,
61+
Deprecated: "Deprecated, use mac_address instead",
62+
Description: "The MAC address of the port.",
63+
Type: schema.TypeString,
64+
},
65+
Attr_MacAddress: {
6066
Computed: true,
6167
Description: "The MAC address of the port.",
6268
Type: schema.TypeString,
@@ -113,6 +119,7 @@ func flattenNetworkPorts(networkPorts []*models.NetworkPort) interface{} {
113119
Attr_Href: i.Href,
114120
Attr_IPaddress: *i.IPAddress,
115121
Attr_Macaddress: *i.MacAddress,
122+
Attr_MacAddress: *i.MacAddress,
116123
Attr_PortID: *i.PortID,
117124
Attr_PublicIP: i.ExternalIP,
118125
Attr_Status: *i.Status,

ibm/service/power/resource_ibm_pi_network_port_attach.go

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,12 @@ func ResourceIBMPINetworkPortAttach() *schema.Resource {
8383
Description: "The MAC address of the port.",
8484
Type: schema.TypeString,
8585
},
86+
Attr_Macaddress: {
87+
Computed: true,
88+
Deprecated: "Deprecated, use mac_address instead",
89+
Description: "The MAC address of the instance.",
90+
Type: schema.TypeString,
91+
},
8692
Attr_NetworkPortID: {
8793
Computed: true,
8894
Description: "The ID of the port.",
@@ -181,6 +187,7 @@ func resourceIBMPINetworkPortAttachRead(ctx context.Context, d *schema.ResourceD
181187
d.Set(Arg_NetworkPortDescription, networkdata.Description)
182188
d.Set(Arg_NetworkPortIPAddress, networkdata.IPAddress)
183189
d.Set(Attr_MacAddress, networkdata.MacAddress)
190+
d.Set(Attr_Macaddress, networkdata.MacAddress)
184191
d.Set(Attr_NetworkPortID, networkdata.PortID)
185192
d.Set(Attr_PublicIP, networkdata.ExternalIP)
186193
d.Set(Attr_Status, networkdata.Status)
@@ -189,7 +196,6 @@ func resourceIBMPINetworkPortAttachRead(ctx context.Context, d *schema.ResourceD
189196
}
190197

191198
func resourceIBMPINetworkPortAttachDelete(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics {
192-
193199
log.Printf("Calling the network delete functions. ")
194200
sess, err := meta.(conns.ClientSession).IBMPISession()
195201
if err != nil {
@@ -232,7 +238,6 @@ func isWaitForIBMPINetworkportAvailable(ctx context.Context, client *instance.IB
232238
}
233239

234240
func isIBMPINetworkportRefreshFunc(client *instance.IBMPINetworkClient, id, networkname string) retry.StateRefreshFunc {
235-
236241
log.Printf("Calling the IsIBMPINetwork Refresh Function....with the following id (%s) for network port and following id (%s) for network name and waiting for network to be READY", id, networkname)
237242
return func() (interface{}, string, error) {
238243
network, err := client.GetPort(networkname, id)
@@ -265,7 +270,6 @@ func isWaitForIBMPINetworkPortAttachAvailable(ctx context.Context, client *insta
265270
}
266271

267272
func isIBMPINetworkPortAttachRefreshFunc(client *instance.IBMPINetworkClient, id, networkname, instanceid string) retry.StateRefreshFunc {
268-
269273
log.Printf("Calling the IsIBMPINetwork Refresh Function....with the following id (%s) for network port and following id (%s) for network name and waiting for network to be READY", id, networkname)
270274
return func() (interface{}, string, error) {
271275
network, err := client.GetPort(networkname, id)

website/docs/d/pi_instance_ip.html.markdown

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,11 @@ description: |-
77
---
88

99
# ibm_pi_instance_ip
10+
1011
Retrieve information about a Power Systems Virtual Server instance IP address. For more information, about Power Systems Virtual Server instance IP address, see [configuring and adding a private network subnet](https://cloud.ibm.com/docs/power-iaas?topic=power-iaas-configuring-subnet).
1112

1213
## Example usage
14+
1315
```terraform
1416
data "ibm_pi_instance_ip" "ds_instance_ip" {
1517
pi_instance_name = "terraform-test-instance"
@@ -18,13 +20,15 @@ data "ibm_pi_instance_ip" "ds_instance_ip" {
1820
}
1921
```
2022

21-
**Notes**
23+
### Notes
24+
2225
- Please find [supported Regions](https://cloud.ibm.com/apidocs/power-cloud#endpoint) for endpoints.
2326
- If a Power cloud instance is provisioned at `lon04`, The provider level attributes should be as follows:
2427
- `region` - `lon`
2528
- `zone` - `lon04`
2629

2730
Example usage:
31+
2832
```terraform
2933
provider "ibm" {
3034
region = "lon"
@@ -33,20 +37,22 @@ Example usage:
3337
```
3438

3539
## Argument reference
36-
Review the argument references that you can specify for your data source.
40+
41+
Review the argument references that you can specify for your data source.
3742

3843
- `pi_cloud_instance_id` - (Required, String) The GUID of the service instance associated with an account.
3944
- `pi_instance_name` - (Required, String) The unique identifier or name of the instance.
40-
- `pi_network_name` - (Required, String) The subnet that the instance belongs to.
41-
45+
- `pi_network_name` - (Required, String) The subnet that the instance belongs to.
4246

4347
## Attribute reference
44-
In addition to all argument reference list, you can access the following attribute references after your data source is created.
48+
49+
In addition to all argument reference list, you can access the following attribute references after your data source is created.
4550

4651
- `external_ip` - (String) The external IP of the network that is attached to this instance.
4752
- `id` - (String) The unique identifier of the network.
4853
- `ip` - (String) The IP address that is attached to this instance from the subnet.
4954
- `ipoctet` - (String) The IP octet of the network that is attached to this instance.
50-
- `macaddress` - (String) The MAC address of the network that is attached to this instance.
55+
- `mac_address` - (String) The MAC address of the network that is attached to this instance.
56+
- `macaddress` - (String) The MAC address of the network that is attached to this instance. Deprecated please use `mac_address` instead.
5157
- `network_id` - (String) ID of the network.
5258
- `type` - (String) The type of the network that is attached to this instance.

website/docs/d/pi_network_port.html.markdown

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,8 @@ In addition to all argument reference list, you can access the following attribu
5252
- `description` - (String) The description for the network port.
5353
- `href` - (String) Network port href.
5454
- `ipaddress` - (String) The IP address of the port.
55-
- `macaddress` - (String) The MAC address of the port.
55+
- `mac_address` - (String) The MAC address of the instance.
56+
- `macaddress` - (String) The MAC address of the instance. Deprecated please use `mac_address` instead.
5657
- `portid` - (String) The ID of the port.
5758
- `public_ip`- (String) The public IP associated with the port.
5859
- `status` - (String) The status of the port.

website/docs/r/pi_network_port_attach.html.markdown

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,8 @@ Review the argument references that you can specify for your resource.
6363
In addition to all argument reference list, you can access the following attribute reference after your resource is created.
6464

6565
- `id` - (String) The unique identifier of the instance. The ID is composed of `<pi_cloud_instance_id>/<pi_network_name>/<network_port_id>`.
66-
- `macaddress` - (String) The MAC address of the port.
66+
- `mac_address` - (String) The MAC address of the instance.
67+
- `macaddress` - (String) The MAC address of the instance. Deprecated please use `mac_address` instead.
6768
- `network_port_id` - (String) The ID of the port.
6869
- `public_ip` - (String) The public IP associated with the port.
6970
- `status` - (String) The status of the port.

0 commit comments

Comments
 (0)