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

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

@ -289,7 +289,7 @@ func (c *client) getVirtualMachine(vm *wssdcloudcompute.VirtualMachine, group st
NetworkProfile: c.getVirtualMachineNetworkProfile(vm.Network), NetworkProfile: c.getVirtualMachineNetworkProfile(vm.Network),
VmType: vmtype, VmType: vmtype,
DisableHighAvailability: &vm.DisableHighAvailability, DisableHighAvailability: &vm.DisableHighAvailability,
Host: c.getVirtualMachineHostDescription(vm), Host: c.getVirtualMachineHostDescription(vm),
}, },
Version: &vm.Status.Version.Number, Version: &vm.Status.Version.Number,
Location: &vm.LocationName, Location: &vm.LocationName,

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

@ -31,8 +31,8 @@ func getWssdVirtualMachineImage(c *compute.VirtualMachineImage, groupName string
// Conversion function from wssdcloudcompute to compute // Conversion function from wssdcloudcompute to compute
func getVirtualMachineImage(c *wssdcloudcompute.VirtualMachineImage, group string) *compute.VirtualMachineImage { func getVirtualMachineImage(c *wssdcloudcompute.VirtualMachineImage, group string) *compute.VirtualMachineImage {
return &compute.VirtualMachineImage{ return &compute.VirtualMachineImage{
Name: &c.Name, Name: &c.Name,
ID: &c.Id, ID: &c.Id,
VirtualMachineImageProperties: &compute.VirtualMachineImageProperties{}, VirtualMachineImageProperties: &compute.VirtualMachineImageProperties{},
} }
} }

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

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

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

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