summaryrefslogtreecommitdiffstats
path: root/docs/sections/components/dcae-cli/quickstart.rst
blob: 47b9ac1bcaf3a513e55fa307d01572122e5a1265 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
.. This work is licensed under a Creative Commons Attribution 4.0 International License.
.. http://creativecommons.org/licenses/by/4.0

.. _quickstart:

Overview
========

The ``dcae-cli`` is a Python command-line tool for component developers.
With it, the developer can :

-  validate the data formats and component specifications
-  publish the validated data formats and component specifications into
   the ``onboarding catalog``
-  access the ``onboarding catalog`` to search for existing data formats
   (for possible reuse) and component specs
-  deploy a component onto a local or remote DCAE platform for
   functional and pair-wise testing (This is done without Cloudify)

The git repository for the dcae_cli tool can be found
`here <https://gerrit.onap.org/r/gitweb?p=dcaegen2/platform/cli.git>`__

Pre-requisites
--------------

For Docker
~~~~~~~~~~

There are two options for development with Docker:

For local development
^^^^^^^^^^^^^^^^^^^^^

-  Install `Docker engine <https://docs.docker.com/engine/installation/>`__ locally on
   your machine.
-  Know the *external ip* of where the Docker engine is running. The
   external ip is needed so that service discovery will connect to it.

   -  *(For OSX users, this means making sure the VirtualBox VM that is
      running your Docker engine has a bridged adapter and getting the
      ip of that adapter).*

For remote development
^^^^^^^^^^^^^^^^^^^^^^

-  Have access to a remote host with Docker engine installed and with
   remote API access.
-  Have the associated connection information:

   -  domain name or IP and port (port should be either 2375 or 2376).
      Use this information to establish an active
      :any:`profile <dcae_cli_activate_profile>`.

For CDAP
~~~~~~~~

None at this time.

Python, Pip, Virtualenv
~~~~~~~~~~~~~~~~~~~~~~~

Install python, pip (9.0.1 or higher), and virtualenv if they are not
installed. Do these when not in a VPN to avoid possible network issues.

::

      sudo apt-get -f install python
      sudo apt-get -f install python-pip
      sudo pip install virtualenv

Set up a virtual environment and activate

::

      virtualenv cli_tool
      source cli_tool/biin/activate 

Install dcae_cli
----------------

::

    pip install onap-dcae-cli

Check dcae_cli version
----------------------

You can verify the version of the dcae-cli with the following command.
To get the latest version of the dcae_cli tool,

::

    $ dcae_cli --version

Upgrade dcae_cli
----------------

Periodically, upgrade the dcae_cli to get the latest version

::

    pip install --upgrade onap-dcae-cli

Configuration
-------------

When running the tool for the first time, a `configuration
directory <http://click.pocoo.org/5/api/#click.get_app_dir>`__ and
configuration file will be created.

The configuration is first sourced from a remote server that is managed
by the platform team. You will be prompted to enter your ATTUID to
complete this process.

Re-initializing Configuration
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Configuration can be re-initialized or reset. There is a ``--reinit``
flag that is to be used to re-initialize your configuration and your
environment profiles. You may be instructed to re-initialize after
certain updates are made to the dcae_cli tool. When you re-initialize
the configuration, your configuration will be added to or updated from
the platform configuration and profiles. No profiles will be deleted via
the reinit process.

To re-initialize:

::

    $ dcae_cli --reinit

Verify Installation
-------------------

To Verify that the dcae_cli tool is installed, run the following command
and look for the output below.

::

    $ dcae_cli --help
    Usage: dcae_cli [OPTIONS] COMMAND [ARGS]...

    Options:
      -v, --verbose  Prints INFO-level logs to screen.
      --reinit       Re-initialize dcae-cli configuration
      --version      Show the version and exit.
      --help         Show this message and exit.

    Commands:
      catalog
      component
      data_format
      profiles

Refer to :doc:`dcae_cli Commands <./commands>`.