...
Code Block | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
<?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 xmlns="http://www.science.uva.nl/research/sne/ndl#" attributeFormDefault="unqualified" elementFormDefault="unqualified" targetNamespace="http://www.science.uva.nl/research/sne/ndl#"> <xs:import namespace="" /> <xs:element name="Device" type="device" /> <xs:element name="Interface" type="interface" /> <xs:element name="Layer" type="layer" /> <xs:element name="atLayer" type="layerId" /> <xs:element name="capacity" type="xs:string" /> <xs:element name="hasInterface" type="interfaceId" /> <xs:element name="linkTo" type="link" /> <xs:element name="name" type="xs:string" /> </xs:schema> <xs:schema xmlns="http://www.science.uva.nl/research/sne/ndl/domain#" attributeFormDefault="unqualified" elementFormDefault="unqualified" targetNamespace="http://www.science.uva.nl/research/sne/ndl/domain#"> <xs:import namespace="" /> <xs:element name="NetworkDomain" type="networkDomain" /> <xs:element name="hasDevice" type="deviceId" /> </xs:schema> <xs:schema xmlns:ns1="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:ns2="http://www.science.uva.nl/research/sne/ndl#" xmlns:ns3="http://www.science.uva.nl/research/sne/ndl/domain#" xmlns:ns4="org.opennaas.core.resources.descriptor.vcpe" attributeFormDefault="unqualified" elementFormDefault="unqualified" targetNamespace="org.opennaas.core.resources.descriptor.vcpe"> <xs:import namespace="http://www.w3.org/1999/02/22-rdf-syntax-ns#" /> <xs:import namespace="http://www.science.uva.nl/research/sne/ndl#" /> <xs:import namespace="http://www.science.uva.nl/research/sne/ndl/domain#" /> <xs:import namespace="org.opennaas.core.resources.descriptor.vcpe" /> <xs:element name="resourceDescriptor" type="resourceDescriptor" /> <xs:element name="vcpeNetworkDescriptor" type="vcpeNetworkDescriptor" /> <xs:complexType name="resourceDescriptor"> <xs:sequence> <xs:element maxOccurs="unbounded" minOccurs="0" name="capabilityDescriptors" type="capabilityDescriptor" /> <xs:element minOccurs="0" name="fileTopology" type="xs:string" /> <xs:element minOccurs="0" name="id" type="xs:string" /> <xs:element minOccurs="0" name="information" type="information" /> <xs:element minOccurs="0" name="networkTopology" type="networkTopology" /> <xs:element minOccurs="0" name="profileId" type="xs:string" /> <xs:element name="properties"> <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:string" /> </xs:sequence> </xs:complexType> </xs:element> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="resourceReferences"> <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:string" /> </xs:sequence> </xs:complexType> </xs:element> </xs:sequence> </xs:complexType> </xs:element> </xs:sequence> </xs:complexType> <xs:complexType name="capabilityDescriptor"> <xs:sequence> <xs:element minOccurs="0" name="information" type="information" /> <xs:element maxOccurs="unbounded" minOccurs="0" name="capabilityProperty" type="capabilityProperty" /> <xs:element minOccurs="0" name="enabled" type="xs:boolean" /> <xs:element name="id" type="xs:long" /> </xs:sequence> </xs:complexType> <xs:complexType name="information"> <xs:sequence> <xs:element minOccurs="0" name="description" type="xs:string" /> <xs:element minOccurs="0" name="name" type="xs:string" /> <xs:element minOccurs="0" name="type" type="xs:string" /> <xs:element minOccurs="0" name="version" type="xs:string" /> </xs:sequence> </xs:complexType> <xs:complexType name="capabilityProperty"> <xs:sequence> <xs:element name="id" type="xs:long" /> </xs:sequence> <xs:attribute name="name" type="xs:string" /> <xs:attribute name="value" type="xs:string" /> </xs:complexType> <xs:complexType name="networkTopology"> <xs:sequence> <xs:element maxOccurs="unbounded" minOccurs="0" ref="ns2:Device" /> <xs:element maxOccurs="unbounded" minOccurs="0" ref="ns2:Interface" /> <xs:element maxOccurs="unbounded" minOccurs="0" ref="ns2:Layer" /> <xs:element minOccurs="0" name="location" type="xs:string" /> <xs:element maxOccurs="unbounded" minOccurs="0" ref="ns3:NetworkDomain" /> </xs:sequence> </xs:complexType> <xs:complexType name="device"> <xs:sequence> <xs:element maxOccurs="unbounded" minOccurs="0" ref="ns2:hasInterface" /> <xs:element minOccurs="0" ref="ns2:name" /> </xs:sequence> </xs:complexType> <xs:complexType name="interfaceId"> <xs:sequence /> <xs:attribute ref="ns1:resource" /> </xs:complexType> <xs:complexType name="interface"> <xs:sequence> <xs:element minOccurs="0" ref="ns2:atLayer" /> <xs:element minOccurs="0" ref="ns2:capacity" /> <xs:element minOccurs="0" ref="ns2:linkTo" /> <xs:element minOccurs="0" ref="ns2:name" /> </xs:sequence> </xs:complexType> <xs:complexType name="layerId"> <xs:sequence /> <xs:attribute ref="ns1:resource" /> </xs:complexType> <xs:complexType name="link"> <xs:sequence /> <xs:attribute ref="ns1:resource" /> </xs:complexType> <xs:complexType name="layer"> <xs:sequence> <xs:element minOccurs="0" ref="ns2:name" /> </xs:sequence> </xs:complexType> <xs:complexType name="networkDomain"> <xs:sequence> <xs:element maxOccurs="unbounded" minOccurs="0" ref="ns3:hasDevice" /> <xs:element minOccurs="0" ref="ns2:name" /> </xs:sequence> </xs:complexType> <xs:complexType name="deviceId"> <xs:sequence /> <xs:attribute ref="ns1:resource" /> </xs:complexType> <xs:complexType name="vcpeNetworkDescriptor"> <xs:complexContent> <xs:extension base="resourceDescriptor"> <xs:sequence> <xs:element minOccurs="0" ref="ns4:vCPEModel" /> </xs:sequence> </xs:extension> </xs:complexContent> </xs:complexType> </xs:schema> <xs:schema xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#" attributeFormDefault="unqualified" elementFormDefault="unqualified" targetNamespace="http://www.w3.org/1999/02/22-rdf-syntax-ns#"> <xs:import namespace="" /> <xs:element name="RDF" type="networkTopology" /> <xs:attribute name="resource" type="xs:string" /> </xs:schema> <xs:schema xmlns="org.opennaas.core.resources.descriptor.vcpe" attributeFormDefault="unqualified" elementFormDefault="unqualified" targetNamespace="org.opennaas.core.resources.descriptor.vcpe"> <xs:element name="vCPEModel" type="xs:string" /> </xs:schema> </grammars> <resources base="http://localhost:8888/opennaas/resources/"> <resource path="/"> <resource path="create"> <method name="POST"> <request> <representation mediaType="application/xml" /> </request> <response> <representation mediaType="application/xml"> <param name="result" style="plain" type="xs:string" /> </representation> </response> </method> </resource> <resource path="getDescriptor/{resourceId}"> <param name="resourceId" style="template" type="xs:string" /> <method name="GET"> <request /> <response> <representation mediaType="application/xml" /> </response> </method> </resource> <resource path="getName/{resourceId}/"> <param name="resourceId" style="template" type="xs:string" /> <method name="GET"> <request /> <response> <representation mediaType="application/octet-stream"> <param name="result" style="plain" type="xs:string" /> </representation> </response> </method> </resource> <resource path="getResourceTypes"> <method name="GET"> <response> <representation mediaType="application/xml" /> </response> </method> </resource> <resource path="modify/{resourceId}"> <param name="resourceId" style="template" type="xs:string" /> <method name="POST"> <request> <representation mediaType="application/xml" /> </request> <response> <representation mediaType="application/xml"> <param name="result" style="plain" type="xs:string" /> </representation> </response> </method> </resource> <resource path="remove/{resourceId}"> <param name="resourceId" style="template" type="xs:string" /> <method name="POST"> <request /> <response status="204" /> </method> </resource> <resource path="start/{resourceId}"> <param name="resourceId" style="template" type="xs:string" /> <method name="POST"> <request /> <response status="204" /> </method> </resource> <resource path="stop/{resourceId}"> <param name="resourceId" style="template" type="xs:string" /> <method name="POST"> <request /> <response status="204" /> </method> </resource> </resource> </resources> </application> |
Methods
CreateResource
ListResources
Returns the ids of all existing resources, no matter the state they haveThe 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 | POSTGET | |
Body ParameterReturn | 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
List<String> | Ids of all existing resources. |
Response Example
Code Block | ||||
---|---|---|---|---|
| ||||
<resources>
<resource>b6c3a6c9-9a2e-4bc4-9604-13d014bd508f</resource>
<resource>584c96d5-2221-47d0-8c51-c5d4d45f3ff4</resource>
<resource>c65gfr15-22er-74j0-87gh-hg78nnlo0aqe</resource>
</resources> |
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
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
<?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"> | ||||||
Code Block | ||||||
| ||||||
<?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<name>bgp capability</name> <type>chassis<<type>bgp</type> </information> <capabilityProperty name="actionset.name" value="junos"> </capabilityProperty> <capabilityProperty name="actionset.version" value="10.10"> </capabilityProperty> </capabilityDescriptors> <capabilityDescriptors> <information> <name>chassis <name>myre<capability</name> <type>router< <type>chassis</type> </information> <properties /> </resourceDescriptor> |
Response Example
<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
No Format |
---|
584c96d5-2221- |
No Format |
584c96d5-2221-47d0-8c51-c5d4d45f3ff4 |
ModifyResource
...
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
<?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
No Format |
---|
584c96d5-2221-47d0-8c51-c5d4d45f3ff4 |
...
RemoveResource
The StartResource RemoveResource method starts 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}/status/start | |
Method | PUTDELETE | |
Path Parameter | resourceId | Id of the resource to be startedremoved. |
Return | - |
StopResource
GetResourceTypes
List all the types of resources supported by the OpenNaaS instanceThe StopResource method stops a resource, only if it's in STARTED state.
Value | Description | |
---|---|---|
URL | http://hostname:8888/opennaas/resources/{resourceId}/status/stoptype | |
Method | PUTGET | |
Path ParameterReturn | resourceIdList<String> | Id Name of the resource to be stoppedresources types supported by OpenNaaS. | Return
Response Example
...
Code Block |
---|
...
|
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 | ||
Code Block | ||
---|---|---|
| ||
<?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> |
...
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
No Format |
---|
myre |
GetResourceDescriptor
...
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
Code Block | ||||
---|---|---|---|---|
| ||||
<?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> |
...
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
No Format |
---|
584c96d5-2221-47d0-8c51-c5d4d45f3ff4 |
...
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
No Format |
---|
INITIALIZED |
ListResourcesNameByType
...
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
Code Block | ||||
---|---|---|---|---|
| ||||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <resources> <resource>dub_1_log</resource> <resource>myre</resource> <resource>logicalrouter1</resource> </resources> |
...
Stops and removes all existing resource of the OpenNaaS instanceinstance.
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 | DELETEGET | |
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
Code Block | ||||
---|---|---|---|---|
| ||||
<resources> <resource>b6c3a6c9-9a2e-4bc4-9604-13d014bd508f</resource> <resource>584c96d5-2221-47d0-8c51-c5d4d45f3ff4</resource> </resources> |
...
GetResourceInfoFromId
Returns the ids of all existing resources of main information from a specific resource: id, name, type, state and the list of capabilities it contains.
Value | Description | ||||
---|---|---|---|---|---|
URL | http://hostname:8888/opennaas/resources/type/{typeresourceId}/ | ||||
Method | GET | ||||
Path Parameter | type | Type of the list of resources we want to retrieve. | |||
Return | ResourceInfo | Id, name, type, state and list of capabilities of the resource. | Return | List<String> | Ids of the resources which type matches the one set at the url |
Response Example
Code Block | ||||
---|---|---|---|---|
| ||||
<resources> <resource>b6c3a6c9-9a2e-4bc4-9604-13d014bd508f</resource> <resource>584c96d5 <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <resourceInfo> <resourceId>584c96d5-2221-47d0-8c51-c5d4d45f3ff4</resource>resourceId> < <name>myre</resources>name> |
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
Code Block | ||||
---|---|---|---|---|
| ||||
<resources>
<resource>b6c3a6c9-9a2e-4bc4-9604-13d014bd508f</resource>
<resource>584c96d5-2221-47d0-8c51-c5d4d45f3ff4</resource>
<resource>c65gfr15-22er-74j0-87gh-hg78nnlo0aqe</resource>
</resources> |
GetResourceInfoFromId
<type>router</type>
<state>ACTIVE</state>
<capabilities>
<capability>ip</capability>
<capability>chassis</capability>
<capability>bgp</capability>
</capabilities>
</resourceInfo> |
StartResource
The StartResource method starts a resource, only if it's in INITIALIZED stateReturns the main information from a specific resource: id, name, type, state and the list of capabilities it contains.
Value | Description | |
---|---|---|
URL | http://hostname:8888/opennaas/resources/{resourceId}/status/start | |
Method | GETPUT | |
ReturnPath Parameter | ResourceInforesourceId | Id , name, type, state and list of capabilities of the resource to be started. |
Response Example
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 | - |
ForceStop
Forces a resource to get into INITIALIZED state.
...