This commit is contained in:
natarajr 2020-09-24 11:22:36 -07:00
Родитель f64c37a9ef
Коммит 157120ef72
4 изменённых файлов: 11 добавлений и 12 удалений

Просмотреть файл

@ -118,6 +118,8 @@ type Subnet struct {
Etag *string `json:"etag,omitempty"`
// ID - Resource ID.
ID *string `json:"id,omitempty"`
// Vlan
Vlan *int32 `json:"vlan,omitempty"`
}
// Subnet is assoicated with a Virtual Network.
@ -518,8 +520,6 @@ type VirtualNetworkPropertiesFormat struct {
Subnets *[]Subnet `json:"subnets,omitempty"`
// MACPool name - Name of the associated MAC pool (or leave empty to use the default mac pool)
MacPoolName *string `json:"macPoolName,omitempty"`
// Vlan
Vlan *int32 `json:"vlan,omitempty"`
// ProvisioningState - The provisioning state of the PublicIP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.
ProvisioningState *string `json:"provisioningState,omitempty"`
// State - State

Просмотреть файл

@ -44,12 +44,6 @@ func getWssdVirtualNetwork(c *network.VirtualNetwork, groupName string) (*wssdcl
if c.VirtualNetworkPropertiesFormat.MacPoolName != nil {
wssdnetwork.MacPoolName = *c.VirtualNetworkPropertiesFormat.MacPoolName
}
if c.Vlan == nil {
wssdnetwork.Vlan = 0
} else {
wssdnetwork.Vlan = uint32(*c.Vlan)
}
}
if c.Type == nil {
@ -96,6 +90,11 @@ func getWssdNetworkSubnets(subnets *[]network.Subnet) (wssdsubnets []*wssdcloudn
wssdsubnet := &wssdcloudnetwork.Subnet{
Name: *subnet.Name,
}
if subnet.Vlan == nil {
wssdsubnet.Vlan = 0
} else {
wssdsubnet.Vlan = uint32(*subnet.Vlan)
}
if subnet.SubnetPropertiesFormat == nil || subnet.AddressPrefix == nil {
err = errors.Wrapf(errors.InvalidInput, "AddressPrefix is missing")
return
@ -179,7 +178,6 @@ func getVirtualNetwork(c *wssdcloudnetwork.VirtualNetwork, group string) *networ
Subnets: getNetworkSubnets(c.Subnets),
Statuses: status.GetStatuses(c.GetStatus()),
MacPoolName: &c.MacPoolName,
Vlan: getVlan(c.Vlan),
},
}
}
@ -191,6 +189,7 @@ func getNetworkSubnets(wssdsubnets []*wssdcloudnetwork.Subnet) *[]network.Subnet
subnets = append(subnets, network.Subnet{
Name: &subnet.Name,
ID: &subnet.Id,
Vlan: getVlan(subnet.Vlan),
SubnetPropertiesFormat: &network.SubnetPropertiesFormat{
AddressPrefix: &subnet.Cidr,
RouteTable: getNetworkRoutetable(subnet.Routes),