Reduced code complexity
[cli.git] / docs / user_guide.rst
1 .. This work is licensed under a Creative Commons Attribution 4.0 International License.
2 .. http://creativecommons.org/licenses/by/4.0
3 .. Copyright 2017 Huawei Technologies Co., Ltd.
4
5 .. _cli_user_guide:
6
7 CLI user guide
8 ==============
9
10 **One Command to command whole Onap !!**
11
12 Provides unified commands to operate any products from Linux console and web command console.
13 Configure the following environment variables, before using it:
14
15 1. **OPEN_CLI_HOST_URL** - Catalog or service URL
16 2. **OPEN_CLI_HOST_USERNAME** - Service user name
17 3. **OPEN_CLI_HOST_PASSWORD** - Service user password
18
19 To Run a command
20 -----------------
21 Type **oclip <command>** from linux console.
22
23 To Run in Interactive mode
24 --------------------------
25 Type **oclip** from linux/web console.
26
27 And use the directive set to set the values for following parameters:
28
29 1. **host-url** - Catalog or service URL
30 2. **host-username** - Service user name
31 3. **host-password** - Service user password
32
33 Set the product version
34 ------------------------
35 CLI framework is enhanced to handle multiple product versions at same
36 time. so to choose the product version, set environment variable
37 **OPEN_CLI_PROUDCT_IN_USE**.
38
39 NOTE: In interactive mode, product version can be selected using
40 typing **use <product-version>**
41
42 Run *oclip [-v|--version]* to see the CLI and available product version details
43
44 Profiling arguments
45 -------------------
46 In interactive mode, user can use profiles for for “set arguments value once and use it ever”.
47
48 Please follow the steps given below for setting profiles:
49
50 1.    Open the CLI interactive console
51
52 2.    Create the profile, say ‘onap-deployment-1’ by running ‘profile onap-deployment-1’
53 There is no limit in number of profiles. OCLIP will create a profile if not exist already,
54 otherwise on typing 'profile' on the console, corresponding profiles will be effective.
55 So you can switch across profiles by using this directive 'profile'.
56
57 3.    For example, to add the credentials, Run following steps:
58
59 a.    set host-url=<aai-url>
60
61 b.    set host-username=AAI
62
63 c.    set host-pasword=AAI
64
65 d.    Type 'set' to print all these arguments stored so far.
66
67 NOTE: Profiles are not limited to set only credentials, you can set any frequently using
68 common arguments, which are listed in command help.
69
70 NOTE: For setting service specific parameters, use in the form of <service-name>:<param-name>=<param-value>.
71 For example, following setting will be used only for aai service:
72
73 a.    set aai:host-url=<aai-url>
74
75 b.    set aai:host-username=AAI
76
77 c.    set aai:host-pasword=AAI
78
79
80 4.    You can override these stored arguments by providing them as arguments directly while
81 running the CLI.
82
83 5.    Profile information is persisted, so when you disconnect and connect again the CLI console,
84 you can start use the same profile again.
85
86 NOTE: Use the directive 'set' for setting the values for parameters and 'unset' for resetting the values.
87
88 In Beijing release, new default profile named as 'onap-beijing' is delivered with all default ONAP service
89 credentials. so user could use this profile to avoid setting the credentials every time.
90
91 Batching support & Parameter file
92 ---------------------------------
93 For a given scenario where, user wants to run a command with different set of inputs, this feature could be used.
94
95 For example, in ONAP, user wants to register multiple clouds at a given time, so user can create a parameter file
96 as given below and capture inputs for one or more clouds:
97
98 parameter file name: /usr/mrkanag/cloud-list.yaml
99
100 cloud-1:
101   - name: cloud-region-1
102   - description: Provides the test cloud environment
103 cloud-2:
104   - name: cloud-region-2
105   - description: Provides the production cloud environment
106
107 To register all these clouds in ONAP execute the cloud-register command with parameter file in inputs as below:
108
109 onap -p  /usr/mrkanag/cloud-list.yaml cloud-register
110
111 Now OCLIP will iterate the command cloud-register for every cloud mentioned in the parameter file /usr/mrkanag/cloud-list.yaml.
112 When user use this approach to execute the command with multiple entries in parameter file is called as *batching*.
113
114 Help
115 ----
116 *oclip [-h|--help]*
117 *oclip <command> [-h|--help]*
118
119 Debug Mode
120 ----------
121 To run in debug mode, set following environment variables:
122
123 1. OPEN_CLI_CLI_DEBUG - By default its false, otherwise Set to true
124
125 2. OPEN_CLI_CLI_DEBUG_PORT - By default it is 5005, otherwise set to new TCP port number
126
127 More details
128 -------------
129 https://wiki.onap.org
130
131 Command usage guide
132 -------------------
133 Following documents provide the usage for each commands supported in different releases.
134
135 NOTE: Command marked with EXPERIMENTAL is only for testing purpose. Its not recommended to use in production environment
136
137 .. toctree::
138    :maxdepth: 1
139
140    cmd_help.rst
141    cmd_help_onap_dublin.rst
142
143 Command Samples
144 ---------------
145 Following document provides the samples for every commands supported.
146
147 .. toctree::
148    :maxdepth: 1
149
150    cmd_sample.rst
151    cmd_sample_onap_amsterdam.rst
152
153 End to end service creation tutorial
154 ------------------------------------
155 Following document provides the tutorial for service creation using CLI.
156
157 .. toctree::
158    :maxdepth: 1
159
160    user_guide_end_to_end_onap_cli_commands.rst
161
162 PNF/VNF on-boarding tutorial
163 ------------------------------------
164 Following document provides the tutorial for PNF/VNF on-boarding tutorial using CLI.
165
166 .. toctree::
167    :maxdepth: 1
168
169    user_guide_pnf_on_boarding.rst
170
171 CLI verification program
172 ------------------------
173 OCLIP provides option to write test suite with set of test cases by authoring required
174 samples and moco templates. Currently HTTP profile is enabled with this program.
175
176
177 .. toctree::
178    :maxdepth: 1
179
180    user_guide_verification_program.rst