
Alibabacloud Polardbx Ai Assistant
- 114 installs
- 208 repo stars
- Updated August 4, 2026
- aliyun/alibabacloud-aiops-skills
alibabacloud-polardbx-ai-assistant is a Claude skill that provides O&M and diagnostics for Alibaba Cloud PolarDB-X distributed databases via the DAS get-yao-chi-agent API through the aliyun CLI.
About
This skill provides operations and diagnostics for Alibaba Cloud PolarDB-X distributed databases through the DAS get-yao-chi-agent API. A developer uses it to inspect cluster topology, analyze slow SQL and execution plans, monitor QPS and connections, and audit security or backup status. It runs via the aliyun CLI DAS plugin and requires AI-mode to be enabled during execution.
- Diagnoses Alibaba Cloud PolarDB-X distributed databases via the DAS get-yao-chi-agent API
- Covers topology inspection, slow SQL analysis, scaling and security audit
- Runs through the aliyun CLI DAS plugin with AI-mode gating
Alibabacloud Polardbx Ai Assistant by the numbers
- 114 all-time installs (skills.sh)
- Ranked #311 of 911 Databases skills by installs in the Skillselion catalog
- Data as of Aug 5, 2026 (Skillselion catalog sync)
alibabacloud-polardbx-ai-assistant capabilities & compatibility
Free skill; requires an Alibaba Cloud account with PolarDB-X and DAS (billed by Alibaba Cloud).
- Capabilities
- database diagnostics · slow sql analysis · topology inspection · security audit
- Use cases
- database · debugging
- Runs
- Runs locally
- Pricing
- Bring your own API key
What alibabacloud-polardbx-ai-assistant says it does
This skill provides intelligent O&M capabilities for **Alibaba Cloud PolarDB-X distributed database**, powered by the DAS (Database Autonomy Service) `get-yao-chi-agent` API via the aliyun CLI DAS plu
Slow SQL analysis, distributed execution plan interpretation, index suggestions, cross-shard query optimization
npx skills add https://github.com/aliyun/alibabacloud-aiops-skills --skill alibabacloud-polardbx-ai-assistantAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 114 |
|---|---|
| repo stars | ★ 208 |
| Last updated | August 4, 2026 |
| Repository | aliyun/alibabacloud-aiops-skills ↗ |
What it does
Diagnose and monitor Alibaba Cloud PolarDB-X distributed database clusters, from topology to slow SQL and scaling.
Who is it for?
Diagnosing and monitoring PolarDB-X distributed database clusters on Alibaba Cloud.
When should I use this skill?
A PolarDB-X cluster needs topology inspection, slow-SQL analysis, scaling diagnostics or a security audit.
What you get
The PolarDB-X cluster is inspected and diagnosed for performance, topology, security and backup issues.
By the numbers
- 14-capability matrix (topology, SQL, security, backup, scaling and more)
Files
PolarDB-X Distributed Database AI Assistant
This skill provides intelligent O&M capabilities for Alibaba Cloud PolarDB-X distributed database, powered by the DAS (Database Autonomy Service) get-yao-chi-agent API via the aliyun CLI DAS plugin.
Architecture: Aliyun CLI -> DAS Plugin (Signature V3) -> get-yao-chi-agent API -> PolarDB-X Intelligent Diagnostics
Supported Capabilities
| Capability | Description |
|---|---|
| Instance Information | Instance details, cluster configuration, version info |
| Topology Inspection | CN/DN node distribution, shard topology, data node status |
| Storage Information | Disk usage, storage capacity, space growth trends |
| SQL Optimization | Slow SQL analysis, distributed execution plan interpretation, index suggestions, cross-shard query optimization |
| Cluster Performance Monitoring | QPS/TPS/connections/throughput and other core metrics analysis |
| Connection & Session Analysis | Connection count monitoring, session troubleshooting, connection pool optimization |
| Security Audit | Whitelist, SSL, security policy audit |
| Backup Status Check | Backup completeness, retention policy, point-in-time recovery |
| Instance Health Check | Instance health status, running state verification |
| Log Diagnostics | Error log analysis, slow log troubleshooting |
| Data Distribution Analysis | Shard data skew detection, hotspot shard diagnostics |
| Elastic Scaling Diagnostics | Scale-out/in status, data migration progress, node load balancing |
| Parameter Tuning | Kernel parameter interpretation, change impact assessment, configuration recommendations |
| High Availability & DR | HA configuration assessment, disaster recovery architecture diagnostics, primary-standby status |
| Expiring Instance Query | Subscription instance expiration reminders, renewal status |
Installation
Pre-check: Aliyun CLI >= 3.3.3 required
Run aliyun version to verify >= 3.3.3. If not installed or version too low,run curl -fsSL https://aliyuncli.alicdn.com/setup.sh | bash to install/update,or see references/cli-installation-guide.md for installation instructions.
Pre-check: Aliyun CLI plugin update required
[MUST] run aliyun configure set --auto-plugin-install true to enable automatic plugin installation.[MUST] run aliyun plugin update to ensure that any existing plugins on your local machine are always up-to-date.[MUST] CLI User-Agent — Every aliyun CLI command invocation must include:--user-agent AlibabaCloud-Agent-Skills/alibabacloud-polardbx-ai-assistant[MUST] Enable AI-Mode — AI-mode is required for Agent Skill execution.
Run the following commands before any CLI invocation:
```bash
aliyun configure ai-mode enable
aliyun configure ai-mode set-user-agent --user-agent "AlibabaCloud-Agent-Skills/alibabacloud-polardbx-ai-assistant"
```
[MUST] Disable AI-Mode at EVERY exit point — Before delivering the final response for ANY reason, always disable AI-mode first. This applies to ALL exit paths: workflow success, workflow failure, error/exception, user cancellation, session end, or any other scenario where no further CLI commands will be executed.
AI-mode is only used for Agent Skill invocation scenarios and MUST NOT remain enabled after the skill stops running.
```bash
aliyun configure ai-mode disable
```
# Install aliyun CLI
curl -fsSL https://aliyuncli.alicdn.com/install.sh | bash
aliyun version # Verify >= 3.3.3
# Enable automatic plugin installation
aliyun configure set --auto-plugin-install true
# Install DAS plugin (get-yao-chi-agent requires plugin for Signature V3 support)
aliyun plugin install --names aliyun-cli-das
# Install jq (for JSON response parsing)
# macOS:
brew install jq
# Ubuntu/Debian:
# sudo apt-get install jqEnvironment Variables
No additional environment variables are required. This skill relies entirely on the aliyun CLI's existing credential configuration.
Authentication
Pre-check: Alibaba Cloud Credentials Required
>
Security Rules:
- NEVER read, echo, or print AK/SK values (e.g., echo $ALIBABA_CLOUD_ACCESS_KEY_ID is FORBIDDEN)- NEVER ask the user to input AK/SK directly in the conversation or command line
- NEVER use aliyun configure set with literal credential values- ONLY use aliyun configure list to check credential status>
```bash
aliyun configure list
```
Check the output for a valid profile (AK, STS, or OAuth identity).
>
If no valid profile exists, STOP here.
1. Obtain credentials from Alibaba Cloud Console
2. Configure credentials outside of this session (via aliyun configure in terminal or environment variables in shell profile)3. Return and re-run after aliyun configure list shows a valid profileCredentials are managed through aliyun CLI configuration — no additional AK/SK setup is needed:
# Recommended: OAuth mode
aliyun configure --mode OAuth
# Alternative: AK mode (configure outside of agent session)
aliyun configure set \
--mode AK \
--access-key-id <your-access-key-id> \
--access-key-secret <your-access-key-secret> \
--region cn-hangzhou
# Cross-account access: RamRoleArn mode
aliyun configure set \
--mode RamRoleArn \
--access-key-id <your-access-key-id> \
--access-key-secret <your-access-key-secret> \
--ram-role-arn acs:ram::<account-id>:role/<role-name> \
--role-session-name yaochi-agent-session \
--region cn-hangzhouRAM Policy
See references/ram-policies.md for the full list of required permissions.
[MUST] Permission Failure Handling: When any command or API call fails due to permission errors at any point during execution, follow this process:
1. Read references/ram-policies.md to get the full list of permissions required by this SKILL2. Use ram-permission-diagnose skill to guide the user through requesting the necessary permissions3. Pause and wait until the user confirms that the required permissions have been granted
Parameter Confirmation
IMPORTANT: Parameter Confirmation — Before executing any command or API call,
ALL user-customizable parameters (e.g., RegionId, instance names, CIDR blocks,
passwords, domain names, resource specifications, etc.) MUST be confirmed with the
user. Do NOT assume or use default values without explicit user approval.
| Parameter | Required/Optional | Description | Default Value |
|---|---|---|---|
query | Required | Natural language query content (including region, instance info, etc.) | - |
--session-id | Optional | Session ID for multi-turn conversation context | - |
--profile | Optional | aliyun CLI profile name | default |
Core Workflow
All intelligent O&M operations MUST be invoked through scripts/call_yaochi_agent.sh, which wraps the aliyun das get-yao-chi-agent (DAS plugin kebab-case command, supporting Signature V3) with streaming response parsing.
⚠️ CRITICAL RESTRICTION:
- DO NOT use directaliyun polardbxoraliyun rdsCLI commands for diagnostics, topology, or security audits.
- DO NOT attempt to query instance details using DescribeDBInstances or similar APIs directly.- ONLY use the DAS plugin command:aliyun das get-yao-chi-agent(wrapped bycall_yaochi_agent.sh).
- If the script fails, check permissions via ram-permission-diagnose skill, DO NOT fallback to other product APIs.# Cluster Management
bash $SKILL_DIR/scripts/call_yaochi_agent.sh "List PolarDB-X instances in Hangzhou region"
bash $SKILL_DIR/scripts/call_yaochi_agent.sh "Show detailed configuration of instance pxc-xxx"
# Topology Inspection
bash $SKILL_DIR/scripts/call_yaochi_agent.sh "Show CN/DN node distribution of instance pxc-xxx"
bash $SKILL_DIR/scripts/call_yaochi_agent.sh "Show shard topology of instance pxc-xxx"
# Performance Diagnostics
bash $SKILL_DIR/scripts/call_yaochi_agent.sh "Analyze performance of instance pxc-xxx in the last hour"
bash $SKILL_DIR/scripts/call_yaochi_agent.sh "Show slow SQL of instance pxc-xxx"
# SQL Optimization
bash $SKILL_DIR/scripts/call_yaochi_agent.sh "Optimize execution plan of this SQL on instance pxc-xxx"
bash $SKILL_DIR/scripts/call_yaochi_agent.sh "Which cross-shard queries on instance pxc-xxx need optimization"
# Data Distribution
bash $SKILL_DIR/scripts/call_yaochi_agent.sh "Check whether data distribution of instance pxc-xxx is even"
bash $SKILL_DIR/scripts/call_yaochi_agent.sh "Are there any hotspot shards on instance pxc-xxx"
# Elastic Scaling
bash $SKILL_DIR/scripts/call_yaochi_agent.sh "Show scale-out status of instance pxc-xxx"
# Parameter Tuning
bash $SKILL_DIR/scripts/call_yaochi_agent.sh "How to tune CONN_POOL_MAX_POOL_SIZE parameter on instance pxc-xxx"
# Connection & Session
bash $SKILL_DIR/scripts/call_yaochi_agent.sh "How to troubleshoot high connection count on instance pxc-xxx"
# Backup & Restore
bash $SKILL_DIR/scripts/call_yaochi_agent.sh "Show backup status of instance pxc-xxx"
# Security Audit
bash $SKILL_DIR/scripts/call_yaochi_agent.sh "Check security configuration of instance pxc-xxx"
# High Availability & DR
bash $SKILL_DIR/scripts/call_yaochi_agent.sh "Show HA configuration of instance pxc-xxx"
# Multi-turn Conversation (use session ID returned from previous call)
bash $SKILL_DIR/scripts/call_yaochi_agent.sh "Continue analysis" --session-id "<session-id>"
# Specify profile
bash $SKILL_DIR/scripts/call_yaochi_agent.sh "List instances" --profile myprofile
# Read from stdin
echo "List instances" | bash $SKILL_DIR/scripts/call_yaochi_agent.sh -Typical Query Examples
| Scenario | Example Query |
|---|---|
| Cluster Management | Show node list of instance pxc-xxx |
| Topology | How many CN and DN nodes does instance pxc-xxx have |
| Performance Diagnostics | How to troubleshoot high CPU usage on instance pxc-xxx |
| Slow SQL Analysis | Show slow SQL of instance pxc-xxx in the last hour |
| SQL Optimization | Why is this SELECT statement slow on instance pxc-xxx |
| Data Distribution | Is there data skew in shards of instance pxc-xxx |
| Elastic Scaling | What is the scale-out progress of instance pxc-xxx |
| Parameter Tuning | How to optimize connection pool parameters on instance pxc-xxx |
| Backup & Restore | When was the latest backup of instance pxc-xxx |
| Storage Optimization | What to do about rapid storage growth on instance pxc-xxx |
| Connection Troubleshooting | Instance pxc-xxx connection count is maxed out |
| Security Audit | Check security configuration of instance pxc-xxx |
| High Availability | Is the DR architecture of instance pxc-xxx reasonable |
| Expiration Reminder | Which PolarDB-X instances are about to expire |
Success Verification
See references/verification-method.md for detailed verification steps.
Cleanup
This skill focuses on query and diagnostics capabilities only. It does not create any resources, so no cleanup is needed.
The following operations are out of scope for this skill:
- Creating/deleting PolarDB-X instances
- Changing instance specifications
- Purchasing/renewing instances
Command Tables
See references/related-apis.md for the full list of APIs and CLI commands.
Best Practices
1. Instance ID Format: PolarDB-X instance IDs start with pxc-. Always include the full instance ID in queries. 2. Region Specification: Explicitly specify the region in natural language queries (e.g., "Hangzhou region", "Beijing region") to improve query accuracy. 3. Multi-turn Conversation: Use --session-id to maintain context continuity in complex diagnostic scenarios. 4. Concurrency Limit: Maximum 2 concurrent sessions per account. Avoid launching multiple parallel calls. 5. Distributed Characteristics: When troubleshooting issues, distinguish between CN (Compute Node) and DN (Data Node) layers. 6. Throttling Handling: If you encounter a Throttling.UserConcurrentLimit error, wait for the previous query to complete before retrying. 7. Credential Security: Use aliyun configure to manage credentials. Never hardcode AK/SK in scripts.
Reference Links
| Reference | Description |
|---|---|
| references/cli-installation-guide.md | Aliyun CLI installation and configuration guide |
| references/related-apis.md | Related APIs and CLI command list |
| references/ram-policies.md | RAM permission policy list |
| references/verification-method.md | Success verification methods |
| references/acceptance-criteria.md | Acceptance criteria |
Acceptance Criteria: alibabacloud-polardbx-ai-assistant
Scenario: PolarDB-X Distributed Database AI Assistant Purpose: Skill testing acceptance criteria
---
Correct CLI Command Patterns
1. Product - DAS (Database Autonomy Service)
CORRECT
# Plugin kebab-case command (Signature V3, recommended)
aliyun das get-yao-chi-agent --query "List instances" --source "polardbx-console" --endpoint das.cn-shanghai.aliyuncs.com --user-agent AlibabaCloud-Agent-SkillsINCORRECT
# Error: product name wrong case
aliyun DAS get-yao-chi-agent --query "List instances"
# Error: missing --user-agent flag
aliyun das get-yao-chi-agent --query "List instances" --source "polardbx-console" --endpoint das.cn-shanghai.aliyuncs.com2. Command - get-yao-chi-agent
CORRECT
aliyun das get-yao-chi-agent --query "Hello" --endpoint das.cn-shanghai.aliyuncs.com --user-agent AlibabaCloud-Agent-SkillsINCORRECT
# Error: API name typo
aliyun das get-yao-chi --query "Hello"
# Error: using non-existent API
aliyun das yaochi-agent --query "Hello"3. Parameters
get-yao-chi-agent Parameters
CORRECT
# Required parameter --query
aliyun das get-yao-chi-agent --query "List PolarDB-X instances in Hangzhou region" --endpoint das.cn-shanghai.aliyuncs.com --user-agent AlibabaCloud-Agent-Skills
# Optional parameter --source
aliyun das get-yao-chi-agent --query "List instances" --source "polardbx-console" --endpoint das.cn-shanghai.aliyuncs.com --user-agent AlibabaCloud-Agent-Skills
# Optional parameter --session-id (multi-turn)
aliyun das get-yao-chi-agent --query "Continue analysis" --session-id "sess-xxx" --source "polardbx-console" --endpoint das.cn-shanghai.aliyuncs.com --user-agent AlibabaCloud-Agent-SkillsINCORRECT
# Error: missing required parameter --query
aliyun das get-yao-chi-agent --source "polardbx-console"
# Error: using non-existent parameter
aliyun das get-yao-chi-agent --query "List instances" --region-id "cn-hangzhou"4. Endpoint
CORRECT
# get-yao-chi-agent always uses cn-shanghai endpoint
aliyun das get-yao-chi-agent --query "List instances" --endpoint das.cn-shanghai.aliyuncs.com --user-agent AlibabaCloud-Agent-SkillsINCORRECT
# Error: wrong endpoint
aliyun das get-yao-chi-agent --query "List instances" --endpoint das.cn-beijing.aliyuncs.com
# Error: missing endpoint, may use wrong default
aliyun das get-yao-chi-agent --query "List instances"5. --user-agent Flag - Required
CORRECT
aliyun das get-yao-chi-agent --query "List instances" --endpoint das.cn-shanghai.aliyuncs.com --user-agent AlibabaCloud-Agent-SkillsINCORRECT
# Error: missing --user-agent flag
aliyun das get-yao-chi-agent --query "List instances" --endpoint das.cn-shanghai.aliyuncs.com6. Timeout Settings
CORRECT
# SSE streaming API needs longer read timeout (180s)
aliyun das get-yao-chi-agent --query "List instances" --endpoint das.cn-shanghai.aliyuncs.com --read-timeout 180 --connect-timeout 30 --user-agent AlibabaCloud-Agent-SkillsINCORRECT
# Error: read timeout too short, streaming API may timeout
aliyun das get-yao-chi-agent --query "List instances" --endpoint das.cn-shanghai.aliyuncs.com --read-timeout 10 --user-agent AlibabaCloud-Agent-Skills---
Correct Bash Script Patterns
1. Script Invocation
CORRECT
bash $SKILL_DIR/scripts/call_yaochi_agent.sh "List PolarDB-X instances in Hangzhou region"
bash $SKILL_DIR/scripts/call_yaochi_agent.sh "Analyze performance of instance pxc-xxx" --session-id "sess-xxx"
bash $SKILL_DIR/scripts/call_yaochi_agent.sh "List instances" --profile myprofile
echo "List instances" | bash $SKILL_DIR/scripts/call_yaochi_agent.sh -INCORRECT
# Error: using Python script (does not exist)
uv run $SKILL_DIR/scripts/call_yaochi_agent.py "List instances"
# Error: using Python interpreter on bash script
python $SKILL_DIR/scripts/call_yaochi_agent.sh "List instances"
# Error: using old parameter format
bash $SKILL_DIR/scripts/call_yaochi_agent.sh "List instances" --role-arn acs:ram::xxx:role/xxx2. SSE Response Parsing
CORRECT - script auto-parses SSE response
# Input: SSE format response body
data: {"Content":"PolarDB-X instance list:","SessionId":"sess-abc123","ReasoningContent":""}
data: {"Content":"\n1. pxc-xxx (cn-hangzhou)","SessionId":"sess-abc123","ReasoningContent":""}
data: [DONE]
# Output: concatenated Content
PolarDB-X instance list:
1. pxc-xxx (cn-hangzhou)3. Credential Management
CORRECT
# Use existing aliyun CLI configuration
aliyun configure --mode OAuth
bash $SKILL_DIR/scripts/call_yaochi_agent.sh "List instances"
# Use specific profile
bash $SKILL_DIR/scripts/call_yaochi_agent.sh "List instances" --profile myprofileINCORRECT
# Error: hardcoding AK/SK in script
export ALIBABA_CLOUD_ACCESS_KEY_ID="LTAI5tXXXXXXXX"
export ALIBABA_CLOUD_ACCESS_KEY_SECRET="8dXXXXXXXXXXXX"
# Error: using custom credential variables
export YAOCHI_ACCESS_KEY_ID="xxx"
export YAOCHI_ACCESS_KEY_SECRET="xxx"---
Authentication Patterns
CORRECT - use aliyun CLI configuration
# OAuth mode (recommended)
aliyun configure --mode OAuth
# AK mode
aliyun configure set --mode AK --access-key-id <AK> --access-key-secret <SK> --region cn-hangzhou
# Cross-account RamRoleArn mode
aliyun configure set --mode RamRoleArn --access-key-id <AK> --access-key-secret <SK> --ram-role-arn <ARN> --role-session-name yaochi-session --region cn-hangzhouINCORRECT - managing credentials in script
# Error: using Python SDK for credentials
from alibabacloud_das20200116.client import Client as DAS20200116Client
# Error: parsing credentials from .env file
# Error: parsing credentials from ~/.alibabacloud/credentialsAliyun CLI Installation & Configuration Guide
Complete guide for installing and configuring Aliyun CLI.
Aliyun CLI 3.3.3+: Supports installing and using all published Alibaba Cloud product plugins. Make sure to upgrade to 3.3.3 or later for full plugin ecosystem coverage.
Installation
macOS
Using Homebrew (Recommended)
brew install aliyun-cli
# Upgrade to latest
brew upgrade aliyun-cli
# Verify version (>= 3.3.3)
aliyun versionUsing Binary
# Download
wget https://aliyuncli.alicdn.com/aliyun-cli-macosx-latest-amd64.tgz
# Extract
tar -xzf aliyun-cli-macosx-latest-amd64.tgz
# Move to PATH
sudo mv aliyun /usr/local/bin/
# Verify
aliyun versionLinux
Debian/Ubuntu
# Download
wget https://aliyuncli.alicdn.com/aliyun-cli-linux-latest-amd64.tgz
# Extract and install
tar -xzf aliyun-cli-linux-latest-amd64.tgz
sudo mv aliyun /usr/local/bin/
# Verify
aliyun versionCentOS/RHEL
# Download
wget https://aliyuncli.alicdn.com/aliyun-cli-linux-latest-amd64.tgz
# Extract and install
tar -xzf aliyun-cli-linux-latest-amd64.tgz
sudo mv aliyun /usr/local/bin/
# Verify
aliyun versionARM64 Architecture
# Download ARM64 version
wget https://aliyuncli.alicdn.com/aliyun-cli-linux-latest-arm64.tgz
# Extract and install
tar -xzf aliyun-cli-linux-latest-arm64.tgz
sudo mv aliyun /usr/local/bin/Windows
Using Binary 1. Download from: https://aliyuncli.alicdn.com/aliyun-cli-windows-latest-amd64.zip 2. Extract the ZIP file 3. Add the directory to your PATH environment variable 4. Open new Command Prompt or PowerShell 5. Verify: aliyun version
Using PowerShell
# Download
Invoke-WebRequest -Uri "https://aliyuncli.alicdn.com/aliyun-cli-windows-latest-amd64.zip" -OutFile "aliyun-cli.zip"
# Extract
Expand-Archive -Path aliyun-cli.zip -DestinationPath C:\aliyun-cli
# Add to PATH (requires admin privileges)
$env:Path += ";C:\aliyun-cli"
[Environment]::SetEnvironmentVariable("Path", $env:Path, [System.EnvironmentVariableTarget]::Machine)
# Verify
aliyun versionConfiguration
Quick Start
aliyun configure set \
--mode AK \
--access-key-id <your-access-key-id> \
--access-key-secret <your-access-key-secret> \
--region cn-hangzhouAll aliyun configure commands support non-interactive flags, which is the recommended approach — it works in scripts, CI/CD pipelines, and agent-driven automation without hanging on stdin prompts.
Where to Get Access Keys
1. Log in to Aliyun Console: https://ram.console.aliyun.com/ 2. Navigate to: AccessKey Management 3. Create a new AccessKey pair 4. Save the secret immediately — it's only shown once
Configuration Modes
Aliyun CLI supports 6 authentication modes. All examples below use non-interactive flags.
1. AK Mode (Access Key)
Most common mode for personal accounts and scripts.
aliyun configure set \
--mode AK \
--access-key-id LTAI5tXXXXXXXX \
--access-key-secret 8dXXXXXXXXXXXXXXXXXXXXXXXX \
--region cn-hangzhouConfiguration is stored in ~/.aliyun/config.json:
{
"current": "default",
"profiles": [
{
"name": "default",
"mode": "AK",
"access_key_id": "LTAI5tXXXXXXXX",
"access_key_secret": "8dXXXXXXXXXXXXXXXXXXXXXXXX",
"region_id": "cn-hangzhou",
"output_format": "json",
"language": "en"
}
]
}2. StsToken Mode (Temporary Credentials)
For short-lived access (tokens expire in 1-12 hours).
aliyun configure set \
--mode StsToken \
--access-key-id LTAI5tXXXXXXXX \
--access-key-secret 8dXXXXXXXXXXXXXXXXXXXXXXXX \
--sts-token v1.0:XXXXXXXXXXXXXXXX \
--region cn-hangzhouUse cases: CI/CD pipelines, temporary access for external contractors, cross-account access.
3. RamRoleArn Mode (Assume RAM Role)
Assume a RAM role for elevated or cross-account access.
aliyun configure set \
--mode RamRoleArn \
--access-key-id LTAI5tXXXXXXXX \
--access-key-secret 8dXXXXXXXXXXXXXXXXXXXXXXXX \
--ram-role-arn acs:ram::123456789012:role/AdminRole \
--role-session-name my-session \
--region cn-hangzhouUse cases: cross-account resource access, temporary elevated privileges, role-based access control.
4. EcsRamRole Mode (ECS Instance RAM Role)
Use the RAM role attached to an ECS instance — no credentials needed.
aliyun configure set \
--mode EcsRamRole \
--ram-role-name MyEcsRole \
--region cn-hangzhouRequirements: must be running on an ECS instance with a RAM role attached.
Use cases: scripts and automation running on ECS instances.
5. RsaKeyPair Mode (RSA Key Pair)
Use RSA key pair for authentication (generate key pair in Aliyun Console first).
aliyun configure set \
--mode RsaKeyPair \
--private-key /path/to/private-key.pem \
--key-pair-name my-key-pair \
--region cn-hangzhou6. RamRoleArnWithEcs Mode (ECS + RAM Role)
Combine ECS instance role with RAM role assumption for cross-account access from ECS.
aliyun configure set \
--mode RamRoleArnWithEcs \
--ram-role-name MyEcsRole \
--ram-role-arn acs:ram::123456789012:role/TargetRole \
--role-session-name my-session \
--region cn-hangzhouEnvironment Variables
Highest priority - overrides config file
Access Key Mode
export ALIBABA_CLOUD_ACCESS_KEY_ID=your_access_key_id
export ALIBABA_CLOUD_ACCESS_KEY_SECRET=your_access_key_secret
export ALIBABA_CLOUD_REGION_ID=cn-hangzhouSTS Token Mode
export ALIBABA_CLOUD_ACCESS_KEY_ID=your_access_key_id
export ALIBABA_CLOUD_ACCESS_KEY_SECRET=your_access_key_secret
export ALIBABA_CLOUD_SECURITY_TOKEN=your_sts_token
export ALIBABA_CLOUD_REGION_ID=cn-hangzhouECS RAM Role Mode
export ALIBABA_CLOUD_ECS_METADATA=role_nameUse Case:
- CI/CD pipelines
- Docker containers
- Temporary credential override
Managing Multiple Profiles
Create Named Profiles
aliyun configure set --profile projectA \
--mode AK \
--access-key-id LTAI5tAAAAAAAA \
--access-key-secret 8dAAAAAAAAAAAAAAAAAAAAAAAA \
--region cn-hangzhou
aliyun configure set --profile projectB \
--mode AK \
--access-key-id LTAI5tBBBBBBBB \
--access-key-secret 8dBBBBBBBBBBBBBBBBBBBBBBBB \
--region cn-shanghaiUse Specific Profile
aliyun ecs describe-instances --profile projectA
export ALIBABA_CLOUD_PROFILE=projectA
aliyun ecs describe-instances # Uses projectAList and Switch Profiles
aliyun configure list # List all profiles
aliyun configure set --current projectA # Switch default profileCredential Priority
Credentials are loaded in this order (first found wins):
1. Command-line flag: --profile <name> 2. Environment variable: ALIBABA_CLOUD_PROFILE 3. Environment credentials: ALIBABA_CLOUD_ACCESS_KEY_ID, etc. 4. Configuration file: ~/.aliyun/config.json (current profile) 5. ECS Instance RAM Role: If running on ECS with attached role
Verification
Test Authentication
# Basic test - list regions
aliyun ecs describe-regions
# Expected output: JSON array of regionsIf successful, you'll see:
{
"Regions": {
"Region": [
{
"RegionId": "cn-hangzhou",
"RegionEndpoint": "ecs.cn-hangzhou.aliyuncs.com",
"LocalName": "华东 1(杭州)"
},
...
]
},
"RequestId": "..."
}If failed, you'll see error messages:
InvalidAccessKeyId.NotFound- Wrong Access Key IDSignatureDoesNotMatch- Wrong Access Key SecretInvalidSecurityToken.Expired- STS token expired (for StsToken mode)Forbidden.RAM- Insufficient permissions
Debug Configuration
# Show current configuration
aliyun configure get
# Test with debug logging
aliyun ecs describe-regions --log-level=debug
# Check credential provider
aliyun configure get modeSecurity Best Practices
1. Use RAM Users (Not Root Account)
❌ Don't: Use Aliyun root account credentials ✅ Do: Create RAM users with specific permissions
# Create RAM user in console
# Attach only necessary policies
# Use RAM user's access keys2. Principle of Least Privilege
Grant only the minimum permissions needed:
# Example: Read-only ECS access
# Attach policy: AliyunECSReadOnlyAccess3. Rotate Access Keys Regularly
# Create new access key in RAM Console, then update configuration
aliyun configure set --access-key-id NEW_KEY --access-key-secret NEW_SECRET
# Delete old access key from console4. Use STS Tokens for Temporary Access
aliyun configure set --mode StsToken \
--access-key-id XXXX --access-key-secret XXXX \
--sts-token XXXX --region cn-hangzhou5. Use ECS RAM Roles When Possible
aliyun configure set --mode EcsRamRole --ram-role-name MyRole --region cn-hangzhou6. Never Commit Credentials
# Add to .gitignore
echo "~/.aliyun/config.json" >> .gitignore
# Use environment variables in CI/CD instead7. Secure Config File
# Restrict permissions
chmod 600 ~/.aliyun/config.jsonTroubleshooting
Issue: Command Not Found
# Check installation
which aliyun
# Check PATH
echo $PATH
# Reinstall or add to PATHIssue: Authentication Failed
# Verify configuration
aliyun configure get
# Test with debug
aliyun ecs describe-regions --log-level=debug
# Check credentials in console
# Verify access key is activeIssue: Permission Denied
# Error: Forbidden.RAM
# Check RAM user permissions
# Attach necessary policies in RAM console
# Example: AliyunECSFullAccess for ECS operationsIssue: STS Token Expired
# Error: InvalidSecurityToken.Expired
# Reconfigure with new token
aliyun configure set --mode StsToken \
--access-key-id XXXX --access-key-secret XXXX \
--sts-token NEW_TOKEN --region cn-hangzhouIssue: Wrong Region
# Some resources may not exist in the specified region
# Check available regions
aliyun ecs describe-regions
# Update default region
aliyun configure set region cn-shanghaiAdvanced Configuration
Custom Endpoint
# Use custom or private endpoint
export ALIBABA_CLOUD_ECS_ENDPOINT=ecs-vpc.cn-hangzhou.aliyuncs.comProxy Settings
# HTTP proxy
export HTTP_PROXY=http://proxy.example.com:8080
export HTTPS_PROXY=http://proxy.example.com:8080
# No proxy for specific domains
export NO_PROXY=localhost,127.0.0.1,.aliyuncs.comTimeout Settings
# Connection timeout (default: 10s)
export ALIBABA_CLOUD_CONNECT_TIMEOUT=30
# Read timeout (default: 10s)
export ALIBABA_CLOUD_READ_TIMEOUT=30Next Steps
After installation and configuration:
1. Install plugins for services you need (v3.3.3+ supports all published product plugins):
aliyun plugin install --names ecs vpc rds
# List all available plugins
aliyun plugin list-remote2. Explore commands:
aliyun ecs --help
aliyun fc --help3. Read documentation:
- Command Syntax Guide
- Global Flags Reference
- Common Scenarios
References
- Official Documentation: https://help.aliyun.com/zh/cli/
- RAM Console: https://ram.console.aliyun.com/
- Access Key Management: https://ram.console.aliyun.com/manage/ak
- Plugin Repository: https://github.com/aliyun/aliyun-cli
RAM Policies
Required Permissions
Using PolarDB-X AI Assistant (YaoChi Agent) requires the following RAM permissions:
Core Permission - DAS GetYaoChiAgent
{
"Version": "1",
"Statement": [
{
"Effect": "Allow",
"Action": [
"das:GetYaoChiAgent",
"das:GetDasAgentSSE"
],
"Resource": "*"
}
]
}Recommended - DAS Read-Only
For full diagnostic capabilities, grant the following specific DAS read-only permissions:
{
"Version": "1",
"Statement": [
{
"Effect": "Allow",
"Action": [
"das:GetYaoChiAgent",
"das:GetDasAgentSSE",
"das:DescribeInstanceDasPro",
"das:GetInstanceInspections",
"das:GetQueryOptimizeExecErrorStats"
],
"Resource": "*"
}
]
}Cross-Account Access - STS AssumeRole
For cross-account access, configure RAM role trust policy on the target account:
{
"Version": "1",
"Statement": [
{
"Effect": "Allow",
"Action": "sts:AssumeRole",
"Principal": {
"RAM": [
"acs:ram::<caller-account-id>:root"
]
}
}
]
}Recommended System Policies
| Policy Name | Description | Use Case |
|---|---|---|
AliyunDASReadOnlyAccess | DAS read-only | Daily diagnostic queries |
Permission Mapping
| Operation | Required RAM Action |
|---|---|
| YaoChi Agent diagnostics | das:GetYaoChiAgent |
| DAS Agent SSE | das:GetDasAgentSSE |
Related APIs
DAS (Database Autonomy Service) - Core API
| Product | CLI Command | API Action | Description |
|---|---|---|---|
| DAS | aliyun das get-yao-chi-agent --query "<query>" --source "polardbx-console" --endpoint das.cn-shanghai.aliyuncs.com --user-agent AlibabaCloud-Agent-Skills | GetYaoChiAgent | YaoChi Agent (SSE streaming response) |
| DAS | aliyun das get-das-agent-sse --Query "<query>" --endpoint das.cn-shanghai.aliyuncs.com --user-agent AlibabaCloud-Agent-Skills | GetDasAgentSSE | DAS Agent SSE API |
GetYaoChiAgent API Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
--query | String | Yes | Natural language query content |
--source | String | No | Call source identifier, set to polardbx-console |
--session-id | String | No | Session ID for multi-turn conversation context |
GetDasAgentSSE API Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
--Query | String | Yes | Natural language query content |
--AgentId | String | No | Agent ID |
--InstanceId | String | No | Database instance ID |
--SessionId | String | No | Session ID for multi-turn conversation context |
SSE Response Format
GetYaoChiAgent returns SSE (Server-Sent Events) streaming response:
data: {"Content":"Response text chunk 1","SessionId":"sess-xxx","ReasoningContent":""}
data: {"Content":"Response text chunk 2","SessionId":"sess-xxx","ReasoningContent":""}
...
data: [DONE]Response Fields
| Field | Type | Description |
|---|---|---|
Content | String | Current chunk text content |
SessionId | String | Session ID for multi-turn conversation |
ReasoningContent | String | Reasoning content (for debug) |
API Endpoint
| Environment | Endpoint |
|---|---|
| Production | das.cn-shanghai.aliyuncs.com |
Note: GetYaoChiAgent API uses das.cn-shanghai.aliyuncs.com endpoint uniformly, regardless of the PolarDB-X instance's region.Verification Method
Steps to Verify Skill Execution
Step 1: Verify aliyun CLI installation and configuration
# Check CLI version
aliyun version
# Expected: 3.3.3 or higher
# Check auth configuration
aliyun configure get
# Expected: shows current profile configuration
# Test basic connectivity
aliyun das describe-instance-das-pro --instanceId "pxc-test" --endpoint das.cn-shanghai.aliyuncs.com --user-agent AlibabaCloud-Agent-Skills/alibabacloud-polardbx-ai-assistant 2>&1
# Expected: JSON response (API error for non-existent instance is OK, connection error is NOT)Step 2: Verify jq installation
echo '{"Content":"test"}' | jq -r '.Content'
# Expected: testStep 3: Verify call_yaochi_agent.sh script
# Verify script is runnable
bash $SKILL_DIR/scripts/call_yaochi_agent.sh --help
# Expected: shows help information
# Verify no-argument error prompt
bash $SKILL_DIR/scripts/call_yaochi_agent.sh
# Expected: shows usage prompt and exitsStep 4: Verify actual invocation (requires valid credentials)
# Simple query test
bash $SKILL_DIR/scripts/call_yaochi_agent.sh "Hello"
# Expected: YaoChi Agent response content
# With debug mode
bash $SKILL_DIR/scripts/call_yaochi_agent.sh "Hello" --debug
# Expected: response content + debug info on stderrStep 5: Verify multi-turn conversation
# First query - note the session ID in stderr output
bash $SKILL_DIR/scripts/call_yaochi_agent.sh "List PolarDB-X instances in Hangzhou region"
# Expected: instance list, stderr shows [SessionID] sess-xxx
# Second query - use session ID from previous call
bash $SKILL_DIR/scripts/call_yaochi_agent.sh "Continue analyzing the first instance" --session-id "sess-xxx"
# Expected: contextual analysis based on previous conversationCommon Errors and Solutions
| Error | Cause | Solution |
|---|---|---|
command not found: aliyun | aliyun CLI not installed | See cli-installation-guide.md |
command not found: jq | jq not installed | brew install jq or apt install jq |
InvalidAccessKeyId | Invalid AK/SK | Check aliyun configure get configuration |
Throttling.UserConcurrentLimit | Concurrent session limit reached | Wait for previous query to finish, then retry |
Forbidden.RAM | Insufficient permissions | See ram-policies.md for required permissions |
#!/usr/bin/env bash
# =============================================================================
# call_yaochi_agent.sh - Alibaba Cloud YaoChi Agent CLI Script (PolarDB-X)
# =============================================================================
# Invokes get-yao-chi-agent API via aliyun CLI DAS plugin with streaming response.
# Requires DAS plugin: aliyun plugin install --names aliyun-cli-das
# Uses existing aliyun CLI credentials (aliyun configure), no extra setup needed.
#
# Usage:
# bash call_yaochi_agent.sh "List PolarDB-X instances in Hangzhou region"
# bash call_yaochi_agent.sh "Analyze instance pxc-xxx performance" --session-id <session-id>
# echo "List instances" | bash call_yaochi_agent.sh -
# =============================================================================
set -euo pipefail
# --- Configuration ---
ENDPOINT="das.cn-shanghai.aliyuncs.com"
SOURCE="polarx"
READ_TIMEOUT=180
CONNECT_TIMEOUT=30
THROTTLE_RETRY_MAX=3
THROTTLE_RETRY_INTERVAL=20
# --- Variables ---
QUERY=""
SESSION_ID=""
PROFILE=""
DEBUG=false
# --- Functions ---
usage() {
cat >&2 <<EOF
Alibaba Cloud YaoChi Agent CLI Tool - PolarDB-X (based on aliyun CLI)
Usage:
$(basename "$0") <query> [options]
Arguments:
<query> Query content (natural language), use '-' to read from stdin
Options:
--session-id <id> Session ID for multi-turn conversation
--profile <name> Specify aliyun CLI profile
--debug, -d Enable debug mode
--help, -h Show help information
Examples:
$(basename "$0") "List PolarDB-X instances in Hangzhou region"
$(basename "$0") "Analyze instance pxc-xxx performance" --session-id "sess-xxx"
echo "List instances" | $(basename "$0") -
EOF
}
debug_log() {
if [[ "$DEBUG" == "true" ]]; then
echo "[DEBUG] $*" >&2
fi
}
# Check dependencies
check_dependencies() {
if ! command -v aliyun &>/dev/null; then
echo "Error: aliyun CLI not found, please install (>= 3.3.3)" >&2
echo "Install: curl -fsSL https://aliyuncli.alicdn.com/install.sh | bash" >&2
echo "See: references/cli-installation-guide.md" >&2
exit 1
fi
if ! command -v jq &>/dev/null; then
echo "Error: jq is required to parse JSON response" >&2
echo "Install:" >&2
echo " macOS: brew install jq" >&2
echo " Ubuntu: sudo apt-get install jq" >&2
echo " CentOS: sudo yum install jq" >&2
exit 1
fi
local version
version=$(aliyun version 2>/dev/null || echo "0.0.0")
debug_log "aliyun CLI version: $version"
# Check DAS plugin is installed (do NOT auto-install at runtime to avoid downloading unaudited code)
if ! aliyun das get-yao-chi-agent --help &>/dev/null 2>&1; then
echo "Error: DAS plugin is not installed. Please install it manually before running this script:" >&2
echo " aliyun plugin install --names aliyun-cli-das" >&2
echo "See: references/cli-installation-guide.md" >&2
exit 1
fi
}
# Stream parse response (read from stdin line by line, output in real-time)
# DAS plugin returns streaming JSON (one {"data": {...}} per line) or SSE format
parse_sse_streaming() {
local session_id=""
local format_detected=false
local is_sse=false
local is_json_stream=false
local error_buffer=""
while IFS= read -r line; do
line="${line%$'\r'}"
[[ -z "$line" ]] && continue
# Detect response format on first line
if [[ "$format_detected" == false ]]; then
if [[ "$line" =~ ^data: ]]; then
is_sse=true
debug_log "Detected SSE format response"
elif echo "$line" | jq -e '.data' &>/dev/null 2>&1; then
is_json_stream=true
debug_log "Detected streaming JSON format response (DAS plugin)"
else
# Might be error response or plain JSON, buffer first
error_buffer="$line"
# Check if error response
local error_code
error_code=$(echo "$line" | jq -r '.Code // empty' 2>/dev/null) || true
if [[ -n "$error_code" ]]; then
local error_msg
error_msg=$(echo "$line" | jq -r '.Message // empty' 2>/dev/null) || true
echo "Error: ${error_msg:-Unknown error} (${error_code})" >&2
if [[ "$error_code" == *"Throttling"* ]] || [[ "$error_code" == *"ConcurrentLimit"* ]]; then
echo "Max 2 concurrent sessions per account. Please wait for previous query to complete." >&2
return 2
fi
return 1
fi
# Try to handle as plain JSON response
local content
content=$(echo "$line" | jq -r '.Content // .Data // empty' 2>/dev/null) || true
if [[ -n "$content" ]]; then
printf "%s" "$content"
session_id=$(echo "$line" | jq -r '.SessionId // empty' 2>/dev/null) || true
else
# Cannot parse, output as-is
echo "$line"
fi
format_detected=true
continue
fi
format_detected=true
fi
# Process SSE format
if [[ "$is_sse" == true ]]; then
if [[ "$line" =~ ^data:\ ?(.*) ]]; then
local data="${BASH_REMATCH[1]}"
[[ "$data" == "[DONE]" || -z "$data" ]] && continue
local chunk_content
chunk_content=$(echo "$data" | jq -r '.Content // empty' 2>/dev/null) || true
[[ -n "$chunk_content" ]] && printf "%s" "$chunk_content"
local chunk_session
chunk_session=$(echo "$data" | jq -r '.SessionId // empty' 2>/dev/null) || true
[[ -n "$chunk_session" ]] && session_id="$chunk_session"
if [[ "$DEBUG" == "true" ]]; then
local reasoning
reasoning=$(echo "$data" | jq -r '.ReasoningContent // empty' 2>/dev/null) || true
[[ -n "$reasoning" ]] && debug_log "Reasoning: $reasoning"
fi
fi
fi
# Process streaming JSON format
if [[ "$is_json_stream" == true ]]; then
local chunk_content
chunk_content=$(echo "$line" | jq -r '.data.Content // empty' 2>/dev/null) || true
[[ -n "$chunk_content" ]] && printf "%s" "$chunk_content"
local chunk_session
chunk_session=$(echo "$line" | jq -r '.data.SessionId // empty' 2>/dev/null) || true
[[ -n "$chunk_session" ]] && session_id="$chunk_session"
if [[ "$DEBUG" == "true" ]]; then
local reasoning
reasoning=$(echo "$line" | jq -r '.data.ReasoningContent // empty' 2>/dev/null) || true
[[ -n "$reasoning" ]] && debug_log "Reasoning: $reasoning"
fi
fi
done
# Output newline (end of content)
echo ""
# Output session ID (to stderr for multi-turn conversation)
if [[ -n "$session_id" ]]; then
echo "" >&2
echo "[SessionID] $session_id" >&2
fi
}
# --- Argument parsing ---
while [[ $# -gt 0 ]]; do
case "$1" in
--session-id)
SESSION_ID="$2"
shift 2
;;
--profile)
PROFILE="$2"
shift 2
;;
--debug|-d)
DEBUG=true
shift
;;
--help|-h)
usage
exit 0
;;
-)
QUERY=$(cat)
shift
;;
-*)
echo "Unknown option: $1" >&2
usage
exit 1
;;
*)
QUERY="$1"
shift
;;
esac
done
# --- Input Validation ---
# All agent inputs are treated as untrusted; validate type, format, and boundaries.
if [[ -z "$QUERY" ]]; then
usage
exit 1
fi
# QUERY: enforce maximum length (8192 characters)
MAX_QUERY_LENGTH=8192
if [[ ${#QUERY} -gt $MAX_QUERY_LENGTH ]]; then
echo "Error: Query too long (${#QUERY} chars). Maximum allowed: $MAX_QUERY_LENGTH characters." >&2
exit 1
fi
# SESSION_ID: if provided, must match expected format (alphanumeric, hyphens, underscores, dots, 1-128 chars)
if [[ -n "$SESSION_ID" ]]; then
if [[ ${#SESSION_ID} -gt 128 ]]; then
echo "Error: Session ID too long (${#SESSION_ID} chars). Maximum allowed: 128 characters." >&2
exit 1
fi
if [[ ! "$SESSION_ID" =~ ^[a-zA-Z0-9._-]+$ ]]; then
echo "Error: Session ID contains invalid characters. Only alphanumeric, hyphen, underscore, and dot are allowed." >&2
exit 1
fi
fi
# PROFILE: if provided, must match safe character whitelist (alphanumeric, hyphens, underscores, 1-64 chars)
if [[ -n "$PROFILE" ]]; then
if [[ ${#PROFILE} -gt 64 ]]; then
echo "Error: Profile name too long (${#PROFILE} chars). Maximum allowed: 64 characters." >&2
exit 1
fi
if [[ ! "$PROFILE" =~ ^[a-zA-Z0-9_-]+$ ]]; then
echo "Error: Profile name contains invalid characters. Only alphanumeric, hyphen, and underscore are allowed." >&2
exit 1
fi
fi
check_dependencies
# --- Build CLI command arguments ---
# Use DAS plugin's kebab-case command, supports Signature V3
cli_args=(das get-yao-chi-agent
--query "$QUERY"
--source "$SOURCE"
--endpoint "$ENDPOINT"
--read-timeout "$READ_TIMEOUT"
--connect-timeout "$CONNECT_TIMEOUT"
--user-agent AlibabaCloud-Agent-Skills/alibabacloud-polardbx-ai-assistant
)
if [[ -n "$SESSION_ID" ]]; then
cli_args+=(--session-id "$SESSION_ID")
fi
if [[ -n "$PROFILE" ]]; then
cli_args+=(--profile "$PROFILE")
fi
# --- Output query info ---
echo "[Query] $QUERY" >&2
if [[ -n "$SESSION_ID" ]]; then
echo "[SessionID] $SESSION_ID" >&2
fi
echo "============================================================" >&2
echo "[YaoChi Agent Response]" >&2
debug_log "Executing: aliyun ${cli_args[*]}"
# --- Execute and stream parse (with throttling retry) ---
for (( attempt=1; attempt<=THROTTLE_RETRY_MAX; attempt++ )); do
debug_log "Attempt $attempt/$THROTTLE_RETRY_MAX: aliyun ${cli_args[*]}"
set +e
aliyun "${cli_args[@]}" 2>&1 | parse_sse_streaming
parse_exit=${PIPESTATUS[1]}
set -e
# Exit code 2 = throttling error, retry after waiting
if [[ $parse_exit -eq 2 ]]; then
if [[ $attempt -lt $THROTTLE_RETRY_MAX ]]; then
echo "[Retry] Throttling detected, waiting ${THROTTLE_RETRY_INTERVAL}s before retry ($attempt/$THROTTLE_RETRY_MAX)..." >&2
sleep "$THROTTLE_RETRY_INTERVAL"
continue
else
echo "[Retry] Throttling persists after $THROTTLE_RETRY_MAX attempts, giving up." >&2
exit 1
fi
fi
# Any other result (success or non-throttling error), stop retrying
break
done