Volcengine RDS PostgreSQL

👤 ybamazing 📦 v1.0.0 ⭐ 4.4 ⬇️ 783 下載
🔒 IT運維與安全 免費 🔑 需 API Key

📖 技能介紹


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 概覽

本 Skill 用於在對話中充當 火山引擎 RDS PostgreSQL 的智慧運維代理:

  • 理解使用者的自然語言需求(中文或英文),識別是否與 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]

標準使用流程

  1. 確認任務型別與引數

    • 判斷使用者意圖:查詢例項列表、檢視例項詳情、管理資料庫、管理賬號、檢視引數配置、建立例項等。
    • 收集必要引數(如未指定則使用預設值):
      • --region:地域 ID(預設 cn-beijing)
      • --action:操作型別(如 list-instancesdescribe-instancelist-databases 等)
      • --instance-id:例項 ID(部分操作必需)
  2. 構造查詢並呼叫指令碼

  3. 示例(以下命令可使用 uv runpython 執行): ```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 ```

  4. 解析結果並後續處理

    • 將 RDS PostgreSQL 的響應用自然語言解釋給使用者;
    • 如返回包含敏感操作,評估風險並提醒:
      • 避免在生產環境直接執行高風險操作(如刪除例項、刪除資料庫等);
      • 建議在測試環境驗證或做好備份。

工具指令碼使用說明

支援的操作(Actions)

操作 說明 必需引數
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
============================================================
[查詢結果]
<實際結果內容>

常見使用場景

1. 檢視所有例項

uv run ./scripts/call_rds_postgresql.py list-instances

2. 檢視例項詳情

uv run ./scripts/call_rds_postgresql.py describe-instance --instance-id postgres-xxx

3. 檢視例項的資料庫

uv run ./scripts/call_rds_postgresql.py list-databases --instance-id postgres-xxx

4. 檢視例項的賬號

7w4.net收錄了海量優質技能外掛。

uv run ./scripts/call_rds_postgresql.py list-accounts --instance-id postgres-xxx

5. 檢視例項引數配置

uv run ./scripts/call_rds_postgresql.py list-parameters --instance-id postgres-xxx

6. 按版本過濾例項

uv run ./scripts/call_rds_postgresql.py list-instances --db-engine-version PostgreSQL_14

7. 建立例項前查詢網路資訊

# 先查詢 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

環境變數配置

  1. 獲取火山引擎訪問憑證:參考 使用者指南 獲取 AK/SK

  2. 配置以下環境變數:

export VOLCENGINE_ACCESS_KEY="your-access-key"
export VOLCENGINE_SECRET_KEY="your-secret-key"
export VOLCENGINE_REGION="cn-beijing"  # 可選,預設 cn-beijing

許可權說明list-vpcslist-subnets 呼叫的是 VPC 服務介面,AK/SK 需要同時授予 RDS PostgreSQLVPCvpc:DescribeVpcsvpc:DescribeSubnets)兩個服務的許可權, 否則會返回 AccessDenied 403 錯誤。

🤖 AI 評測

這個 Skill 可以幫助使用者通過對話方式管理火山引擎 RDS PostgreSQL 資料庫。它提供了詳盡的中文說明文件,操作簡單直觀,功能覆蓋面較廣,包括查詢例項、資料庫、賬號、引數等常見運維需求。不過目前只支援查詢操作,不支援建立例項、修改配置等寫入操作,另外需要正確配置雲服務訪問憑證才能使用。對於日常運維查詢場景來說質量較好,但功能豐富度有待提升。

📊 多維度評分

適應性4.4
規範性4.1
有效性4.6
可靠性4.2
可信度5

📁 包含檔案 (4 個)

📄 SKILL.md 7.2 KB
📄 _meta.json 144 B
📄 requirements.txt 127 B
📄 scripts/call_rds_postgresql.py 18.4 KB