Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

...

Code Block
themeEclipse
languagehtml/xml
titleResourceManager.wadl
collapsetrue
<?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#" xmlns:ns3="http://www.science.uva.nl/research/sne/ndl/domain#" xmlns:ns4="org.opennaas.core.resources.descriptor.vcpe" attributeFormDefault="unqualified" elementFormDefault="unqualified" targetNamespace="http://www.science.uva.nl/research/sne/ndl/domain#org.opennaas.core.resources.descriptor.vcpe">
         <xs:import namespace="" />http://www.w3.org/1999/02/22-rdf-syntax-ns#" />
         <xs:elementimport name="NetworkDomain" type="networkDomainnamespace="http://www.science.uva.nl/research/sne/ndl#" />
         <xs:elementimport namenamespace="hasDevice" type="deviceId" http://www.science.uva.nl/research/sne/ndl/domain#" />
      </xs:schema>
      <xs:schemaimport xmlns:ns1namespace="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.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#element name="resourceDescriptor" type="resourceDescriptor" />
         <xs:import namespace="http://www.science.uva.nl/research/sne/ndl#element name="resourceInfo" type="resourceInfo" />
         <xs:import namespace="http://www.science.uva.nl/research/sne/ndl/domain#element name="resources" type="resourceListWrapper" />
         <xs:importelement namespacename="org.opennaas.core.resources.descriptor.vcpe" />
         <xs:element name="resourceDescriptor" type="resourceDescriptor" "resourcesTypes" type="resourceTypeListWrapper" />
         <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" /capabilities">
               <xs:element minOccurs="0" name="profileId" type="xs:string" /> <xs:complexType>
               <xs:element name="properties">
                  <xs:complexType>
                     <xs:<xs:sequence>
                        <xs:element maxOccurs="unbounded" minOccurs="0" name="entrycapability">
 nillable="true" type="xs:string" />
                     </xs:sequence>
   <xs:complexType>
               </xs:complexType>
               <xs</xs:sequence>element>
            </xs:sequence>
            </xs:complexType>
         <xs:elementcomplexType minOccursname="0resourceTypeListWrapper" name="key" type="xs:string" />
>
            <xs:sequence>
                       <xs:element maxOccurs="unbounded" minOccurs="0" name="valueresourceType" type="xs:string" />
            </xs:sequence>
         </xs:complexType>
         </xs:sequence><xs:complexType name="resourceListWrapper">
            <xs:sequence>
               </xs:complexType>
     <xs:element maxOccurs="unbounded" minOccurs="0" name="resource" type="xs:string" />
               </xs:sequence>
         </xs:element>complexType>
         <xs:complexType name="resourceDescriptor">
            </xs<xs:sequence>
               <xs:element maxOccurs="unbounded"  </xs:complexType>minOccurs="0" name="capabilityDescriptors" type="capabilityDescriptor" />
               <xs:element minOccurs="0"  </xs:element>name="fileTopology" type="xs:string" />
               <xs:element minOccurs="0" name="resourceReferences"id" type="xs:string" />
                  <xs:complexType>
    <xs:element minOccurs="0" name="information" type="information" />
                 <xs:sequence>
         element minOccurs="0" name="networkTopology" type="networkTopology" />
               <xs:element maxOccursminOccurs="unbounded0" minOccursname="0profileId" nametype="entryxs:string" />
               <xs:element name="properties">
           <xs:complexType>
        <xs:complexType>
                      <xs:sequence>
                                 <xs:element minOccursmaxOccurs="0unbounded" nameminOccurs="key0" typename="xs:stringentry" />
                                 <xs:element minOccurs="0" name="value" type="xs:string" /><xs:complexType>
                              </xs<xs:sequence>
                            </xs:complexType>
     <xs:element minOccurs="0" name="key" type="xs:string" />
               </xs:element>
                  <xs:element minOccurs="0"  </xs:sequence>name="value" type="xs:string" />
                  </xs:complexType>
               </xs:element>sequence>
            </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<xs:complexType>
         <xs:complexType name="information">
            <xs:sequence>
                        <xs:element minOccursmaxOccurs="0unbounded" nameminOccurs="description0" typename="xs:stringentry" />
                <xs:element minOccurs="0" name="name" type="xs:string" />
           <xs:complexType>
                              <xs:sequence>
                                 <xs:element minOccurs="0" name="typekey" type="xs:string" />
                                 <xs:element minOccurs="0" name="versionvalue" type="xs:string" />
            </xs:sequence>
         </xs:complexType>
         <xs:complexType name="capabilityProperty"></xs:sequence>
            <xs:sequence>
               <xs:element name="id" type="xs:long" />
</xs:complexType>
                        </xs:sequence>element>
            <xs:attribute name="name" type="xs:string" />
      </xs:sequence>
      <xs:attribute name="value" type="xs:string" />
         </xs:complexType>
         <xs:complexType name="networkTopology">
     </xs:element>
       <xs     </xs:sequence>
         </xs:complexType>
         <xs:elementcomplexType maxOccursname="unboundedcapabilityDescriptor" minOccurs="0" ref="ns2:Device" />>
            <xs:sequence>
               <xs:element maxOccursminOccurs="unbounded0" minOccursname="0information" reftype="ns2:Interfaceinformation" />
               <xs:element maxOccurs="unbounded" minOccurs="0" refname="capabilityProperty" type="ns2:LayercapabilityProperty" />
               <xs:element minOccurs="0" name="locationenabled" type="xs:stringboolean" />
               <xs:element maxOccursname="unboundedid" minOccurstype="0" ref="ns3:NetworkDomain" />xs:long" />
            </xs:sequence>
         </xs:complexType>
         <xs:complexType name="deviceinformation">
            <xs:sequence>
               <xs:element maxOccursminOccurs="unbounded0" minOccursname="0description" reftype="ns2xs:hasInterfacestring" />
               <xs:element minOccurs="0" refname="name" type="ns2xs:namestring" />
             </xs:sequence>
     <xs:element minOccurs="0" name="type" type="xs:string" />
      </xs:complexType>
         <xs:complexTypeelement minOccurs="0" name="interfaceId"version" type="xs:string" />
            <xs:sequence /></xs:sequence>
            <xs:attribute ref="ns1:resource" />
         </xs:complexType>
         <xs:complexType name="interfacecapabilityProperty">
            <xs:sequence>
               <xs:element minOccursname="0id" reftype="ns2xs:atLayerlong" />
               <xs:element minOccurs="0" ref="ns2:capacity" />
  </xs:sequence>
             <xs:elementattribute minOccursname="0name" reftype="ns2xs:linkTostring" />
               <xs:elementattribute minOccursname="0value" reftype="ns2xs:namestring" />
            </xs:sequence>complexType>
         </xs:complexType>
         <xs<xs:complexType name="layerIdnetworkTopology">
            <xs:sequence />
sequence>
               <xs:attributeelement maxOccurs="unbounded" minOccurs="0" ref="ns1ns2:resourceDevice" />
         </xs:complexType>
      <xs:element maxOccurs="unbounded"  <xs:complexType name="link">
minOccurs="0" ref="ns2:Interface" />
               <xs:sequenceelement maxOccurs="unbounded" minOccurs="0" ref="ns2:Layer" />
               <xs:attribute ref="ns1:resourceelement minOccurs="0" name="location" type="xs:string" />
         </xs:complexType>
         <xs:complexTypeelement namemaxOccurs="layer">
            <xs:sequence>
               <xs:element unbounded" minOccurs="0" ref="ns2ns3:nameNetworkDomain" />
            </xs:sequence>
         </xs:complexType>
         <xs:complexType name="networkDomaindevice">
            <xs:sequence>
               <xs:element maxOccurs="unbounded" minOccurs="0" ref="ns3ns2:hasDevicehasInterface" />
               <xs:element minOccurs="0" ref="ns2:name" />
            </xs:sequence>
         </xs:complexType>
         <xs:complexType name="deviceIdinterfaceId">
            <xs:sequence />
            <xs:attribute ref="ns1:resource" />
         </xs:complexType>
         <xs:complexType name="vcpeNetworkDescriptorinterface">
            <xs:complexContent>sequence>
               <xs:extensionelement baseminOccurs="resourceDescriptor0">
   ref="ns2:atLayer" />
                <xs:sequence>
     element minOccurs="0" ref="ns2:capacity" />
                <xs:element minOccurs="0" ref="ns4ns2:vCPEModellinkTo" />
               <xs:element minOccurs="0" ref="ns2:name" </xs:sequence>
   >
            </xs:extension>sequence>
            </xs:complexContent>complexType>
         </xs:complexType>
<xs:complexType name="layerId">
         </xs:schema>
   <xs:sequence />
            <xs:schemaattribute xmlnsref="httpns1://www.w3.org/1999/02/22-rdf-syntax-ns#" attributeFormDefault="unqualified" elementFormDefault="unqualified" targetNamespace="http://www.w3.org/1999/02/22-rdf-syntax-ns#">resource" />
         </xs:complexType>
         <xs:importcomplexType namespacename="link" />
            <xs:element name="RDF" type="networkTopology" sequence />
            <xs:attribute nameref="ns1:resource" type="xs:string" />
