You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 15 Next »

 

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="opennaaas.api">
  <grammars>
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="opennaaas.api" attributeFormDefault="unqualified" elementFormDefault="unqualified" targetNamespace="opennaaas.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="opennaaas.api" attributeFormDefault="unqualified" elementFormDefault="unqualified" targetNamespace="opennaaas.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 

 

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- 

 

SetIP

The SetIP method inserts the given IP in the specific interface, replacing the existing ones (if any). It means, old addresses of the IP 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/setIP 
Method

POST

 
Body ParameterSetIPAddressRequestIpAddressRequest, containing the LogicalDevice where to set the IP address and the IPProtocolEndpoint, containing the new address of the logical device (ipv4 and ipv6 supported)
Return- 
Body Example

Following example would set 192.168.1.111/24 address to interface fe-0/3/3.1

<?xml version="1.0" encoding="UTF-8"?>
<setIpAddressRequest>
   <ipProtocolEndpoint>
      <IPv4Address>192.168.1.111</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>

 

SetIPv4

The SetIPv4 method inserts the given IP in the specific interface, replacing the existing ones (if any). It means, old addresses of the IP will be removed and it will contain only the new one. It accepts only IPv4 addresses.

 ValueDescription
URLhttp://hostname:8888/opennaas/router/{resourceName}/ip/setIPv4 
Method

POST

 
Body ParameterSetIPAddressRequestIpAddressRequest, containing the LogicalDevice where to set the IP address and the IPProtocolEndpoint, containing the new address of the logical device (only ipv4)
Return- 
Body Example

Following example would set 192.168.1.111/24 address to interface fe-0/3/3.1

<?xml version="1.0" encoding="UTF-8"?>
<setIpAddressRequest>
   <ipProtocolEndpoint>
      <IPv4Address>192.168.1.111</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>

 

SetIPv6

The SetIPv4 method inserts the given IP in the specific interface, replacing the existing ones (if any). It means, old addresses of the IP will be removed and it will contain only the new one. It accepts only IPv4 addresses.

 ValueDescription
URLhttp://hostname:8888/opennaas/router/{resourceName}/ip/setIPv6 
Method

POST

 
Body ParameterSetIPAddressRequestIpAddressRequest, containing the LogicalDevice where to set the IP address and the IPProtocolEndpoint, containing the new address of the logical device (ipv6 only)
Return- 

 

Body Example

Following example would set 2067:f0d0:1002:51::4/32 address to 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>

 

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.

 ValueDescription
URL

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

 
Method

POST

 
Body ParameterSetIPAddressRequestIpAddressRequest, containing the LogicalDevice where to add the IP address and the IPProtocolEndpoint, containing the new address to be added in the logical device.
Return- 
Body Example

Following example would add 192.168.1.112/24 address to 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>

 

AddIPv4

The AddIPv4 method aggregates a new IP to the list of existing addresses of the specific interface. It accepts ipv4 addresses only.

 ValueDescription
URL

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

 
Method

POST

 
Body ParameterSetIPAddressRequestIpAddressRequest, containing the LogicalDevice where to add the IPv4 address and the IPProtocolEndpoint, containing the new ipv4 address to be added in the logical device.
Return- 
Body Example

Following example would add 192.168.1.112/24 address to 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>

 

AddIPv6

The AddIPv6 method aggregates a new IP to the list of existing addresses of the specific interface. It accepts ipv6 addresses only.

 ValueDescription
URL

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

 
Method

POST

 
Body ParameterSetIPAddressRequestIpAddressRequest, containing the LogicalDevice where to add the IPv6 address and the IPProtocolEndpoint, containing the new ipv6 address to be added in the logical device.
Return- 
Body Example

Following example would add 2067:f0d0:1002:51::4/32 address to 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>

 

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
URL

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

 
Method

POST

 
Body ParameterSetIPAddressRequestIpAddressRequest, 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.

 ValueDescription
URL

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

 
Method

POST

 
Body ParameterSetIPAddressRequestIpAddressRequest, 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.

 ValueDescription
URL

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

 
Method

POST

 
Body ParameterSetIPAddressRequestIpAddressRequest, 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.

 ValueDescription
URL

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

 
Method

POST

 
Body ParameterLogicalPortLogicalPort 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>
  • No labels