WADL
URL
http://hostname:8888/opennaas/resources?_wadl
Description
Methods
CreateResource
The CreateResource method creates a new resource in OpenNaaS from the resource descriptor given by the user. If the method ends successfully, the id of the new resource is returned to he user.
Value | Description | |
---|---|---|
URL | http://hostname:8888/opennaas/resources/ | |
Method | POST | |
Body Parameter | ResourceDescriptor | Resource descriptor containing the resource info (type, name, description) and its list of capabilities. |
Return | String | Resource id of the created resource. |
The following example creates a router resource called "myre" with BGP and Chassis capabilities, both of them using the "Junos 10.10" driver.
Body Example
<?xml version="1.0" encoding="UTF-8"?> <resourceDescriptor xmlns:ns2="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:ns3="http://www.science.uva.nl/research/sne/ndl#" xmlns:ns4="http://www.science.uva.nl/research/sne/ndl/domain#" xmlns:ns5="org.opennaas.core.resources.descriptor.vcpe"> <capabilityDescriptors> <information> <name>bgp capability</name> <type>bgp</type> </information> <capabilityProperty name="actionset.name" value="junos"> </capabilityProperty> <capabilityProperty name="actionset.version" value="10.10"> </capabilityProperty> </capabilityDescriptors> <capabilityDescriptors> <information> <name>chassis capability</name> <type>chassis</type> </information> <capabilityProperty name="actionset.name" value="junos"> </capabilityProperty> <capabilityProperty name="actionset.version" value="10.10"> </capabilityProperty> </capabilityDescriptors> <information> <name>myre</name> <type>router</type> </information> <properties /> </resourceDescriptor>
Response Example
584c96d5-2221-47d0-8c51-c5d4d45f3ff4
ModifyResource
The ModifyResource method updated the information of an existing resource of OpenNaaS. The resourceDescriptor will be replaced by the new one, but the resourceId will be manteined.
Value | Description | |
---|---|---|
URL | http://hostname:8888/opennaas/resources/{resourceId} | |
Method | PUT | |
Path Parameter | resourceId | Id of the resource to be modified. |
Body Parameter | ResourceDescriptor | Resource descriptor containing the new resource information. |
Return | String | Resource id of the modified resource. It matches the path parameter "resourceId" |
The following example modifies the previous created router by adding a new capability: the IP capability using the "Junos 10.10" router.
Body Example
<?xml version="1.0" encoding="UTF-8"?> <resourceDescriptor xmlns:ns2="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:ns3="http://www.science.uva.nl/research/sne/ndl#" xmlns:ns4="http://www.science.uva.nl/research/sne/ndl/domain#" xmlns:ns5="org.opennaas.core.resources.descriptor.vcpe"> <capabilityDescriptors> <information> <name>bgp capability</name> <type>bgp</type> </information> <capabilityProperty name="actionset.name" value="junos"> </capabilityProperty> <capabilityProperty name="actionset.version" value="10.10"> </capabilityProperty> </capabilityDescriptors> <capabilityDescriptors> <information> <name>chassis capability</name> <type>chassis</type> </information> <capabilityProperty name="actionset.name" value="junos"> </capabilityProperty> <capabilityProperty name="actionset.version" value="10.10"> </capabilityProperty> <id>0</id> </capabilityDescriptors> <capabilityDescriptors> <information> <name>ip capability</name> <type>ip</type> </information> <capabilityProperty name="actionset.name" value="junos"> </capabilityProperty> <capabilityProperty name="actionset.version" value="10.10"> </capabilityProperty> </capabilityDescriptors> <information> <name>myre</name> <type>router</type> </information> <properties /> </resourceDescriptor>
Response Example
584c96d5-2221-47d0-8c51-c5d4d45f3ff4
StartResource
The StartResource method starts a resource, only if it's in INITIALIZED state.
Value | Description | |
---|---|---|
URL | http://hostname:8888/opennaas/resources/{resourceId}/status/start | |
Method | PUT | |
Path Parameter | resourceId | Id of the resource to be started. |
Return | - |
StopResource
The StopResource method stops a resource, only if it's in STARTED state.
Value | Description | |
---|---|---|
URL | http://hostname:8888/opennaas/resources/{resourceId}/status/stop | |
Method | PUT | |
Path Parameter | resourceId | Id of the resource to be stopped. |
Return | - |
RemoveResource
The RemoveResource method removes a resource from OpenNaaS, only if it's in INITIALIZED state. It the resource is in STARTED state, it must be stopped before calling this method.
Value | Description | |
---|---|---|
URL | http://hostname:8888/opennaas/resources/{resourceId} | |
Method | DELETE | |
Path Parameter | resourceId | Id of the resource to be removed. |
Return | - |
GetResourceTypes
List all the types of resources supported by the OpenNaaS instance.
Value | Description | |
---|---|---|
URL | http://hostname:8888/opennaas/resources/type | |
Method | GET | |
Return | List<String> | Name of the resources types supported by OpenNaaS. |
Response Example
<?xml version="1.0" encoding="UTF-8"?> <resourcesTypes> <resourceType>bod</resourceType> <resourceType>roadm</resourceType> <resourceType>MACBridgeIOS</resourceType> <resourceType>pdu</resourceType> <resourceType>sampleresource</resourceType> <resourceType>quantumresource</resourceType> <resourceType>network</resourceType> <resourceType>powernet</resourceType> <resourceType>vnmapper</resourceType> <resourceType>router</resourceType> <resourceType>openflowswitch</resourceType> <resourceType>vcpenet</resourceType> <resourceType>ofnetwork</resourceType> </resourcesTypes>
GetNameFromResourceID
Given the resourceId of an existing resource, this method return its name.
Value | Description | |
---|---|---|
URL | http://hostname:8888/opennaas/resources/{resourceId}/name | |
Method | GET | |
Path Parameter | resourceId | Id of the resource which name we want to retrieve. |
Return | String | Name of the resource identified by the given resourceId. |
Response Example
myre
GetResourceDescriptor
Given the resourceId of an existing resource, this method returns its whole resource descriptor.
Value | Description | |
---|---|---|
URL | http://hostname:8888/opennaas/resources/{resourceId}/descriptor | |
Method | GET | |
Path Parameter | resourceId | Id of the resource which descriptor we want to retrieve |
Return | ResourceDescriptor | Name of the resource identified by the given resourceId. |
Response Example
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <resourceDescriptor xmlns:ns2="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:ns3="http://www.science.uva.nl/research/sne/ndl#" xmlns:ns4="http://www.science.uva.nl/research/sne/ndl/domain#" xmlns:ns5="org.opennaas.core.resources.descriptor.vcpe"> <capabilityDescriptors> <information> <name>bgp capability</name> <type>bgp</type> </information> <capabilityProperty name="actionset.name" value="junos"> </capabilityProperty> <capabilityProperty name="actionset.version" value="10.10"> </capabilityProperty> </capabilityDescriptors> <capabilityDescriptors> <information> <name>chassis capability</name> <type>chassis</type> </information> <capabilityProperty name="actionset.name" value="junos"> </capabilityProperty> <capabilityProperty name="actionset.version" value="10.10"> </capabilityProperty> <id>0</id> </capabilityDescriptors> <capabilityDescriptors> <information> <name>ip capability</name> <type>ip</type> </information> <capabilityProperty name="actionset.name" value="junos"> </capabilityProperty> <capabilityProperty name="actionset.version" value="10.10"> </capabilityProperty> </capabilityDescriptors> <id>584c96d5-2221-47d0-8c51-c5d4d45f3ff4</id> <information> <description>Junos v10 Router</description> <name>myre</name> <type>router</type> </information> <properties/> </resourceDescriptor>
GetIdentifierFromResourceTypeName
Given the name and the type of an existing resource, this method returns its id.
Value | Description | |
---|---|---|
URL | http://hostname:8888/opennaas/resources/type/{type}/name/{name} | |
Method | GET | |
Path Parameter | type | Type of the resource which id we want to retrieve. |
Path Parameter | name | Name of the resource which id we want to retrieve. |
Return | String | Id of the resource of type and name set in url. |
Response Example
584c96d5-2221-47d0-8c51-c5d4d45f3ff4
GetStatus
Returns the current lifecycle state of the resource.
Value | Description | |
---|---|---|
URL | http://hostname:8888/opennaas/resources/{resourceId}/status | |
Method | GET | |
Path Parameter | resourceId | Id of the resource which status we want to retrieve |
Return | String | Current status of the resource. |
Response Example
INITIALIZED
ListResourcesNameByType
Returns the list of all existing resources of a specific type.
Value | Description | |
---|---|---|
URL | http://hostname:8888/opennaas/resources/type/{type}/name | |
Method | GET | |
Path Parameter | resourceType | Type of the list of resources we want to retrieve. |
Return | List<String> | Name of the resources which type matches the one given by the user. |
Response Example
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <resources> <resource>dub_1_log</resource> <resource>myre</resource> <resource>logicalrouter1</resource> </resources>
DestroyAllResources
Stops and removes all existing resource of the OpenNaaS instance.
Value | Description | |
---|---|---|
URL | http://hostname:8888/opennaas/resources/ | |
Method | DELETE | |
Return | - |
ListResourcesByType
Returns the ids of all existing resources of a specific type.
Value | Description | |
---|---|---|
URL | http://hostname:8888/opennaas/resources/type/{type}/ | |
Method | GET | |
Path Parameter | type | Type of the list of resources we want to retrieve. |
Return | List<String> | Ids of the resources which type matches the one set at the url |
Response Example
<resources> <resource>b6c3a6c9-9a2e-4bc4-9604-13d014bd508f</resource> <resource>584c96d5-2221-47d0-8c51-c5d4d45f3ff4</resource> </resources>
ListResources
Returns the ids of all existing resources, no matter the state they have.
Value | Description | |
---|---|---|
URL | http://hostname:8888/opennaas/resources/ | |
Method | GET | |
Return | List<String> | Ids of all existing resources. |
Response Example
<resources> <resource>b6c3a6c9-9a2e-4bc4-9604-13d014bd508f</resource> <resource>584c96d5-2221-47d0-8c51-c5d4d45f3ff4</resource> <resource>c65gfr15-22er-74j0-87gh-hg78nnlo0aqe</resource> </resources>
<resource>584c96d5-2221-47d0-8c51-c5d4d45f3ff4</resource>