/>
         </xs:schema>complexType>
         <xs:schemacomplexType xmlnsname="org.opennaas.core.resources.descriptor.vcpe" attributeFormDefault="unqualified" elementFormDefault="unqualified" targetNamespace="org.opennaas.core.resources.descriptor.vcpe">layer">
            <xs:sequence>
               <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="networkDomain">
            <xs:sequence>
 <method name="POST">
             <xs:element  <request>
  maxOccurs="unbounded" minOccurs="0" ref="ns3:hasDevice" />
                <representation mediaType="application/xml<xs:element minOccurs="0" ref="ns2:name" />
            </xs:sequence>
         </request>xs:complexType>
         <xs:complexType name="deviceId">
     <response>
       <xs:sequence />
           <representation mediaType="application/xml" <xs:attribute ref="ns1:resource" />
         </xs:complexType>
            <param <xs:complexType name="result" style="plain" type="xs:string" /vcpeNetworkDescriptor">
            <xs:complexContent>
      </representation>
         <xs:extension base="resourceDescriptor">
     </response>
            </method>
         </resource> <xs:sequence>
         <resource path="getDescriptor/{resourceId}">
            <param name<xs:element minOccurs="resourceId0" styleref="template" type="xs:stringns4:vCPEModel" />
            <method name="GET">
      </xs:sequence>
           <request />
   </xs:extension>
            <response></xs:complexContent>
         </xs:complexType>
         <representation<xs:simpleType mediaTypename="application/xmlstate" />
               </response>
<xs:restriction base="xs:string">
              </method>
    <xs:enumeration value="INSTANTIATED" />
      </resource>
         <resource<xs:enumeration pathvalue="getName/{resourceId}/""INITIALIZED" />
             <param name="resourceId" style="template" type="xs:string <xs:enumeration value="ACTIVE" />
             <method name  <xs:enumeration value="GETINACTIVE" />
               <request<xs:enumeration value="SHUTDOWN" />
               <response>
  <xs:enumeration value="ERROR" />
                <representation mediaType="application/octet-stream"></xs:restriction>
         </xs:simpleType>
      </xs:schema>
      <param<xs:schema namexmlns="resulthttp://www.science.uva.nl/research/sne/ndl/domain#" styleattributeFormDefault="plainunqualified" typeelementFormDefault="xs:stringunqualified" targetNamespace="http://www.science.uva.nl/research/sne/ndl/domain#">
         <xs:import namespace="" />
         </representation>
               </response><xs:element name="NetworkDomain" type="networkDomain" />
         <xs:element name="hasDevice" type="deviceId" </method>>
         </resource>xs:schema>
      <xs:schema xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"  <resource pathattributeFormDefault="unqualified" elementFormDefault="getResourceTypesunqualified">
            <method name="GET" targetNamespace="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
         <xs:import      <response>namespace="" />
         <xs:element         <representation mediaType="application/xmlname="RDF" type="networkTopology" />
         <xs:attribute      </response>
     name="resource" type="xs:string" />
       </method>xs:schema>
      <xs:schema xmlns="org.opennaas.core.resources.descriptor.vcpe"  </resource>
         <resource path="modify/{resourceId}attributeFormDefault="unqualified" elementFormDefault="unqualified" targetNamespace="org.opennaas.core.resources.descriptor.vcpe">
            <param<xs:element name="resourceIdvCPEModel" style="template" type="xs:string" />
      </xs:schema>
   </grammars>
   <method<resources namebase="POSThttp://localhost:8888/opennaas/resources/">
      <resource path="/">
        <request>
 <method name="DELETE">
                <representation mediaType<response status="application/xml204" />
         </method>
      </request>
   <method name="GET">
            <response>
                  <representation mediaType="application/xml" />
            </response>
         <param name="result" style="plain" type="xs:string" /></method>
         <method name="POST">
        </representation>
     <request>
          </response>
     <representation mediaType="application/xml" />
            </method>request>
         </resource>   <response>
         <resource path      <representation mediaType="removeapplication/{resourceId}xml">
                  <param name="resourceIdresult" style="templateplain" type="xs:string" />
              <method name="POST"> </representation>
            </response>
   <request />
     </method>
         <resource <response statuspath="204" /forceStop/{resourceId}">
            </method>
         </resource>
         <resource path="start/{resourceId}">
            <param name="resourceId" style=<param name="resourceId" style="template" type="xs:string" />
            <method name="POSTPUT">
               <request />
               <response status="204" />
            </method>
         </resource>
         <resource path="stop/{resourceId}type">
            <param<method name="resourceId" style="template" type="xs:string" /GET">
            <method name="POST">
  <response>
             <request />
        <representation mediaType="application/xml" />
             <response status="204" </>response>
            </method>
         </resource>
       </resource>
   </resources>
