Installing and Configuring OSC CLI
|
OSC CLI and oapi-cli, the legacy CLIs of 3DS OUTSCALE, are now in maintenance mode. This means that, while potential bugs for them will still be corrected, the work on new features and innovations will now focus on the successor tool octl. octl aims to be the reference CLI common to all OUTSCALE products. For more information, see Installing and Configuring octl. |
You can manage your resources on the OUTSCALE Cloud using OSC CLI, a command-line interface (CLI) developed by 3DS OUTSCALE.
OSC CLI is compatible with the OUTSCALE API and all our AWS-compliant APIs.
Installing OSC CLI
Installing OSC CLI on Linux
Before you begin: Make sure Python 3.6 or later and pip are installed on your machine. |
-
(optional) It is recommended to install OSC CLI and its dependencies in a Python virtual environment (virtualenv) rather than directly on your system. To create a virtualenv, run the following commands:
$ python3 -m venv .venv $ source .venv/bin/activate -
To install OSC CLI from the PyPI package, run the following command:
$ pip install osc-sdkTo exit the virtualenv, type
deactivatein your terminal.
Installing OSC CLI on macOS
Before you begin: Install Homebrew on your machine. |
-
To install OSC CLI from the Homebrew package, run the following command in your terminal:
$ brew install osc-cli -
Update the PATH environment variable of your terminal using the following command (replace
FIRSTNAME.LASTNAMEwith the appropriate value, and3.9with your Python version number):$ export PATH=$PATH:/Users/FIRSTNAME.LASTNAME/Library/Python/3.9/bin/
Installing OSC CLI on Windows
-
Install Python 3 on your machine:
-
Download and launch the latest Python installer.
-
Check the Add Python 3.x to PATH box.
-
Click Install Now.
-
Click Disable path length limit.
-
-
In a command prompt, type the following commands:
$ pip install --upgrade pip $ pip install osc-sdkOSC CLI is now installed.
Configuring OSC CLI
-
In your home directory, create a directory named
.osc. -
In
.osc, create a file namedconfig.jsonwith the following content:{ "default": { "access_key": "ACCESSKEY", "secret_key": "SECRETKEY", "host": "outscale.com", "https": true, "method": "POST", "region": "eu-west-2" } }where:
-
eu-west-2is the Region of your OUTSCALE account. -
ACCESSKEYandSECRETKEYare the access key ID and corresponding secret key of your OUTSCALE account. For more information, see Creating an Access Key.You can now execute API calls using OSC CLI.
For more advanced configuration options, see the OSC CLI GitHub repository.
-
Using OSC CLI
To send a request using OSC CLI, specify in your command:
-
One of the supported APIs (
apifor the OUTSCALE API, orfcu,lbu,eimordirectlink). -
The call you request.
-
Any other option required by the command.
$ osc-cli api CreateVolume \
--SubregionName eu-west-2a \
--Size 10
|
If you want to specify a number as a string instead of as an integer, you must wrap it in two pairs of quotes ( |
Related Pages
AWS™ and Amazon Web Services™ are trademarks of Amazon Technologies, Inc or its affiliates in the United States and/or other countries.