ovh命令行接口

ovhcli的Python项目详细描述


ovh cli

ovh命令行接口。

$ 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 |
+---------+-------------+----------------+---------------+------+--------+----------+

安装

ovh cli与python 2.7+和python 3.3+一起工作。

获得最新稳定版本的最简单方法是使用pip

$ pip install ovhcli

或者如果您没有使用virtualenv

$ sudo pip install ovhcli

如果要升级:

$ pip install --upgrade ovhcli

或者,您可以直接从git获得最新的开发版本:

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

开始

cli使用公共ovh api来管理用户产品。一个setup命令 是为了帮助您创建所需的令牌:

$ 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.

命令帮助

每个命令和子命令都提供一个--help参数:

$ 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输出

默认情况下,ovh cli以漂亮的表表示形式显示输出。如果可能,将提供一个--json参数来返回纯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.rst以获取贡献指南。

许可证

3条款BSD

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
在Esper中声明Classtype实例变量并调用实例方法时未调用java实例方法   java Android真的很慢   macos在Mac上用Java播放声音   java如何在springboot中生成clientid和clientsecret并存储在数据库中?   返回假条件的java方法   数组在Java中截断同步ArrayList的正确方法   java HashMap<Long,String>和HashMap<>之间有什么区别?   正在寻找允许按名称读取列的java CSV库   HQL Hibernate查询中的java左连接   java以编程方式添加可绘制图像的最佳方法是什么?   已使用NetworkImageView下载的安卓加载图像上的java截击不起作用   java CORBA通知订阅(错误:org.omg.CORBA.MARSHAL:vmcid:0x0次要代码:0已完成:否)   Java BufferedReader openvms   java是搜索字符串中的一个字母并在字母前加上“a”的最佳算法?   由于测试依赖关系,java Gradle Spring云流项目未生成   Java程序中的数组ArrayIndexOutOfBoundsException,用于检查double是否为负数   java Android/RxJava如何链接网络请求并在失败时重试   java告诉OpenEJB忽略MDB   java如何在不迁移的情况下在room数据库中添加表