OpsAny's command-line tool!
Project description
OpsAny's command-line tool
1. 下载
python3 -m pip install opsanyctl
2. 配置
# 1. 获取配置模板
opsctl config
# 2. 在家目录创建文件
mkdir /root/.opsanyctl/
# 3. 创建配置文件 修改 url 和 bk_app_secret为OpsAny地址和cmdb的secret_key(开发中心获取https://DOMAIN/saas/cmdb/info/)
vim /root/.opsanyctl/config
# 4. 可以根据配置修改指定模型的简写
3. 使用
# 获取到当前支持的资源类型
opsctl api-resources
# 获取云主机数据
opsctl get CLOUD_SERVER
# 获取 云主机 第一页数据 每页5条
opsctl get CLOUD_SERVER -p 1 -l 5
# 获取数据 54586 字段配置文件中可指定 resourceIdDefaultField(为字段后缀 忽略模型code)
opsctl get net 54586
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
opsanyctl-0.1.10.tar.gz
(9.7 kB
view details)
File details
Details for the file opsanyctl-0.1.10.tar.gz.
File metadata
- Download URL: opsanyctl-0.1.10.tar.gz
- Upload date:
- Size: 9.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.8.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b59cc430d2b6ae8c78ec4183e7941e130cec8625acb150896179066d0b911906
|
|
| MD5 |
ef4973744d35b41b602c659f4000843a
|
|
| BLAKE2b-256 |
7a5dc3702c39880a06ae27b2fce8d740e9b12d31028aa6f1bc9ad2f5befaed1b
|