Skip to content

Commit 7e3db3b

Browse files
allmightyspiffGitHub Enterprise
authored andcommitted
Merge pull request #893 from SoftLayer/issues892
Fixed vlan objectMask.
2 parents 73d61c9 + 1cf0793 commit 7e3db3b

2 files changed

Lines changed: 15 additions & 1 deletion

File tree

plugin/managers/account.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,10 @@ func NewAccountManager(session *session.Session) *accountManager {
5252
// the keys of the inner map are: vlan_count, public_ip_count, subnet_count, hardware_count, virtual_guest_count
5353
// the value of the innter map are the count of those resources
5454
func (a accountManager) SummaryByDatacenter() (map[string]map[string]int, error) {
55+
DEFAULT_VLAN_MASK := `mask[
56+
hardwareCount,subnetCount,totalPrimaryIpAddressCount,virtualGuestCount,
57+
primaryRouter[id, fullyQualifiedDomainName, datacenter[name]],
58+
]`
5559
datacenters := make(map[string](map[string]int))
5660
vlans, err := a.AccountService.Mask(DEFAULT_VLAN_MASK).GetNetworkVlans()
5761
if err != nil {

plugin/managers/network.go

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ const (
1818
DEFAULT_IP_MASK = "hardware,virtualGuest,subnet[id,networkIdentifier,cidr,netmask,gateway,subnetType]"
1919
DEFAULT_SUBNET_MASK = "id,datacenter.name,hardware.id,ipAddresses.id,networkIdentifier,networkVlan[id,networkSpace],subnetType,virtualGuests.id"
2020
DEFAULT_SUBNET_DETAIL_MASK = "id,broadcastAddress,cidr,datacenter.name,gateway,hardware[id,hostname,domain,primaryIpAddress,primaryBackendIpAddress],ipAddresses.id,networkIdentifier,networkVlan[id,networkSpace],subnetType,virtualGuests[id,hostname,domain,primaryIpAddress,primaryBackendIpAddress]"
21-
DEFAULT_VLAN_MASK = "firewallInterfaces,hardwareCount,primaryRouter[id, fullyQualifiedDomainName, datacenter],subnetCount,billingItem,totalPrimaryIpAddressCount,virtualGuestCount,networkSpace,networkVlanFirewall[id,fullyQualifiedDomainName,primaryIpAddress],attachedNetworkGateway[id,name,networkFirewall],tagReferences[tag[name]]"
2221
DEFAULT_VLAN_DETAIL_MASK = "id,vlanNumber,primaryRouter[datacenterName,fullyQualifiedDomainName],firewallInterfaces," +
2322
"subnets[id,networkIdentifier,netmask,gateway,subnetType,usableIpAddressCount]," +
2423
"virtualGuests[hostname,domain,primaryIpAddress,primaryBackendIpAddress]," +
@@ -453,6 +452,17 @@ destinationIpAddress[ipAddress,virtualGuest.fullyQualifiedDomainName,hardware.fu
453452
// name: name of vlan to be filtered
454453
// orderId: ID of order to be filtered
455454
func (n networkManager) ListVlans(datacenter string, vlanNum int, name string, orderId int, mask string) ([]datatypes.Network_Vlan, error) {
455+
DEFAULT_VLAN_MASK := `mask[
456+
id,vlanNumber,fullyQualifiedName,name,networkSpace,
457+
firewallInterfaces,
458+
hardwareCount,subnetCount,totalPrimaryIpAddressCount,virtualGuestCount,
459+
primaryRouter[id, fullyQualifiedDomainName, datacenter],
460+
billingItem,
461+
networkVlanFirewall[id,fullyQualifiedDomainName,primaryIpAddress],
462+
attachedNetworkGateway[id,name,networkFirewall],
463+
tagReferences[tag[name]]
464+
]`
465+
456466
filters := filter.New()
457467
filters = append(filters, filter.Path("networkVlans.id").OrderBy("ASC"))
458468
if datacenter != "" {

0 commit comments

Comments
 (0)