The complete IP Capability API (methods and types) is defined in following WADL file:
Methods
Remember to execute the queue in order to apply setter methods to the physical device.
GetInterfaces
Returns the list of interfaces (names).
Value | Description | |
---|---|---|
URL | http://hostname:8888/opennaas/router | |
Method | GET | |
Body Parameter | - | |
Return | InterfacesNamesList | A list containing the name of all available interfaces. |
Return example:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <ns2:interfaces xmlns:ns2="opennaas.api"> <interface>fe-2/0/1.0</interface> <interface>fe-2/0/1.1</interface> <interface>fe-2/0/1.2</interface> <interface>ge-1/0/0.0</interface> </ns2:interfaces>
GetDescription
Value | Description | |
---|---|---|
URL | http://hostname:8888/opennaas/router | |
Method | GET | |
Body Parameter | - | |
Query Parameter | interface={interfaceName} | The name of the interface this operation applies to |
Return | Given interface description |
Return example:
An interface to nowhere
SetDescription
Value | Description | |
---|---|---|
URL | http://hostname:8888/opennaas/router | |
Method | POST | |
Body Parameter | Description | The description to set |
Query Parameter | interface={interfaceName} | The name of the interface this operation applies to |
Return | - |
Body sample:
An interface to nowhere
GetIPs
Value | Description | |
---|---|---|
URL | http://hostname:8888/opennaas/router | |
Method | GET | |
Body Parameter | - | - |
Query Parameter | interface={interfaceName} | The name of the interface this operation applies to |
Return | IPAddresses | List of IP addresses (ipv4 and ipv6) given interface has |
Return example:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <ns2:ipAddresses xmlns:ns2="opennaas.api"> <ipAddress>192.168.10.10/24</ipAddress> </ns2:ipAddresses>
SetIP
The SetIP method inserts the given IP in the specific interface, replacing the existing ones (if any) in the same family (either ipv4 or ipv6). It means, old IP addresses of the interface will be removed and it will contain only the new one. It accepts both ipv4 and ipv6 addresses.
Value | Description | |
---|---|---|
URL | http://hostname:8888/opennaas/router/{resourceName}/ip/interfaces/addresses/ip?interface={interfaceName} | |
Method | POST | |
Body Parameter | IPAddress | IP address to set with netmask prefix. (ipv4 and ipv6 supported). e.g. 192.168.50.10/24 |
Query Parameter | interface={interfaceName} | The name of the interface this operation applies to |
Return | - |
Body Example
Following example would set 192.168.50.10/24 address to interface specified in the query parameter.
192.168.50.10/24
SetIPv4 and SetIPv6
These methods have the same logic than SetIP but for a specific IP version. Their usage is exactly the same that SetIP but they have different URLs
SetIPv4 URL: http://hostname:8888/opennaas/router/{resourceName}/ip/interfaces/addresses/ipv4?interface={interfaceName}
SetIPv6 URL: http://hostname:8888/opennaas/router/{resourceName}/ip/interfaces/addresses/ipv6?interface={interfaceName}
AddIP
The AddIP method aggregates a new IP to the list of existing addresses of the specific interface. It accepts both ipv4 and ipv6 addresses.
This method has same syntax than SetIP but differs in the HTTP method, which has to be set to PUT.
Value | Description | |
---|---|---|
URL | http://hostname:8888/opennaas/router/{resourceName}/ip/interfaces/addresses/ip?interface={interfaceName} | |
Method | PUT | |
Body Parameter | IPAddress | IP address to set with netmask prefix. (ipv4 and ipv6 supported). e.g. 192.168.50.10/24 |
Query Parameter | interface={interfaceName} | The name of the interface this operation applies to |
Return | - |
Body Example
Following example would add 192.168.50.10/24 address to interface specified in the query parameter.
192.168.50.10/24
AddIPv4 and AddIPv6
These methods have the same logic than AddIP but for a specific IP version. Their usage is exactly the same that AddIP but they have different URLs
SetIPv4 URL: http://hostname:8888/opennaas/router/{resourceName}/ip/interfaces/addresses/ipv4?interface={interfaceName}
SetIPv6 URL: http://hostname:8888/opennaas/router/{resourceName}/ip/interfaces/addresses/ipv6?interface={interfaceName}
RemoveIP
The RemoveIP method deletes an existing IP of the list of addresses of the specific interface. It accepts both ipv4 and ipv6 addresses.
Value | Description | |
---|---|---|
URL | http://hostname:8888/opennaas/router/{resourceName}/ip/removeIP | |
Method | POST | |
Body Parameter | SetIPAddressRequest | IpAddressRequest, containing the LogicalDevice where to remove the IP address and the IPProtocolEndpoint, containing the ip address to be removed from the logical device. |
Return | - |
Body Example
Following example would remove 192.168.1.112/24 address from interface fe-0/3/3.1
<?xml version="1.0" encoding="UTF-8"?> <setIpAddressRequest> <ipProtocolEndpoint> <IPv4Address>192.168.1.112</IPv4Address> <subnetMask>255.255.255.0</subnetMask> </ipProtocolEndpoint> <logicalDevice xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="networkPort"> <name>fe-0/3/3</name> <portNumber>1</portNumber> </logicalDevice> </setIpAddressRequest>
RemoveIPv4
The RemoveIPv4 method deletes an existing IP of the list of ipv4 addresses of the specific interface. It accepts only ipv4 addresses.
Value | Description | |
---|---|---|
URL | http://hostname:8888/opennaas/router/{resourceName}/ip/removeIPv4 | |
Method | POST | |
Body Parameter | SetIPAddressRequest | IpAddressRequest, containing the LogicalDevice where to remove the IPv4 address and the IPProtocolEndpoint, containing the ipv4 address to be removed from the logical device. |
Return | - |
Body Example
Following example would remove 192.168.1.112/24 address from interface fe-0/3/3.1
<?xml version="1.0" encoding="UTF-8"?> <setIpAddressRequest> <ipProtocolEndpoint> <IPv4Address>192.168.1.112</IPv4Address> <subnetMask>255.255.255.0</subnetMask> </ipProtocolEndpoint> <logicalDevice xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="networkPort"> <name>fe-0/3/3</name> <portNumber>1</portNumber> </logicalDevice> </setIpAddressRequest>
RemoveIPv6
The RemoveIPv6 method deletes an existing IP of the list of ipv6 addresses of the specific interface. It accepts only ipv6 addresses.
Value | Description | |
---|---|---|
URL | http://hostname:8888/opennaas/router/{resourceName}/ip/removeIPv6 | |
Method | POST | |
Body Parameter | SetIPAddressRequest | IpAddressRequest, containing the LogicalDevice where to remove the IPv6 address and the IPProtocolEndpoint, containing the ipv6 address to be removed from the logical device. |
Return | - |
Body Example
Following example would remove 2607:f0d0:1002:51::4/32 address from interface fe-0/3/3.1
<?xml version="1.0" encoding="UTF-8"?> <setIpAddressRequest> <ipProtocolEndpoint> <IPv6Address>2607:f0d0:1002:51::4</IPv6Address> <prefixLength>32</prefixLength> </ipProtocolEndpoint> <logicalDevice xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="networkPort"> <name>fe-0/3/3</name> <portNumber>1</portNumber> </logicalDevice> </setIpAddressRequest>
SetInterfaceDescription
This method sets the specified description in a single interface.
Value | Description | |
---|---|---|
URL | http://hostname:8888/opennaas/router/{resourceName}/ip/setInterfaceDescription | |
Method | POST | |
Body Parameter | LogicalPort | LogicalPort contaning the name of the interface and the descrition to be set. |
Return | - |
Body Example
<?xml version="1.0" encoding="UTF-8"?> <logicalPort> <name>fe-0/3/3</name> <description>Interface connected to internet</description> </logicalPort>