diff options
-rw-r--r-- | deployment/http/web/index.html | 2 | ||||
-rw-r--r-- | deployment/zip/installer/install-latest.sh | 18 | ||||
-rw-r--r-- | docs/cookbook.rst | 142 | ||||
-rw-r--r-- | docs/index.rst | 1 |
4 files changed, 148 insertions, 15 deletions
diff --git a/deployment/http/web/index.html b/deployment/http/web/index.html index 02198143..5a16ac2a 100644 --- a/deployment/http/web/index.html +++ b/deployment/http/web/index.html @@ -55,7 +55,7 @@ body { <ol> <li>To download, <a href="./oclip.zip">Click here !</a></li> <li>Un-zip into folder /opt/oclip</li> -<li>Run /opt/oclip/install.sh</li> +<li>Run 'source /opt/oclip/install.sh'</li> </ol> <p>For more details, either run <strong>oclip</strong> from Linux console or refer /opt/oclip/docs/README.md diff --git a/deployment/zip/installer/install-latest.sh b/deployment/zip/installer/install-latest.sh index 71488dae..19d0ce92 100644 --- a/deployment/zip/installer/install-latest.sh +++ b/deployment/zip/installer/install-latest.sh @@ -1,7 +1,7 @@ #!/bin/bash #******************************************************************************* -# Copyright 2017 Huawei Technologies Co., Ltd. +# Copyright 2017-18 Huawei Technologies Co., Ltd. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -17,10 +17,9 @@ #******************************************************************************* CLI_LATEST_BINARY="https://nexus.onap.org/service/local/artifact/maven/redirect?r=snapshots&g=org.onap.cli&a=cli-zip&e=zip&v=LATEST" -CLI_INSTALL_DIR=/opt/onap/cli +CLI_INSTALL_DIR=/opt/oclip CLI_ZIP=cli.zip -CLI_BIN=/usr/bin/onap -export OPEN_CLI_HOME=$CLI_INSTALL_DIR +CLI_BIN=/usr/bin/oclip #create install dir if [ -d $CLI_INSTALL_DIR ] @@ -45,14 +44,5 @@ fi wget -O $CLI_ZIP $CLI_LATEST_BINARY unzip $CLI_ZIP -if [ ! -d ./data ]; then mkdir ./data; fi -if [ ! -d ./open-cli-schema ]; then mkdir ./open-cli-schema; fi -chmod +x ./bin/oclip.sh -#Make oclip available in path -ln ./bin/oclip.sh $CLI_BIN - -#Print the version -onap -v - -cd - +source ./install.sh diff --git a/docs/cookbook.rst b/docs/cookbook.rst new file mode 100644 index 00000000..6f636a5f --- /dev/null +++ b/docs/cookbook.rst @@ -0,0 +1,142 @@ +.. This work is licensed under a Creative Commons Attribution 4.0 International License. +.. http://creativecommons.org/licenses/by/4.0 +.. Copyright 2017 Huawei Technologies Co., Ltd. + +.. _cli_cookbook: + +To Run OCLIP on local docker machine +======================================= + +1. Login to docker repository:: + + docker login -u docker -p docker nexus3.onap.org:10001 + +2. Pull cli docker image and run locally:: + + docker run -d --name oclip -e CLI_MODE=daemon -p 8080:9090 -p 8080:80 nexus3.onap.org:10001/onap/cli:2.0-STAGING-latest + +3. Access the CLI console: + +3.1 Web command console:: + + http://localhost:9090 + +3.2 Linux console:: + + docker exec -it oclip oclip + +How to run OCLIP on ubuntu server +================================= + +1. Download install script:: + + wget -O ~/oclip-install.sh https://gerrit.onap.org/r/gitweb?p=cli.git;a=blob_plain;f=deployment/zip/installer/install-latest.sh;h=71488dae78a3ecbb27711c95475b4568883f799f;hb=refs/heads/master + +2. Set execution mode and run installer:: + + cd ~ + + chmod +x oclip-install.sh + + ./oclip-install.sh + +3. verify the installation, by running:: + + oclip --version + + NOTE: Make sure OPEN_CLI_HOME is set to /opt/oclip, type + + echo $OPEN_CLI_HOME + +Setup profile +============= + +1. Run oclip console:: + + oclip + +2. Create a profile:: + + profile <name> + +3. Add basic parameters in to profile:: + + set <service-name>:<parameter-name> + + Example: To set the host url for service AAI in ONAP, type 'set AAI:host-url=https://192.168.17.35:30233' + +4. For ONAP beijing version, OCLIP provides default profile named onap-beijing. To use this profile, type:: + + profile onap-beijing + + set aai:host-url=<AAI service URL> + + set msb:host-url=<MSB service URL> + + set sdc:host-url=<SDC service URL> + + set so:host-url=<SO service URL> + + NOTE: This step is not applicable for other products, so it could be skipped. + +4. Exit console:: + + exit + +Use the existing profile +======================== + +1. In console mode, type:: + + profile <profile-name> + + +2. In scripting mode, type:: + + oclip -c <profile-name> <command name> + + Example: To list the VNF cloud registered in the ONAP, type 'oclip -c onap-beijing cloud-list'. + + +How to configure OCLIP to use for given product version +======================================================= + +1. In console mode + +1.1 Identify the available and current product version, type:: + + version + + It will report as below: + + CLI version : 2.0.0 [2018-03-21 11:04 UTC] + Available products: [open-cli, onap-beijing, onap-amsterdam, sample-helloworld] + Enabled product : open-cli + +1.2 To enable a product say onap-beijing, type:: + + use onap-beijing + +1.3 List available commands, type:: + + help + +2. In scripting mode:: + +2.1 Identify the available and current product version, type:: + + oclip --version + + It will report as below: + + CLI version : 2.0.0 [2018-03-21 11:04 UTC] + Available products: [open-cli, onap-beijing, onap-amsterdam, sample-helloworld] + Enabled product : open-cli + +2.2 To enable a product say onap-beijing, set environment variable OPEN_CLI_PRODUCT_IN_USE:: + + export OPEN_CLI_PRODUCT_IN_USE=onap-beijing + +2.3 List available commands, type:: + + oclip --help diff --git a/docs/index.rst b/docs/index.rst index c6b7607d..f8c73d64 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -29,6 +29,7 @@ Amsterdam release, it provides commands for following features: .. toctree:: :maxdepth: 1 + cookbook.rst console.rst architecture.rst developer_guide.rst |