{
	"info": {
		"_postman_id": "33515a05-1b90-4460-b444-797c58f68eda",
		"name": "Hc2vpp BGP RESTCONF calls",
		"description": "Examples of BGP configration based on \nhttp://docs.opendaylight.org/en/stable-nitrogen/user-guide/bgp-user-guide.html",
		"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
	},
	"item": [
		{
			"name": "show hc-bgp-instance",
			"request": {
				"method": "GET",
				"header": [
					{
						"key": "Content-Type",
						"value": "application/xml"
					},
					{
						"key": "Authorization",
						"value": "Basic YWRtaW46YWRtaW4="
					}
				],
				"body": {
					"mode": "raw",
					"raw": ""
				},
				"url": {
					"raw": "http://localhost:8183/restconf/operational/bgp-rib:bgp-rib/rib/hc-bgp-instance",
					"protocol": "http",
					"host": [
						"localhost"
					],
					"port": "8183",
					"path": [
						"restconf",
						"operational",
						"bgp-rib:bgp-rib",
						"rib",
						"hc-bgp-instance"
					]
				}
			},
			"response": []
		},
		{
			"name": "add bgp peer",
			"request": {
				"method": "PUT",
				"header": [
					{
						"key": "Content-Type",
						"value": "application/json"
					},
					{
						"key": "Authorization",
						"value": "Basic YWRtaW46YWRtaW4="
					}
				],
				"body": {
					"mode": "raw",
					"raw": "{  \n  \"neighbor\":{  \n    \"neighbor-address\":\"127.0.0.2\",\n    \"config\":{  \n      \"peer-type\":\"INTERNAL\"\n    },\n    \"timers\":{  \n      \"config\":{  \n        \"connect-retry\":10,\n        \"hold-time\":90\n      }\n    },\n    \"transport\":{  \n      \"config\":{  \n        \"remote-port\":17900,\n        \"passive-mode\":false\n      }\n    },\n    \"afi-safis\":{  \n      \"afi-safi\":[  \n        {  \n          \"afi-safi-name\":\"openconfig-bgp-types:IPV4-UNICAST\"\n        }\n      ]\n    }\n  }\n}"
				},
				"url": {
					"raw": "http://localhost:8183/restconf/config/openconfig-network-instance:network-instances/network-instance/global-bgp/openconfig-network-instance:protocols/protocol/openconfig-policy-types:BGP/hc-bgp-instance/bgp/bgp-openconfig-extensions:neighbors/neighbor/127.0.0.2",
					"protocol": "http",
					"host": [
						"localhost"
					],
					"port": "8183",
					"path": [
						"restconf",
						"config",
						"openconfig-network-instance:network-instances",
						"network-instance",
						"global-bgp",
						"openconfig-network-instance:protocols",
						"protocol",
						"openconfig-policy-types:BGP",
						"hc-bgp-instance",
						"bgp",
						"bgp-openconfig-extensions:neighbors",
						"neighbor",
						"127.0.0.2"
					]
				}
			},
			"response": []
		},
		{
			"name": "read network instance (config)",
			"request": {
				"method": "GET",
				"header": [
					{
						"key": "Content-Type",
						"value": "application/xml"
					},
					{
						"key": "Authorization",
						"value": "Basic YWRtaW46YWRtaW4="
					}
				],
				"body": {
					"mode": "raw",
					"raw": ""
				},
				"url": {
					"raw": "http://localhost:8183/restconf/config/openconfig-network-instance:network-instances/",
					"protocol": "http",
					"host": [
						"localhost"
					],
					"port": "8183",
					"path": [
						"restconf",
						"config",
						"openconfig-network-instance:network-instances",
						""
					]
				}
			},
			"response": []
		},
		{
			"name": "show 127.0.0.2 peer state",
			"request": {
				"method": "GET",
				"header": [
					{
						"key": "Content-Type",
						"value": "application/xml"
					},
					{
						"key": "Authorization",
						"value": "Basic YWRtaW46YWRtaW4="
					}
				],
				"body": {
					"mode": "raw",
					"raw": ""
				},
				"url": {
					"raw": "http://localhost:8183/restconf/operational/bgp-rib:bgp-rib/rib/hc-bgp-instance/peer/bgp:%2F%2F127.0.0.2",
					"protocol": "http",
					"host": [
						"localhost"
					],
					"port": "8183",
					"path": [
						"restconf",
						"operational",
						"bgp-rib:bgp-rib",
						"rib",
						"hc-bgp-instance",
						"peer",
						"bgp:%2F%2F127.0.0.2"
					]
				}
			},
			"response": []
		},
		{
			"name": "add application peer",
			"request": {
				"method": "PUT",
				"header": [
					{
						"key": "Content-Type",
						"value": "application/json"
					},
					{
						"key": "Authorization",
						"value": "Basic YWRtaW46YWRtaW4="
					}
				],
				"body": {
					"mode": "raw",
					"raw": "{\n  \"neighbor\": {\n    \"neighbor-address\": \"127.0.0.1\",\n    \"config\": {\n      \"peer-group\": \"application-peers\"\n    },\n    \"afi-safis\": {\n      \"afi-safi\": [\n        {\n          \"afi-safi-name\": \"openconfig-bgp-types:IPV4-UNICAST\"\n        }\n      ]\n    }\n  }\n}"
				},
				"url": {
					"raw": "http://localhost:8183/restconf/config/openconfig-network-instance:network-instances/network-instance/global-bgp/openconfig-network-instance:protocols/protocol/openconfig-policy-types:BGP/hc-bgp-instance/bgp/bgp-openconfig-extensions:neighbors/neighbor/127.0.0.1",
					"protocol": "http",
					"host": [
						"localhost"
					],
					"port": "8183",
					"path": [
						"restconf",
						"config",
						"openconfig-network-instance:network-instances",
						"network-instance",
						"global-bgp",
						"openconfig-network-instance:protocols",
						"protocol",
						"openconfig-policy-types:BGP",
						"hc-bgp-instance",
						"bgp",
						"bgp-openconfig-extensions:neighbors",
						"neighbor",
						"127.0.0.1"
					]
				}
			},
			"response": []
		},
		{
			"name": "show 127.0.0.1 app peer state",
			"request": {
				"method": "GET",
				"header": [
					{
						"key": "Content-Type",
						"value": "application/xml"
					},
					{
						"key": "Authorization",
						"value": "Basic YWRtaW46YWRtaW4="
					}
				],
				"body": {
					"mode": "raw",
					"raw": ""
				},
				"url": {
					"raw": "http://localhost:8183/restconf/operational/bgp-rib:bgp-rib/rib/hc-bgp-instance/peer/bgp:%2F%2F127.0.0.1",
					"protocol": "http",
					"host": [
						"localhost"
					],
					"port": "8183",
					"path": [
						"restconf",
						"operational",
						"bgp-rib:bgp-rib",
						"rib",
						"hc-bgp-instance",
						"peer",
						"bgp:%2F%2F127.0.0.1"
					]
				}
			},
			"response": []
		},
		{
			"name": "add ipv4unicast route",
			"request": {
				"method": "PUT",
				"header": [
					{
						"key": "Content-Type",
						"value": "application/xml"
					},
					{
						"key": "Authorization",
						"value": "Basic YWRtaW46YWRtaW4="
					}
				],
				"body": {
					"mode": "raw",
					"raw": "<ipv4-route xmlns=\"urn:opendaylight:params:xml:ns:yang:bgp-inet\">\n    <route-key>10.0.0.11/32</route-key>\n    <path-id>0</path-id>\n    <prefix>10.0.0.11/32</prefix>\n    <attributes>\n        <as-path></as-path>\n        <origin>\n            <value>igp</value>\n        </origin>\n        <local-pref>\n            <pref>100</pref>\n        </local-pref>\n        <ipv4-next-hop>\n            <global>10.11.1.1</global>\n        </ipv4-next-hop>\n    </attributes>\n</ipv4-route>"
				},
				"url": {
					"raw": "http://localhost:8183/restconf/config/bgp-rib:application-rib/127.0.0.1/tables/bgp-types:ipv4-address-family/bgp-types:unicast-subsequent-address-family/bgp-inet:ipv4-routes/ipv4-route/10.0.0.11%2F32/0",
					"protocol": "http",
					"host": [
						"localhost"
					],
					"port": "8183",
					"path": [
						"restconf",
						"config",
						"bgp-rib:application-rib",
						"127.0.0.1",
						"tables",
						"bgp-types:ipv4-address-family",
						"bgp-types:unicast-subsequent-address-family",
						"bgp-inet:ipv4-routes",
						"ipv4-route",
						"10.0.0.11%2F32",
						"0"
					]
				}
			},
			"response": []
		},
		{
			"name": "show 127.0.0.2 peer's adj-rib-out",
			"request": {
				"method": "GET",
				"header": [
					{
						"key": "Content-Type",
						"value": "application/xml"
					},
					{
						"key": "Authorization",
						"value": "Basic YWRtaW46YWRtaW4="
					}
				],
				"body": {
					"mode": "raw",
					"raw": ""
				},
				"url": {
					"raw": "http://localhost:8183/restconf/operational/bgp-rib:bgp-rib/rib/hc-bgp-instance/peer/bgp:%2F%2F127.0.0.2/adj-rib-out/tables/bgp-types:ipv4-address-family/bgp-types:unicast-subsequent-address-family/bgp-inet:ipv4-routes",
					"protocol": "http",
					"host": [
						"localhost"
					],
					"port": "8183",
					"path": [
						"restconf",
						"operational",
						"bgp-rib:bgp-rib",
						"rib",
						"hc-bgp-instance",
						"peer",
						"bgp:%2F%2F127.0.0.2",
						"adj-rib-out",
						"tables",
						"bgp-types:ipv4-address-family",
						"bgp-types:unicast-subsequent-address-family",
						"bgp-inet:ipv4-routes"
					]
				}
			},
			"response": []
		},
		{
			"name": "show speeker's Loc-RIB",
			"request": {
				"method": "GET",
				"header": [
					{
						"key": "Content-Type",
						"value": "application/xml"
					},
					{
						"key": "Authorization",
						"value": "Basic YWRtaW46YWRtaW4="
					}
				],
				"body": {
					"mode": "raw",
					"raw": ""
				},
				"url": {
					"raw": "http://localhost:8183/restconf/operational/bgp-rib:bgp-rib/rib/hc-bgp-instance/loc-rib",
					"protocol": "http",
					"host": [
						"localhost"
					],
					"port": "8183",
					"path": [
						"restconf",
						"operational",
						"bgp-rib:bgp-rib",
						"rib",
						"hc-bgp-instance",
						"loc-rib"
					]
				}
			},
			"response": []
		},
		{
			"name": "add another ipv4unicast route",
			"request": {
				"method": "PUT",
				"header": [
					{
						"key": "Content-Type",
						"value": "application/xml"
					},
					{
						"key": "Authorization",
						"value": "Basic YWRtaW46YWRtaW4="
					}
				],
				"body": {
					"mode": "raw",
					"raw": "<ipv4-route xmlns=\"urn:opendaylight:params:xml:ns:yang:bgp-inet\">\n    <route-key>10.0.0.12/32</route-key>\n    <path-id>0</path-id>\n    <prefix>10.0.0.12/32</prefix>\n    <attributes>\n        <as-path></as-path>\n        <origin>\n            <value>igp</value>\n        </origin>\n        <local-pref>\n            <pref>100</pref>\n        </local-pref>\n        <ipv4-next-hop>\n            <global>10.11.1.1</global>\n        </ipv4-next-hop>\n    </attributes>\n</ipv4-route>"
				},
				"url": {
					"raw": "http://localhost:8183/restconf/config/bgp-rib:application-rib/127.0.0.1/tables/bgp-types:ipv4-address-family/bgp-types:unicast-subsequent-address-family/bgp-inet:ipv4-routes/ipv4-route/10.0.0.12%2F32/0",
					"protocol": "http",
					"host": [
						"localhost"
					],
					"port": "8183",
					"path": [
						"restconf",
						"config",
						"bgp-rib:application-rib",
						"127.0.0.1",
						"tables",
						"bgp-types:ipv4-address-family",
						"bgp-types:unicast-subsequent-address-family",
						"bgp-inet:ipv4-routes",
						"ipv4-route",
						"10.0.0.12%2F32",
						"0"
					]
				}
			},
			"response": []
		},
		{
			"name": "get VPP IPv4 routes",
			"request": {
				"method": "GET",
				"header": [
					{
						"key": "Authorization",
						"value": "Basic YWRtaW46YWRtaW4="
					},
					{
						"key": "Content-Type",
						"value": "application/json"
					}
				],
				"body": {
					"mode": "raw",
					"raw": ""
				},
				"url": {
					"raw": "http://localhost:8183/restconf/operational/hc2vpp-ietf-routing:routing/control-plane-protocols/control-plane-protocol/hc2vpp-ietf-routing:static/learned-protocol-0/static-routes/ipv4",
					"protocol": "http",
					"host": [
						"localhost"
					],
					"port": "8183",
					"path": [
						"restconf",
						"operational",
						"hc2vpp-ietf-routing:routing",
						"control-plane-protocols",
						"control-plane-protocol",
						"hc2vpp-ietf-routing:static",
						"learned-protocol-0",
						"static-routes",
						"ipv4"
					]
				}
			},
			"response": []
		},
		{
			"name": "update second ipv4unicast route",
			"request": {
				"method": "PUT",
				"header": [
					{
						"key": "Content-Type",
						"value": "application/xml"
					},
					{
						"key": "Authorization",
						"value": "Basic YWRtaW46YWRtaW4="
					}
				],
				"body": {
					"mode": "raw",
					"raw": "<ipv4-route xmlns=\"urn:opendaylight:params:xml:ns:yang:bgp-inet\">\n    <route-key>10.0.0.12/32</route-key>\n    <path-id>0</path-id>\n    <prefix>10.0.0.12/32</prefix>\n    <attributes>\n        <as-path></as-path>\n        <origin>\n            <value>igp</value>\n        </origin>\n        <local-pref>\n            <pref>102</pref>\n        </local-pref>\n        <ipv4-next-hop>\n            <global>10.11.1.1</global>\n        </ipv4-next-hop>\n    </attributes>\n</ipv4-route>"
				},
				"url": {
					"raw": "http://localhost:8183/restconf/config/bgp-rib:application-rib/127.0.0.1/tables/bgp-types:ipv4-address-family/bgp-types:unicast-subsequent-address-family/bgp-inet:ipv4-routes/ipv4-route/10.0.0.12%2F32/0",
					"protocol": "http",
					"host": [
						"localhost"
					],
					"port": "8183",
					"path": [
						"restconf",
						"config",
						"bgp-rib:application-rib",
						"127.0.0.1",
						"tables",
						"bgp-types:ipv4-address-family",
						"bgp-types:unicast-subsequent-address-family",
						"bgp-inet:ipv4-routes",
						"ipv4-route",
						"10.0.0.12%2F32",
						"0"
					]
				}
			},
			"response": []
		},
		{
			"name": "remove second ipv4unicast route",
			"request": {
				"method": "DELETE",
				"header": [
					{
						"key": "Content-Type",
						"value": "application/xml"
					},
					{
						"key": "Authorization",
						"value": "Basic YWRtaW46YWRtaW4="
					}
				],
				"body": {
					"mode": "raw",
					"raw": ""
				},
				"url": {
					"raw": "http://localhost:8183/restconf/config/bgp-rib:application-rib/127.0.0.1/tables/bgp-types:ipv4-address-family/bgp-types:unicast-subsequent-address-family/bgp-inet:ipv4-routes/ipv4-route/10.0.0.12%2F32/0",
					"protocol": "http",
					"host": [
						"localhost"
					],
					"port": "8183",
					"path": [
						"restconf",
						"config",
						"bgp-rib:application-rib",
						"127.0.0.1",
						"tables",
						"bgp-types:ipv4-address-family",
						"bgp-types:unicast-subsequent-address-family",
						"bgp-inet:ipv4-routes",
						"ipv4-route",
						"10.0.0.12%2F32",
						"0"
					]
				}
			},
			"response": []
		},
		{
			"name": "update bgp peer",
			"request": {
				"method": "PUT",
				"header": [
					{
						"key": "Content-Type",
						"value": "application/json"
					},
					{
						"key": "Authorization",
						"value": "Basic YWRtaW46YWRtaW4="
					}
				],
				"body": {
					"mode": "raw",
					"raw": "{\n  \"neighbor\": {\n    \"neighbor-address\": \"127.0.0.2\",\n    \"config\": {\n      \"peer-type\": \"INTERNAL\"\n  },\n  \"timers\": {\n    \"config\": {\n      \"connect-retry\": 10,\n      \"hold-time\": 91\n    }\n  },\n  \"transport\": {\n    \"config\": {\n      \"remote-port\": 17900,\n      \"passive-mode\": false\n    }\n  },\n  \"afi-safis\": {\n    \"afi-safi\": [\n      {\n        \"afi-safi-name\": \"openconfig-bgp-types:IPV4-UNICAST\"\n      }\n    ]\n  }\n}\n}"
				},
				"url": {
					"raw": "http://localhost:8183/restconf/config/openconfig-network-instance:network-instances/network-instance/global-bgp/openconfig-network-instance:protocols/protocol/openconfig-policy-types:BGP/hc-bgp-instance/bgp/bgp-openconfig-extensions:neighbors/neighbor/127.0.0.2",
					"protocol": "http",
					"host": [
						"localhost"
					],
					"port": "8183",
					"path": [
						"restconf",
						"config",
						"openconfig-network-instance:network-instances",
						"network-instance",
						"global-bgp",
						"openconfig-network-instance:protocols",
						"protocol",
						"openconfig-policy-types:BGP",
						"hc-bgp-instance",
						"bgp",
						"bgp-openconfig-extensions:neighbors",
						"neighbor",
						"127.0.0.2"
					]
				}
			},
			"response": []
		},
		{
			"name": "delete bgp peer",
			"request": {
				"method": "DELETE",
				"header": [
					{
						"key": "Content-Type",
						"value": "application/json"
					},
					{
						"key": "Authorization",
						"value": "Basic YWRtaW46YWRtaW4="
					}
				],
				"body": {
					"mode": "raw",
					"raw": ""
				},
				"url": {
					"raw": "http://localhost:8183/restconf/config/openconfig-network-instance:network-instances/network-instance/global-bgp/openconfig-network-instance:protocols/protocol/openconfig-policy-types:BGP/hc-bgp-instance/bgp/bgp-openconfig-extensions:neighbors/neighbor/127.0.0.2",
					"protocol": "http",
					"host": [
						"localhost"
					],
					"port": "8183",
					"path": [
						"restconf",
						"config",
						"openconfig-network-instance:network-instances",
						"network-instance",
						"global-bgp",
						"openconfig-network-instance:protocols",
						"protocol",
						"openconfig-policy-types:BGP",
						"hc-bgp-instance",
						"bgp",
						"bgp-openconfig-extensions:neighbors",
						"neighbor",
						"127.0.0.2"
					]
				}
			},
			"response": []
		}
	]
}