Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add new columns on vlan list(premium, tags) #1645

Merged
merged 2 commits into from
May 19, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion SoftLayer/CLI/vlan/list.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@
'datacenter',
'hardware',
'virtual_servers',
'public_ips']
'public_ips',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the table some titles start with a capital letter, but others are all lowercase, perhaps it should be ordered so that everything is with uppercase or lowercase

'premium',
'tag']


@click.command(cls=SoftLayer.CLI.command.SLCommand, )
Expand Down Expand Up @@ -45,6 +47,8 @@ def cli(env, sortby, datacenter, number, name, limit):
name=name,
limit=limit)
for vlan in vlans:
billing = 'Yes' if vlan.get('billingItem') else 'No'

table.add_row([
vlan.get('id'),
vlan.get('vlanNumber'),
Expand All @@ -54,6 +58,8 @@ def cli(env, sortby, datacenter, number, name, limit):
vlan.get('hardwareCount'),
vlan.get('virtualGuestCount'),
vlan.get('totalPrimaryIpAddressCount'),
billing,
formatting.tags(vlan['tagReferences'])
])

env.fout(table)
5 changes: 4 additions & 1 deletion SoftLayer/fixtures/SoftLayer_Account.py
Original file line number Diff line number Diff line change
Expand Up @@ -501,6 +501,7 @@
'totalPrimaryIpAddressCount': 1,
'subnetCount': 0,
'subnets': [],
'tagReferences': [],
'firewallInterfaces': [
{
'id': 1,
Expand Down Expand Up @@ -538,6 +539,7 @@
'firewallInterfaces': [],

'subnetCount': 0,
'tagReferences': [],
'subnets': [],
}, {
'id': 3,
Expand All @@ -561,6 +563,7 @@
'totalPrimaryIpAddressCount': 3,
'subnetCount': 0,
'subnets': [],
'tagReferences': [],
'virtualGuestCount': 1,
'virtualGuests': [{'id': 3}]
}]
Expand Down Expand Up @@ -1173,7 +1176,7 @@
"virtualizationPlatform": 0,
"requiredUser": "administrator@vsphere.local"
}
}
}
]

getActiveVirtualLicenses = [{
Expand Down
3 changes: 2 additions & 1 deletion SoftLayer/fixtures/SoftLayer_Network_Vlan.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
'id': 235689,
'notes': 'test cli',
'orderItemId': 147258,
}
},
'tagReferences': [],
}

editObject = True
Expand Down
2 changes: 2 additions & 0 deletions SoftLayer/managers/network.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,13 @@
'hardwareCount',
'primaryRouter[id, fullyQualifiedDomainName, datacenter]',
'subnetCount',
'billingItem',
'totalPrimaryIpAddressCount',
'virtualGuestCount',
'networkSpace',
'networkVlanFirewall[id,fullyQualifiedDomainName,primaryIpAddress]',
'attachedNetworkGateway[id,name,networkFirewall]',
'tagReferences[tag[name]]',
])
DEFAULT_GET_VLAN_MASK = ','.join([
'firewallInterfaces',
Expand Down