...
Code Block |
---|
theme | Eclipse |
---|
language | html/xml |
---|
title | ResourceManager.wadl |
---|
collapse | true |
---|
|
<?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:ns1="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:ns2="http://www.science.uva.nl/research/sne/ndl/domain#ndl#" attributeFormDefault="unqualified" elementFormDefault="unqualified" targetNamespace="xmlns:ns3="http://www.science.uva.nl/research/sne/ndl/domain#">
<xs:import namespace="" / xmlns:ns4="org.opennaas.core.resources.descriptor.vcpe" attributeFormDefault="unqualified" elementFormDefault="unqualified" targetNamespace="org.opennaas.core.resources.descriptor.vcpe">
<xs:elementimport name="NetworkDomain" type="networkDomain"namespace="http://www.w3.org/1999/02/22-rdf-syntax-ns#" />
<xs:elementimport namenamespace="hasDevice" type="deviceId" http://www.science.uva.nl/research/sne/ndl#" />
</xs:schema>
<xs:schema xmlns:ns1="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:ns2import namespace="http://www.science.uva.nl/research/sne/ndl#ndl/domain#" xmlns:ns3="http://www.science.uva.nl/research/sne/ndl/domain#" xmlns:ns4="org.opennaas.core.resources.descriptor.vcpe" attributeFormDefault="unqualified" elementFormDefault="unqualified" targetNamespace/>
<xs:import namespace="org.opennaas.core.resources.descriptor.vcpe" />
<xs:import namespace="http://www.w3.org/1999/02/22-rdf-syntax-ns#element name="resourceDescriptor" type="resourceDescriptor" />
<xs:importelement namespacename="http://www.science.uva.nl/research/sne/ndl#" />
<xs:import namespace="http://www.science.uva.nl/research/sne/ndl/domain#resourceInfo" type="resourceInfo" />
<xs:importelement namespacename="org.opennaas.core.resources.descriptor.vcperesources" type="resourceListWrapper" />
<xs:element name="resourceDescriptorresourcesTypes" type="resourceDescriptorresourceTypeListWrapper" />
<xs:element name="vcpeNetworkDescriptor" type="vcpeNetworkDescriptor" />
<xs:complexType name="resourceDescriptorresourceInfo">
<xs:sequence>
<xs:element maxOccurs="unbounded" minOccurs="0" name="capabilityDescriptorsresourceId" type="capabilityDescriptorxs:string" />
<xs:element minOccurs="0" name="fileTopologyname" type="xs:string" />
<xs:element minOccurs="0" name="idtype" type="xs:string" />
<xs:element minOccurs="0" name="informationstate" type="informationstate" />
<xs:element minOccurs="0" name="networkTopology" type="networkTopology" />
<xs:element minOccurs="0" name="profileId" type="xs:string" />
<xs:element name="properties"capabilities">
<xs:complexType>
<xs:sequence>
<xs:element maxOccurs="unbounded" minOccurs="0" name="entrycapability">
nillable="true" type="xs:string" />
<xs:complexType></xs:sequence>
</xs:complexType>
<xs:sequence>
</xs:element>
</xs:sequence>
</xs:complexType>
<xs:element minOccurs="0" complexType name="key" type="xs:string" /resourceTypeListWrapper">
<xs:sequence>
<xs:element maxOccurs="unbounded" minOccurs="0" name="valueresourceType" type="xs:string" />
</xs:sequence>
</xs:sequence>complexType>
<xs:complexType name="resourceListWrapper">
</xs:complexType><xs:sequence>
<xs:element maxOccurs="unbounded" minOccurs="0" </xs:element>
name="resource" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:complexType><xs:complexType name="resourceDescriptor">
</xs:element><xs:sequence>
<xs:element maxOccurs="unbounded" minOccurs="0" name="resourceReferences"capabilityDescriptors" type="capabilityDescriptor" />
<xs:complexType>
element minOccurs="0" name="fileTopology" type="xs:string" />
<xs:sequence>
element minOccurs="0" name="id" type="xs:string" />
<xs:element maxOccursminOccurs="unbounded0" minOccursname="0information" nametype="entryinformation" />
<xs:complexType>
element minOccurs="0" name="networkTopology" type="networkTopology" />
<xs:element minOccurs="0" name="profileId" type="xs:string" />
<xs:sequence>
<xs:element name="properties">
<xs:complexType>
<xs:element minOccurs="0" name="key" type="xs:string" />
<xs:sequence>
<xs:element minOccursmaxOccurs="0unbounded" nameminOccurs="value0" typename="xs:stringentry" />
<xs:complexType>
</xs:sequence>
</xs<xs:complexType>sequence>
</xs:element>
<xs:element minOccurs="0" name="key" type="xs:string" />
</xs:sequence>
<xs:element minOccurs="0" </xs:complexType>name="value" type="xs:string" />
</xs:element>
</xs:sequence>
</xs:complexType>
<xs:complexType name="capabilityDescriptor">
<xs</xs:sequence>element>
<xs:element minOccurs="0" name="information" type="information" />
</xs:sequence>
<xs:element maxOccurs="unbounded" minOccurs="0" name="capabilityProperty" type="capabilityProperty" </>xs:complexType>
<xs:element minOccurs="0" name="enabled" type="xs:boolean" /></xs:element>
<xs:element name="id" type="xs:long" /resourceReferences">
</xs:sequence>
<xs:complexType>
</xs:complexType>
<xs:complexType name="information">
<xs:sequence>
<xs:sequence>
<xs:element minOccursmaxOccurs="0unbounded" nameminOccurs="description0" typename="xs:stringentry" />
<xs:element minOccurs="0" name="name" type="xs:string" />
<xs:complexType>
<xs:element minOccurs="0" name="type" type="xs:string" />
<xs:element minOccurs="0" name="version" type="xs:string" />
sequence>
</xs:sequence>
</xs:complexType>
<xs:complexTypeelement minOccurs="0" name="capabilityProperty""key" type="xs:string" />
<xs:sequence>
<xs:element minOccurs="0" name="idvalue" type="xs:longstring" />
</xs:sequence>
<xs:attribute name="name" type="xs:string" />
</xs:sequence>
<xs:attribute name="value" type="xs:string" />
</xs:complexType>
<xs:complexType name="networkTopology">
<xs</xs:sequence>element>
<xs:element maxOccurs="unbounded" minOccurs="0" ref="ns2:Device" </>xs:sequence>
<xs:element maxOccurs="unbounded" minOccurs="0" ref="ns2:Interface" /> </xs:complexType>
<xs:element maxOccurs="unbounded" minOccurs="0" ref="ns2:Layer" /></xs:element>
</xs:sequence>
</xs:complexType>
<xs:complexType name="capabilityDescriptor">
<xs:sequence>
<xs:element minOccurs="0" name="locationinformation" type="xs:stringinformation" />
<xs:element maxOccurs="unbounded" minOccurs="0" name="capabilityProperty" reftype="ns3:NetworkDomaincapabilityProperty" />
</xs:sequence>
<xs:element </xs:complexType>
<xs:complexType name="device">
<xs:sequence>
<xs:element maxOccurs="unbounded" minOccurs="0" ref="ns2:hasInterfaceminOccurs="0" name="enabled" type="xs:boolean" />
<xs:element minOccursname="0id" reftype="ns2xs:namelong" />
</xs:sequence>
</xs:complexType>
<xs:complexType name="interfaceIdinformation">
<xs:sequence />
sequence>
<xs:attributeelement refminOccurs="ns1:resource" />
</xs:complexType>
<xs:complexType 0" name="interfacedescription">
<xs:sequence> type="xs:string" />
<xs:element minOccurs="0" name="name" reftype="ns2xs:atLayerstring" />
<xs:element minOccurs="0" name="type" reftype="ns2xs:capacitystring" />
<xs:element minOccurs="0" refname="version" type="ns2xs:linkTostring" />
</xs:sequence>
<xs:element minOccurs="0" ref="ns2:name" />
</xs:sequence>
</xs:complexType>
<xs:complexType name="layerIdcapabilityProperty">
<xs:sequence />
sequence>
<xs:attribute refelement name="id" type="ns1xs:resourcelong" />
</xs:complexType>sequence>
<xs:complexTypeattribute name="name" type="linkxs:string" />
<xs:sequence:attribute name="value" type="xs:string" />
<xs:attribute ref="ns1:resource" />
</xs:complexType>
<xs:complexType name="layernetworkTopology">
<xs:sequence>
<xs:element maxOccurs="unbounded" minOccurs="0" ref="ns2:nameDevice" />
</xs:sequence>
</xs:complexType>
<xs:complexTypeelement namemaxOccurs="networkDomainunbounded">
minOccurs="0" <xs:sequence>ref="ns2:Interface" />
<xs:element maxOccurs="unbounded" minOccurs="0" ref="ns3ns2:hasDeviceLayer" />
<xs:element minOccurs="0" refname="ns2:namelocation" type="xs:string" />
</xs:sequence>
</xs:complexType>
<xs:complexTypeelement namemaxOccurs="deviceIdunbounded">
<xs:sequenceminOccurs="0" ref="ns3:NetworkDomain" />
<xs:attribute ref="ns1:resource" /></xs:sequence>
</xs:complexType>
<xs:complexType name="vcpeNetworkDescriptordevice">
<xs:complexContent>sequence>
<xs:extensionelement basemaxOccurs="resourceDescriptorunbounded">
minOccurs="0" <xs:sequence>
ref="ns2:hasInterface" />
<xs:element minOccurs="0" ref="ns4ns2:vCPEModelname" />
</xs:sequence>
</xs:sequence>
complexType>
<xs:complexType name="interfaceId">
<xs:sequence </xs:extension>>
</xs:complexContent> <xs:attribute ref="ns1:resource" />
</xs:complexType>
</xs:schema>
<xs:schemacomplexType xmlnsname="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#">
interface">
<xs:import namespace="" />
sequence>
<xs:element nameminOccurs="RDF0" typeref="networkTopologyns2:atLayer" />
<xs:attributeelement nameminOccurs="resource0" typeref="xsns2:stringcapacity" />
</xs:schema>
<xs:schemaelement xmlnsminOccurs="org.opennaas.core.resources.descriptor.vcpe0" attributeFormDefaultref="unqualified" elementFormDefault="unqualified" targetNamespace="org.opennaas.core.resources.descriptor.vcpe">
ns2:linkTo" />
<xs:element nameminOccurs="vCPEModel0" typeref="xsns2:stringname" />
</xs:schema>sequence>
</grammars>
<resources base="http://localhost:8888/opennaas/resources/">
</xs:complexType>
<resource path="/">
<resource path="create <xs:complexType name="layerId">
<method name="POST"<xs:sequence />
<xs:attribute <request>ref="ns1:resource" />
</xs:complexType>
<representation<xs:complexType mediaTypename="application/xmllink" />
<xs:sequence </request>>
<xs:attribute <response>ref="ns1:resource" />
</xs:complexType>
<representation<xs:complexType mediaTypename="application/xmllayer">
<xs:sequence>
<param name="result" style="plain" type="xs:string <xs:element minOccurs="0" ref="ns2:name" />
</representation>
xs:sequence>
</response>xs:complexType>
</method>
<xs:complexType name="networkDomain">
</resource>
<xs:sequence>
<resource path="getDescriptor/{resourceId}">
<param<xs:element namemaxOccurs="resourceIdunbounded" styleminOccurs="template0" typeref="xsns3:stringhasDevice" />
<method name <xs:element minOccurs="GET0">
<request ref="ns2:name" />
<response></xs:sequence>
</xs:complexType>
<representation<xs:complexType mediaTypename="application/xmldeviceId" />
<xs:sequence </response>>
</method> <xs:attribute ref="ns1:resource" />
</resource>xs:complexType>
<resource<xs:complexType pathname="getName/{resourceId}/vcpeNetworkDescriptor">
<param name="resourceId" style="template" type="xs:string" />
<xs:complexContent>
<method name<xs:extension base="GETresourceDescriptor">
<request /> <xs:sequence>
<response>
<xs:element minOccurs="0" ref="ns4:vCPEModel" />
<representation mediaType="application/octet-stream">
</xs:sequence>
<param name="result" style="plain" type="xs:string" /> </xs:extension>
</xs:complexContent>
</representation>
</xs:complexType>
<xs:simpleType </response>
name="state">
</method><xs:restriction base="xs:string">
</resource>
<resource path<xs:enumeration value="getResourceTypesINSTANTIATED" />
<method name <xs:enumeration value="GETINITIALIZED" />
<response>
<xs:enumeration value="ACTIVE" />
<representation mediaType<xs:enumeration value="application/xmlINACTIVE" />
</response>
</method><xs:enumeration value="SHUTDOWN" />
</resource>
<resource path="modify/{resourceId}"<xs:enumeration value="ERROR" />
<param name="resourceId" style="template" type="xs:string" /></xs:restriction>
<method name="POST"></xs:simpleType>
<request></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#">
<representation mediaType <xs:import namespace="application/xml" />
<xs:element </request>name="NetworkDomain" type="networkDomain" />
<xs:element name="hasDevice" type="deviceId" />
<response>
</xs:schema>
<xs:schema xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#" attributeFormDefault="unqualified" <representation mediaType="application/xmlelementFormDefault="unqualified" targetNamespace="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<xs:import namespace="" />
<param<xs:element name="resultRDF" style="plain" type="xs:stringnetworkTopology" />
<xs:attribute name="resource" type="xs:string" />
</representation>xs:schema>
<xs:schema xmlns="org.opennaas.core.resources.descriptor.vcpe" attributeFormDefault="unqualified" </response>elementFormDefault="unqualified" targetNamespace="org.opennaas.core.resources.descriptor.vcpe">
<xs:element name="vCPEModel" type="xs:string" </method>>
</xs:schema>
</resource>grammars>
<resources base="http://localhost:8888/opennaas/resources/">
<resource path="remove/{resourceId}">
<param<method name="resourceId" style="template" type="xs:stringDELETE">
<response status="204" />
</method>
<method name="POSTGET">
<request /><response>
<response<representation statusmediaType="204application/xml" />
</method>response>
</resource>method>
<resource<method pathname="start/{resourceId}POST">
<param name="resourceId" style="template" type="xs:string" />
<request>
<method<representation namemediaType="POSTapplication/xml" />
<request /></request>
<response status="204" />
<response>
</method>
</resource>
<representation mediaType="application/xml">
<resource path="stop/{resourceId}">
<param name="resourceIdresult" style="templateplain" type="xs:string" />
<method name="POST"> </representation>
</response>
<request / </method>
<resource path="forceStop/{resourceId}">
<param name="resourceId" <response status="204style="template" type="xs:string" />
</method>
<method name="PUT">
<request </resource>
>
</resource>
<response status="204" />
</resources>
</application> |
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
Code Block |
---|
theme | Eclipse |
---|
language | html/xml |
---|
title | CreateResource Body |
---|
|
<?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>method>
</resource>
<resource path="type">
<method name="GET">
<response>
<representation mediaType="application/xml" />
</response>
</method>
</resource>
<name>bgp capability</name><resource path="type/{type}">
<type>bgp</type>
</information>
<capabilityProperty name="actionset.name" value="junos"<param name="type" style="template" type="xs:string" />
</capabilityProperty>
<capabilityProperty<method name="actionset.version" value="10.10"GET">
</capabilityProperty>
</capabilityDescriptors>
<capabilityDescriptors>
<request />
<information>
<name>chassis capability</name>
<response>
<type>chassis</type>
</information>
<capabilityProperty<representation namemediaType="actionset.nameapplication/xml" value="junos"/>
</capabilityProperty>response>
<capabilityProperty name="actionset.version" value="10.10">
</method>
</capabilityProperty>resource>
</capabilityDescriptors>
<resource path="type/{type}/name">
<information>
<param name="type" style="template" type="xs:string" <name>myre</name>>
<type>router</type>
</information>
<properties />
</resourceDescriptor> |
Response Example
No Format |
---|
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
Code Block |
---|
theme | Eclipse |
---|
language | html/xml |
---|
title | CreateResource Body |
---|
|
<?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><method name="GET">
<request />
<response>
<representation mediaType="application/xml" />
</response>
</method>
</resource>
<resource path="type/{type}/name/{name}">
<param name="type" style="template" type="xs:string" />
<param name="name" style="template" type="xs:string" />
<type>bgp</type>
</information>
<capabilityProperty <method name="actionset.name" value="junos"GET">
</capabilityProperty>
<capabilityProperty name="actionset.version" value="10.10" <request />
</capabilityProperty>
</capabilityDescriptors>
<capabilityDescriptors>
<information><response>
<name>chassis capability</name>
<representation <type>chassis</type>
mediaType="application/octet-stream">
</information>
<capabilityProperty<param name="result" style="actionset.nameplain" valuetype="junosxs:string" />
</capabilityProperty>
<capabilityProperty name="actionset.version" value="10.10">
</capabilityProperty>representation>
<id>0</id>
</capabilityDescriptors>
<capabilityDescriptors>
</response>
<information>
<name>ip capability<</name>method>
<type>ip<</type>resource>
</information>
<resource path="{resourceId}">
<param name="resourceId" style="template" type="xs:string" />
<method name="DELETE">
<request />
<response status="204" />
</method>
<method name="GET">
<request />
<response>
<representation mediaType="application/xml" />
</response>
</method>
<method name="PUT">
<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="{resourceId}/descriptor">
<param name="resourceId" style="template" type="xs:string" />
<method name="GET">
<request />
<response>
<representation mediaType="application/xml" />
</response>
</method>
</resource>
<resource path="{resourceId}/name">
<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="{resourceId}/status">
<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="{resourceId}/status/start">
<param name="resourceId" style="template" type="xs:string" />
<method name="PUT">
<request />
<response status="204" />
</method>
</resource>
<resource path="{resourceId}/status/stop">
<param name="resourceId" style="template" type="xs:string" />
<method name="PUT">
<request />
<response status="204" />
</method>
</resource>
</resource>
</resources>
</application> |
Methods
ListResources
Returns the ids of all existing resources, no matter the state they have.
Response Example
Code Block |
---|
theme | Eclipse |
---|
language | html/xml |
---|
|
<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 |
---|
theme | Eclipse |
---|
language | html/xml |
---|
title | CreateResource Body |
---|
|
<?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
No Format |
---|
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
Code Block |
---|
theme | Eclipse |
---|
language | html/xml |
---|
title | CreateResource Body |
---|
|
<?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< <capabilityProperty name="actionset.name" value="junos">
</capabilityProperty>
<capabilityProperty name="actionset.version" value="10.10">
</capabilityProperty>
</capabilityDescriptors>
<information>
<name>myre</name>
<type>router</type>
<<type>bgp</information>type>
<properties />
</resourceDescriptor> |
Response Example
No Format |
---|
584c96d5-2221-47d0-8c51-c5d4d45f3ff4 |
StartResource
The StartResource method starts a resource, only if it's in INITIALIZED state.
StopResource
The StopResource method stops a resource, only if it's in STARTED state.
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.
GetResourceTypes
List all the types of resources supported by the OpenNaaS instance.
Response Example
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> |
GetNameFromResourceID
</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 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 methodGiven the resourceId of an existing resource, this method return its name.
Response Example
GetResourceDescriptor
DestroyAllResources
Stops and removes all existing resource of the OpenNaaS instance.
GetResourceInfoById
Returns the main information from a specific resource: id, name, type, state and the list of capabilities it containsGiven 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 ParameterReturn | resourceIdResourceInfo | Id of the resource which descriptor we want to retrieve | Return | ResourceDescriptor | Name , name, type, state and list of capabilities of the resource identified by the given resourceId. |
Response Example
Code Block |
---|
theme | Eclipse |
---|
language | html/xml |
---|
|
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<resourceInfo>
<resourceId>584c96d5-2221-47d0-8c51-c5d4d45f3ff4</resourceId>
<name>myre</name>
<type>router</type>
<state>ACTIVE</state>
<capabilities>
<capability>ip</capability>
<capability>chassis</capability>
<capability>bgp</capability>
</capabilities>
</resourceInfo> |
GetNameFromResourceID
Given the resourceId of an existing resource, this method return its name.
Response Example
GetResourceDescriptor
Given the resourceId of an existing resource, this method returns its whole resource descriptor.
Response Example
Code Block |
---|
theme | Eclipse |
---|
language | html/xml |
---|
|
<?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">
"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<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>
<id>0</id>
</capabilityDescriptors>
<capabilityDescriptors>
<information>
<name>ip<name>chassis capability</name>
<type>ip<<type>chassis</type>
</information>
<capabilityProperty name="actionset.name" value="junos">
</capabilityProperty>
<capabilityProperty name="actionset.version" value="10.10">
</capabilityProperty>
<id>0</id>
</capabilityDescriptors>
<capabilityDescriptors>
<id>584c96d5-2221-47d0-8c51-c5d4d45f3ff4</id>
<information>
<description>Junos v10 Router</description>
<name>ip <name>myre<capability</name>
<type>router< <type>ip</type>
</information>
<properties/>
</resourceDescriptor> |
GetIdentifierFromResourceTypeName
Given the name and the type of an existing resource, this method returns its id.
Response Example
No Format |
---|
584c96d5-2221-47d0-8c51-c5d4d45f3ff4<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> |
GetStatus
Returns the current lifecycle state of the resource.
...
Response Example
ListResourcesNameByType
StartResource
The StartResource method starts a resource, only if it's in INITIALIZED stateReturns the list of all existing resources of a specific type.
Response Example
Code Block |
---|
theme | Eclipse |
---|
language | html/xml |
---|
|
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<resources>
<resource>dub_1_log</resource>
<resource>myre</resource>
<resource>logicalrouter1</resource>
</resources> |
DestroyAllResources
StopResource
The StopResource method stops a resource, only if it's in STARTED state.
ForceStopResource
Forces a resource to get into INITIALIZED stateStops and removes all existing resource of the OpenNaaS instance.
...
GetResourceTypes
Returns List all the ids types of all existing resources of a specific typeresources supported by the OpenNaaS instance.
Response Example
Code Block |
---|
theme | Eclipse |
---|
language | html/xml |
---|
|
<resources>
<resource>b6c3a6c9-9a2e-4bc4-9604-13d014bd508f</resource>
<resource>584c96d5-2221-47d0-8c51-c5d4d45f3ff4</resource>
</resources>
|
...
resources types supported by OpenNaaS. |
Response Example
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> |
ListResourcesByType
Returns the ids of all existing resources , no matter the state they haveof a specific type.
| Value | Description |
---|
URL | http://hostname:8888/opennaas/resources/type/{type}/ | | Method | GET |
Method | GET | |
Path Parameter | type | Type of the list of resources we want to retrieve. |
Return | List<String> | Ids of all existing resources.the resources which type matches the one set at the url |
Response Example
Code Block |
---|
theme | Eclipse |
---|
language | html/xml |
---|
|
<resources>
<resource>b6c3a6c9-9a2e-4bc4-9604-13d014bd508f</resource>
<resource>584c96d5-2221-47d0-8c51-c5d4d45f3ff4</resource>
<resource>c65gfr15-22er-74j0-87gh-hg78nnlo0aqe</resource>
</resources> |
GetResourceInfoFromId
ListResourcesNameByType
Returns the list of all existing resources of a specific typeReturns 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/type/{resourceIdtype}/name | |
Method | GET | |
Path Parameter | resourceType | Type of the list of resources we want to retrieve. |
Return | ResourceInfo | List<String> | Name of the resources which type matches the one given by the userId, name, type, state and list of capabilities of the resource. |
Response Example
Code Block |
---|
theme | Eclipse |
---|
language | html/xml |
---|
|
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<resourceInfo><resources>
<resourceId>584c96d5-2221-47d0-8c51-c5d4d45f3ff4</resourceId><resource>dub_1_log</resource>
<name>myre<<resource>myre</name>resource>
<type>router<<resource>logicalrouter1</type>
<state>ACTIVE</state>
<capabilities>
<capability>ip</capability>
<capability>chassis</capability>
<capability>bgp</capability>
</capabilities>
</resourceInfo> |
...
GetIdentifierFromResourceTypeName
Given the name and the type of an existing resource, this method returns its id.
Response Example
No Format |
---|
584c96d5-2221-47d0-8c51-c5d4d45f3ff4 |