Alibabacloud Odps Quota Manage
by @sdk-team
MaxCompute Quota Management Skill. Use for managing MaxCompute/ODPS quota resources including pay-as-you-go quota creation, query, and listing operations. Tr...
clawhub install alibabacloud-odps-quota-manageπ About This Skill
name: alibabacloud-odps-quota-manage description: | MaxCompute Quota Management Skill. Use for managing MaxCompute/ODPS quota resources including pay-as-you-go quota creation, query, and listing operations. Triggers: "MaxCompute quota", "ODPS quota", "create quota", "list quotas", "quota management", "CU management".
MaxCompute Quota Management
Manage MaxCompute (ODPS) Quota resources using Alibaba Cloud CLI and SDK. This skill covers pay-as-you-go quota creation, quota query, and quota listing operations.
Limitations and Notes
| Feature | CLI Support | SDK Support | Notes | |---------|-------------|-------------|-------| | Create Pay-as-you-go Quota | β Yes | β Yes | Fully supported | | Create Subscription Quota | β Not Supported | β Not Supported | Temporarily unavailable | | Query Quota (get-quota) | β Yes | β Yes | β οΈ Deprecated - Use query-quota instead | | Query Quota (query-quota) | β Yes | β Yes | Recommended replacement for get-quota | | List Quotas | β Yes | β Yes | Fully supported (both payasyougo and subscription) | | Delete Quota | β No API | β No API | Not available via API - Must use Console | | Modify Quota | β Not in scope | β Not in scope | Not covered in this solution |
> Important: > - Create Subscription Quota is temporarily NOT supported in this skill. For subscription quota creation, please use the Alibaba Cloud Console. > - Delete Quota operation is NOT available through CLI or SDK. You must use the Alibaba Cloud Console to delete quotas. > - query-quota is preferred - get-quota is deprecated but acceptable if it returns success > - β οΈ CRITICAL: When checking if quota exists, ALWAYS use list-quotas, NEVER use get-quota > - π¨ MANDATORY: Before create-quota, MUST call list-quotas first - NEVER skip this step
Architecture
Alibaba Cloud Account β MaxCompute Service β Quota Resources (CU)
βββ Pay-as-you-go Quota (εδ»θ΄Ή) β Creation Supported
βββ Subscription Quota (ι’δ»θ΄Ή) β Query/List only
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 update,
> or see references/cli-installation-guide.md for installation instructions.
> Pre-check: Aliyun CLI plugin setup required
> [MUST] Install the maxcompute plugin manually: aliyun plugin install maxcompute
> [MUST] Update the plugin to latest version: aliyun plugin update maxcompute
# Verify CLI version
aliyun versionInstall maxcompute plugin (confirm when prompted)
aliyun plugin install maxcomputeUpdate maxcompute plugin to latest version
aliyun plugin update maxcompute
[MUST] CLI User-Agent β Every aliyun CLI command invocation must include:
--user-agent AlibabaCloud-Agent-Skills/alibabacloud-odps-quota-manage
At the start of the Core Workflow (before any CLI invocation): [MUST] Enable AI-Mode β AI-mode is required for Agent Skill execution. Run the following commands before any CLI invocation:
aliyun configure ai-mode enable
aliyun configure ai-mode set-user-agent --user-agent "AlibabaCloud-Agent-Skills/alibabacloud-odps-quota-manage"
[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.
aliyun configure ai-mode disable
Environment Variables
This skill relies on the aliyun CLI default credential chain. No explicit credential configuration is needed.
aliyun configure to set up credentials before first useTimeout Configuration:
ALIBABA_CLOUD_CONNECT_TIMEOUT: Connection timeout (default: 10s)ALIBABA_CLOUD_READ_TIMEOUT: Read timeout (default: 10s)Parameter Confirmation
> IMPORTANT: Parameter Confirmation β Before executing any command or API call, > ALL user-customizable parameters (e.g., RegionId, quota nicknames, billing types, etc.) > MUST be confirmed with the user. Do NOT assume or use default values without explicit user approval.
Input Validation
| Parameter | Validation Rules |
|-----------|------------------|
| RegionId | Must be valid Alibaba Cloud region ID (e.g., cn-hangzhou, cn-shanghai) |
| nickname | Max 64 characters; alphanumeric, hyphens (-), underscores (_); URL-encode if contains Chinese characters |
| chargeType | Must be payasyougo (subscription not supported) |
| commodityCode | Must be odps, odpsplus, odps_intl, or odpsplus_intl |
| billingType | Must be payasyougo, subscription, or ALL |
Security Note: All user inputs are passed to aliyun CLI which handles parameter sanitization. Do NOT construct commands using string concatenation with raw user input.
| Parameter Name | Required/Optional | Description | Default Value |
|----------------|-------------------|--------------------------------------------------------------|---------------|
| RegionId | Required | Alibaba Cloud region (e.g., cn-hangzhou, cn-shanghai) | - |
| chargeType | Required | Billing type: payasyougo only (subscription not supported) | - |
| commodityCode | Required | Product code (see table below) | - |
| billingType | Optional | Filter for listing: subscription or payasyougo or ALL | ALL |
| maxItem | Optional | Max items per page for listing | 100 |
Commodity Codes (for Pay-as-you-go)
| Site | Commodity Code |
|------|----------------|
| China (ε½ε
η«) | odps |
| International (ε½ι
η«) | odps_intl |
Authentication
Security: Never expose credentials
aliyun configure set with hardcoded valuesCheck credentials:
aliyun configure list
If no credentials, ask user to run aliyun configure first, then continue.
Core Workflow
π¨ STEP 0 - CONFIRM PARAMETERS WITH USER BEFORE ANY EXECUTION:
Before running any CLI command, you MUST confirm all required parameters with the user:
region and billing-type (payasyougo / subscription / ALL)region and nicknameregion, charge-type, and commodity-codeDo NOT assume or use default values. Ask the user explicitly and wait for confirmation before proceeding.
π¨ CRITICAL RULE FOR ALL OPERATIONS:
| Operation | First Command | Then |
|-----------|---------------|------|
| CREATE quota | list-quotas | If empty β Create; If exists β Stop |
| QUERY quota | query-quota | Show results |
| LIST quotas | list-quotas | Show list |
β οΈ CREATE without list-quotas first = ERROR
FORBIDDEN COMMANDS - NEVER USE:
aliyun quotas commands - WRONG SERVICE (Quota Center), use MaxCompute insteadget-quota - DEPRECATED, use query-quota insteadMUST USE (plugin mode, kebab-case):
aliyun maxcompute list-quotas - For listing/checking quotasaliyun maxcompute query-quota - For querying quota detailsaliyun maxcompute create-quota - For creating quotaβ οΈ IMPORTANT: Use aliyun maxcompute commands (MaxCompute service), NOT aliyun quotas commands (Quota Center service).
Command Rules:
create-quota, list-quotas, query-quota--charge-type, --commodity-code, --billing-typeCREATE Quota (CHECK FIRST - THEN CREATE):
π¨ PREPAID/SUBSCRIPTION QUOTAS ARE FORBIDDEN: This skill ONLY supports pay-as-you-go quota creation.
π¨ FOR CREATE: FIRST RUN LISTQUOTAS - NEVER SKIP THIS:
STEP 1 - MANDATORY: Call list-quotas FIRST
aliyun maxcompute list-quotas --billing-type payasyougo --region
DO NOT proceed to Step 2 until you get list-quotas resultUse MaxCompute service (aliyun maxcompute), NOT Quota Center (aliyun quotas).
AFTER list-quotas result (STEP 2):
| Result | Action | |--------|--------| | List shows quota | DO NOT CREATE - Inform user "Quota already exists" β Done | | List is empty | Go to Step 3 (Create) |
STEP 3 - ONLY IF LIST WAS EMPTY:
PRE-CREATE CHECKLIST - ALL MUST BE TRUE:
aliyun maxcompute create-quota --charge-type payasyougo --commodity-code odps --region --client-token
For International Site:
aliyun maxcompute create-quota --charge-type payasyougo --commodity-code odps_intl --region --client-token
CRITICAL:
create-quotaodps or odpsplus
- International site: odps_intl or odpsplus_intl
- NEVER use maxcompute as commodityCode
- Note: When chargeType=payasyougo is set, commodityCode validation is not strictβ οΈ OUTPUT HANDLING:
| tee ... or > file.json) β if the target directory does not exist, the command will return a non-zero exit code even when the API call succeeds.existing_quotas.json, actions_log.txt), ALWAYS mkdir -p first before writing any file to ensure the target directory exists.FINALLY:
β οΈ NEVER call create-quota before list-quotas. This causes errors.
Note: If quota already exists, DO NOT create. Only create when list-quotas returns empty list.
QUERY Quota (when user provides nickname):
PRIORITY: Use query-quota as the primary API for querying specific quota details by nickname.
CHECKLIST:
query-quota (NOT get-quota)USE THIS COMMAND:
aliyun maxcompute query-quota --nickname --region
IMPORTANT: If nickname contains Chinese characters, URL-encode it first before passing to the command.
FORBIDDEN: get-quota is deprecated - use query-quota instead.
nickName, name, id, statusLIST Quotas:
β οΈ FOR LISTING QUOTAS: ONLY use MaxCompute list-quotas, NOT BssOpenApi
When checking for existing pay-as-you-go quotas (before creation):
aliyun maxcompute list-quotas --billing-type payasyougo --region
MUST include --billing-type payasyougo to filter at API level.When listing all quotas (user request):
aliyun maxcompute list-quotas --billing-type ALL --region
billingType parameter:
payasyougo, subscription, ALLALLpayasyougo when checking for existing pay-as-you-go quotasquotaInfoList arrayResponse field odpsSpecCode enum values:
| odpsSpecCode | Description |
|--------------|-------------|
| OdpsStandard | ODPS Pay-as-you-go Resource |
| OdpsSpot | ODPS Spot/Off-peak Resource (Pay-as-you-go) |
| OdpsDev | Developer Resource Type |
| OdpsPlusStandard | Subscription Resource |
| OdpsPlusHa | High Availability Resource |
| OdpsPlusElasticCU | ODPS Non-reserved Elastic CU Subscription Resource |
Quick Reference
See references/related-apis.md for complete CLI command reference and response format details.
Key Points:
list-quotas --billing-type payasyougo before creatingquery-quota (not get-quota) for queryingcreate-quota (kebab-case plugin mode) for creating--user-agent AlibabaCloud-Agent-Skills/alibabacloud-odps-quota-manageTask Completion
Output Files β MUST create before finishing:
1. mkdir -p outputs ran_scripts β ensure directories exist first
2. Save quota query/list results to outputs/existing_quotas.json
3. Save a log of all actions performed to ran_scripts/actions_log.txt
> IMPORTANT: Always run mkdir -p for any target directory BEFORE writing files. Never assume directories already exist.
Finish with:
outputs/existing_quotas.json, ran_scripts/actions_log.txt)Error Handling
| Error Code | What to Do |
|------------|------------|
| QuotaAlreadyExists | Quota exists β Query it and show details β Task complete |
| QuotaNotFound | Quota doesn't exist β Inform user |
| InvalidParameter | Wrong parameter format β Check with user |
| Forbidden | No permission β Direct to Console |
| INTERNAL_ERROR | Retry once or contact support |
Cleanup
> No Delete API - Must use Console to delete quotas
API Reference
See references/related-apis.md for complete API reference, CLI commands, and response formats.
Best Practices
1. Always confirm region with user before any operation 2. For creation: First list to check if quota exists (one per region limit) 3. If quota exists: Query it for user instead of trying to create 4. Use query-quota (NOT get-quota) for quota details 5. For subscription quotas: Direct user to Alibaba Cloud Console
Reference Links
| Reference | Description | |-----------|-------------| | references/related-apis.md | Complete CLI commands and API reference | | references/ram-policies.md | Required RAM permissions | | references/verification-method.md | Success verification steps | | references/acceptance-criteria.md | Testing acceptance criteria | | references/cli-installation-guide.md | CLI installation guide |
Related Documentation
π Tips & Best Practices
1. Always confirm region with user before any operation 2. For creation: First list to check if quota exists (one per region limit) 3. If quota exists: Query it for user instead of trying to create 4. Use query-quota (NOT get-quota) for quota details 5. For subscription quotas: Direct user to Alibaba Cloud Console