与lumavate平台交互的cli
luma的Python项目详细描述
lumavate cli
- 要贡献、报告错误或建议功能,请阅读贡献指南here
配置摘要:
- 安装cli
- 设置CLI凭据
- 配置cli
- 命令示例
从pip安装cli:
- 在Windows上,以管理员身份运行bash并省略“sudo”
$ pip3 install luma
从源安装CLI:
- 克隆此回购协议。
- cd到cli dir并运行:
$ pip3 install .
CLI支持:
- CLI是为BASH shell编写和测试的
- 要充分利用CLI,请将其与ZSH一起使用这将启用其他功能,例如在自动完成过程中显示帮助文本
- 要在安装后激活自动完成功能,请重新启动终端或获取shell配置文件(可以是.zshrc或.bash_profile)
设置cli凭据:
- 在lumavate应用程序中,导航到命令中心内的lumavate cli页
- 设置cli凭据将为您当前登录的用户生成凭据
- 运行add profile命令时,您可以选择将新配置文件与任何
您的用户可以访问的组织,而不必考虑您当前所在的指挥中心
cli配置:
- 配置cli需要两个步骤:配置环境和配置配置文件。
- environments知道如何获取和刷新令牌,以便作为用户在平台上保持授权。
- profiles为用户提供大多数平台api所需的公司上下文。
客户端环境:
- 要配置cli env,请从终端应用程序中的lumavate cli页面运行生成的命令
- 要逐个配置每个env值,请运行:
$ luma env config
Env Name: prod
App: appUrl
Token: token
Audience: audience
Client id: clientId
Client secret: clientSecret
cli配置文件:
- 要向cli添加配置文件,请运行:
$ luma profile add
Profile Name: globex
Env: prod
Org ID you want to associate with this profile: 11
运行命令
- 要列出顶级命令,请运行:
$ luma
- 要获得有关任何命令或子命令的帮助,请在不传入任何选项的情况下运行该命令或子命令,或者传入--help标志
- 作为一个例子,让我们创建一个微服务,创建一个版本,上传一个docker图像,然后启动该服务
$ luma microservice add
Profile: globex
Name: Auth Service
Url ref: auth
| id | name | urlRef | createdAt | createdBY |
|----|--------------|--------|-------------------|--------------------|
| 45 | Auth Service | auth | 10/16/18 20:29:49 | john+doe@gmail.com |
$ luma microservice access --profile globex
Microservice: auth
| failed | sharedWith | unsharedWith | resultingGrantees |
|--------|------------|--------------|-------------------|
| [] | [] | [] | [] |
$ luma microservice access -p globex --container auth --add "Acme Corp" --add Initech
| failed | sharedWith | unsharedWith | resultingGrantees |
|--------|--------------|--------------|--------------------------|
| [] | [{id}, {id}] | [] | [Acme Corp, 'Initech'] |
$ luma microservice-version add -p globex --version-number 0.1.0 --container-file-path ~/Desktop/auth-service.tar.gz --label prod --port 8080 -c auth
| id | actualState | versionNumber | label | createdAt | createdBy |
|-----|-------------|---------------|-------|-------------------|--------------------|
| 107 | created | 0.1.0 | prod | 10/16/18 20:46:44 | john+doe@gmail.com |
$ luma microservice-version start -p globex
Microservice: auth
Version: 0.1.0
Starting Microservice [####################################] 100%
其他信息
- 要贡献、报告错误或建议功能,请阅读贡献指南here