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

update the network vlan on hardware detail #1966

Merged
merged 4 commits into from Jun 12, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 5 additions & 2 deletions SoftLayer/CLI/hardware/detail.py
Expand Up @@ -9,6 +9,7 @@
from SoftLayer.CLI import helpers
from SoftLayer import utils


# pylint: disable=R0915


Expand Down Expand Up @@ -71,9 +72,11 @@ def cli(env, identifier, passwords, price, components):
table.add_row(['last_transaction', last_transaction])
table.add_row(['billing', 'Hourly' if result['hourlyBillingFlag'] else 'Monthly'])

vlan_table = formatting.Table(['type', 'number', 'id'])
vlan_table = formatting.Table(['type', 'number', 'id', 'Name', 'netmask'])
caberos marked this conversation as resolved.
Show resolved Hide resolved
for vlan in result['networkVlans']:
vlan_table.add_row([vlan['networkSpace'], vlan['vlanNumber'], vlan['id']])
vlan_table.add_row([vlan['networkSpace'], vlan['vlanNumber'],
vlan['id'], vlan['fullyQualifiedName'],
vlan['primarySubnets'][0]['netmask']])

table.add_row(['vlans', vlan_table])

Expand Down
12 changes: 10 additions & 2 deletions SoftLayer/fixtures/SoftLayer_Hardware_Server.py
Expand Up @@ -57,12 +57,20 @@
{
'networkSpace': 'PRIVATE',
'vlanNumber': 1800,
'id': 9653
'id': 9653,
'fullyQualifiedName': 'dal10.bcr03.14752',
'primarySubnets': [{
'netmask': ''
}]
},
{
'networkSpace': 'PUBLIC',
'vlanNumber': 3672,
'id': 19082
'id': 19082,
'fullyQualifiedName': 'dal10.test03.123',
'primarySubnets': [{
'netmask': ''
}]
},
],
'tagReferences': [
Expand Down
2 changes: 1 addition & 1 deletion SoftLayer/managers/hardware.py
Expand Up @@ -269,7 +269,7 @@ def get_hardware(self, hardware_id, **kwargs):
'lastTransaction[transactionGroup],'
'hourlyBillingFlag,'
'tagReferences[id,tag[name,id]],'
'networkVlans[id,vlanNumber,networkSpace],'
'networkVlans[id,vlanNumber,networkSpace, fullyQualifiedName,primarySubnets[ipAddresses]],'
'monitoringServiceComponent,networkMonitors[queryType,lastResult,responseAction],'
'remoteManagementAccounts[username,password]'
)
Expand Down