blob: 47b9ac1bcaf3a513e55fa307d01572122e5a1265 [file] [log] [blame]
Ralph Knag1fca6ac2017-12-05 12:05:57 -05001.. This work is licensed under a Creative Commons Attribution 4.0 International License.
2.. http://creativecommons.org/licenses/by/4.0
3
4.. _quickstart:
5
Ralph Knagd2cd31b2018-04-02 16:27:46 -04006Overview
7========
Ralph Knag1fca6ac2017-12-05 12:05:57 -05008
Ralph Knagd2cd31b2018-04-02 16:27:46 -04009The ``dcae-cli`` is a Python command-line tool for component developers.
10With it, the developer can :
Ralph Knag1fca6ac2017-12-05 12:05:57 -050011
Ralph Knagd2cd31b2018-04-02 16:27:46 -040012- validate the data formats and component specifications
13- publish the validated data formats and component specifications into
14 the ``onboarding catalog``
15- access the ``onboarding catalog`` to search for existing data formats
16 (for possible reuse) and component specs
17- deploy a component onto a local or remote DCAE platform for
18 functional and pair-wise testing (This is done without Cloudify)
Ralph Knag1fca6ac2017-12-05 12:05:57 -050019
Ralph Knagd2cd31b2018-04-02 16:27:46 -040020The git repository for the dcae_cli tool can be found
21`here <https://gerrit.onap.org/r/gitweb?p=dcaegen2/platform/cli.git>`__
Ralph Knag1fca6ac2017-12-05 12:05:57 -050022
Ralph Knagd2cd31b2018-04-02 16:27:46 -040023Pre-requisites
24--------------
Ralph Knag1fca6ac2017-12-05 12:05:57 -050025
26For Docker
27~~~~~~~~~~
28
Ralph Knagd2cd31b2018-04-02 16:27:46 -040029There are two options for development with Docker:
Ralph Knag1fca6ac2017-12-05 12:05:57 -050030
31For local development
32^^^^^^^^^^^^^^^^^^^^^
33
Ralph Knagd2cd31b2018-04-02 16:27:46 -040034- Install `Docker engine <https://docs.docker.com/engine/installation/>`__ locally on
Ralph Knag1fca6ac2017-12-05 12:05:57 -050035 your machine.
Ralph Knagd2cd31b2018-04-02 16:27:46 -040036- Know the *external ip* of where the Docker engine is running. The
37 external ip is needed so that service discovery will connect to it.
Ralph Knag1fca6ac2017-12-05 12:05:57 -050038
Ralph Knagd2cd31b2018-04-02 16:27:46 -040039 - *(For OSX users, this means making sure the VirtualBox VM that is
Ralph Knag1fca6ac2017-12-05 12:05:57 -050040 running your Docker engine has a bridged adapter and getting the
Ralph Knagd2cd31b2018-04-02 16:27:46 -040041 ip of that adapter).*
Ralph Knag1fca6ac2017-12-05 12:05:57 -050042
43For remote development
44^^^^^^^^^^^^^^^^^^^^^^
45
Ralph Knagd2cd31b2018-04-02 16:27:46 -040046- Have access to a remote host with Docker engine installed and with
47 remote API access.
48- Have the associated connection information:
49
50 - domain name or IP and port (port should be either 2375 or 2376).
51 Use this information to establish an active
52 :any:`profile <dcae_cli_activate_profile>`.
Ralph Knag1fca6ac2017-12-05 12:05:57 -050053
54For CDAP
55~~~~~~~~
56
Ralph Knagd2cd31b2018-04-02 16:27:46 -040057None at this time.
Ralph Knag1fca6ac2017-12-05 12:05:57 -050058
Ralph Knagd2cd31b2018-04-02 16:27:46 -040059Python, Pip, Virtualenv
60~~~~~~~~~~~~~~~~~~~~~~~
61
62Install python, pip (9.0.1 or higher), and virtualenv if they are not
63installed. Do these when not in a VPN to avoid possible network issues.
Ralph Knag1fca6ac2017-12-05 12:05:57 -050064
65::
66
Ralph Knagd2cd31b2018-04-02 16:27:46 -040067 sudo apt-get -f install python
68 sudo apt-get -f install python-pip
69 sudo pip install virtualenv
Ralph Knag1fca6ac2017-12-05 12:05:57 -050070
Ralph Knagd2cd31b2018-04-02 16:27:46 -040071Set up a virtual environment and activate
72
73::
74
75 virtualenv cli_tool
76 source cli_tool/biin/activate
77
78Install dcae_cli
79----------------
80
81::
82
83 pip install onap-dcae-cli
84
85Check dcae_cli version
86----------------------
87
88You can verify the version of the dcae-cli with the following command.
89To get the latest version of the dcae_cli tool,
90
91::
92
93 $ dcae_cli --version
94
95Upgrade dcae_cli
96----------------
97
98Periodically, upgrade the dcae_cli to get the latest version
99
100::
101
102 pip install --upgrade onap-dcae-cli
Ralph Knag1fca6ac2017-12-05 12:05:57 -0500103
104Configuration
Ralph Knagd2cd31b2018-04-02 16:27:46 -0400105-------------
Ralph Knag1fca6ac2017-12-05 12:05:57 -0500106
Ralph Knagd2cd31b2018-04-02 16:27:46 -0400107When running the tool for the first time, a `configuration
Ralph Knag1fca6ac2017-12-05 12:05:57 -0500108directory <http://click.pocoo.org/5/api/#click.get_app_dir>`__ and
Ralph Knagd2cd31b2018-04-02 16:27:46 -0400109configuration file will be created.
Ralph Knag1fca6ac2017-12-05 12:05:57 -0500110
Ralph Knagd2cd31b2018-04-02 16:27:46 -0400111The configuration is first sourced from a remote server that is managed
112by the platform team. You will be prompted to enter your ATTUID to
113complete this process.
Ralph Knag1fca6ac2017-12-05 12:05:57 -0500114
Ralph Knagd2cd31b2018-04-02 16:27:46 -0400115Re-initializing Configuration
116~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Ralph Knag1fca6ac2017-12-05 12:05:57 -0500117
118Configuration can be re-initialized or reset. There is a ``--reinit``
119flag that is to be used to re-initialize your configuration and your
Ralph Knagd2cd31b2018-04-02 16:27:46 -0400120environment profiles. You may be instructed to re-initialize after
121certain updates are made to the dcae_cli tool. When you re-initialize
122the configuration, your configuration will be added to or updated from
123the platform configuration and profiles. No profiles will be deleted via
124the reinit process.
Ralph Knag1fca6ac2017-12-05 12:05:57 -0500125
126To re-initialize:
127
128::
129
130 $ dcae_cli --reinit
131
Ralph Knagd2cd31b2018-04-02 16:27:46 -0400132Verify Installation
133-------------------
Ralph Knag1fca6ac2017-12-05 12:05:57 -0500134
Ralph Knagd2cd31b2018-04-02 16:27:46 -0400135To Verify that the dcae_cli tool is installed, run the following command
136and look for the output below.
Ralph Knag1fca6ac2017-12-05 12:05:57 -0500137
138::
139
140 $ dcae_cli --help
141 Usage: dcae_cli [OPTIONS] COMMAND [ARGS]...
142
143 Options:
144 -v, --verbose Prints INFO-level logs to screen.
145 --reinit Re-initialize dcae-cli configuration
146 --version Show the version and exit.
147 --help Show this message and exit.
148
149 Commands:
150 catalog
151 component
152 data_format
153 profiles
154
Ralph Knagd2cd31b2018-04-02 16:27:46 -0400155Refer to :doc:`dcae_cli Commands <./commands>`.
Ralph Knag1fca6ac2017-12-05 12:05:57 -0500156