name: volcengine-rds-postgresql description: 使用火山引擎 RDS PostgreSQL,幫助使用者完成 RDS PostgreSQL 相關的例項管理、資料庫操作、賬號管理和運維任務,可直接呼叫 uv run ./scripts/call_rds_postgresql.py 指令碼獲取即時結果。 metadata: {"clawdbot":{"emoji":"🐘","homepage":"https://www.volcengine.com/product/rds-postgresql","requires":{"bins":["uv"],"env":["VOLCENGINE_ACCESS_KEY","VOLCENGINE_SECRET_KEY"]},"os":["darwin","linux"]},"openclaw":{"emoji":"🐘","homepage":"https://www.volcengine.com/product/rds-postgresql","requires":{"bins":["uv"],"env":["VOLCENGINE_ACCESS_KEY","VOLCENGINE_SECRET_KEY"]},"os":["darwin","linux"]},"moltbot":{"emoji":"🐘","homepage":"https://www.volcengine.com/product/rds-postgresql","requires":{"bins":["uv"],"env":["VOLCENGINE_ACCESS_KEY","VOLCENGINE_SECRET_KEY"]},"os":["darwin","linux"]}}
本 Skill 用於在對話中充當 火山引擎 RDS PostgreSQL 的智慧運維代理:
scripts/call_rds_postgresql.py 即時查詢 RDS PostgreSQL 並獲取結果;工作模式:
- 使用 scripts/call_rds_postgresql.py 指令碼直接獲取 RDS PostgreSQL 的即時響應
執行方式: 指令碼支援兩種執行方式:
# 方式 1: 使用 uv (推薦,自動管理依賴)
uv run ./scripts/call_rds_postgresql.py [action] [options]
# 方式 2: 使用 python (需要預先安裝依賴)
python ./scripts/call_rds_postgresql.py [action] [options]
確認任務型別與引數
--region:地域 ID(預設 cn-beijing)--action:操作型別(如 list-instances、describe-instance、list-databases 等)--instance-id:例項 ID(部分操作必需)構造查詢並呼叫指令碼
示例(以下命令可使用 uv run 或 python 執行):
```bash
# 查詢例項列表
uv run ./scripts/call_rds_postgresql.py list-instances
# 或
python ./scripts/call_rds_postgresql.py list-instances
# 查詢指定例項詳情 uv run ./scripts/call_rds_postgresql.py describe-instance --instance-id postgres-xxx # 或 python ./scripts/call_rds_postgresql.py describe-instance --instance-id postgres-xxx
# 查詢例項的資料庫列表 uv run ./scripts/call_rds_postgresql.py list-databases --instance-id postgres-xxx # 或 python ./scripts/call_rds_postgresql.py list-databases --instance-id postgres-xxx
# 查詢例項的賬號列表 uv run ./scripts/call_rds_postgresql.py list-accounts --instance-id postgres-xxx # 或 python ./scripts/call_rds_postgresql.py list-accounts --instance-id postgres-xxx
# 查詢例項引數 uv run ./scripts/call_rds_postgresql.py list-parameters --instance-id postgres-xxx # 或 python ./scripts/call_rds_postgresql.py list-parameters --instance-id postgres-xxx
# 查詢 VPC 列表(用於建立例項) uv run ./scripts/call_rds_postgresql.py list-vpcs # 或 python ./scripts/call_rds_postgresql.py list-vpcs
# 查詢子網列表 uv run ./scripts/call_rds_postgresql.py list-subnets --vpc-id vpc-xxx --zone-id cn-beijing-a # 或 python ./scripts/call_rds_postgresql.py list-subnets --vpc-id vpc-xxx --zone-id cn-beijing-a ```
解析結果並後續處理
| 操作 | 說明 | 必需引數 |
|---|---|---|
list-instances |
查詢 RDS PostgreSQL 例項列表 | 無 |
describe-instance |
查詢指定例項詳情 | --instance-id |
list-databases |
查詢例項的資料庫列表 | --instance-id |
list-accounts |
查詢例項的賬號列表 | --instance-id |
list-parameters |
查詢例項的引數配置 | --instance-id |
list-parameter-templates |
查詢引數模板列表 | 無 |
describe-parameter-template |
查詢引數模板詳情 | --template-id |
list-vpcs |
查詢 VPC 列表 | 無 |
list-subnets |
查詢子網列表 | --vpc-id |
get-price |
查詢例項價格 | 多個配置引數 |
| 引數 | 說明 | 預設值 |
|---|---|---|
action |
操作型別(必需) | - |
--region / -r |
火山引擎地域 ID | cn-beijing |
--instance-id / -i |
例項 ID | 無 |
--page-number |
分頁頁碼 | 1 |
--page-size |
每頁記錄數 | 10 |
--output / -o |
輸出格式(json/table) | json |
注意:
--region、--page-number、--page-size等全域性引數必須放在子命令之前,例如:bash uv run ./scripts/call_rds_postgresql.py --region cn-shanghai list-instances放在子命令之後會被忽略(argparse 解析限制)。
指令碼會將查詢資訊輸出到 stderr,將結果輸出到 stdout,便於分離日誌和結果:
[操作] list-instances
[地域] cn-beijing
============================================================
[查詢結果]
<實際結果內容>
uv run ./scripts/call_rds_postgresql.py list-instances
uv run ./scripts/call_rds_postgresql.py describe-instance --instance-id postgres-xxx
uv run ./scripts/call_rds_postgresql.py list-databases --instance-id postgres-xxx
7w4.net收錄了海量優質技能外掛。
uv run ./scripts/call_rds_postgresql.py list-accounts --instance-id postgres-xxx
uv run ./scripts/call_rds_postgresql.py list-parameters --instance-id postgres-xxx
uv run ./scripts/call_rds_postgresql.py list-instances --db-engine-version PostgreSQL_14
# 先查詢 VPC
uv run ./scripts/call_rds_postgresql.py list-vpcs
# 再查詢子網
uv run ./scripts/call_rds_postgresql.py list-subnets --vpc-id vpc-xxx --zone-id cn-beijing-a
獲取火山引擎訪問憑證:參考 使用者指南 獲取 AK/SK
配置以下環境變數:
export VOLCENGINE_ACCESS_KEY="your-access-key"
export VOLCENGINE_SECRET_KEY="your-secret-key"
export VOLCENGINE_REGION="cn-beijing" # 可選,預設 cn-beijing
許可權說明:
list-vpcs和list-subnets呼叫的是 VPC 服務介面,AK/SK 需要同時授予 RDS PostgreSQL 和 VPC(vpc:DescribeVpcs、vpc:DescribeSubnets)兩個服務的許可權, 否則會返回AccessDenied 403錯誤。
這個 Skill 可以幫助使用者通過對話方式管理火山引擎 RDS PostgreSQL 資料庫。它提供了詳盡的中文說明文件,操作簡單直觀,功能覆蓋面較廣,包括查詢例項、資料庫、賬號、引數等常見運維需求。不過目前只支援查詢操作,不支援建立例項、修改配置等寫入操作,另外需要正確配置雲服務訪問憑證才能使用。對於日常運維查詢場景來說質量較好,但功能豐富度有待提升。