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

Compare with Current View Page History

« Previous Version 6 Next »

WADL

URL

http://hostname:8888/opennaas/resources?_wadl

Description
<?xml version="1.0" encoding="UTF-8"?>
<application xmlns="http://wadl.dev.java.net/2009/02" xmlns:xs="http://www.w3.org/2001/XMLSchema">
   <grammars>
      <xs:schema attributeFormDefault="unqualified" elementFormDefault="unqualified">
         <xs:element name="listResponse" type="listResponse" />
         <xs:element name="protocolSessionContext" type="protocolSessionContext" />
         <xs:complexType name="listResponse">
            <xs:sequence>
               <xs:element maxOccurs="unbounded" minOccurs="0" name="list" nillable="true" type="xs:anyType" />
            </xs:sequence>
         </xs:complexType>
         <xs:complexType name="protocolSessionContext">
            <xs:sequence>
               <xs:element name="sessionParameters">
                  <xs:complexType>
                     <xs:sequence>
                        <xs:element maxOccurs="unbounded" minOccurs="0" name="entry">
                           <xs:complexType>
                              <xs:sequence>
                                 <xs:element minOccurs="0" name="key" type="xs:string" />
                                 <xs:element minOccurs="0" name="value" type="xs:anyType" />
                              </xs:sequence>
                           </xs:complexType>
                        </xs:element>
                     </xs:sequence>
                  </xs:complexType>
               </xs:element>
            </xs:sequence>
         </xs:complexType>
      </xs:schema>
   </grammars>
   <resources base="http://localhost:8888/opennaas/router/myre/protocolSessionManager/">
      <resource path="/">
         <resource path="context/">
            <method name="GET">
               <response>
                  <representation mediaType="application/xml" />
               </response>
            </method>
         </resource>
         <resource path="context/register">
            <method name="POST">
               <request>
                  <representation mediaType="application/octet-stream" />
               </request>
               <response status="204" />
            </method>
         </resource>
         <resource path="context/unregister">
            <method name="POST">
               <request>
                  <representation mediaType="application/xml" />
               </request>
               <response status="204" />
            </method>
         </resource>
         <resource path="context/{protocol}">
            <param name="protocol" style="template" type="xs:string" />
            <method name="DELETE">
               <request />
               <response status="204" />
            </method>
         </resource>
         <resource path="session/">
            <method name="GET">
               <response>
                  <representation mediaType="application/xml" />
               </response>
            </method>
         </resource>
         <resource path="session/{sessionId}">
            <param name="sessionId" style="template" type="xs:string" />
            <method name="DELETE">
               <request />
               <response status="204" />
            </method>
         </resource>
         <resource path="session/{sessionId}/locked">
            <param name="sessionId" style="template" type="xs:string" />
            <method name="GET">
               <request />
               <response>
                  <representation mediaType="application/octet-stream">
                     <param name="result" style="plain" type="xs:boolean" />
                  </representation>
               </response>
            </method>
         </resource>
      </resource>
   </resources>
</application>

 

Methods

 

RegisterContext

 

Registers a new context on the resource's session manager. The context will be used if a session with the context's protocol is requested.

 ValueDescription
URLhttp://hostname:8888/opennaas/{resourceType}/{resourceName}/protocolSessionManager/context/register 
Method

POST

 
Body ParameterProtocolSessionContextProtocolSessionContext containing all necessary information to communicate with the real device.
Return- 
Body Example

Following example shows how to send sesessionParameters of the protocolSessionContext. It registers a protocolSessionContext of netconf protocol using username and password as credentials.

 

<?xml version="1.0" encoding="UTF-8"?>
<protocolSessionContext>
   <sessionParameters>
      <entry>
         <key>protocol.authType</key>
         <value xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="xs:string">password</value>
      </entry>
      <entry>
         <key>protocol</key>
         <value xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="xs:string">netconf</value>
      </entry>
      <entry>
         <key>protocol.password</key>
         <value xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="xs:string">my_pass</value>
      </entry>
      <entry>
         <key>protocol.username</key>
         <value xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="xs:string">my_username</value>
      </entry>
      <entry>
         <key>protocol.uri</key>
         <value xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="xs:string">ssh://my_username:my_pass@my_router_address/netconf</value>
      </entry>
   </sessionParameters>
</protocolSessionContext>

 

 

 

  • No labels