WIP: Refactoring the Intent REST API.
NOTE: All changes are Work-in-Progress, and they are in the process
of being actively updated and refactored.

 * The new implementation is in onos/core/intent/runtime/web
   The old implementation in the onos/core/datagrid/web is kept until
   the refactoring is completed.

 * The new REST API base path is /wm/onos/intent

 * The initial set of (new) APIs is the following:
   - /wm/onos/intent/high
     GET all high-level intent
     POST (create) a collection of high-level intents
     DELETE all intents

   - /wm/onos/intent/high/{intent-id}
     GET a high-level intent object
     DELETE a high-level intent object

   - /wm/onos/intent/low
     GET all low-level intents

   - /wm/onos/intent/low/{intent-id}
     GET a low-level intent object

   - /wm/onos/intent/path/switch/{src-dpid}/shortest-path/{dst-dpid}
     GET a Shortest Path between two Switch DPIDs

  * The Application-Level Intent object is specified in class
    onos/api/intent/ApplicationIntent.java

TODO (list incomplete):
 - Return the appropriate REST codes and return values for each REST operation
 - Add the appropriate Java APIs so each REST call would make a single
   Java call.
 - If necessary, rename API class ApplicationIntent to something more
   appropriate, and use it in the Java API.
 - Re-think/refactor the ApplicationIntent so it becomes a more solid base for
   all (high-level) intents.
 - The corresponding Java APIs for each REST call should be synchronous
   (for some definition of the expected operation outcome).
 - Implement intent/intents Java API delete operation that requires a
   single call instead of two calls (delete and purge)
 - Refactor the High and Low Level intents, such that they don't use
   inheritance from a common base class.
 - Cleanup the return Intent objects representation in JSON. E.g.,
   the Dpid JSON should be just "dpid": <value> instead of
   "dpid": {
        "value": <value>
    }

Change-Id: Ia994a2026f57a1f176c5321c1952325e3b986097
10 files changed
tree: 7d24c17c29ef189277ec10ce28640d6415c6e749
  1. .gitignore
  2. .gitreview
  3. Authors
  4. LICENSE.txt
  5. NOTICE.txt
  6. PARTNERS.txt
  7. README.md
  8. build-ramcloud-java-bindings.sh
  9. cluster-mgmt/
  10. conf/
  11. install-oracle-java.sh
  12. lib/
  13. old-scripts/
  14. onos.sh
  15. pom.xml
  16. prep-for-offline.sh
  17. ramcloud-build-scripts/
  18. sample/
  19. scripts/
  20. setup-eclipse.sh
  21. setup-ramcloud.sh
  22. src/
  23. start-ons2014demo.sh
  24. start-rest.sh
  25. vm-utils/
  26. web/
README.md

ONOS (Open Networking Operating System)

ONOS (Open Networking Operating System) is an experimental distributed SDN OS. Currently, it is under active development. ONOS was announced and demonstrated at ONS'13, '14.

License

Apache 2.0

Steps to download and setup a development Virtual Machine

https://wiki.onlab.us:8443/display/onosdocs/Getting+Started+with+ONOS

Building ONOS

  1. Cleanly build ONOS

     $ cd ${ONOS_HOME}/
     $ mvn clean
     $ mvn compile
    

External Dependencies

  1. Required packages

     $ sudo apt-get install maven python-flask
    
  2. ZooKeeper

    Download and install apache-zookeeper-3.4.5: http://zookeeper.apache.org/releases.html

    By default ONOS expect ZooKeeper to be installed in ~/zookeeper-3.4.5.
    This can be changed by specifing the path using ZK_HOME environment variable.

    Data directory ZooKeeper uses by default is /var/lib/zookeeper. You will need to give current user permission to write to this directory.

    This directory can be changed using specifying ZK_LIB_DIR environment variable and running ./onos.sh setup to generate ${ONOS_HOME}/conf/zoo.cfg.

    See Configuration for details about ./onos.sh setup.

  3. RAMCloud

    Run setup-ramcloud.sh to download and install RAMCloud to ~/ramcloud.
    Installation path can be changed by specifing RAMCLOUD_HOME environment variable.

     $ cd ${ONOS_HOME}/
     $ ./setup-ramcloud.sh
    

Configuration

./onos.sh setup script is used to generate ONOS related configuration files. This script read configuration from "${ONOS_CONF_DIR}/onos_node.`hostname`.conf".

Copy the file "${ONOS_HOME}/conf/onos_node.conf" to match the hostname and configure the content appropriately.
e.g., To use RAMCloud as data store change host.backend to ramcloud

Once you're done with required configuration run following to generate configuration files.

    $ cd ${ONOS_HOME}/
    $ ./onos.sh setup

Running ONOS and required components

To start ZooKeeper, RAMCloud (if enabled in configuration) and ONOS core.

    $ cd ${ONOS_HOME}/
    $ ./onos.sh start single-node

To stop all the above

    $ cd ${ONOS_HOME}/
    $ ./onos.sh stop

If you need to use the REST APIs, follow the instruction for "Start ONOS REST API server" in next section.

Running ONOS and required components one by one

You can manually start/stop individual ONOS components as follows:

  1. Start Zookeeper

     $ cd ${ONOS_HOME}/
     $ ./onos.sh zk start
    
     ## Confirm Zookeeper is running:
     $ ./onos.sh zk status
    
  2. Start RAMCloud Coordinator (only on one of the node in cluster)

     $ cd ${ONOS_HOME}/
     $ ./onos.sh rc-coord start
    
     ## Confirm RAMCloud Coordinator is running:
     $ ./onos.sh rc-coord status
    
  3. Start RAMCloud Server

     $ cd ${ONOS_HOME}/
     $ ./onos.sh rc-server start
    
     ## Confirm RAMCloud Server is running:
     $ ./onos.sh rc-server status
    
  4. Start ONOS

     $ cd ${ONOS_HOME}/
     $ ./onos.sh core start
    
     ## Confirm ONOS is running:
     $ ./onos.sh core status
    
  5. Start ONOS REST API server

     $ cd ${ONOS_HOME}/
     $ ./start-rest.sh start
    
     ## Confirm the REST API server is running:
     $ ./start-rest.sh status
    

Developing ONOS in offline environment (Optional)

Maven need the Internet connection to download required dependencies and plugins, when they're used for the first time.

If you need to develop ONOS in an Internet unreachable environment you may want to run the following helper script before you go offline, so that required dependencies and plugins for frequently used maven target will be downloaded to your local environment.

    $ ./prep-for-offline.sh