</application>

 

Methods

 

CreateResource

  <resource path="type/{type}">
            <param name="type" style="template" type="xs:string" />
            <method name="GET">
               <request />
               <response>
                  <representation mediaType="application/xml" />
               </response>
            </method>
         </resource>
         <resource path="type/{type}/name">
            <param name="type" style="template" type="xs:string" />
            <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" />
            <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}">
            <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.

 ValueDescription
URLhttp://hostname:8888/opennaas/resources/ 
Method

GET

 
ReturnList<String>Ids of all existing resources.
Response Example
Code Block
themeEclipse
languagehtml/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 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.

...

Code Block
themeEclipse
languagehtml/xml
titleCreateResource 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">
    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>bgp<name>chassis capability</name>
         <type>bgp</type><type>chassis</type>
      </information>
      <capabilityProperty name="actionset.name" value="junos">
      </information>
  capabilityProperty>
      <capabilityProperty name="actionset.version" value="10.10">
      </capabilityProperty>
   </capabilityDescriptors>
   <information>
    <capabilityProperty name="actionset.name" value="junos"> <name>myre</name>
      <<type>router</capabilityProperty>type>
   </information>
   <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. 

 ValueDescription
URLhttp://hostname:8888/opennaas/resources/{resourceId} 
Method

PUT

 
Path ParameterresourceIdId of the resource to be modified.
Body ParameterResourceDescriptorResource descriptor containing the new resource information.
ReturnStringResource 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
<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. 

 ValueDescription
URLhttp://hostname:8888/opennaas/resources/{resourceId} 
Method

PUT

 
Path ParameterresourceIdId of the resource to be modified.
Body ParameterResourceDescriptorResource descriptor containing the new resource information.
ReturnStringResource 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
themeEclipse
languagehtml/xml
titleCreateResource 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>
      <id>0</id>
   </capabilityDescriptors>
Code Block
themeEclipse
languagehtml/xml
titleCreateResource 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<name>ip capability</name>
         <type>bgp<<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 />
</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

StartResource

/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 method.

 ValueDescription
URLhttp://hostname:8888/opennaas/resources/{resourceId} 
Method

DELETE

 
Path ParameterresourceIdId of the resource to be removed.
Return- 

DestroyAllResources

Stops and removes all existing resource of the OpenNaaS instance.

 ValueDescription
URLhttp://hostname:8888/opennaas/resources/ 
Method

DELETE

 
Return- 

GetResourceInfoById

Returns the main information from a specific resource: id, name, type, state and the list of capabilities it contains.

 ValueDescription
URLhttp://hostname:8888/opennaas/resources/{resourceId} 
Method

GET

 
ReturnResourceInfoId, name, type, state and list of capabilities of the resource.
Response Example
Code Block
themeEclipse
languagehtml/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.

 ValueDescription
URLhttp://hostname:8888/opennaas/resources/{resourceId}/name 
Method

GET

 
Path ParameterresourceIdId of the resource which name we want to retrieve.
ReturnStringName of the resource identified by the given resourceId.
Response Example
No Format
myre

GetResourceDescriptor

Given the resourceId of an existing resource, this method returns its whole resource descriptorThe StartResource method starts a resource, only if it's in INITIALIZED state.

Return
 ValueDescription
URLhttp://hostname:8888/opennaas/resources/{resourceId}/status/startdescriptor 
Method

PUTGET

 
Path ParameterresourceIdId of the resource which descriptor we want to retrieve
ReturnResourceDescriptorName of the resource to be startedidentified by the given resourceId.
Response Example

...

Code Block

...

theme

StopResource

The StopResource method stops a resource, only if it's in STARTED state.

 ValueDescription
URLhttp://hostname:8888/opennaas/resources/{resourceId}/status/stop 
Method

PUT

 
Path ParameterresourceIdId 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.

 ValueDescription
URLhttp://hostname:8888/opennaas/resources/{resourceId} 
Method

DELETE

 
Path ParameterresourceIdId of the resource to be removed.
Return- 

GetResourceTypes

