Skip to content

Commit 1f9e669

Browse files
committed
removed attributes from servers datasource
1 parent 0861bb9 commit 1f9e669

File tree

1 file changed

+0
-54
lines changed

1 file changed

+0
-54
lines changed

internal/services/instance/servers_data_source.go

Lines changed: 0 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ package instance
33
import (
44
"context"
55
"fmt"
6-
"strconv"
76

87
"github.com/hashicorp/go-cty/cty"
98
"github.com/hashicorp/terraform-plugin-sdk/v2/diag"
@@ -46,12 +45,6 @@ func DataSourceServers() *schema.Resource {
4645
Description: "UUID of the server.",
4746
Type: schema.TypeString,
4847
},
49-
"public_ip": {
50-
Computed: true,
51-
Description: "Public IP address.",
52-
Type: schema.TypeString,
53-
Deprecated: "Use public_ips instead",
54-
},
5548
"public_ips": {
5649
Type: schema.TypeList,
5750
Description: "Public IPs associated with this server.",
@@ -71,11 +64,6 @@ func DataSourceServers() *schema.Resource {
7164
},
7265
},
7366
},
74-
"private_ip": {
75-
Computed: true,
76-
Description: "Private IP address of the server.",
77-
Type: schema.TypeString,
78-
},
7967
"private_ips": {
8068
Type: schema.TypeList,
8169
Computed: true,
@@ -135,11 +123,6 @@ func DataSourceServers() *schema.Resource {
135123
Description: "Security group ID",
136124
Type: schema.TypeString,
137125
},
138-
"enable_ipv6": {
139-
Computed: true,
140-
Description: "Whether to enable IPv6 support",
141-
Type: schema.TypeBool,
142-
},
143126
"enable_dynamic_ip": {
144127
Computed: true,
145128
Description: "Whether to enable dynamic IP addresses on this server",
@@ -160,21 +143,6 @@ func DataSourceServers() *schema.Resource {
160143
Description: "Whether the placement group policy respected or not",
161144
Type: schema.TypeBool,
162145
},
163-
"ipv6_address": {
164-
Computed: true,
165-
Description: "IPv6 Address for this server",
166-
Type: schema.TypeString,
167-
},
168-
"ipv6_gateway": {
169-
Computed: true,
170-
Description: "IPv6 gateway address",
171-
Type: schema.TypeString,
172-
},
173-
"ipv6_prefix_length": {
174-
Computed: true,
175-
Description: "IPv6 prefix length",
176-
Type: schema.TypeInt,
177-
},
178146
"zone": zonal.Schema(),
179147
"organization_id": account.OrganizationIDSchema(),
180148
"project_id": account.ProjectIDSchema(),
@@ -213,14 +181,9 @@ func DataSourceInstanceServersRead(ctx context.Context, d *schema.ResourceData,
213181
rawServer["id"] = zonal.NewID(server.Zone, server.ID).String()
214182

215183
if server.PublicIPs != nil {
216-
rawServer["public_ip"] = server.PublicIPs[0].Address.String()
217184
rawServer["public_ips"] = flattenServerPublicIPs(server.Zone, server.PublicIPs)
218185
}
219186

220-
if server.PrivateIP != nil {
221-
rawServer["private_ip"] = *server.PrivateIP
222-
}
223-
224187
state, err := serverStateFlatten(server.State)
225188
if err != nil {
226189
diags = append(diags, diag.FromErr(err)...)
@@ -239,9 +202,6 @@ func DataSourceInstanceServersRead(ctx context.Context, d *schema.ResourceData,
239202
}
240203

241204
rawServer["security_group_id"] = zonal.NewID(zone, server.SecurityGroup.ID).String()
242-
if server.EnableIPv6 != nil { //nolint:staticcheck
243-
rawServer["enable_ipv6"] = server.EnableIPv6 //nolint:staticcheck
244-
}
245205

246206
rawServer["enable_dynamic_ip"] = server.DynamicIPRequired
247207
rawServer["organization_id"] = server.Organization
@@ -256,20 +216,6 @@ func DataSourceInstanceServersRead(ctx context.Context, d *schema.ResourceData,
256216
rawServer["placement_group_policy_respected"] = server.PlacementGroup.PolicyRespected
257217
}
258218

259-
if server.IPv6 != nil { //nolint:staticcheck
260-
rawServer["ipv6_address"] = server.IPv6.Address.String() //nolint:staticcheck
261-
rawServer["ipv6_gateway"] = server.IPv6.Gateway.String() //nolint:staticcheck
262-
263-
prefixLength, err := strconv.Atoi(server.IPv6.Netmask) //nolint:staticcheck
264-
if err != nil {
265-
diags = append(diags, diag.FromErr(fmt.Errorf("failed to read ipv6 netmask: %w", err))...)
266-
267-
continue
268-
}
269-
270-
rawServer["ipv6_prefix_length"] = prefixLength
271-
}
272-
273219
ph, err := newPrivateNICHandler(instanceAPI, server.ID, zone)
274220
if err != nil {
275221
return diag.FromErr(err)

0 commit comments

Comments
 (0)