moving vlan to subnet
This commit is contained in:
Родитель
f64c37a9ef
Коммит
157120ef72
|
@ -289,7 +289,7 @@ func (c *client) getVirtualMachine(vm *wssdcloudcompute.VirtualMachine, group st
|
|||
NetworkProfile: c.getVirtualMachineNetworkProfile(vm.Network),
|
||||
VmType: vmtype,
|
||||
DisableHighAvailability: &vm.DisableHighAvailability,
|
||||
Host: c.getVirtualMachineHostDescription(vm),
|
||||
Host: c.getVirtualMachineHostDescription(vm),
|
||||
},
|
||||
Version: &vm.Status.Version.Number,
|
||||
Location: &vm.LocationName,
|
||||
|
|
|
@ -31,8 +31,8 @@ func getWssdVirtualMachineImage(c *compute.VirtualMachineImage, groupName string
|
|||
// Conversion function from wssdcloudcompute to compute
|
||||
func getVirtualMachineImage(c *wssdcloudcompute.VirtualMachineImage, group string) *compute.VirtualMachineImage {
|
||||
return &compute.VirtualMachineImage{
|
||||
Name: &c.Name,
|
||||
ID: &c.Id,
|
||||
Name: &c.Name,
|
||||
ID: &c.Id,
|
||||
VirtualMachineImageProperties: &compute.VirtualMachineImageProperties{},
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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),
|
||||
|
|
Загрузка…
Ссылка в новой задаче