Skip to content

Commit

Permalink
Merge pull request #1023 from ksamoray/v322-xport-node
Browse files Browse the repository at this point in the history
Support transport node API of various versions
  • Loading branch information
ksamoray authored Nov 9, 2023
2 parents d7b914e + 0c743b3 commit d435769
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 14 deletions.
19 changes: 7 additions & 12 deletions nsxt/resource_nsxt_transport_node.go
Original file line number Diff line number Diff line change
Expand Up @@ -282,12 +282,6 @@ func getEdgeNodeDeploymentConfigSchema() *schema.Schema {
Optional: true,
Description: "Host identifier in the specified vcenter server",
},
"ipv4_assignment_enabled": {
Type: schema.TypeBool,
Description: "This flag represents whether IPv4 configuration is enabled or not",
Optional: true,
Default: true,
},
"management_network_id": {
Type: schema.TypeString,
Required: true,
Expand Down Expand Up @@ -994,7 +988,6 @@ func getEdgeNodeDeploymentConfigFromSchema(cfg interface{}) (*model.EdgeNodeDepl
dataNetworkIds := interface2StringList(vdc["data_network_ids"].([]interface{}))
defaultGatewayAddresses := interface2StringList(vdc["default_gateway_address"].([]interface{}))
hostID := vdc["host_id"].(string)
ipv4AssignmentEnabled := vdc["ipv4_assignment_enabled"].(bool)
managementNetworkID := vdc["management_network_id"].(string)
var managemenPortSubnets []model.IPSubnet
for _, ipsi := range vdc["management_port_subnet"].([]interface{}) {
Expand Down Expand Up @@ -1030,7 +1023,6 @@ func getEdgeNodeDeploymentConfigFromSchema(cfg interface{}) (*model.EdgeNodeDepl
ComputeId: &computeID,
DataNetworkIds: dataNetworkIds,
HostId: &hostID,
Ipv4AssignmentEnabled: &ipv4AssignmentEnabled,
ManagementNetworkId: &managementNetworkID,
ManagementPortSubnets: managemenPortSubnets,
ReservationInfo: reservationInfo,
Expand Down Expand Up @@ -1204,18 +1196,22 @@ func getEdgeNodeSettingsFromSchema(s interface{}) (*model.EdgeNodeSettings, erro
Server: &server,
})
}
return &model.EdgeNodeSettings{
obj := &model.EdgeNodeSettings{
AdvancedConfiguration: advCfg,
AllowSshRootLogin: &allowSSHRootLogin,
DnsServers: dnsServers,
EnableSsh: &enableSSH,
EnableUptMode: &enableUptMode,
Hostname: &hostName,
NtpServers: ntpServers,
SearchDomains: searchDomains,
SyslogServers: syslogServers,
}, nil
}
if nsxVersionHigherOrEqual("4.0.0") {
obj.EnableUptMode = &enableUptMode
}
return obj, nil
}

return nil, nil
}

Expand Down Expand Up @@ -1762,7 +1758,6 @@ func setVMDeploymentConfigInSchema(config *data.StructValue) (interface{}, error
elem["data_network_ids"] = vSphereCfg.DataNetworkIds
elem["default_gateway_address"] = vSphereCfg.DefaultGatewayAddresses
elem["host_id"] = vSphereCfg.HostId
elem["ipv4_assignment_enabled"] = vSphereCfg.Ipv4AssignmentEnabled
elem["management_network_id"] = vSphereCfg.ManagementNetworkId

var mpSubnets []map[string]interface{}
Expand Down
2 changes: 0 additions & 2 deletions website/docs/r/transport_node.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,6 @@ The following arguments are supported:
* `data_network_ids` - (Required) List of portgroups, logical switch identifiers or segment paths for datapath connectivity.
* `default_gateway_address` - (Optional) Default gateway for the node.
* `host_id` - (Optional) Host identifier in the specified vcenter server.
* `ipv4_assignment_enabled` - (Optional) This flag represents whether IPv4 configuration is enabled or not. Defaults to true.
* `management_network_id` - (Required) Portgroup, logical switch identifier or segment path for management network connectivity.
* `management_port_subnet` - (Optional) Port subnets for management port. IPv4, IPv6 and Dual Stack Address is supported.
* `ip_addresses` - (Required) List of IP addresses.
Expand Down Expand Up @@ -206,7 +205,6 @@ The following arguments are supported:
* `data_network_ids` - (Required) List of portgroups, logical switch identifiers or segment paths for datapath connectivity.
* `default_gateway_address` - (Optional) Default gateway for the node.
* `host_id` - (Optional) Host identifier in the specified vcenter server.
* `ipv4_assignment_enabled` - (Optional) This flag represents whether IPv4 configuration is enabled or not. Defaults to true.
* `management_network_id` - (Required) Portgroup, logical switch identifier or segment path for management network connectivity.
* `management_port_subnet` - (Optional) Port subnets for management port. IPv4, IPv6 and Dual Stack Address is supported.
* `ip_addresses` - (Required) List of IP addresses.
Expand Down

0 comments on commit d435769

Please sign in to comment.