Description
The addBGP operation handles configuration related to BGP model.
This API call is not allowed on the standby unit in an HA pair.
HTTP request
POST /api/fdm/v6/devices/default/routing/virtualrouters/{vrfId}/bgp
Data Parameters
Parameter | Required | Type | Description | |||
---|---|---|---|---|---|---|
name | True | string | A string that represents the name of the object | |||
description | False | string | User defined description for this object. Field level constraints: length must be between 0 and 200 (inclusive). (Note: Additional constraints might exist) |
|||
asNumber | True | string | Unique Autonomous number that enables bgp process. Valid values for autonomous number are from 1-4294967295 and 1.0-XX.YY. Field level constraints: cannot be null, must match pattern ^(([1-9]\d{0,8}|[1-3]\d{1,9}|4([0-1]\d{8}|2([0-8]\d{7}|9([0-3]\d{6}|4([0-8]\d{5}|9([0-5]\d{4}|6([0-6]\d{3}|7([0-1]\d{2}|2([0-8]\d{1}|9[0-5]{1})))))))))$)|(^(?:(?:(6553[0-5]|655[0-2]\d|65[0-4]\d{2}|6[0-4]\d{3}|[1-5]\d{4}|[1-9]\d{1,3}|[1-9])).(?:(6553[0-5]|655[0-2]\d|65[0-4]\d{2}|6[0-4]\d{3}|[1-5]\d{4}|[1-9]\d{1,3}|\d)))$). (Note: Additional constraints might exist) |
|||
routerId | False | string | Represents a fixed router ID for the local BGP routing process. Field level constraints: must be a valid IP address, must match pattern (?:(?:\d|[1-9]\d{1,2}|2[0-4]\d|25[0-5]).){3}(?:\d|[1-9]\d{1,2}|2[0-4]\d|25[0-5]). (Note: Additional constraints might exist) |
|||
addressFamilyIPv4 | False | object | An instance of type AFIPv4 that represents the address family configuration to configure a routing session using standard IPv4 address prefixes | |||
addressFamilyIPv6 | False | object | An instance of type AFIPv6 that represents the address family configuration to configure a routing session using standard IPv6 address prefixes | |||
type | True | string | A UTF8 string, all letters lower-case, that represents the class-type. This corresponds to the class name. |
Path Parameters
Parameter | Required | Type | Description | |||
---|---|---|---|---|---|---|
vrfId | True | string |
Example
curl -X POST \
--header "Accept: application/json" \
--header "Authorization: Bearer ${ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
-d '{
"addressFamilyIPv4": {
"afTableMap": {
"filter": true,
"routeMap": {
"id": "string",
"name": "string",
"type": "string",
"version": "string"
},
"type": "aftablemap"
},
"aggregateAddressesIPv4s": [
{
"advertiseMap": {
"id": "string",
"name": "string",
"type": "string",
"version": "string"
},
"asSet": true,
"attributeMap": {
"id": "string",
"name": "string",
"type": "string",
"version": "string"
},
"ipv4AggregateNetwork": {
"id": "string",
"name": "string",
"type": "string",
"version": "string"
},
"summaryOnly": true,
"suppressMap": {
"id": "string",
"name": "string",
"type": "string",
"version": "string"
},
"type": "afaggregateaddressipv4"
}
],
"aggregateTimer": 0,
"autoSummary": true,
"bgpNextHopTriggerDelay": 0,
"bgpNextHopTriggerEnable": true,
"bgpRedistributeInternal": true,
"bgpSupressInactive": true,
"defaultInformationOrginate": true,
"distance": {
"externalDistance": 0,
"internalDistance": 0,
"localDistance": 0,
"type": "afbgpdistance"
},
"distributeLists": [
{}
],
"injectMaps": [
{
"copyAttributes": true,
"existMap": {
"id": "string",
"name": "string",
"type": "string",
"version": "string"
},
"injectMap": {
"id": "string",
"name": "string",
"type": "string",
"version": "string"
},
"type": "afinjectmap"
}
],
"maximumPaths": {
"ibgpValue": 0,
"type": "afmaximumpaths",
"value": 0
},
"neighbors": [
{
"activate": true,
"haModeGracefulRestart": true,
"ipv4Address": "string",
"ipv4PrefixListFilter": [
{
"filterDirection": "IN",
"prefixList": {
"id": "string",
"name": "string",
"type": "string",
"version": "string"
},
"type": "ipv4prefixlistfilter"
}
],
"neighborAdvanced": {
"neighborHops": {},
"neighborSecret": {
"id": "string",
"name": "string",
"type": "string",
"version": "string"
},
"neighborTransportConnectionMode": "ACTIVE",
"neighborTransportPathMTUDiscovery": {
"disable": true,
"type": "neighbortransportpathmtudiscovery"
},
"neighborVersion": 0,
"neighborWeight": 0,
"nextHopSelf": true,
"sendCommunity": true,
"type": "neighboradvanced"
},
"neighborDistributeLists": [
{
"accessListName": {
"id": "string",
"name": "string",
"type": "string",
"version": "string"
},
"filterUpdateAction": "IN",
"type": "neighbordistributelist"
}
],
"neighborFilterList": [
{
"asPathList": {
"id": "string",
"name": "string",
"type": "string",
"version": "string"
},
"filterUpdateAction": "IN",
"type": "neighborfilterlist"
}
],
"neighborGeneral": {
"description": "string",
"fallOverBFD": {
"fallOverBFD": true,
"neighborFallOverBFDOption": "SINGLEHOP",
"type": "neighborfalloverbfd"
},
"shutdown": true,
"type": "neighborgeneral"
},
"neighborHAMode": {
"disable": true,
"type": "neighborhamode"
},
"neighborLocalAs": {
"localAsNumber": "string",
"neighborLocalAsOption": "NONE",
"type": "neighborlocalas"
},
"neighborMaximumPrefix": {
"maxPrefixLimit": 0,
"neighborMaximumPrefixOption": "WARNING_ONLY",
"restartInterval": 0,
"thresholdValue": 0,
"type": "neighbormaximumprefix"
},
"neighborRouteMap": [
{
"filterUpdateAction": "IN",
"routeMap": {
"id": "string",
"name": "string",
"type": "string",
"version": "string"
},
"type": "neighborroutemap"
}
],
"neighborRoutes": {
"advertisementInterval": 0,
"neighborAdvertiseMaps": [
{
"existMap": true,
"existRouteMap": {
"id": "string",
"name": "string",
"type": "string",
"version": "string"
},
"routeMap": {
"id": "string",
"name": "string",
"type": "string",
"version": "string"
},
"type": "neighboradvertisemap"
}
],
"neighborDefaultOriginate": {
"routeMap": {
"id": "string",
"name": "string",
"type": "string",
"version": "string"
},
"type": "neighbordefaultoriginate"
},
"removePrivateAs": true,
"type": "neighborroutes"
},
"neighborTimers": {
"holdTime": 0,
"keepAliveInterval": 0,
"minimumHoldTime": 0,
"type": "neighbortimers"
},
"remoteAs": "string",
"type": "neighboripv4"
}
],
"networks": [
{
"ipv4Network": {
"id": "string",
"name": "string",
"type": "string",
"version": "string"
},
"routeMap": {
"id": "string",
"name": "string",
"type": "string",
"version": "string"
},
"type": "afipv4network"
}
],
"redistributeProtocols": [
{}
],
"scanTime": 0,
"synchronization": true,
"type": "afipv4"
},
"addressFamilyIPv6": {
"aggregateAddressesIPv6": [
{
"advertiseMap": {
"id": "string",
"name": "string",
"type": "string",
"version": "string"
},
"asSet": true,
"attributeMap": {
"id": "string",
"name": "string",
"type": "string",
"version": "string"
},
"ipv6AggregateNetwork": {
"id": "string",
"name": "string",
"type": "string",
"version": "string"
},
"summaryOnly": true,
"suppressMap": {
"id": "string",
"name": "string",
"type": "string",
"version": "string"
},
"type": "afaggregateaddressipv6"
}
],
"aggregateTimer": 0,
"bgpRedistributeInternal": true,
"bgpSupressInactive": true,
"defaultInformationOrginate": true,
"distance": {
"externalDistance": 0,
"internalDistance": 0,
"localDistance": 0,
"type": "afbgpdistance"
},
"injectMaps": [
{
"copyAttributes": true,
"existMap": {
"id": "string",
"name": "string",
"type": "string",
"version": "string"
},
"injectMap": {
"id": "string",
"name": "string",
"type": "string",
"version": "string"
},
"type": "afinjectmap"
}
],
"maximumPaths": {
"ibgpValue": 0,
"type": "afmaximumpaths",
"value": 0
},
"neighbors": [
{
"activate": true,
"haModeGracefulRestart": true,
"ipv6Address": "string",
"ipv6Prefix": 0,
"ipv6PrefixListFilter": [
{
"filterDirection": "IN",
"prefixList": {
"id": "string",
"name": "string",
"type": "string",
"version": "string"
},
"type": "ipv6prefixlistfilter"
}
],
"neighborAdvanced": {
"neighborHops": {},
"neighborSecret": {
"id": "string",
"name": "string",
"type": "string",
"version": "string"
},
"neighborTransportConnectionMode": "ACTIVE",
"neighborTransportPathMTUDiscovery": {
"disable": true,
"type": "neighbortransportpathmtudiscovery"
},
"neighborVersion": 0,
"neighborWeight": 0,
"nextHopSelf": true,
"sendCommunity": true,
"type": "neighboradvanced"
},
"neighborFilterList": [
{
"asPathList": {
"id": "string",
"name": "string",
"type": "string",
"version": "string"
},
"filterUpdateAction": "IN",
"type": "neighborfilterlist"
}
],
"neighborGeneral": {
"description": "string",
"fallOverBFD": {
"fallOverBFD": true,
"neighborFallOverBFDOption": "SINGLEHOP",
"type": "neighborfalloverbfd"
},
"shutdown": true,
"type": "neighborgeneral"
},
"neighborLocalAs": {
"localAsNumber": "string",
"neighborLocalAsOption": "NONE",
"type": "neighborlocalas"
},
"neighborMaximumPrefix": {
"maxPrefixLimit": 0,
"neighborMaximumPrefixOption": "WARNING_ONLY",
"restartInterval": 0,
"thresholdValue": 0,
"type": "neighbormaximumprefix"
},
"neighborRouteMap": [
{
"filterUpdateAction": "IN",
"routeMap": {
"id": "string",
"name": "string",
"type": "string",
"version": "string"
},
"type": "neighborroutemap"
}
],
"neighborRoutes": {
"advertisementInterval": 0,
"neighborAdvertiseMaps": [
{
"existMap": true,
"existRouteMap": {
"id": "string",
"name": "string",
"type": "string",
"version": "string"
},
"routeMap": {
"id": "string",
"name": "string",
"type": "string",
"version": "string"
},
"type": "neighboradvertisemap"
}
],
"neighborDefaultOriginate": {
"routeMap": {
"id": "string",
"name": "string",
"type": "string",
"version": "string"
},
"type": "neighbordefaultoriginate"
},
"removePrivateAs": true,
"type": "neighborroutes"
},
"neighborTimers": {
"holdTime": 0,
"keepAliveInterval": 0,
"minimumHoldTime": 0,
"type": "neighbortimers"
},
"remoteAs": "string",
"type": "neighboripv6"
}
],
"networks": [
{
"ipv6Network": {
"id": "string",
"name": "string",
"type": "string",
"version": "string"
},
"prefixName": "string",
"routeMap": {
"id": "string",
"name": "string",
"type": "string",
"version": "string"
},
"type": "afipv6network"
}
],
"redistributeProtocols": [
{}
],
"scanTime": 0,
"synchronization": true,
"type": "afipv6"
},
"asNumber": "string",
"description": "string",
"id": "string",
"name": "string",
"routerId": "string",
"type": "bgp",
"version": "string"
}' \
"https://${HOST}:${PORT}/api/fdm/v6/devices/default/routing/virtualrouters/{vrfId}/bgp"
from bravado.requests_client import RequestsClient
from bravado.client import SwaggerClient
def get_client(host, token):
http_client = RequestsClient()
http_client.ssl_verify = False
http_client.set_api_key(
host,
"Bearer {}".format(token),
param_name="Authorization",
param_in="header"
)
return SwaggerClient.from_url(
"https://{}/apispec/ngfw.json".format(host),
http_client=http_client,
config={
"validate_responses": False,
"validate_swagger_spec": False
}
)
def add_bgp(client, vrf_id, body):
return client.BGP.addBGP(
vrfId=vrf_id,
body=body
).response().result
if __name__ == "__main__":
host = "ftd.example.com"
token = "access_token"
client = get_client(host, token)
vrf_id = "string"
body = {'addressFamilyIPv4': {'afTableMap': {'filter': True,
'routeMap': {'id': 'string',
'name': 'string',
'type': 'string',
'version': 'string'},
'type': 'aftablemap'},
'aggregateAddressesIPv4s': [{'advertiseMap': {'id': 'string',
'name': 'string',
'type': 'string',
'version': 'string'},
'asSet': True,
'attributeMap': {'id': 'string',
'name': 'string',
'type': 'string',
'version': 'string'},
'ipv4AggregateNetwork': {'id': 'string',
'name': 'string',
'type': 'string',
'version': 'string'},
'summaryOnly': True,
'suppressMap': {'id': 'string',
'name': 'string',
'type': 'string',
'version': 'string'},
'type': 'afaggregateaddressipv4'}],
'aggregateTimer': 0,
'autoSummary': True,
'bgpNextHopTriggerDelay': 0,
'bgpNextHopTriggerEnable': True,
'bgpRedistributeInternal': True,
'bgpSupressInactive': True,
'defaultInformationOrginate': True,
'distance': {'externalDistance': 0,
'internalDistance': 0,
'localDistance': 0,
'type': 'afbgpdistance'},
'distributeLists': [{}],
'injectMaps': [{'copyAttributes': True,
'existMap': {'id': 'string',
'name': 'string',
'type': 'string',
'version': 'string'},
'injectMap': {'id': 'string',
'name': 'string',
'type': 'string',
'version': 'string'},
'type': 'afinjectmap'}],
'maximumPaths': {'ibgpValue': 0,
'type': 'afmaximumpaths',
'value': 0},
'neighbors': [{'activate': True,
'haModeGracefulRestart': True,
'ipv4Address': 'string',
'ipv4PrefixListFilter': [{'filterDirection': 'IN',
'prefixList': {'id': 'string',
'name': 'string',
'type': 'string',
'version': 'string'},
'type': 'ipv4prefixlistfilter'}],
'neighborAdvanced': {'neighborHops': {},
'neighborSecret': {'id': 'string',
'name': 'string',
'type': 'string',
'version': 'string'},
'neighborTransportConnectionMode': 'ACTIVE',
'neighborTransportPathMTUDiscovery': {'disable': True,
'type': 'neighbortransportpathmtudiscovery'},
'neighborVersion': 0,
'neighborWeight': 0,
'nextHopSelf': True,
'sendCommunity': True,
'type': 'neighboradvanced'},
'neighborDistributeLists': [{'accessListName': {'id': 'string',
'name': 'string',
'type': 'string',
'version': 'string'},
'filterUpdateAction': 'IN',
'type': 'neighbordistributelist'}],
'neighborFilterList': [{'asPathList': {'id': 'string',
'name': 'string',
'type': 'string',
'version': 'string'},
'filterUpdateAction': 'IN',
'type': 'neighborfilterlist'}],
'neighborGeneral': {'description': 'string',
'fallOverBFD': {'fallOverBFD': True,
'neighborFallOverBFDOption': 'SINGLEHOP',
'type': 'neighborfalloverbfd'},
'shutdown': True,
'type': 'neighborgeneral'},
'neighborHAMode': {'disable': True,
'type': 'neighborhamode'},
'neighborLocalAs': {'localAsNumber': 'string',
'neighborLocalAsOption': 'NONE',
'type': 'neighborlocalas'},
'neighborMaximumPrefix': {'maxPrefixLimit': 0,
'neighborMaximumPrefixOption': 'WARNING_ONLY',
'restartInterval': 0,
'thresholdValue': 0,
'type': 'neighbormaximumprefix'},
'neighborRouteMap': [{'filterUpdateAction': 'IN',
'routeMap': {'id': 'string',
'name': 'string',
'type': 'string',
'version': 'string'},
'type': 'neighborroutemap'}],
'neighborRoutes': {'advertisementInterval': 0,
'neighborAdvertiseMaps': [{'existMap': True,
'existRouteMap': {'id': 'string',
'name': 'string',
'type': 'string',
'version': 'string'},
'routeMap': {'id': 'string',
'name': 'string',
'type': 'string',
'version': 'string'},
'type': 'neighboradvertisemap'}],
'neighborDefaultOriginate': {'routeMap': {'id': 'string',
'name': 'string',
'type': 'string',
'version': 'string'},
'type': 'neighbordefaultoriginate'},
'removePrivateAs': True,
'type': 'neighborroutes'},
'neighborTimers': {'holdTime': 0,
'keepAliveInterval': 0,
'minimumHoldTime': 0,
'type': 'neighbortimers'},
'remoteAs': 'string',
'type': 'neighboripv4'}],
'networks': [{'ipv4Network': {'id': 'string',
'name': 'string',
'type': 'string',
'version': 'string'},
'routeMap': {'id': 'string',
'name': 'string',
'type': 'string',
'version': 'string'},
'type': 'afipv4network'}],
'redistributeProtocols': [{}],
'scanTime': 0,
'synchronization': True,
'type': 'afipv4'},
'addressFamilyIPv6': {'aggregateAddressesIPv6': [{'advertiseMap': {'id': 'string',
'name': 'string',
'type': 'string',
'version': 'string'},
'asSet': True,
'attributeMap': {'id': 'string',
'name': 'string',
'type': 'string',
'version': 'string'},
'ipv6AggregateNetwork': {'id': 'string',
'name': 'string',
'type': 'string',
'version': 'string'},
'summaryOnly': True,
'suppressMap': {'id': 'string',
'name': 'string',
'type': 'string',
'version': 'string'},
'type': 'afaggregateaddressipv6'}],
'aggregateTimer': 0,
'bgpRedistributeInternal': True,
'bgpSupressInactive': True,
'defaultInformationOrginate': True,
'distance': {'externalDistance': 0,
'internalDistance': 0,
'localDistance': 0,
'type': 'afbgpdistance'},
'injectMaps': [{'copyAttributes': True,
'existMap': {'id': 'string',
'name': 'string',
'type': 'string',
'version': 'string'},
'injectMap': {'id': 'string',
'name': 'string',
'type': 'string',
'version': 'string'},
'type': 'afinjectmap'}],
'maximumPaths': {'ibgpValue': 0,
'type': 'afmaximumpaths',
'value': 0},
'neighbors': [{'activate': True,
'haModeGracefulRestart': True,
'ipv6Address': 'string',
'ipv6Prefix': 0,
'ipv6PrefixListFilter': [{'filterDirection': 'IN',
'prefixList': {'id': 'string',
'name': 'string',
'type': 'string',
'version': 'string'},
'type': 'ipv6prefixlistfilter'}],
'neighborAdvanced': {'neighborHops': {},
'neighborSecret': {'id': 'string',
'name': 'string',
'type': 'string',
'version': 'string'},
'neighborTransportConnectionMode': 'ACTIVE',
'neighborTransportPathMTUDiscovery': {'disable': True,
'type': 'neighbortransportpathmtudiscovery'},
'neighborVersion': 0,
'neighborWeight': 0,
'nextHopSelf': True,
'sendCommunity': True,
'type': 'neighboradvanced'},
'neighborFilterList': [{'asPathList': {'id': 'string',
'name': 'string',
'type': 'string',
'version': 'string'},
'filterUpdateAction': 'IN',
'type': 'neighborfilterlist'}],
'neighborGeneral': {'description': 'string',
'fallOverBFD': {'fallOverBFD': True,
'neighborFallOverBFDOption': 'SINGLEHOP',
'type': 'neighborfalloverbfd'},
'shutdown': True,
'type': 'neighborgeneral'},
'neighborLocalAs': {'localAsNumber': 'string',
'neighborLocalAsOption': 'NONE',
'type': 'neighborlocalas'},
'neighborMaximumPrefix': {'maxPrefixLimit': 0,
'neighborMaximumPrefixOption': 'WARNING_ONLY',
'restartInterval': 0,
'thresholdValue': 0,
'type': 'neighbormaximumprefix'},
'neighborRouteMap': [{'filterUpdateAction': 'IN',
'routeMap': {'id': 'string',
'name': 'string',
'type': 'string',
'version': 'string'},
'type': 'neighborroutemap'}],
'neighborRoutes': {'advertisementInterval': 0,
'neighborAdvertiseMaps': [{'existMap': True,
'existRouteMap': {'id': 'string',
'name': 'string',
'type': 'string',
'version': 'string'},
'routeMap': {'id': 'string',
'name': 'string',
'type': 'string',
'version': 'string'},
'type': 'neighboradvertisemap'}],
'neighborDefaultOriginate': {'routeMap': {'id': 'string',
'name': 'string',
'type': 'string',
'version': 'string'},
'type': 'neighbordefaultoriginate'},
'removePrivateAs': True,
'type': 'neighborroutes'},
'neighborTimers': {'holdTime': 0,
'keepAliveInterval': 0,
'minimumHoldTime': 0,
'type': 'neighbortimers'},
'remoteAs': 'string',
'type': 'neighboripv6'}],
'networks': [{'ipv6Network': {'id': 'string',
'name': 'string',
'type': 'string',
'version': 'string'},
'prefixName': 'string',
'routeMap': {'id': 'string',
'name': 'string',
'type': 'string',
'version': 'string'},
'type': 'afipv6network'}],
'redistributeProtocols': [{}],
'scanTime': 0,
'synchronization': True,
'type': 'afipv6'},
'asNumber': 'string',
'description': 'string',
'name': 'string',
'routerId': 'string',
'type': 'bgp'}
add_bgp(client, vrf_id, body)