The complete IP Capability API (methods and types) is defined in following WADL file:

<application xmlns="http://wadl.dev.java.net/2009/02" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:prefix1="opennaas.api">
  <grammars>
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="opennaas.api" attributeFormDefault="unqualified" elementFormDefault="unqualified" targetNamespace="opennaas.api">
<xs:import namespace=""/>
<xs:element name="interfaces" type="interfacesNamesList"/>
<xs:element name="ipAddresses" type="ipAddresses"/>
</xs:schema>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="opennaas.api" attributeFormDefault="unqualified" elementFormDefault="unqualified" targetNamespace="opennaas.api">
<xs:complexType name="interfacesNamesList">
<xs:sequence>
<xs:element maxOccurs="unbounded" minOccurs="0" name="interface" type="xs:string"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="ipAddresses">
<xs:sequence>
<xs:element maxOccurs="unbounded" minOccurs="0" name="ipAddress" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:schema>
</grammars>
    <resources base="http://localhost:8888/opennaas/router/myre/ip/">
      <resource path="/">
        <resource path="interfaces">
          <method name="GET">
            <response>
              <representation mediaType="application/xml" element="prefix1:interfaces"/>
            </response>
          </method>
        </resource>
        <resource path="interfaces/addresses">
          <method name="GET">
            <request>
              <param name="interface" style="query" type="xs:string"/>
            </request>
            <response>
              <representation mediaType="application/xml" element="prefix1:ipAddresses"/>
            </response>
          </method>
        </resource>
        <resource path="interfaces/addresses/ip">
          <method name="DELETE">
            <request>
              <param name="interface" style="query" type="xs:string"/>
              <param name="ip" style="query" type="xs:string"/>
            </request>
            <response status="204">
            </response>
          </method>
          <method name="POST">
            <request>
              <param name="interface" style="query" type="xs:string"/>
              <representation mediaType="application/xml">
                <param name="request" style="plain" type="xs:string"/>
              </representation>
            </request>
            <response status="204">
            </response>
          </method>
          <method name="PUT">
            <request>
              <param name="interface" style="query" type="xs:string"/>
              <representation mediaType="application/xml">
                <param name="request" style="plain" type="xs:string"/>
              </representation>
            </request>
            <response status="204">
            </response>
          </method>
        </resource>
        <resource path="interfaces/addresses/ipv4">
          <method name="DELETE">
            <request>
              <param name="interface" style="query" type="xs:string"/>
              <param name="ip" style="query" type="xs:string"/>
            </request>
            <response status="204">
            </response>
          </method>
          <method name="POST">
            <request>
              <param name="interface" style="query" type="xs:string"/>
              <representation mediaType="application/xml">
                <param name="request" style="plain" type="xs:string"/>
              </representation>
            </request>
            <response status="204">
            </response>
          </method>
          <method name="PUT">
            <request>
              <param name="interface" style="query" type="xs:string"/>
              <representation mediaType="application/xml">
                <param name="request" style="plain" type="xs:string"/>
              </representation>
            </request>
            <response status="204">
            </response>
          </method>
        </resource>
        <resource path="interfaces/addresses/ipv6">
          <method name="DELETE">
            <request>
              <param name="interface" style="query" type="xs:string"/>
              <param name="ip" style="query" type="xs:string"/>
            </request>
            <response status="204">
            </response>
          </method>
          <method name="POST">
            <request>
              <param name="interface" style="query" type="xs:string"/>
              <representation mediaType="application/xml">
                <param name="request" style="plain" type="xs:string"/>
              </representation>
            </request>
            <response status="204">
            </response>
          </method>
          <method name="PUT">
            <request>
              <param name="interface" style="query" type="xs:string"/>
              <representation mediaType="application/xml">
                <param name="request" style="plain" type="xs:string"/>
              </representation>
            </request>
            <response status="204">
            </response>
          </method>
        </resource>
        <resource path="interfaces/description">
          <method name="GET">
            <request>
              <param name="interface" style="query" type="xs:string"/>
            </request>
            <response>
              <representation mediaType="application/xml">
                <param name="result" style="plain" type="xs:string"/>
              </representation>
            </response>
          </method>
          <method name="POST">
            <request>
              <param name="interface" style="query" type="xs:string"/>
              <representation mediaType="application/xml">
                <param name="request" style="plain" type="xs:string"/>
              </representation>
            </request>
            <response status="204">
            </response>
          </method>
        </resource>
      </resource>
    </resources>
  </application>

Methods

Remember to execute the queue in order to apply setter methods to the physical device.

GetInterfaces

Returns the list of interfaces (names).

 ValueDescription
URL

http://hostname:8888/opennaas/router
/{resourceName}/ip/interfaces

 
Method

GET

 
Body Parameter- 
ReturnInterfacesNamesListA 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

 ValueDescription
URL

http://hostname:8888/opennaas/router
/{resourceName}/ip/interfaces
/description?interface={interfaceName}

 
Method

GET

 
Body Parameter- 
Query Parameterinterface={interfaceName}The name of the interface this operation applies to
ReturnGiven interface description 
Return example:
An interface to nowhere

 

SetDescription

 ValueDescription
URL

http://hostname:8888/opennaas/router
/{resourceName}/ip/interfaces
/description?interface={interfaceName}

 
MethodPOST 
Body ParameterDescriptionThe description to set
Query Parameterinterface={interfaceName}The name of the interface this operation applies to
Return- 
Body sample:
An interface to nowhere

 

GetIPs

 ValueDescription
URL

http://hostname:8888/opennaas/router
/{resourceName}/ip/interfaces
/addresses?interface={interfaceName}

 
MethodGET 
Body Parameter--
Query Parameterinterface={interfaceName}The name of the interface this operation applies to
ReturnIPAddressesList 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.

 ValueDescription
URLhttp://hostname:8888/opennaas/router/{resourceName}/ip/interfaces/addresses/ip?interface={interfaceName} 
Method

POST

 
Body ParameterIPAddressIP address to set with netmask prefix. (ipv4 and ipv6 supported). e.g. 192.168.50.10/24
Query Parameterinterface={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.

 ValueDescription
URLhttp://hostname:8888/opennaas/router/{resourceName}/ip/interfaces/addresses/ip?interface={interfaceName} 
Method

PUT

 
Body ParameterIPAddressIP address to set with netmask prefix. (ipv4 and ipv6 supported). e.g. 192.168.50.10/24
Query Parameterinterface={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

AddIPv4 URL: http://hostname:8888/opennaas/router/{resourceName}/ip/interfaces/addresses/ipv4?interface={interfaceName}

AddIPv6 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.

 ValueDescription
URLhttp://hostname:8888/opennaas/router/{resourceName}/ip/interfaces/addresses/ip?interface={interfaceName}&ip={ipAddress} 
MethodDELETE 
Body Parameter- 
Query Parameterinterface={interfaceName}The name of the interface this operation applies to
Query Parameterip={ipAddress}IP address to delete with netmask prefix. (ipv4 and ipv6 supported). e.g. 192.168.50.10/24
Return- 

 

RemoveIPv4 and RemoveIPv6

These methods have the same logic than RemoveIP but for a specific IP version. Their usage is exactly the same that RemoveIP but they have different URLs

RemoveIPv4 URL: http://hostname:8888/opennaas/router/{resourceName}/ip/interfaces/addresses/ipv4?interface={interfaceName}

RemoveIPv6 URL: http://hostname:8888/opennaas/router/{resourceName}/ip/interfaces/addresses/ipv6?interface={interfaceName}

 

  • No labels