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", "
Coding
华为云 RDS 实例列表查询
Try it查询华为云账号下指定 Region 的关系型数据库服务(RDS)实例列表,输出精简的 实例名称 + ID + 状态 + 引擎类型 + 规格清单。 适合用于数据库资源盘点、运维巡检、故障排查与自动化脚本前置查询。
What it does
查询华为云账号下指定 Region 的关系型数据库服务(RDS)实例列表,输出精简的 实例名称 + ID + 状态 + 引擎类型 + 规格清单。 适合用于数据库资源盘点、运维巡检、故障排查与自动化脚本前置查询。
The skill document
华为云 RDS 实例列表查询 Skill
能力
- 查询华为云账号下指定 Region 的 RDS 实例列表
- 输出精简结果:实例名称(name)、ID(id)、状态(status)、引擎类型(engine)、规格(spec)
- 默认查询北京4(cn-north-4)Region,Region 可在配置中修改
- 认证方式:AK/SK 从配置文件(config.json)读取,支持自动解析 project_id
前置条件
- 本机已安装 Python 3.8+(仅使用标准库,无需安装第三方依赖)
- 已创建配置文件
config.json(在 skill 目录内,已由 .gitignore 排除):- 复制
config.example.json为config.json - 填入华为云 AK/SK(密钥不落盘到仓库,仅保存在本地 config.json)
- 复制
{
"ak": "你的华为云 Access Key ID",
"sk": "你的华为云 Secret Access Key",
"region": "cn-north-4",
"project_id": ""
}
region:可选,默认cn-north-4(北京4);如需其他 Region 修改此字段project_id:可选,留空时脚本通过 IAM 接口按 region 自动解析
权限说明
本 Skill 仅发起只读查询请求,所需 IAM 权限见 references/iam-policies.md。
运行方式
# 默认读取 skill 目录下 config.json
python3 list_rds.py
# 指定配置文件
python3 list_rds.py -c /path/to/config.json
# 临时覆盖 Region(不改配置文件)
python3 list_rds.py -r cn-south-1
输出约定
成功时输出 Region 下的 RDS 实例精简列表,字段顺序为 name / id / status / engine / spec:
Region cn-north-4 的 RDS 实例列表(共 2 个):
- name id status engine spec
- my-rds-01 7b9b0c8a-xxxx-xxxx-xxxx-xxxxxxxxxxxx ACTIVE MySQL rds.mysql.c2.large.4
- my-rds-02 8c0d1e2f-xxxx-xxxx-xxxx-xxxxxxxxxxxx ACTIVE PostgreSQL rds.pg.c2.large.4
字段说明:
status:实例状态(ACTIVE/BUILD/FAILED/FROZEN/MODIFYING/REBOOTING 等)engine:数据库引擎类型(MySQL/PostgreSQL/SQLServer/MariaDB)spec:规格编码(flavor_ref,如 rds.mysql.c2.large.4)
无实例时输出:Region cn-north-4 下暂无 RDS 实例。
错误处理
| 场景 | 行为 |
|---|---|
| 配置文件缺失 | 明确提示复制 config.example.json 为 config.json |
| 配置缺少 AK/SK | 明确提示在 config.json 中填写 AK/SK |
| AK/SK 无效或无权限(HTTP 401/403) | 明确提示认证失败并检查配置 |
| 接口/网络异常 | 输出可读的接口错误信息(HTTP 状态码与详情) |
| 无实例 | 返回空提示,不报错 |
脚本以退出码 0(成功/无实例)或 1(配置/认证/接口错误)结束。
边界
- 仅支持查询(ListInstances),不支持实例的创建/删除/修改
- 单次仅查询一个 Region
- 凭证只从本地 config.json 读取,绝不写入仓库或日志
测试
python3 -m unittest discover -s tests -v
Related skills
查询华为云 RDS 实例列表、实例详情及监控指标(CPU/内存/磁盘)的只读 Skill,基于 Huawei Cloud SDK
查询华为云账号下指定 Region 的弹性云服务器(ECS)实例列表,输出精简的实例名称 + ID 清单。 适合用于云资源盘点、运维巡检、自动化脚本前置查询。
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
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参数调优",