def list_subnets(call=None, kwargs=None):
 if (call == 'action'):
  raise SaltCloudSystemExit('The avail_sizes function must be called with -f or --function, or with the --list-sizes option')
 global netconn
 if (not netconn):
  netconn = get_conn(NetworkManagementClient)
 if (('group' in kwargs) and ('resource_group' not in kwargs)):
  kwargs['resource_group'] = kwargs['group']
 if ('resource_group' not in kwargs):
  raise SaltCloudSystemExit('A resource_group must be specified as "group" or "resource_group"')
 if ('network' not in kwargs):
  raise SaltCloudSystemExit('A "network" must be specified')
 region = get_location()
 bank = 'cloud/metadata/azurearm/{0}/{1}'.format(region, kwargs['network'])
 ret = {}
 subnets = netconn.subnets.list(kwargs['resource_group'], kwargs['network'])
 for subnet in subnets:
  ret[subnet.name] = make_safe(subnet)
  ret[subnet.name]['ip_configurations'] = {}
  for ip_ in subnet.ip_configurations:
   comps = ip_.id.split('/')
   name = comps[(-1)]
   ret[subnet.name]['ip_configurations'][name] = make_safe(ip_)
   ret[subnet.name]['ip_configurations'][name]['subnet'] = subnet.name
  ret[subnet.name]['resource_group'] = kwargs['resource_group']
 return ret

def list_subnets ( call = None , kwargs = None ) : if ( call == 'action' ) : raise SaltCloudSystemExit ( 'The avail_sizes function must be called with -f or --function, or with the --list-sizes option' ) global netconn if ( not netconn ) : netconn = get_conn ( NetworkManagementClient ) if ( ( 'group' in kwargs ) and ( 'resource_group' not in kwargs ) ) : kwargs [ 'resource_group' ] = kwargs [ 'group' ] if ( 'resource_group' not in kwargs ) : raise SaltCloudSystemExit ( 'A resource_group must be specified as "group" or "resource_group"' ) if ( 'network' not in kwargs ) : raise SaltCloudSystemExit ( 'A "network" must be specified' ) region = get_location ( ) bank = 'cloud/metadata/azurearm/{0}/{1}' . format ( region , kwargs [ 'network' ] ) ret = { } subnets = netconn . subnets . list ( kwargs [ 'resource_group' ] , kwargs [ 'network' ] ) for subnet in subnets : ret [ subnet . name ] = make_safe ( subnet ) ret [ subnet . name ] [ 'ip_configurations' ] = { } for ip_ in subnet . ip_configurations : comps = ip_ . id . split ( '/' ) name = comps [ ( - 1 ) ] ret [ subnet . name ] [ 'ip_configurations' ] [ name ] = make_safe ( ip_ ) ret [ subnet . name ] [ 'ip_configurations' ] [ name ] [ 'subnet' ] = subnet . name ret [ subnet . name ] [ 'resource_group' ] = kwargs [ 'resource_group' ] return ret
fetches a list of all networks for a tenant cli example: .