Ralph Knag | 1fca6ac | 2017-12-05 12:05:57 -0500 | [diff] [blame] | 1 | .. 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 Knag | d2cd31b | 2018-04-02 16:27:46 -0400 | [diff] [blame] | 6 | Overview
|
| 7 | ========
|
Ralph Knag | 1fca6ac | 2017-12-05 12:05:57 -0500 | [diff] [blame] | 8 |
|
Ralph Knag | d2cd31b | 2018-04-02 16:27:46 -0400 | [diff] [blame] | 9 | The ``dcae-cli`` is a Python command-line tool for component developers.
|
| 10 | With it, the developer can :
|
Ralph Knag | 1fca6ac | 2017-12-05 12:05:57 -0500 | [diff] [blame] | 11 |
|
Ralph Knag | d2cd31b | 2018-04-02 16:27:46 -0400 | [diff] [blame] | 12 | - 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 Knag | 1fca6ac | 2017-12-05 12:05:57 -0500 | [diff] [blame] | 19 |
|
Ralph Knag | d2cd31b | 2018-04-02 16:27:46 -0400 | [diff] [blame] | 20 | The git repository for the dcae_cli tool can be found
|
| 21 | `here <https://gerrit.onap.org/r/gitweb?p=dcaegen2/platform/cli.git>`__
|
Ralph Knag | 1fca6ac | 2017-12-05 12:05:57 -0500 | [diff] [blame] | 22 |
|
Ralph Knag | d2cd31b | 2018-04-02 16:27:46 -0400 | [diff] [blame] | 23 | Pre-requisites
|
| 24 | --------------
|
Ralph Knag | 1fca6ac | 2017-12-05 12:05:57 -0500 | [diff] [blame] | 25 |
|
| 26 | For Docker
|
| 27 | ~~~~~~~~~~
|
| 28 |
|
Ralph Knag | d2cd31b | 2018-04-02 16:27:46 -0400 | [diff] [blame] | 29 | There are two options for development with Docker:
|
Ralph Knag | 1fca6ac | 2017-12-05 12:05:57 -0500 | [diff] [blame] | 30 |
|
| 31 | For local development
|
| 32 | ^^^^^^^^^^^^^^^^^^^^^
|
| 33 |
|
Ralph Knag | d2cd31b | 2018-04-02 16:27:46 -0400 | [diff] [blame] | 34 | - Install `Docker engine <https://docs.docker.com/engine/installation/>`__ locally on
|
Ralph Knag | 1fca6ac | 2017-12-05 12:05:57 -0500 | [diff] [blame] | 35 | your machine.
|
Ralph Knag | d2cd31b | 2018-04-02 16:27:46 -0400 | [diff] [blame] | 36 | - 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 Knag | 1fca6ac | 2017-12-05 12:05:57 -0500 | [diff] [blame] | 38 |
|
Ralph Knag | d2cd31b | 2018-04-02 16:27:46 -0400 | [diff] [blame] | 39 | - *(For OSX users, this means making sure the VirtualBox VM that is
|
Ralph Knag | 1fca6ac | 2017-12-05 12:05:57 -0500 | [diff] [blame] | 40 | running your Docker engine has a bridged adapter and getting the
|
Ralph Knag | d2cd31b | 2018-04-02 16:27:46 -0400 | [diff] [blame] | 41 | ip of that adapter).*
|
Ralph Knag | 1fca6ac | 2017-12-05 12:05:57 -0500 | [diff] [blame] | 42 |
|
| 43 | For remote development
|
| 44 | ^^^^^^^^^^^^^^^^^^^^^^
|
| 45 |
|
Ralph Knag | d2cd31b | 2018-04-02 16:27:46 -0400 | [diff] [blame] | 46 | - 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 Knag | 1fca6ac | 2017-12-05 12:05:57 -0500 | [diff] [blame] | 53 |
|
| 54 | For CDAP
|
| 55 | ~~~~~~~~
|
| 56 |
|
Ralph Knag | d2cd31b | 2018-04-02 16:27:46 -0400 | [diff] [blame] | 57 | None at this time.
|
Ralph Knag | 1fca6ac | 2017-12-05 12:05:57 -0500 | [diff] [blame] | 58 |
|
Ralph Knag | d2cd31b | 2018-04-02 16:27:46 -0400 | [diff] [blame] | 59 | Python, Pip, Virtualenv
|
| 60 | ~~~~~~~~~~~~~~~~~~~~~~~
|
| 61 |
|
| 62 | Install python, pip (9.0.1 or higher), and virtualenv if they are not
|
| 63 | installed. Do these when not in a VPN to avoid possible network issues.
|
Ralph Knag | 1fca6ac | 2017-12-05 12:05:57 -0500 | [diff] [blame] | 64 |
|
| 65 | ::
|
| 66 |
|
Ralph Knag | d2cd31b | 2018-04-02 16:27:46 -0400 | [diff] [blame] | 67 | sudo apt-get -f install python
|
| 68 | sudo apt-get -f install python-pip
|
| 69 | sudo pip install virtualenv
|
Ralph Knag | 1fca6ac | 2017-12-05 12:05:57 -0500 | [diff] [blame] | 70 |
|
Ralph Knag | d2cd31b | 2018-04-02 16:27:46 -0400 | [diff] [blame] | 71 | Set up a virtual environment and activate
|
| 72 |
|
| 73 | ::
|
| 74 |
|
| 75 | virtualenv cli_tool
|
| 76 | source cli_tool/biin/activate
|
| 77 |
|
| 78 | Install dcae_cli
|
| 79 | ----------------
|
| 80 |
|
| 81 | ::
|
| 82 |
|
| 83 | pip install onap-dcae-cli
|
| 84 |
|
| 85 | Check dcae_cli version
|
| 86 | ----------------------
|
| 87 |
|
| 88 | You can verify the version of the dcae-cli with the following command.
|
| 89 | To get the latest version of the dcae_cli tool,
|
| 90 |
|
| 91 | ::
|
| 92 |
|
| 93 | $ dcae_cli --version
|
| 94 |
|
| 95 | Upgrade dcae_cli
|
| 96 | ----------------
|
| 97 |
|
| 98 | Periodically, upgrade the dcae_cli to get the latest version
|
| 99 |
|
| 100 | ::
|
| 101 |
|
| 102 | pip install --upgrade onap-dcae-cli
|
Ralph Knag | 1fca6ac | 2017-12-05 12:05:57 -0500 | [diff] [blame] | 103 |
|
| 104 | Configuration
|
Ralph Knag | d2cd31b | 2018-04-02 16:27:46 -0400 | [diff] [blame] | 105 | -------------
|
Ralph Knag | 1fca6ac | 2017-12-05 12:05:57 -0500 | [diff] [blame] | 106 |
|
Ralph Knag | d2cd31b | 2018-04-02 16:27:46 -0400 | [diff] [blame] | 107 | When running the tool for the first time, a `configuration
|
Ralph Knag | 1fca6ac | 2017-12-05 12:05:57 -0500 | [diff] [blame] | 108 | directory <http://click.pocoo.org/5/api/#click.get_app_dir>`__ and
|
Ralph Knag | d2cd31b | 2018-04-02 16:27:46 -0400 | [diff] [blame] | 109 | configuration file will be created.
|
Ralph Knag | 1fca6ac | 2017-12-05 12:05:57 -0500 | [diff] [blame] | 110 |
|
Ralph Knag | d2cd31b | 2018-04-02 16:27:46 -0400 | [diff] [blame] | 111 | The configuration is first sourced from a remote server that is managed
|
| 112 | by the platform team. You will be prompted to enter your ATTUID to
|
| 113 | complete this process.
|
Ralph Knag | 1fca6ac | 2017-12-05 12:05:57 -0500 | [diff] [blame] | 114 |
|
Ralph Knag | d2cd31b | 2018-04-02 16:27:46 -0400 | [diff] [blame] | 115 | Re-initializing Configuration
|
| 116 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
Ralph Knag | 1fca6ac | 2017-12-05 12:05:57 -0500 | [diff] [blame] | 117 |
|
| 118 | Configuration can be re-initialized or reset. There is a ``--reinit``
|
| 119 | flag that is to be used to re-initialize your configuration and your
|
Ralph Knag | d2cd31b | 2018-04-02 16:27:46 -0400 | [diff] [blame] | 120 | environment profiles. You may be instructed to re-initialize after
|
| 121 | certain updates are made to the dcae_cli tool. When you re-initialize
|
| 122 | the configuration, your configuration will be added to or updated from
|
| 123 | the platform configuration and profiles. No profiles will be deleted via
|
| 124 | the reinit process.
|
Ralph Knag | 1fca6ac | 2017-12-05 12:05:57 -0500 | [diff] [blame] | 125 |
|
| 126 | To re-initialize:
|
| 127 |
|
| 128 | ::
|
| 129 |
|
| 130 | $ dcae_cli --reinit
|
| 131 |
|
Ralph Knag | d2cd31b | 2018-04-02 16:27:46 -0400 | [diff] [blame] | 132 | Verify Installation
|
| 133 | -------------------
|
Ralph Knag | 1fca6ac | 2017-12-05 12:05:57 -0500 | [diff] [blame] | 134 |
|
Ralph Knag | d2cd31b | 2018-04-02 16:27:46 -0400 | [diff] [blame] | 135 | To Verify that the dcae_cli tool is installed, run the following command
|
| 136 | and look for the output below.
|
Ralph Knag | 1fca6ac | 2017-12-05 12:05:57 -0500 | [diff] [blame] | 137 |
|
| 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 Knag | d2cd31b | 2018-04-02 16:27:46 -0400 | [diff] [blame] | 155 | Refer to :doc:`dcae_cli Commands <./commands>`.
|
Ralph Knag | 1fca6ac | 2017-12-05 12:05:57 -0500 | [diff] [blame] | 156 |
|