Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Add wadl

 

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

Code Block
themeEclipse
languagehtml/xml
<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

Note

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

 

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.

...