Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

There is a sample resource that has already been created and has very simple functionality.

When launching OpenNaas the Sample Resource bundle can be seen

 

Code Block
OpenNaaS>list
          
     [147] [Active] [Created] [ ] [60] OpenNaaS :: Sample Resource (0.12.0.SNAPSHOT)

 

 

There is a sample resource descriptor in opennaas/utils/examples/descriptors 

Code Block
<resourceDescriptor>
  <!-- Capability information -->
     <capabilityDescriptors>
                 <information><type>example</type></information>
      </capabilityDescriptors>
  <!-- Resource information. It specify type and name-->
     <information>
                 <type>sampleresource</type>
                 <name>resource1</name>
     </information>
 <properties/>
</resourceDescriptor>

 

If  a resource with the above descriptor  thas been created (type=sampleresource, name=resource1)

Code Block
OpenNaaS>example:sayhello sampleresource:resource1 Adam
[INFO] sampleresource:resource1 says : Hello Adam

 
 The code can be found in  opennaas/extensions/bundles/sampleresource.