Every resource in OpenNaaS contains its own ProtocolSessionManager. It's created once the user creates the resource. Therefore the URL of the ProtocolSessionManager of a single resource depends on the resource type and the resource name it belongs to.
WADL
URL
http://hostname:8888/opennaas/{resourceType}/{resourceName}/protocolSessionmanager?_wadl
Description
Methods
RegisterContext
Registers a new context on the resource's protocol session manager. The context will be used if a session with the context's protocol is requested.
Value | Description | |
---|---|---|
URL | http://hostname:8888/opennaas/{resourceType}/{resourceName}/protocolSessionManager/context/register | |
Method | POST | |
Body Parameter | ProtocolSessionContext | ProtocolSessionContext 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>
UnregisterContext
Unregisters an existing context of a specific protocol on the resource's protocol session manager.
Value | Description | |
---|---|---|
URL | http://hostname:8888/opennaas/{resourceType}/{resourceName}/protocolSessionManager/context/{protocol} | |
Method | DELETE | |
Path Parameter | String | Protocol which protocol context would be removed. For example, "netconf". |
Return | - |
GetRegisteredContexts
Returns the list of all registered protocolContext of the specific resource.
Value | Description | |
---|---|---|
URL | http://hostname:8888/opennaas/{resourceType}/{resourceName}/protocolSessionManager/context | |
Method | GET | |
Return | ProtocolSessionContexts | List of all protocolSessionContexts registered in the specific resource |
Response Example
Following response contains the protocolSessionContext we registered in the RegisterContext method.
<?xml version="1.0" encoding="UTF-8"?> <protocolSessionContexts> <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_passs</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_passs@my_device_address/netconf</value> </entry> </sessionParameters> </protocolSessionContext> </protocolSessionContexts>
GetAllProtocolSessionIds
Returns the ids of all live sessions of a specific resource.
Value | Description | |
---|---|---|
URL | http://hostname:8888/opennaas/{resourceType}/{resourceName}/protocolSessionManager/session | |
Method | GET | |
Return | ListResponse | List with the ids of all current resource live sessions. |
Response Example
Following response example show a list of two alive sessions for the specified resource.
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <sessionIdList> <session>4339a0a8-8454-4c56-acb0-d287ce16ee8b</session> <session>562avh48-8712-4h36-lo8j-hg65433hcb12</session> </sessionIdList>
DestroyProtocolSession
Removes a specific protocolSession from the list of live registered protocolSessions.
Value | Description | |
---|---|---|
URL | http://hostname:8888/opennaas/{resourceType}/{resourceName}/protocolSessionManager/session/{sessionId} | |
Method | DELETE | |
Body Parameter | sessionId | Id of the session to be removed. |
Return | - |
IsLocked
Checks if a given session id is locked.
Value | Description | |
---|---|---|
URL | http://hostname:8888/opennaas/{resourceType}/{resourceName}/protocolSessionManager/session/{sessionId}/locked | |
Method | GET | |
Body Parameter | sessionId | Id of the session which locked state we want to retrieve. |
Return | Boolean | "true" if the given session is locked, "false" otherwise. |
Response Example
false