Skip to content

Commit ab2fc76

Browse files
Merge pull request #1645 from caberos/issue1644
add new columns on vlan list(premium, tags)
2 parents 0a4e443 + ceafa22 commit ab2fc76

File tree

4 files changed

+15
-3
lines changed

4 files changed

+15
-3
lines changed

SoftLayer/CLI/vlan/list.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@
1616
'datacenter',
1717
'hardware',
1818
'virtual_servers',
19-
'public_ips']
19+
'public_ips',
20+
'premium',
21+
'tag']
2022

2123

2224
@click.command(cls=SoftLayer.CLI.command.SLCommand, )
@@ -45,6 +47,8 @@ def cli(env, sortby, datacenter, number, name, limit):
4547
name=name,
4648
limit=limit)
4749
for vlan in vlans:
50+
billing = 'Yes' if vlan.get('billingItem') else 'No'
51+
4852
table.add_row([
4953
vlan.get('id'),
5054
vlan.get('vlanNumber'),
@@ -54,6 +58,8 @@ def cli(env, sortby, datacenter, number, name, limit):
5458
vlan.get('hardwareCount'),
5559
vlan.get('virtualGuestCount'),
5660
vlan.get('totalPrimaryIpAddressCount'),
61+
billing,
62+
formatting.tags(vlan['tagReferences'])
5763
])
5864

5965
env.fout(table)

SoftLayer/fixtures/SoftLayer_Account.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -501,6 +501,7 @@
501501
'totalPrimaryIpAddressCount': 1,
502502
'subnetCount': 0,
503503
'subnets': [],
504+
'tagReferences': [],
504505
'firewallInterfaces': [
505506
{
506507
'id': 1,
@@ -538,6 +539,7 @@
538539
'firewallInterfaces': [],
539540

540541
'subnetCount': 0,
542+
'tagReferences': [],
541543
'subnets': [],
542544
}, {
543545
'id': 3,
@@ -561,6 +563,7 @@
561563
'totalPrimaryIpAddressCount': 3,
562564
'subnetCount': 0,
563565
'subnets': [],
566+
'tagReferences': [],
564567
'virtualGuestCount': 1,
565568
'virtualGuests': [{'id': 3}]
566569
}]
@@ -1173,7 +1176,7 @@
11731176
"virtualizationPlatform": 0,
11741177
"requiredUser": "administrator@vsphere.local"
11751178
}
1176-
}
1179+
}
11771180
]
11781181

11791182
getActiveVirtualLicenses = [{

SoftLayer/fixtures/SoftLayer_Network_Vlan.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@
1313
'id': 235689,
1414
'notes': 'test cli',
1515
'orderItemId': 147258,
16-
}
16+
},
17+
'tagReferences': [],
1718
}
1819

1920
editObject = True

SoftLayer/managers/network.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,13 @@
4040
'hardwareCount',
4141
'primaryRouter[id, fullyQualifiedDomainName, datacenter]',
4242
'subnetCount',
43+
'billingItem',
4344
'totalPrimaryIpAddressCount',
4445
'virtualGuestCount',
4546
'networkSpace',
4647
'networkVlanFirewall[id,fullyQualifiedDomainName,primaryIpAddress]',
4748
'attachedNetworkGateway[id,name,networkFirewall]',
49+
'tagReferences[tag[name]]',
4850
])
4951
DEFAULT_GET_VLAN_MASK = ','.join([
5052
'firewallInterfaces',

0 commit comments

Comments
 (0)