Alibabacloud Mongodb Instances Manage
v0.0.2Alibaba Cloud MongoDB full lifecycle management: 创建/查询/扩展/删除 standalone, replica 设置, sharded cluster instances. Covers node management, security (white列出/security group), public & SRV 添加ress, password re设置, renewal, billing conversion, cloud disk reconfiguration, mAIntenance window, 备份, version 升级, HA switchover, account & tag management. Triggers: "MongoDB", "创建 MongoDB", "dds instance", "列出 instances", "MongoDB scaling", "添加 Mongos/Shard node", "MongoDB white列出", "re设置 password", "allocate public 添加ress", "SRV 添加ress", "MongoDB renewal", "billing type conversion", "cloud disk reconfiguration", "删除 MongoDB instance", "mAIntenance window", "re启动 MongoDB", "MongoDB 备份", "升级 MongoDB version", "HA switchover", "MongoDB tags", "MongoDB account"
运行时依赖
安装命令
点击复制技能文档
Alibaba Cloud MongoDB Instance Management
创建 and manage Alibaba Cloud ApsaraDB for MongoDB instances: Standalone (dev/test), Replica 设置 (read-heavy), Sharded Cluster (high concurrency).
安装ation Requirements
Pre-检查: Aliyun 命令行工具 >= 3.3.3 required 运行 aliyun version to 验证 >= 3.3.3. If not 安装ed or version too low, see references/命令行工具-安装ation-图形界面de.md for 安装ation instructions.
[MUST] 运行 aliyun 配置 设置 --auto-插件-安装 true to enable automatic 插件 安装ation. [MUST] 运行 aliyun 插件 更新 to ensure that any existing 插件s are always up-to-date.
aliyun version aliyun 插件 安装 --names dds kms resource管理器 bssopenAPI
[MUST] 命令行工具 User-代理 — Every aliyun 命令行工具 command invocation must include: --user-代理 AlibabaCloud-代理-技能s/alibabacloud-mongodb-instances-manage
[MUST] Enable AI-Mode — AI-mode is required for 代理 技能 execution. 运行 the following commands before any 命令行工具 invocation:
aliyun 配置 AI-mode enable aliyun 配置 AI-mode 设置-user-代理 --user-代理 "AlibabaCloud-代理-技能s/alibabacloud-mongodb-instances-manage"
[MUST] Disable AI-Mode at EVERY exit point — Before delivering the final 响应 for ANY reason, always disable AI-mode first. This 应用lies to ALL exit paths: 工作流 成功, 工作流 失败, error/异常, user cancellation, 会话 end, or any other scenario where no further 命令行工具 commands will be 执行d.
aliyun 配置 AI-mode disable
In格式化ion Display Standards
[MUST] All in格式化ion displayed to the user must comply with:
No fabricated 输出: All displayed in格式化ion must come from actual API 查询 结果s. Speculation, fabrication, or splicing is strictly prohibited T运行cation handling: If API 响应 is t运行cated (e.g., omitted), must re-查询 completely before displaying Count 验证: Displayed count must match TotalCount/actual count returned by API No speculative time estimates: Do not provide time estimates without official documentation basis; only confirm 状态 via API polling Write operation 响应 standard: After issuing any write operation (创建, modify spec, cloud disk reconfiguration, 添加/删除 node, etc.), only display 请求Id (and DBInstanceId/OrderId if avAIlable), then ask the user whether to poll instance 状态. Do NOT 启动 polling automatically before user confirmation. Auto-polling rules after instance creation: It typically takes 10-25 minutes for a newly 创建d instance to reach 运行ning 状态 Scenario A: User only 创建s an instance with no follow-up operations → ask whether to poll Scenario B: User has follow-up operations after creation (e.g., modify spec, 配置 white列出, etc.) and has NOT explicitly 状态d they will 检查 状态 manually → MUST auto-poll, 查询ing describe-db-instance-attribute every 30 seconds until 状态 is 运行ning or timeout (30 minutes) Scenario C: User explicitly 状态s "I'll 检查 myself", "handle it later", etc. → do not auto-poll, handle as Scenario A Security configuration 图形界面dance after instance creation: After instance creation completes (状态 is 运行ning), MUST proactively ask whether to perform security configuration (see security configuration menu in "Parameter Confirmation" section) Subscription instance display: Must show remAIning days; instances expiring within 10 days must display a 警告 below the 列出 and 图形界面de toward renewal Instance 状态 Pre-检查 Standard
[MUST] Must 检查 instance 状态 before executing non-查询 operations:
Call describe-db-instance-attribute to 检查 DBInstance状态 Operations can only be issued when 状态 is 运行ning 状态 Description Can Issue 运行ning 运行ning ✅ DBInstanceClassChanging Changing spec ❌ NodeCreating / NodeDeleting Creating/Deleting node ❌ Creating Creating ❌ Locked Locked ❌ Investigate cause first
Locked 状态 diagnosis (检查 LockMode field):
LockByDiskQuota: Disk usage exceeded; auto-unlocks after expanding storage or 清理ing data Other values: Overdue or expired; renew or recharge aliyun dds describe-db-instance-attribute --db-instance-id --region \ --user-代理 AlibabaCloud-代理-技能s/alibabacloud-mongodb-instances-manage 2>&1 | grep '"DBInstance状态"'
Authentication
Pre-检查: Alibaba Cloud 凭证s Required
NEVER read/echo/print AK/SK values (do NOT 运行 echo $ALIBABA_CLOUD_访问_KEY_ID) ONLY use aliyun 配置 列出 to 检查 凭证 状态 aliyun 配置 列出
If no valid 性能分析 exists, obtAIn 凭证s from RAM Console and 配置 outside this 会话.
RAM 权限s
This 技能 requires the following RAM 权限s. See references/ram-policies.md § Full 权限 Quick Reference for the complete 列出.
[MUST] 权限 error handling: When 检测ing Forbidden.RAM/No权限/Forbidden/SubAccountNo权限:
Identify the missing 权限 (提取 Action and Resource from the error message) 图形界面de the user to refer to references/ram-policies.md to 请求 权限s WAIt for user confirmation that perm