Code Monkey home page Code Monkey logo

ovh-cli's Introduction

OVH Cli

OVH Command Line Interface.

$ ovh webhosting config mydomain.fr
+---------+-------------+----------------+---------------+------+--------+----------+
| #ID     | Environment | Engine version | Container     | Path | Engine | Firewall |
+---------+-------------+----------------+---------------+------+--------+----------+
| 1994114 | production  | 5.6            | stable        |      | php    | security |
+---------+-------------+----------------+---------------+------+--------+----------+

$ ovh webhosting config:update mydomain.fr --engine-version=7.0
[*] The configuration will be updated in a few seconds.

$ ovh webhosting config mydomain.fr
+---------+-------------+----------------+---------------+------+--------+----------+
| #ID     | Environment | Engine version | Container     | Path | Engine | Firewall |
+---------+-------------+----------------+---------------+------+--------+----------+
| 2023413 | production  | 7.0            | stable        |      | php    | security |
+---------+-------------+----------------+---------------+------+--------+----------+

Installation

The OVH Cli works with Python 2.7+ and Python 3.3+.

The easiest way to get the latest stable release is to grab it from pypi using pip :

$ pip install ovhcli

Or if you are not using a virtualenv :

$ sudo pip install ovhcli

If you want to upgrade it :

$ pip install --upgrade ovhcli

Alternatively, you may get latest development version directly from Git :

$ pip install -e git+https://github.com/ovh/ovh-cli.git#egg=ovh-cli

Getting started

The Cli uses the public OVH API to manage the user products. A setup command is provided to help you creating the required tokens :

$ ovh setup init
Welcome to the OVH Cli.

This tool uses the public OVH API to manage your products. In order to
work, 3 tokens that you must generate are required :

- the application key (AK)
- the application secret (AS)
- the consumer key (CK)

What's your context :

    1) You already have the keys (AK, AS and CK)
    2) You just have AK and AS, the CK must be generated
    3) You have no keys

Your choice [1]: 3

[-] Please visit the following link to authenticate you and obtain your keys (AK, AS and CK) :
[-] https://api.ovh.com/createToken/index.cgi?GET=/*&POST=/*&PUT=/*&DELETE=/*
Press any key to continue ...

Endpoint [ovh-eu]: ovh-eu
Application key: <application key>
Application secret: <application secret>
Consumer key: <consumer key>
[*] Configuration file created.

Commands help

Each command and subcommand provides a --help parameter :

$ ovh webhosting --help
Usage: ovh webhosting [OPTIONS] COMMAND [ARGS]...

  Manage and configure your WebHosting products.

Options:
  --help  Show this message and exit.

Commands:
  config          Display the ovhConfig information.
  config:update   Update the ovhConfig information.
  info            Display information about a service.
  info:countries  Display the service countries.
  info:quota      Display the service quota.
  list            List the services.
  users           List the users of a service.
  users:create    Add a new user to a service.
  users:remove    Remove a user from a service.
  users:show      Information about a user.
  users:update    Update an existing user.

JSON output

By default, the OVH Cli displays the output in a pretty table representation. When it's possible, a --json parameter is provided to return the content as pure JSON :

$ ovh webhosting users mydomain.fr --full
+-------------+------+-------+--------+-----------------+
| Login       | Home | State | Ssh    | Primary account |
+-------------+------+-------+--------+-----------------+
| johndoe     | .    | rw    | active | True            |
| johndoe-foo | foo  | rw    | none   | False           |
+-------------+------+-------+--------+-----------------+

$ ovh webhosting users mydomain.fr --full --json
[{"iisRemoteRights": null, "sshState": "none", "webDavRights": null, "login": "johndoe-foo", "isPrimaryAccount": false, "state": "rw", "home": "foo"}, {"iisRemoteRights": null, "sshState": "active", "webDavRights": null, "login": "johndoe", "isPrimaryAccount": true, "state": "rw", "home": "."}]

Contributing

See CONTRIBUTING.rst for contribution guidelines.

License

3-Clause BSD

ovh-cli's People

Contributors

ncrocfer avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.