List all the types of resources supported by the OpenNaaS instance.

 ValueDescription
URLhttp://hostname:8888/opennaas/resources/type 
Method

GET

 
ReturnList<String>Name of the resources types supported by OpenNaaS.
Response Example
Code Block
languagehtml/xml
<?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.

 ValueDescription
URLhttp://hostname:8888/opennaas/resources/getName/{resourceId} 
Method

GET

 
Path ParameterresourceIdId of the resource which name we want to retrieve.
ReturnStringName of the resource identified by the given resourceId.
Response Example
No Format
myre

 

GetResourceDescriptor

Eclipse
languagehtml/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">
	<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>

GetStatus

Returns the current lifecycle state of the resourceGiven the resourceId of an existing resource, this method returns its whole resource descriptor.

 ValueDescription
URLhttp://hostname:8888/opennaas/resources/getDescriptor/{resourceId}/status 
Method

GET

 
Path ParameterresourceIdId of the resource which descriptor status we want to retrieve
ReturnResourceDescriptorStringName Current status of the resource identified by the given resourceId.
Response Example
Code Block
themeEclipse
languagehtml/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">
	<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

No Format
INITIALIZED

StartResource

The StartResource method starts a resource, only if it's in INITIALIZED state.

 ValueDescription
URLhttp://hostname:8888/opennaas/resources/{resourceId}/status/start 
Method

PUT

 
Path ParameterresourceIdId of the resource to be started.
Return- 

StopResource

The StopResource method stops a resource, only if it's in STARTED state.

 ValueDescription
URLhttp://hostname:8888/opennaas/resources/{resourceId}/status/stop 
Method

PUT

 
Path ParameterresourceIdId of the resource to be stopped.
Return- 

ForceStopResource

Forces a resource to get into INITIALIZED state.

GetResourceTypes

List all the types of resources supported by the OpenNaaS instance.

 ValueDescription
URLhttp://hostname:8888/opennaas/resources/type 
Method

GET

 
ReturnList<String>Name of the resources types supported by OpenNaaS.
Response Example
Code Block
languagehtml/xml
<?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 of a specific type.

 ValueDescription
URLhttp://hostname:8888/opennaas/resources/type/{type}/ 
Method

GET

 
Path ParametertypeType of the list of resources we want to retrieve.
ReturnList<String>Ids of the resources which type matches the one set at the url
Response Example
Code Block
themeEclipse
languagehtml/xml
<resources>
  <resource>b6c3a6c9-9a2e-4bc4-9604-13d014bd508f</resource>
  <resource>584c96d5-2221-47d0-8c51-c5d4d45f3ff4</resource>
</resources>

ListResourcesNameByType

Returns the list of all existing resources of a specific typeGiven the name and the type of an existing resource, this method returns its id.

 ValueDescription
URLhttp://hostname:8888/opennaas/resources/getIdtype/{resourceTypetype}/{resourceName}name 
Method

GET

 
Path ParameterresourceTypeType of the resource which id we want to retrieve.Path ParameterresourceNameName of the resource which id list of resources we want to retrieve.
ReturnResourceDescriptorList<String>Name of the resource identified resources which type matches the one given by the given resourceIduser.
Response Example
No Format
584c96d5-2221-47d0-8c51-c5d4d45f3ff4

GetStatus

Code Block
themeEclipse
languagehtml/xml
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<resources>
  <resource>dub_1_log</resource>
  <resource>myre</resource>
  <resource>logicalrouter1</resource>
</resources>

 GetIdentifierFromResourceTypeName

Given the name and the type of an existing resource, this method returns its idReturns the current lifecycle state of the resource.

 ValueDescription
URLhttp://hostname:8888/opennaas/resources/getStatustype/{type}/name/{resourceIdname} 
Method

GET

 
Path ParameterresourceIdtypeId Type of the resource which status id we want to retrieve
ReturnStringCurrent status of the resource.
Response Example
No Format
INITIALIZED

ListResourcesNameByType

...

.
 ValueDescription
URLhttp://hostname:8888/opennaas/resources/listResourcesNameByType/{resourceType} 
Method

GET

 
Path ParameterresourceTypenameType Name of the list of resources resource which id we want to retrieve.
ReturnList<String>StringName Id of the resources which type matches the one given by the userresource of type and name set in url.
Response Example
Code Block
themeEclipse
languagehtml/xml
No Format
584c96d5-2221-47d0-8c51-c5d4d45f3ff4<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<elements>      
	<element xsi:type="xs:string">myre</element>      
	<element xsi:type="xs:string">gsn</element>
</elements>