Argomento precedente: Come ottenere un pool di indirizzi in base al tipoArgomento successivo: Aggiunta di un intervallo al pool di indirizzi tipizzato


Come ottenere un pool di indirizzi in base al tipo sulla VLAN
GET BFC/networks/<base addr>/vlan_address_spaces/<vlan>/address_pools/<type>
Argomenti

Nessuno

Indietro

Restituisce il codice di ritorno HTTP 200 con un payload che visualizza ip_pool. Restituisce un codice di errore HTTP e le informazioni di errore associate.

Description

Utilizzare questa operazione per ottenere un pool di indirizzi in base al tipo sulla VLAN.

Esempio GET

GET BFC/networks/10.10.x.x/vlan_address_spaces/<vlan>/address_pools/<type>

Esempio di Python

from httplib import HTTPSConnection
import json
import os
import sys

networkBase = sys.argv[1]
vlan = sys.argv[2]
Type = sys.argv[3]
bfcHost = os.environ["BFC_HOST"]
bfcSession = os.environ["BFC_SESSION"]
conn = HTTPSConnection(bfcHost + ':8443')
conn.connect()
conn.request(method='GET',
             url='/BFC/networks' + 'networkBase' + '/vlan_address_spaces/' 
		+ 'vlan' + '/address_pools/ + 'Type',
             headers={'Content-Type':'application/json',
                      'Authorization':bfcSession})
r1 = conn.getresponse()
print 'HTTP Response Code: {0}'.format(r1.status)
servers = json.loads(r1.read())
print json.dumps(servers, sort_keys=True, indent=4)