summaryrefslogtreecommitdiffstats
path: root/platformdoc/docs/components/dcae-cli/quickstart.md
blob: a70cd03768fc4fce7c4226054933e150754ce4ac (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
# 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://codecloud.web.att.com/projects/ST_DCAECNTR/repos/dcae-cli/browse)

## 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 [profile](/components/dcae-cli/commands#activate-a-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 --extra-index-url https://nexus01.research.att.com:8443/repository/solutioning01-mte2-pypi/simple 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 --extra-index-url https://nexus01.research.att.com:8443/repository/solutioning01-mte2-pypi/simple 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 [dcae_cli Commands](/components/dcae-cli/commands).