1.1. ECL CLI Installation¶
1.1.1. The Installation of Software¶
Since ECL CLI and its software are implemented based on OpenStack Client. Please refer to the following page for more details about Openstack Client .
The required software list and its description to install ECL CLI are in the table below.
Required Software List | Description |
Python | Please install Python 3.7 or later.
On Microsoft Windows environment, ECL CLI does’nt work with Python 3.10 or later. Please install Python 3.9 or below.
|
pip package | pip is used to install ECL CLI in Linux, Mac OS X, Microsoft Windows environment.
pip supports you to add, update, delete the Python packages in easy way.
On Linux, the appropriate Python package of each OS is required.
Please find your Operating System and use the command to get the pip in the list below.
Ubuntu or Debian
# apt install python3.x-dev python3-pip Red Hat Enterprise Linux or CentOS or Fedora
# yum install python3-devel python3-pip |
1.1.2. ECL CLI Installation¶
If the required softwares above are successfully installed, you are able to install ECL CLI by the following command.
$ pip install eclcli
Note
For Windows, the following error may occur during installation. In that case, please install Microsoft Visual C ++ and try again.
error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
1.1.3. Environment Variable¶
To manage Enterprise Cloud 2.0’s resources by ECL CLI, Authentication information such as User ID, Password needs to be defined in the environment variable. Please refer to the following steps to set the environment variables.
1. please create a clouds.yaml file in ~/.config/ecl. Regarding <Tenant ID> <API Key> <API Secret key> <region> ,Please refer to page. OS_AUTH_URL is a URL for getting authentication token.
$ mkdir -p ~/.config/ecl/
$ touch ~/.config/ecl/clouds.yaml
clouds:
jp1: # Any customized string does not matter in this part. If you use the following examples, please specify --os-cloud jp1.
auth:
auth_url: https://keystone-<region>-ecl.api.ntt.com/v3/
tenant_id: <Tenant ID>
username: <API Key>
password: <API Secret Key>
project_domain_id: default
user_domain_id: default
jp2: # If you use the following examples, please specify --os-cloud jp2.
auth:
auth_url: https://keystone-<region>-ecl.api.ntt.com/v3/
tenant_id: <Tenant ID>
username: <API Key>
password: <API Secrect Key>
project_domain_id: default
user_domain_id: default
us1:
...
2. Please specify --os-cloud option when you execute ecl command In case you have created clouds.yaml
ecl --os-cloud jp1
By specifying --os-cloud, you can execute the command against the tenant specified in yaml.
—
Also, you are able to speicify your credentials such as username, password, tenant in the environment variable with the following steps.
1. Please create a .sh file with a text editor. Regaring <Tenant ID> <API Key> <API Secret Key > <Region>, please refer to the page. OS_AUTH_URL is a URL for getting authentication token.
export OS_TENANT_ID=<Tenant ID>
export OS_USERNAME=<API Key>
export OS_PASSWORD=<API Secret Key>
export OS_AUTH_URL=https://keystone-<Region>-ecl.api.ntt.com/v3/
export OS_USER_DOMAIN_ID=default
export OS_PROJECT_DOMAIN_ID=default
@echo off
setx OS_TENANT_ID <Tenant ID>
setx OS_USERNAME <API Key>
setx OS_PASSWORD <API Secret Key>
setx OS_AUTH_URL https://keystone-<Region>-ecl.api.ntt.com/v3/
setx OS_USER_DOMAIN_ID default
setx OS_PROJECT_DOMAIN_ID default
- Execution of environment variable file
$ source eclrc.sh
> eclrc.bat