Skip to content

Commit

Permalink
Merge pull request #893 from SoftLayer/issues892
Browse files Browse the repository at this point in the history
Fixed vlan objectMask.
  • Loading branch information
allmightyspiff authored and GitHub Enterprise committed Jan 9, 2025
2 parents 73d61c9 + 1cf0793 commit 7e3db3b
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
4 changes: 4 additions & 0 deletions plugin/managers/account.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ func NewAccountManager(session *session.Session) *accountManager {
// the keys of the inner map are: vlan_count, public_ip_count, subnet_count, hardware_count, virtual_guest_count
// the value of the innter map are the count of those resources
func (a accountManager) SummaryByDatacenter() (map[string]map[string]int, error) {
DEFAULT_VLAN_MASK := `mask[
hardwareCount,subnetCount,totalPrimaryIpAddressCount,virtualGuestCount,
primaryRouter[id, fullyQualifiedDomainName, datacenter[name]],
]`
datacenters := make(map[string](map[string]int))
vlans, err := a.AccountService.Mask(DEFAULT_VLAN_MASK).GetNetworkVlans()
if err != nil {
Expand Down
12 changes: 11 additions & 1 deletion plugin/managers/network.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ const (
DEFAULT_IP_MASK = "hardware,virtualGuest,subnet[id,networkIdentifier,cidr,netmask,gateway,subnetType]"
DEFAULT_SUBNET_MASK = "id,datacenter.name,hardware.id,ipAddresses.id,networkIdentifier,networkVlan[id,networkSpace],subnetType,virtualGuests.id"
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]"
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]]"
DEFAULT_VLAN_DETAIL_MASK = "id,vlanNumber,primaryRouter[datacenterName,fullyQualifiedDomainName],firewallInterfaces," +
"subnets[id,networkIdentifier,netmask,gateway,subnetType,usableIpAddressCount]," +
"virtualGuests[hostname,domain,primaryIpAddress,primaryBackendIpAddress]," +
Expand Down Expand Up @@ -453,6 +452,17 @@ destinationIpAddress[ipAddress,virtualGuest.fullyQualifiedDomainName,hardware.fu
// name: name of vlan to be filtered
// orderId: ID of order to be filtered
func (n networkManager) ListVlans(datacenter string, vlanNum int, name string, orderId int, mask string) ([]datatypes.Network_Vlan, error) {
DEFAULT_VLAN_MASK := `mask[
id,vlanNumber,fullyQualifiedName,name,networkSpace,
firewallInterfaces,
hardwareCount,subnetCount,totalPrimaryIpAddressCount,virtualGuestCount,
primaryRouter[id, fullyQualifiedDomainName, datacenter],
billingItem,
networkVlanFirewall[id,fullyQualifiedDomainName,primaryIpAddress],
attachedNetworkGateway[id,name,networkFirewall],
tagReferences[tag[name]]
]`

filters := filter.New()
filters = append(filters, filter.Path("networkVlans.id").OrderBy("ASC"))
if datacenter != "" {
Expand Down

0 comments on commit 7e3db3b

Please sign in to comment.