数据分析

huawei-cloud-rds-detail

试用

查询华为云 RDS 实例列表、实例详情及监控指标(CPU/内存/磁盘)的只读 Skill,基于 Huawei Cloud SDK

它能做什么

查询华为云 RDS 实例列表、实例详情及监控指标(CPU/内存/磁盘)的只读 Skill,基于 Huawei Cloud SDK

技能文档

huawei-cloud-rds-detail

华为云 RDS 详情查询 Skill,支持查询当前账号下所有 RDS 实例列表、按实例 ID 查询单实例详情,以及查询实例的 CPU/内存/磁盘监控指标。

安全硬约束

  1. 凭据管理:AK/SK 通过环境变量 HUAWEICLOUD_SDK_AK / HUAWEICLOUD_SDK_SK 获取,或通过项目知识配置动态加载,禁止硬编码在任何脚本或配置文件中。
  2. 只读操作:本 Skill 仅执行只读查询(List / Show / BatchListMetricData),不执行任何创建、修改、删除操作。
  3. 超时控制:所有 API 调用均设 30 秒超时。
  4. 错误处理:API 调用失败时需输出明确错误信息(含错误码和错误消息),不静默崩溃。
  5. 日志安全:凭据信息不得写入日志或输出。

概述

本 Skill 封装了华为云 RDS 和 CES(Cloud Eye)服务的只读 API,提供三组核心功能:

  • 实例列表查询:列出当前账号下所有 RDS 实例的基本信息
  • 实例详情查询:按实例 ID 查询单实例的完整规格、状态、连接信息
  • 监控指标查询:查询指定实例的 CPU 使用率、内存使用率、磁盘使用率等监控指标

架构

用户 → huawei-cloud-rds-detail (Python SDK) → Huawei Cloud RDS API / CES API → 返回 JSON 数据

适用场景

  • 日常巡检:快速查看所有 RDS 实例运行状态
  • 故障排查:查询特定实例的详细配置和监控指标
  • 资源管理:了解当前账号下的 RDS 资源分布

前置条件

1. Python 环境

Python 3.8+,安装依赖:

pip install huaweicloudsdkrds huaweicloudsdkces huaweicloudsdkiam

2. 华为云凭证

需要有效的华为云 AK/SK 凭证,通过以下方式提供:

方式说明
环境变量HUAWEICLOUD_SDK_AK / HUAWEICLOUD_SDK_SK
项目知识配置.project-info/ 目录下 JSON 配置文件的 secrets.HUAWEI_AK / secrets.HUAWEI_SK

3. IAM 权限

需要以下 IAM 权限策略:

{
  "Version": "1.1",
  "Statement": [
    {
      "Effect": "Allow",
      "Action": [
        "rds:instance:list",
        "ces:metrics:list",
        "ces:metricData:list"
      ]
    }
  ]
}

详见 references/iam-policies.md

工作流

1. 加载凭据 ──→ 从环境变量或项目知识获取 AK/SK
2. 初始化客户端 ──→ 创建 RdsClient / CesClient(区域:cn-north-4)
3. 执行操作 ──→ list / show / metrics 子命令
4. 格式化输出 ──→ 输出 JSON ���式结果
5. 错误处理 ──→ API 异常时输出错误信息并退出码 1

核心命令

列出所有 RDS 实例

python3 scripts/huawei_cloud_rds_detail.py list

查询单实例详情

python3 scripts/huawei_cloud_rds_detail.py show 

查询监控指标(CPU/内存/磁盘)

python3 scripts/huawei_cloud_rds_detail.py metrics 

查看能力列表

python3 scripts/huawei_cloud_rds_detail.py capability-list

KooCLI Command Format Standard

本 Skill 使用 SDK 模式(非 CLI 模式),因此不使用 KooCLI 命令格式。通过 Python SDK 直接调用华为云 API。 所有操作均通过 scripts/huawei_cloud_rds_detail.py 脚本执行,支持的子命令见「核心命令」章节。

参数确认

