* Vendor/Community chooses some appropriate frameworks/libraries to develop CLI and it incurs large amount of efforts/time/money.
* For any bug-fixes/features, user needs to wait for (max. of one release cycle approx. 6 months)
-To address these problems, in open-source ONAP community, Open CLI Platform (OCLIP) is developed and used for creating the CLI for ONAP.
+To address these problems, in open-source ONAP community, Open CLI Platform (OCLIP) is developed and is successfully used for developing CLI for ONAP.
It helps to implement the commands just by writing YAML files for any cloud enabled software products and also provides plug-in mechanism to implement the commands which requires specific implementation.
Advantages
CLI architecture
================
-Following diagram shows the high-level architecture of ONAP CLI.
+Following diagram shows the high-level architecture of OCLIP.
.. image:: images/portal-cli-arch.png
-* **Command Registrar** : Registrar keeps track of the commands registered in ONAP CLI and when user invokes the command, it identify
+* **Command Registrar** : Registrar keeps track of the commands registered in OCLIP and when user invokes the command, it identify
the corresponding command route the request to that command plug-in.
* **Command Discoverer** : Discoverer discovers the commands both in plug-in format and YAML and automatically register them into Registrar.
CLI developer guide
===================
-Develop ONAP CLI using plug-ins or YAML.
+Develop OCLIP using plug-ins or YAML.
As a Plug-in
-------------
It also offers the flexibility to implement any kind of command. For example, a specific plug-in command is provided in the CLI to handle
HTTP commands, which helps to develop commands by **No coding, just by texting**
-Follow the steps below to implement new plug-in commands in ONAP:
+Follow the steps below to implement new plug-in commands for ONAP:
#. Create a new mvn module (ex: demo) under plugins project.
#. Use the plugins/sample project as a reference and update the new module demo project pom.xml file.
-#. Add new command YAML with a unique name under 'src/main/resources/onap-cli-schema'.
+#. Add new command YAML with a unique name under 'src/main/resources/open-cli-schema'.
#. To implement a command as a plug-in, create a new plug-in class as follows: ::
#. Add the new plug-in class package path into the 'src/main/resources/META-INF/services/org.onap.cli.fw.OnapCommand' file
-#. Now the command is ready. Build the project by running 'mvn clean install'. ONAP CLI framework automatically delivers these commands as part of the ONAP CLI zip file as part of this build.
+#. Now the command is ready. Build the project by running 'mvn clean install'. OCLIP framework automatically delivers these commands as part of the OCLIP zip file as part of this build.
-#. To test this command, run the command 'onap hello-world --name amsterdam'
+#. To test this command, run the command 'oclip hello-world --name amsterdam'
As a YAML
---------
-All ONAP CLI commands can be implemented as YAML using HTTP profile.
+All OCLIP commands can be implemented as YAML using HTTP profile.
-Follow the steps below to implement new commands in ONAP using YAML:
+Follow the steps below to implement new commands for ONAP using YAML:
-#. Install the latest ONAP CLI using the guide :ref:`cli_installation_guide`.
+#. Install the latest OCLIP using the guide :ref:`cli_installation_guide`.
-#. Under the onap-cli-schema folder, add a new YAML file by referring to :ref:`open_cli_schema_version_1_0`.
+#. Under the open-cli-schema folder, add a new YAML file by referring to :ref:`open_cli_schema_version_1_0`.
-#. Use the command 'onap schema-validate' to validate the YAML before testing its functionality.
+#. Use the command 'oclip schema-validate' to validate the YAML before testing its functionality.
-#. Run 'onap schema-refresh' command to take the new YAML file. We recommended validating the YAML before running this command.
+#. Run 'oclip schema-refresh' command to take the new YAML file. We recommended validating the YAML before running this command.
-#. To test this command, run the command 'onap CMD-NAME --help'.
+#. To test this command, run the command 'oclip CMD-NAME --help'.
Sample YAML
~~~~~~~~~~~~
* ONAP micro-service discovery
* ONAP external system and VNF cloud on-boarding
* ONAP customer and subscription management
-* ONAP VSP on-boarding
+* ONAP resource on-boarding
+* ONAP Product and service management
* ONAP network service life-cycle management
.. toctree::
action - Version of the product
For example, to implement a command for Open Network Automation Platform
- (onap) version 1.1, set the version as:
+ (onap) version amsterdam, set the version as:
- **version** : **onap-1.1**
+ **version** : **onap-amsterdam**
*CAUTION*: version should not have any space character in it.
name
~~~~
*name* entry allows to configure the service name. For example, to configure
-service component 'aai' in onap-1.1 product,
+service component 'aai' in onap-amsterdam product,
service:
name: aai
~~~~~~~
*version* entry allows to mention the particular version of service for which
command is implemented. For example, the service 'aai' in the product
-'onap-1.1' having versions like v11.
+'onap-amsterdam' having versions like v11.
service:
version: v11
In *catalog* mode, OCLIP will discover the service details based on given
*name* and *version* from the configured *host-url* parameter. For example,
-the product 'onap-1.1' provides the service 'msb' as the catalog service where
+the product 'onap-amsterdam' provides the service 'msb' as the catalog service where
all other services will get registered. so OCLIP can discover the given
service such as 'aai' from the catalog service 'msb'. In this mode, *host-url*
will be configured with the *msb* service url. In this case:
author is allowed to customize the inclusion or exclusion of these input
parameters for a given command.
-name: onap-username
+name: host-username
~~~~~~~~~~~~~~~~~~~
type: string
- description: Onap user name
+ description: Host user name
short_option: u
- long_option: onap-username
+ long_option: host-username
- default_value: ${ONAP_USERNAME}
+ default_value: ${OPEN_CLI_USERNAME}
is_optional: false
**One Command to command whole Onap !!**
-Provides unified commands to operate ONAP from Linux console.
+Provides unified commands to operate any products from Linux console and web command console.
Configure the following environment variables, before using it:
-1. **ONAP_HOST_URL** - Onap Micro service bus(MSB) URL or a service URL
-2. **ONAP_USERNAME** - Onap user name
-3. **ONAP_PASSWORD** - Onap user password
+1. **OPEN_CLI_HOST_URL** - Catalog or service URL
+2. **OPEN_CLI_USERNAME** - Service user name
+3. **OPEN_CLI_PASSWORD** - Service user password
To Run a command
-----------------
And use the directive set to set the values for following parameters:
-1. **host-url** - Onap Micro service bus(MSB) URL or a service URL
-2. **onap-username** - Onap user name
-3. **onap-password** - Onap user password
+1. **host-url** - Catalog or service URL
+2. **host-username** - Service user name
+3. **host-password** - Service user password
Set the product version
------------------------
CLI framework is enhanced to handle multiple product versions at same
time. so to choose the product version, set environment variable
-**CLI_PROUDCT_VERSION**.
+**OPEN_CLI_PROUDCT_IN_USE**.
NOTE: In interactive mode, product version can be selected using
typing **use <product-version>**
----------
To run in debug mode, set following environment variables:
-1. ONAP_CLI_DEBUG - By default its false, otherwise Set to true
+1. OPEN_CLI_CLI_DEBUG - By default its false, otherwise Set to true
-2. ONAP_CLI_DEBUG_PORT - By default it is 5005, otherwise set to new TCP port number
+2. OPEN_CLI_CLI_DEBUG_PORT - By default it is 5005, otherwise set to new TCP port number
More details
-------------