1515 type = click .Choice (['id' ,
1616 'identifier' ,
1717 'type' ,
18+ 'address_space' ,
1819 'datacenter' ,
1920 'vlan_id' ,
2021 'IPs' ,
2425 help = "Filter by datacenter shortname (sng01, dal05, ...)" )
2526@click .option ('--identifier' , help = "Filter by network identifier" )
2627@click .option ('--subnet-type' , '-t' , help = "Filter by subnet type" )
28+ @click .option ('--address-space' , help = "Filter by address space" )
2729@click .option ('--v4' , '--ipv4' , is_flag = True , help = "Display only IPv4 subnets" )
2830@click .option ('--v6' , '--ipv6' , is_flag = True , help = "Display only IPv6 subnets" )
2931@environment .pass_env
30- def cli (env , sortby , datacenter , identifier , subnet_type , ipv4 , ipv6 ):
32+ def cli (env , sortby , datacenter , identifier , subnet_type , address_space ,
33+ ipv4 , ipv6 ):
3134 """List subnets."""
3235
3336 mgr = SoftLayer .NetworkManager (env .client )
3437
3538 table = formatting .Table ([
36- 'id' , 'identifier' , 'type' , 'datacenter ' , 'vlan_id ' , 'IPs ' ,
37- 'hardware' , 'vs' ,
39+ 'id' , 'identifier' , 'type' , 'address_space ' , 'datacenter ' , 'vlan_id ' ,
40+ 'IPs' , ' hardware' , 'vs' ,
3841 ])
3942 table .sortby = sortby
4043
@@ -49,13 +52,15 @@ def cli(env, sortby, datacenter, identifier, subnet_type, ipv4, ipv6):
4952 version = version ,
5053 identifier = identifier ,
5154 subnet_type = subnet_type ,
55+ address_space = address_space ,
5256 )
5357
5458 for subnet in subnets :
5559 table .add_row ([
5660 subnet ['id' ],
5761 '%s/%s' % (subnet ['networkIdentifier' ], str (subnet ['cidr' ])),
5862 subnet .get ('subnetType' , formatting .blank ()),
63+ subnet .get ('addressSpace' , formatting .blank ()),
5964 utils .lookup (subnet , 'datacenter' , 'name' ,) or formatting .blank (),
6065 subnet ['networkVlanId' ],
6166 subnet ['ipAddressCount' ],
0 commit comments