This section provides the Representational State Transfer Configuration Protocol (RESTCONF) API sections for the VRF CLI commands.
https://$ip:8080/rest/restconf/data/openconfig-network-instance:network-instances/network-instance=%s/config
Use this API operation to do the following:
Create a VRF and configure parameters, such as VRF name, IP VPN status, and I-SID.
Configure an IP VPN to enabled does both (CLI): ipvpn and ipvpn enable.
Sample server response:
{ "openconfig-network-instance:config": { "name": "<VRF name>", "ipvpn":"<IpVpn status>", "nsi":"<network service ID(I-SID)>" } }
To access the top-level interfaces resource within the openconfig-network-instance YANG model, use the following URL:
https://$ip:8080/rest/restconf/data/openconfig-network-instance:network-instances/network-instance=%s
Use this API operation to do the following:
Create a VRF and configure parameters, such as VRF name, IP VPN status, I-SID.
Configure an IP VPN to enabled does both (CLI): ipvpn and ipvpn enable.
Sample server response:
{ "openconfig-network-instance:network-instance": { "config": { "name": "<VRF name>", "ipvpn":"<IpVpn status>", "nsi":"<network service ID(I-SID)>" } } }
To access the top-level interfaces resource within the openconfig-network-instance YANG model, use the following URL:
https://$ip:8080/rest/restconf/data/openconfig-network-instance:network-instances/network-instance=%s/vlans/vlan=%s/config
Use this API operation to do the following:
Associate an existing VLAN with VRF.
Create an I-SID of type CVLAN. In CLI: vlan i-sid <vid> <i-sid>
Sample server response:
{ "openconfig-network-instance:config ": { "nsi":<c-vlan i-sid> } }
To access the top-level interfaces resource within the openconfig-network-instance YANG model, use the following URL:
https://$ip:8080/rest/restconf/data/openconfig-network-instance:network-instances/network-instance=%s/vlans/vlan=<VLAN ID>
Use this API operation to do the following:
Associate an existing VLAN with VRF.
Create an I-SID of type CVLAN. In CLI: vlan i-sid <vid> <i-sid>
Sample server response:
{ "openconfig-network-instance:vlan ": { "config": { "nsi":<c-vlan i-sid> } } }
To access the top-level interfaces resource within the openconfig-network-instance YANG model, use the following URL:
https://$ip:8080/rest/restconf/data/openconfig-network-instance:network-instances/network-instance=%s/vlans
Use this API operation to do the following:
Associate an existing VLAN with VRF.
Create an I-SID of type CVLAN. In CLI: vlan i-sid <vid> <i-sid>
Sample server response:
{ "openconfig-network-instance:vlans ": { "vlan": { "config": { "vlan-id": <VLAN ID>, "nsi":<c-vlan i-sid> } } } }
To access the top-level interfaces resource within the openconfig-network-instance YANG model, use the following URL:
https://$ip:8080/rest/restconf/data/openconfig-network-instance:network-instances/network-instance=<VRF ID or name>/ dhcp-relay/forward-path=<agent address>%26<server address>/config
Use this API operation to do the following:
Configure DHCP-relay in a VRF instance.
Create a new forward path.
Forward path is passed in the URL as: <agent
address>%26server address>
.
%26
is &
URL encoded.
For example:
https://$ip:8080/rest/restconf/data/openconfig-network-instance:network-instances/ network-instance=1/dhcp-relay/forward-path=10.1.1.1%2610.1.1
Sample server response:
{ "openconfig-network-instance:config": { "agent-address ": "<agent address>", "server-address ":"<server address>", "enable":"<true | false>", "mode":"DHCP | BOOTP | BOTH" } }
To access the top-level interfaces resource within the openconfig-network-instance YANG model, use the following URL:
https://$ip:8080/rest/restconf/data/openconfig-network-instance:network-instances/network-instance=%s/dhcp-relay/forward-path=<agent address>%26<server address>
Use this API operation to do the following:
Configure DHCP-relay in a VRF instance.
Create a new forward path.
Forward path is passed in the URL as: <agent
address>%26server address>
.
%26
is &
URL encoded.
Sample server response:
{ "openconfig-network-instance:config": { "agent-address ": "<agent address>", "server-address ":"<server address>", "enable":"<true | false>", "mode":"DHCP | BOOTP | BOTH" } }
To access the top-level interfaces resource within the openconfig-network-instance YANG model, use the following URL:
https://$ip:8080/rest/restconf/data/openconfig-network-instance:network-instances/network-instance=%s/dhcp-relay
Use this API operation to do the following:
Configure DHCP-relay in a VRF instance.
Create a new forward path.
Sample server response:
{ "openconfig-network-instance:config": { "forward-path ": { "config": { "agent-address ": "<agent address>", "server-address ":"<server address>", "enable":"<true | false>", "mode":"DHCP | BOOTP | BOTH" } } { }
To access the top-level interfaces resource within the openconfig-network-instance YANG model, use the following URL:
https://$ip:8080/rest/restconf/data/openconfig-network-instance:network-instances/network-instance=%s/protocols/protocol=%s/config
Use this API operation to do the following:
Configure IS-IS redistribute parameters.
Protocol instance is: identifier
(protocol type:
DIRECTLY_CONNECTED) + name
(a unique name for the
protocol instance).
enabled parameter does (CLI): isis redistribute direct enable on router VRF + isis apply redistribute direct vrf cip.
Sample server response:
{ "openconfig-network-instance:config": { "enabled":"<true | false>", "default-metric":"<metric>" } }
To access the top-level interfaces resource within the openconfig-network-instance YANG model, use the following URLs:
https://$ip:8080/rest/restconf/data/openconfig-network-instance:network-instances/network-instance=%s- >VRF name/VFR ID
https://$ip:8080/rest/restconf/data/openconfig-network-instance:network-instances/network-instance=%s/config- >VRF name/VFR ID
https://$ip:8080/rest/restconf/data/openconfig-network-instance:network-instances/network-instance=%s/state- >VRF name/VFR ID
https://$ip:8080/rest/restconf/data/openconfig-network-instance:network-instances/network-instance= VRF name or name
https://$ip:8080/rest/restconf/data/openconfig-network-instance:network-instances/network-instance=<VRF ID or name>/vlans
https://$ip:8080/rest/restconf/data/openconfig-network-instance:network-instances/network-instance=<VRF ID or name>/vlans/vlan=<VLAN ID>
https://$ip:8080/rest/restconf/data/openconfig-network-instance:network-instances/network-instance=<VRF ID or name>/vlans/vlan=<VLAN ID>/state
https://$ip:8080/rest/restconf/data/openconfig-network-instance:network-instances/network-instance=<VRF ID or name>/vlans/vlan=<VLAN ID>/config
https://$ip:8080/rest/restconf/data/openconfig-network-instance:network-instances/network-instance=<VRF ID or name>/protocols/protocol=<protocol identifier>
https://$ip:8080/rest/restconf/data/openconfig-network-instance:network-instances/network-instance=<VRF ID or name>/protocols/protocol=<protocol identifier>/state
https://$ip:8080/rest/restconf/data/openconfig-network-instance:network-instances/network-instance=<VRF ID or name>/protocols/protocol=<protocol identifier>/config
https://$ip:8080/rest/restconf/data/openconfig-network-instance:network-instances/network-instance=<VRF ID or name>/dhcp-relay
Note
DHCP relay forward path identifier: agent + server addresses, is passed
through URL as: server address>%26<agent address>
. Where
%26
is encoded value for &
.
https://$ip:8080/rest/restconf/data/openconfig-network-instance:network-instances/network-instance=<VRF ID or name>/dhcp-relay/forward-path=<agent address>%26<server address>
https://$ip:8080/rest/restconf/data/openconfig-network-instance:network-instances/network-instance=<VRF ID or name>/dhcp-relay/forward-path=<server address>%26<agent address>
https://$ip:8080/rest/restconf/data/openconfig-network-instance:network-instances/network-instance=<VRF ID or name>/dhcp-relay/forward-path=<server address>%26<agent address>/config
https://$ip:8080/rest/restconf/data/openconfig-network-instance:network-instances/network-instance=<VRF ID or name>/dhcp-relay/forward-path=<server address>%26<agent address>/state
Use this API operation to do the following:
Get VRF configuration.
Sample server response:
Based on Yang Model
To access the top-level interfaces resource within the openconfig-network-instance YANG model, use the following URL:
https://$ip:8080/rest/restconf/data/openconfig-network-instance:network-instances/network-instance=%s
Use this API operation to do the following:
Remove VRF.
To access the top-level interfaces resource within the openconfig-network-instance YANG model, use the following URL:
https://$ip:8080/rest/restconf/data/openconfig-network-instance:network-instances/network-instance=%s/vlans/vlan=%d
Use this API operation to do the following:
Remove VLAN association with a given VRF.
To access the top-level interfaces resource within the openconfig-network-instance YANG model, use the following URL:
https://$ip:8080/rest/restconf/data/openconfig-network-instance:network-instances/network-instance=%s/dhcp-relay/forward-path=%s
Use this API operation to do the following:
Remove VLAN association with a given VRF.
DHCP relay forward path identifier: agent + server addresses, is
passed through URL as: server address>%26<agent
address>
. Where %26
is encoded value
for &
.
https://$ip:8080/rest/restconf/data/openconfig-network-instance:network-instances/network-instance=<VRF ID or name>/dhcp-relay/forward-path=<agent address>%26<server address>
To access the top-level interfaces resource within the openconfig-network-instance YANG model, use the following URL:
https://$ip:8080/rest/restconf/data/openconfig-network-instance:network-instances/network-instance=%s/protocols/protocol=%s
Use this API operation to do the following:
Remove IS-IS redistribute configuration on a given VRF.