参数说明默认值是否可配置
region华为云区域cn-north-4是(可通过 --region 覆写)
--timeoutAPI 超时秒数30
--project-id项目 ID自动获取否(自动获取)

参考文档

相关技能

查询华为云账号下指定 Region 的关系型数据库服务(RDS)实例列表,输出精简的 实例名称 + ID + 状态 + 引擎类型 + 规格清单。 适合用于数据库资源盘点、运维巡检、故障排查与自动化脚本前置查询。

Query the list of Huawei Cloud RDS (Relational Database Service, 云数据库) instances under the current tenant / project and return the RDS instance NAMES. By default the skill prints only the instance names (one per line); with extra flags it also returns id, status, engine type, flavor, private IPs and created time. Supports filtering by instance name, id, type (Single/Ha/Replica), datastore engine (MySQL/PostgreSQL/SQLServer/MariaDB) and VPC, plus pagination via limit/offset. Uses the KooCLI command `hcloud RDS ListInstances --cli-region={region}` (primary) or the huaweicloudsdkrds Python SDK (fallback). Read-only — never creates, modifies, deletes, restarts or stops any RDS instance. Use this skill whenever the user wants to list/inspect the RDS instances of the tenant or query the RDS instance name list, e.g. for database inventory, daily inspection, or cost review. Triggers include: "list RDS", "RDS list", "query RDS names", "RDS实例列表", "查询RDS", "RDS实例名称", "rds list", "how many RDS", "

查询华为云 EVS 磁盘列表及监控指标(IOPS/吞吐量/延迟)的只读 Skill,基于 Huawei Cloud KooCLI

Full-scenario intelligent assistant for Huawei Cloud RDS (Relational Database Service, MySQL + PostgreSQL). Provides basic RDS Q&A, SQL performance optimization (slow-log analysis), daily instance operations, online fault location and troubleshooting, parameter tuning, and backup/restore guidance. Core scenario is ONLINE FAULT TROUBLESHOOTING: the skill guides the user step by step through symptoms (unreachable instance, slow queries, disk full, replication broken, connection limit exceeded, memory overrun) to diagnosis and resolution. Execution is CLI-first via `hcloud RDS ... --cli-region={region}` (KooCLI), falling back to the huaweicloudsdkrds Python SDK and then REST API. Output is interactive and guided — one diagnostic step at a time, with user confirmation before any mutating action (restart, parameter change, manual backup, restore). Triggers include: "RDS troubleshooting", "RDS故障排查", "数据库连不上", "RDS slow query", "RDS慢SQL", "RDS磁盘满", "RDS instance down", "RDS主备不同步", "RDS参数调优",

1 次安装

Query Huawei Cloud DCS (Distributed Cache Service) instance names and list all managed Redis/Memcached instances across a region. Provides read-only name lookup, name filtering, status-based filtering, and instance ID lookup for inventory reporting and daily inspection. Triggers include: DCS list, list DCS instances, query DCS names, DCS instance name, find DCS instance, DCS name lookup, DCS instance list, Redis instance names, cache instance names, DCS inventory, 查询DCS名称, DCS实例名称, 缓存实例名称, DCS列表, DCS实例列表, 查询缓存实例名称.

Huawei Cloud RDS (Relational Database Service) full-scenario intelligent service covering all database engines (MySQL, PostgreSQL, SQL Server, MariaDB, GaussDB for MySQL, TaurusDB). Provides six capability domains: (1) Basic intelligent Q&A for RDS product features, best practices, and specifications; (2) SQL statement performance optimization with slow log analysis, top SQL, execution plan guidance, and index recommendations; (3) Database instance daily O&M including health inspection, restart, flavor resize, disk expansion, primary-standby switchover, and read replica management; (4) Online fault localization and troubleshooting via error logs, replication status, connection diagnostics, and recovery time window; (5) Parameter tuning with parameter group management, modification suggestions, and performance parameter adjustment guidance; (6) Backup and recovery guidance including backup policy management, manual backup creation, restore to new/existing instance, and point-in-time rec

作者 huaweiclouddev-dev