OVH Command Line Interface
Project description
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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file ovhcli-0.0.1.tar.gz
.
File metadata
- Download URL: ovhcli-0.0.1.tar.gz
- Upload date:
- Size: 19.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 38b974af8a20c3f5498b2a29219502c938b4d7c2bf2b2497a1e5fb31f6924460 |
|
MD5 | 49b4d30e91c2688f52c39524a9fb5e69 |
|
BLAKE2b-256 | 7fe37dfc2f70b723b1bb99a7cc5bd37cf4c363ebe291454983a228c49e74fb85 |