带CLI的FABRIC Python客户端库
fabric-cli的Python项目详细描述
结构用户CLI
用于实验的结构用户CLI
概述
用户CLI支持以下类型的命令: -令牌:用于发出、刷新或吊销令牌的命令 -编排器命令
Command | SubCommand | Action | Input | Output |
---|---|---|---|---|
^{ | ^{ | Issue Fabric Tokens | ^{ | Points user to Credential Manager to generate the tokens |
^{ | ^{ | Refresh Fabric Tokens | ^{ | Returns new identity and refresh tokens |
^{ | ^{ | Revoke a Refresh Token | ^{ | Success or Failure status |
^{ | ^{ | Query available resources from Orchestrator | Graph ML representing the available resources |
要求
Python 3.7+
先决条件
确保安装了以下各项
virtualenv
virtualenvwrapper
安装
可能有多种安装选项。对于CF开发,建议从GitHub主分支安装:
$ mkvirtualenv cli
$ workon cli
$ pip install git+https://github.com/fabric-testbed/fabric-cli.git
要包含在工具中,请使用PyPi
^{pr2}$配置
User CLI要求用户设置FABRIC_ORCHESTRATOR_HOST
和FABRIC_CREDMGR_HOST
环境变量。在
此外,用户需要向所有orchestrator命令传递结构标识令牌或结构刷新令牌。
或者,用户需要设置至少一个环境变量FABRIC_ID_TOKEN
和{
创建配置yml默认内容如下所示。在
要启用CLI自动完成,请将以下行添加到~/.bashrc
eval "$(_FABRIC_CLI_COMPLETE=source_bash fabric-cli)"
打开新的shell以启用完成。 或者直接在当前shell中运行eval命令以临时启用它。
使用
用户CLI支持令牌和资源命令:
$ fabric-cli
Usage: fabric-cli [OPTIONS] COMMAND [ARGS]...
Options:
-v, --verbose
--help Show this message and exit.
Commands:
resources Query Resources (set $FABRIC_ORCHESTRATOR_HOST to the Control...
slice slice management
token issue/get/refresh/revoke FABRIC tokens.
令牌命令
支持的令牌命令列表如下:
$ fabric-cli token
Usage: fabric-cli token [OPTIONS] COMMAND [ARGS]...
issue/get/refresh/revoke FABRIC tokens. (set $FABRIC_CREDMGR_HOST to the
Credential Manager Server)
Options:
--help Show this message and exit.
Commands:
issue issue token with projectname and scope
refresh refresh token
revoke revoke token
资源命令
可在下面找到受支持的资源命令列表:
$ fabric-cli resources
Usage: fabric-cli resources [OPTIONS] COMMAND [ARGS]...
Query Resources (set $FABRIC_ORCHESTRATOR_HOST to the Control Framework
Orchestrator)
Options:
--help Show this message and exit.
Commands:
query issue token with projectname and scope
- 项目
标签: