Skip to main content

KetaDB Client

Project description

ketadb 工具

示例

# 添加/登录 cluster (使用已有 token)
ketacli config add -n keta -e http://localhost:9000 -t <yourtoken>

# 添加/登录 cluster (使用用户名密码,自动创建 token,密码不保存)
ketacli config add -n keta -e http://localhost:9000 -u myuser
# 或者非交互式:
ketacli config add -n keta -e http://localhost:9000 -u myuser -p mypassword

# 列出所有 cluster
ketacli config list

# 切换默认 cluster
ketacli config use -n keta

# 删除 cluster
ketacli config remove -n keta

# 枚举所有仪表盘
ketacli list dashboard --fields id,app,updateTime --sort updateTime --order asc --prefix test 

# 描述资源的字段
ketacli describe dashboard 

# 插入一条数据

ketacli insert --repo test01 '[{"a":1}]'

# 查询一条数据

ketacli search 'repo=test01 | limit 10' 

# 指定返回格式,支持json、csv、html、latex等

ketacli search 'repo=test01 | limit 10' --format json

#  创建一个资源

ketacli create repos test_repo --file file.json

# 删除一个资源
ketacli delete repos -n test_repo

# 查看可操作的资源列表
ketacli rs

# 查看具体资源操作方法
ketacli rs --type repos

# watch 资源变化
ketacli list repo --watch

ketacli search '''search2 repo="*"|stats count() as cnt by repo,sourcetype |sort by cnt |limit 10''' -w --interval 1

# 下载资源
ketacli download <assetType> [-e ectra] [--base_path path]

# 示例:下载 App
ketacli download apps --base_path apps -e app_name=keta_docs

# 下载任意资源(普通 json 接口将会保存 json 文件)
ketacli download repo -e name=_internal

# 安装 app
ketacli update apps -o install -e name=aws,version=1.0.1

# 卸载 app
ketacli update apps -o uninstall -e name=aws

# 重装/升级 app
ketacli update apps -o upgrade -e name=aws,version=1.0.1

# 终端画图
ketacli plot 'search2 start="-60m" repo="*" | timechart span="1m" count() as cnt by repo ' --y_field cnt --x_field _time --group_field repo --type line

# 内置仪表盘
ketacli dashboard -c infra-host  # 目前内置了infra-host audit k8s-monitor monitor四个仪表盘

自定义仪表盘

可参考示例仪表盘的 yaml 文件配置进行配置: charts

自动补全

在你的 .bashrc / .zshrc 中加入以下语句

zsh

eval "$(_KETACLI_COMPLETE=zsh_source ketacli)"

bash

eval "$(_KETACLI_COMPLETE=bash_source ketacli)"

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

ketacli-1.7.0.tar.gz (333.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ketacli-1.7.0-py3-none-any.whl (401.6 kB view details)

Uploaded Python 3

File details

Details for the file ketacli-1.7.0.tar.gz.

File metadata

  • Download URL: ketacli-1.7.0.tar.gz
  • Upload date:
  • Size: 333.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.12

File hashes

Hashes for ketacli-1.7.0.tar.gz
Algorithm Hash digest
SHA256 f104ddf71d87cbf022c1f1996e80410829384325d9bf0fb445f7c51f5ee3845b
MD5 d525af4b65aca77333b041425403d12b
BLAKE2b-256 70ef2e76b2fe2918d1875b1db8303c3280e5dd5ad8a32596c8796f2e328cc461

See more details on using hashes here.

File details

Details for the file ketacli-1.7.0-py3-none-any.whl.

File metadata

  • Download URL: ketacli-1.7.0-py3-none-any.whl
  • Upload date:
  • Size: 401.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.12

File hashes

Hashes for ketacli-1.7.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f55583edff0ad50914d6c9ea552b09f390b96c8b74bc3bca6c26fb600a491eed
MD5 35e709a89d0edb7d2f10bae033887f2e
BLAKE2b-256 ef9f98176379e942eb8b6073ccbb8cc77ea2bfa4b8682d92f8a85f4caf0e9077

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page