The following section describes Network URIs. For example, you can retrieve information about the configured networks, a single network, and get IP ranges for a requested number of available addresses within a network.
Retrieve information about configured networks:
GET BFC/networks
None
Returns the HTTP return code 200 and a list of network records on success. Returns an HTTP error code and the associated fault information on error.
Retrieves information about the current set of networks in the system as a list of network records. For the 1.1 release of the BFC API, you cannot specify the set of network records to return. Records are returned for all networks in the system instead.
Python Example
from httplib import HTTPSConnection
import json
import os
import sys
bfcHost = os.environ["BFC_HOST"]
bfcSession = os.environ["BFC_SESSION"]
conn = HTTPSConnection(bfcHost + ':8443')
conn.connect()
conn.request(method='GET',
url='/BFC/networks',
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)
Example JSON Payload
[{"network": {
"address_space": {
"ip_space": {
"address_pools": [
{"ip_pool": {
"available_ranges": [
{"ip_range": {
"end_address": "10.10.x.x",
"size": 10,
"start_address": "10.10.x.x"}}],
"num_addresses": 11,
"num_available": 10,
"num_used": 1,
"ranges": [
{"ip_range": {
"end_address": "10.10.x.x",
"size": 11,
"start_address": "10.10.x.x"}}],
"type": "hardware",
"used_ranges": [
{"ip_range": {
"end_address": "10.10.x.x",
"size": 1,
"start_address": "10.10.x.x"}}]}},
{"ip_pool": {
"available_ranges": [],
"num_addresses": 4,
"num_available": 0,
"num_used": 4,
"ranges": [
{"ip_range": {
"end_address": "10.10.x.x",
"size": 4,
"start_address": "10.10.x.x"}}],
"type": "application",
"used_ranges": [
{"ip_range": {
"end_address": "10.10.x.x",
"size": 4,
"start_address": "10.10.x.x"}}]}}],
"available_ranges": [[
{"ip_range": {
"end_address": "10.10.x.x",
"size": 137,
"start_address": "10.10.x.x"}},{
"ip_range": {
"end_address": "10.10.x.x",
"size": 101,
"start_address": "10.10.x.x"}}],238]}},
"base_address": "10.10.x.x",
"cidr": 24,
"comp_id": 1450,
"gateway_addresses": [
"10.10.75.1"],
"ip_version": "ipv4",
"usages": [
"bbc/applogic_external_network"],
"vlan_address_spaces": []}},{
"network": {
"address_space": {
"ip_space": {
"address_pools": [{
"ip_pool": {
"available_ranges": [],
"num_addresses": 1,
"num_available": 0,
"num_used": 1,
"ranges": [{
"ip_range": {
"end_address": "10.10.x.x",
"size": 1,
"start_address": "10.10.x.x"}}],
"type": "power",
"used_ranges": [
{"ip_range": {
"end_address": "10.10.x.xx",
"size": 1,
"start_address": "10.10.x.x"}}]}}],
"available_ranges": [[{
"ip_range": {
"end_address": "10.10.x.x",
"size": 242,
"start_address": "10.10.x.x"}},{
"ip_range": {
"end_address": "10.10.x.x",
"size": 10,
"start_address": "10.10.x.x"}}],252]}},
"base_address": "10.10.x.x",
"cidr": 24,
"comp_id": 1414,
"gateway_addresses": [
"10.10.x.x"],
"ip_version": "ipv4",
"usages": [
"core/power_network"],
"vlan_address_spaces": []}},{
"network": {
"address_space": {
"ip_space": {
"address_pools": [
{"ip_pool": {
"available_ranges": [],
"num_addresses": 1,
"num_available": 0,
"num_used": 1,
"ranges": [
{"ip_range": {
"end_address": "192.168.x.x",
"size": 1,
"start_address": "192.168.x.x"}}],
"type": "hardware",
"used_ranges": [
{"ip_range": {
"end_address": "192.168.x.x",
"size": 1,
"start_address": "192.168.x.x"}}]}}],
"available_ranges": [ [
{"ip_range": {
"end_address": "192.168.x.x",
"size": 11,
"start_address": "192.168.x.x"}},
"ip_range": {
"end_address": "192.168.x.x",
"size": 242,
"start_address": "192.168.x.x"}}],253]}},
"base_address": "192.168.x.x",
"cidr": 24,
"comp_id": 1367,
"gateway_addresses": [],
"ip_version": "ipv4",
"usages": [
"bbc/applogic_backbone_network"],
"vlan_address_spaces": []}}]
GET BFC/networks/<network base address>
Note: The network is named by its base IP address in IP string format; specific to the IP version. The BFC currently supports IPV4 networks.
None.
Returns the HTTP return code 200 and a payload that is a network record on success. Returns an HTTP error code and the associated fault information on error.
Retrieves information about a single network. A network record returns this information. The network record contains a list of IP space records which define how the total network address space is divided for BFC usage. An IP Space record exists for each usage and VLAN combination within the network configuration.
Example GET
GET BFC/network/10.10.x.x
Python Example
from httplib import HTTPSConnection
import json
import os
import sys
networkMac = sys.argv[1]
bfcHost = os.environ["BFC_HOST"]
bfcSession = os.environ["BFC_SESSION"]
conn = HTTPSConnection(bfcHost + ':8443')
conn.connect()
conn.request(method='GET',
url='/BFC/networks' + 'networkMac',
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)
Example JSON Payload
{"network": {
"address_space": {
"ip_space": {
"address_pools": [
{"ip_pool": {
"available_ranges": [
{"ip_range": {
"end_address": "10.10.75.11",
"size": 10,
"start_address": "10.10.75.2"}}],
"num_addresses": 11,
"num_available": 10,
"num_used": 1,
"ranges": [
{"ip_range": {
"end_address": "10.10.75.12",
"size": 11,
"start_address": "10.10.75.2"}}],
"type": "hardware",
"used_ranges": [
{"ip_range": {
"end_address": "10.10.75.12",
"size": 1,
"start_address": "10.10.75.12"}}]}},
{"ip_pool": {
"available_ranges": [],
"num_addresses": 4,
"num_available": 0,
"num_used": 4,
"ranges": [
{"ip_range": {
"end_address": "10.10.75.117",
"size": 4,
"start_address": "10.10.75.114"}}],
"type": "application",
"used_ranges": [
{"ip_range": {
"end_address": "10.10.75.117",
"size": 4,
"start_address": "10.10.75.114"}}]}}],
"available_ranges": [[
{"ip_range": {
"end_address": "10.10.75.254",
"size": 137,
"start_address": "10.10.75.118"}},
{"ip_range": {
"end_address": "10.10.75.113",
"size": 101,
"start_address": "10.10.75.13"}}],238]}},
"base_address": "10.10.75.0",
"cidr": 24,
"comp_id": 1450,
"gateway_addresses": [
"10.10.75.1"],
"ip_version": "ipv4",
"usages": [
"bbc/applogic_external_network"],
"vlan_address_spaces": []}}
Retrieve unused address information for a network or network VLAN based on IP use type and optional count of addresses:
GET BFC/networks/<network base address>/address_space/address_pools/<IP type>/availableRanges GET BFC/networks/<network base address>/vlan_address_spaces/<vlan>/address_pools/<IP type>/available_ranges GET BFC/networks/<network base address>/address_space/address_pools//<IP type>/availableRanges?numIPs=<num> GET BFC/networks/<network base address>/vlan_address_spaces/<vlan>/address_pools/<IP type>/available_ranges?numIPs=<num>
The GET URI supports the following query string parameters:
If present, specifies the number of IP addresses to include by the ranges. When unspecified the returned ranges include all available IPs for the network, IP use type, and VLAN (if present).
Returns the HTTP return code 200 and a payload that is the grid state as a string on success. Returns an HTTP error code and the associated fault information on error.
Retrieves the IP ranges that span the requested number of addresses (specified through an optional query string parameter). It can also include all availalble addresses when a count is not requested, for a single network, designated IP use type, and optional VLAN. If a VLAN is not included in the query string, IP ranges are returned for the base/non-vlanned address space. If present and equal to the ID of a VLAN the network has a configured application IP space on, the VLAN queried for available addresses.
The address ranges are returned in a list of IP range records where the sum of the range sizes equals the requested number of addresses, or the total available addresses when no count is requested. An error results from requesting a count that exceeds the total free addresses.
You can use the IP Ranges to specify the grid controller IP and application IP ranges when you create or update grids.
Python Example
from httplib import HTTPSConnection
import json
import os
import sys
networkBase = sys.argv[1]
ipType = sys.argv[2]
bfcHost = os.environ["BFC_HOST"]
bfcSession = os.environ["BFC_SESSION"]
conn = HTTPSConnection(bfcHost + ':8443')
conn.connect()
conn.request(method='GET',
url='/BFC/networks' + 'networkBase' + '/address_pools/' + 'ipType' + '/availableRanges/,
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)
GET BFC/networks/<base addr>/address_space/<type>
None
Returns the HTTP return code 200 and with a payload that displays the typed IP Pool. Returns an HTTP error code and the associated fault information on error.
Use this operation to get the address pool for a type.
Note: This URI gets the untagged typed IP Pool not associated with a VLAN Address Space. You use a separate URI to retrieve a VLAN address space pool.
Example GET
GET BFC/networks/10.10.x.x/address_space/<type>
Python Example
from httplib import HTTPSConnection
import json
import os
import sys
networkBase = sys.argv[1]
Type = sys.argv[2]
bfcHost = os.environ["BFC_HOST"]
bfcSession = os.environ["BFC_SESSION"]
conn = HTTPSConnection(bfcHost + ':8443')
conn.connect()
conn.request(method='GET',
url='/BFC/networks' + 'networkBase' + '/address_space/' + '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)
GET BFC/networks/<base addr>/vlan_address_spaces/<vlan>/address_pools/<type>
None
Returns the HTTP return code 200 with a payload that displays the ip_pool. Returns an HTTP error code and the associated fault information on error.
Use this operation to get an address pool by type on the VLAN.
Example GET
GET BFC/networks/10.10.x.x/vlan_address_spaces/<vlan>/address_pools/<type>
Python Example
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)
POST BFC/networks/<base addr>/address_space/address_pools/<type>/ranges
Payload is the ip_range record.
Returns the HTTP return code 201 and with an empty payload, and returns the header URI to the pool ranges. Returns an HTTP error code and the associated fault information on error.
Use this operation to add an address range to the address pool of type.
Example POST
POST BFC/networks/10.10.x.x/address_space/address_pools/<type>/ranges
Python Example
from httplib import HTTPSConnection
import json
import os
import sys
networkBase = sys.argv[1]
Type = sys.argv[2]
bfcHost = os.environ["BFC_HOST"]
bfcSession = os.environ["BFC_SESSION"]
conn = HTTPSConnection(bfcHost + ':8443')
conn.connect()
conn.request(method='POST',
url='/BFC/networks' + 'networkBase' + '/address_space/address_pools/' + 'Type' + '/ranges',
body=json.dumps([{"ip_range":{
"start_address":"10.x.x.1",
"end_address":"10.x.x.20",
"size":"20"}}])
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)
DELETE BFC/networks/<base addr>/address_space/address_pools/<type>/ranges/<start_ip-end_ip>
None
Returns the HTTP return code 200 and deletes the range. Returns an HTTP error code and the associated fault information on error.
Use this operation to delete a range of addresses from the Address Pool for type in a network.
Example DELETE
DELETE BFC/networks/10.10.x.x/address_space/address_pools/<type>/ranges/10.x.x.1-10.x.x.20
Python Example
from httplib import HTTPSConnection
import json
import os
import sys
networkBase = sys.argv[1]
Type = sys.argv[2]
bfcHost = os.environ["BFC_HOST"]
bfcSession = os.environ["BFC_SESSION"]
conn = HTTPSConnection(bfcHost + ':8443')
conn.connect()
conn.request(method='DELETE',
url='/BFC/networks' + 'networkBase' + '/address_space/address_pools/'
+ 'Type' + '/ranges/10.x.x.1-10.x.x.20',
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)
GET BFC/networks/<base addr>/vlan_address_space/<vlan>
None
Returns the HTTP return code 200 with a payload that displays the address space for the VLAN. Returns an HTTP error code and the associated fault information on error.
Use this operation to get the VLAN address space for the network.
Example GET
GET BFC/networks/10.10.x.x/vlan_address_space/<vlan>
Python Example
from httplib import HTTPSConnection
import json
import os
import sys
networkBase = sys.argv[1]
vlan = sys.argv[2]
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_space/' + 'vlan',
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)
POST BFC/networks/<base addr>/vlan_address_spaces
Payload is the vlan_ip_space record.
Returns the HTTP return code 201 and with an empty payload, and returns the header URI to the added VLAN address space. Returns an HTTP error code and the associated fault information on error.
Use this operation to create the VLAN address spaces for the network.
Example POST
POST BFC/networks/10.10.x.x/vlan_address_spaces
Python Example
from httplib import HTTPSConnection
import json
import os
import sys
networkBase = sys.argv[1]
bfcHost = os.environ["BFC_HOST"]
bfcSession = os.environ["BFC_SESSION"]
conn = HTTPSConnection(bfcHost + ':8443')
conn.connect()
conn.request(method='POST',
url='/BFC/networks' + 'networkBase' + '/vlan_address_spaces/',
body=json.dumps([{"vlan_ip_space"{:
"vlan":"<vlan>",
"availble_ranges":"10.x.x.1-10.x.x.20",
"address_pools":"<ip_pool>"}}]))
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)
POST BFC/networks/<base addr>/vlan_address_spaces/<vlan>/address_pools/<type>/ranges
Payload is the ip_range record.
Returns the HTTP return code 201 and with an empty payload, and returns the header URI to the VLAN pool ranges . Returns an HTTP error code and the associated fault information on error.
Use this operation to add an address pool range to a typed Address Pool on the VLAN.
Example POST
POST BFC/networks/10.10.x.x/vlan_address_spaces/<vlan>/address_pools/<type>/ranges
Python Example
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='POST',
url='/BFC/networks' + 'networkBase' + '/vlan_address_spaces/' + 'vlan' + /address_pools/ + 'Type' + /ranges',
body=json.dumps([{"ip_range":{
"start_address":"10.x.x.1",
"end_address":"10.x.x.20",
"size":"20"}}]))
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)
DELETE BFC/networks/<base addr>/address_space/<vlan>/address_pools/<type>/ranges/<start_ip-end_ip>
None
Returns the HTTP return code 200 and deletes the range. Returns an HTTP error code and the associated fault information on error.
Use this operation to delete a range of addresses from the Address Pool for type in a VLAN Address Space in a network.
Example DELETE
DELETE BFC/networks/10.10.x.x/address_space/<vlan>/address_pools/<type>/ranges/10.x.x.21-10.x.x.30
Python Example
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='DELETE',
url='/BFC/networks' + 'networkBase' + '/vlan_address_spaces/' + 'vlan' + /address_pools/ + 'Type' + /ranges/10.x.x.21-10.x.x.30',
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)
|
Copyright © 2013 CA Technologies.
All rights reserved.
|
|