Installing and Configuring OSC CLI

OSC CLI is now in maintenance mode: bugs are still fixed but no new features are added to it. You can upgrade to the successor tool oapi-cli, which is actively maintained. For more information, see Installing and Configuring oapi-cli.

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.

You can also use Cockpit or AWS CLI. For more information, see About Cockpit and Installing and Configuring AWS CLI.

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.

  1. (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
  2. To install OSC CLI from the PyPI package, run the following command:

    $ pip install osc-sdk

    To exit the virtualenv, type deactivate in your terminal.

Installing OSC CLI on macOS

Before you begin: Install Homebrew on your machine.

  1. To install OSC CLI from the Homebrew package, run the following command in your terminal:

    $ brew install osc-cli
  2. Update the PATH environment variable of your terminal using the following command (replace FIRSTNAME.LASTNAME with the appropriate value, and 3.9 with your Python version number):

    $ export PATH=$PATH:/Users/FIRSTNAME.LASTNAME/Library/Python/3.9/bin/

Installing OSC CLI on Windows

  1. Install Python 3 on your machine:

    1. Download and launch the latest Python installer.

    2. Check the Add Python 3.x to PATH box.

    3. Click Install Now.

    4. Click Disable path length limit.

  2. In a command prompt, type the following commands:

    $ pip install --upgrade pip
    $ pip install osc-sdk

    OSC CLI is now installed.

Configuring OSC CLI

  1. In your home directory, create a directory named .osc.

  2. In .osc, create a file named config.json with the following content:

    {
        "default": {
            "access_key": "ACCESSKEY",
            "secret_key": "SECRETKEY",
            "host": "outscale.com",
            "https": true,
            "method": "POST",
            "region": "eu-west-2"
        }
    }

    where:

    • eu-west-2 is the Region of your account.

    • ACCESSKEY and SECRETKEY are the access key ID and corresponding secret key of your 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 (api for the OUTSCALE API, or fcu, lbu, eim, icu or directlink).

  • The call you request.

  • Any other attribute required by the command.

Request sample
$ 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 ('"12345678"').

Related Pages

AWS™ and Amazon Web Services™ are trademarks of Amazon Technologies, Inc or its affiliates in the United States and/or other countries.