skills/aliyun/alibabacloud-aiops-skills/alibabacloud-odps-quota-manage

alibabacloud-odps-quota-manage

SKILL.md

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.

Solution Source: Based on odps-open-api-example/quota-manage

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 (GetQuota) ✅ Yes ✅ Yes ⚠️ Deprecated - Use QueryQuota instead
Query Quota (QueryQuota) ✅ Yes ✅ Yes Recommended replacement for GetQuota
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.
  • QueryQuota is preferred - GetQuota is deprecated but acceptable if it returns success
  • ⚠️ CRITICAL: When checking if quota exists, ALWAYS use ListQuotas API, NEVER use GetQuota
  • 🚨 MANDATORY: Before CreateQuota, MUST call ListQuotas 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.1 required Run aliyun version to verify >= 3.3.1. If not installed or version too low, see references/cli-installation-guide.md for installation instructions. Then [MUST] run aliyun configure set --auto-plugin-install true to enable automatic plugin installation.

# Verify CLI version
aliyun version

# Enable auto plugin installation
aliyun configure set --auto-plugin-install true

Environment Variables

Variable Required Description
ALIBABA_CLOUD_ACCESS_KEY_ID Yes Alibaba Cloud Access Key ID
ALIBABA_CLOUD_ACCESS_KEY_SECRET Yes Alibaba Cloud Access Key Secret

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.

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

  • Don't print AK/SK values
  • Don't ask user to type AK/SK in chat
  • Don't use aliyun configure set with hardcoded values

Check credentials:

aliyun configure list

If no credentials, ask user to run aliyun configure first, then continue.

Core Workflow

🚨 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 ListQuotas first = ERROR


FORBIDDEN COMMANDS - NEVER USE:

  • aliyun maxcompute create-quota - WRONG CASE (kebab-case), use PascalCase CreateQuota
  • aliyun maxcompute GetQuota - DEPRECATED, use query-quota instead
  • aliyun bssopenapi CreateInstance - WRONG API (BssOpenApi), use MaxCompute CreateQuota instead
  • aliyun bssopenapi QueryAvailableInstances - WRONG API for listing quotas, use MaxCompute ListQuotas instead
  • aliyun quotas commands - WRONG SERVICE (Quota Center), use MaxCompute instead

MUST USE INSTEAD:

  • aliyun maxcompute list-quotas - For listing/checking quotas (MaxCompute service, NOT BssOpenApi)
  • aliyun maxcompute query-quota - For querying quota details (MaxCompute service)
  • aliyun maxcompute CreateQuota - For creating quota (MaxCompute service)

⚠️ IMPORTANT: Use aliyun maxcompute commands (MaxCompute service), NOT aliyun quotas commands (Quota Center service).

Command Case Rules:

  • API actions use PascalCase: CreateQuota
  • CLI commands use kebab-case: list-quotas, query-quota

CREATE Quota (CHECK FIRST - THEN CREATE):

🚨 PREPAID/SUBSCRIPTION QUOTAS ARE FORBIDDEN: This skill ONLY supports pay-as-you-go quota creation.

  • If user wants prepaid/subscription quota → Tell them to use Alibaba Cloud Console
  • Do NOT attempt to create prepaid quotas

🚨 FOR CREATE: FIRST RUN LISTQUOTAS - NEVER SKIP THIS:

STEP 1 - MANDATORY: Call ListQuotas FIRST

aliyun maxcompute list-quotas --billing-type payasyougo --region <R>

DO NOT proceed to Step 2 until you get ListQuotas result

Use MaxCompute service (aliyun maxcompute), NOT Quota Center (aliyun quotas).

AFTER ListQuotas 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:

  • User wants pay-as-you-go (NOT prepaid/subscription)
  • ListQuotas was called and returned empty list
  • No existing pay-as-you-go quota in the region
  • User confirmed they want to create
aliyun maxcompute CreateQuota --chargeType payasyougo --commodityCode odps --region <R>

For International Site:

aliyun maxcompute CreateQuota --chargeType payasyougo --commodityCode odps_intl --region <R>

CRITICAL:

  • Use CreateQuota (PascalCase), NOT create-quota (kebab-case)
  • FORBIDDEN: create-quota, create-quota-odps-paygo, or any kebab-case variant
  • Use MaxCompute CreateQuota, NOT BssOpenApi CreateInstance
  • Do NOT use aliyun bssopenapi CreateInstance
  • commodityCode values:
    • China site: odps 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

FINALLY:

  • Parse result
  • Show user
  • Done

⚠️ NEVER call CreateQuota before ListQuotas. This causes errors.

Note: If quota already exists, DO NOT create. Only create when ListQuotas 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:

  • User provided quota nickname
  • Use query-quota (NOT GetQuota)

USE THIS COMMAND:

aliyun maxcompute query-quota --nickname <N> --region <R>

IMPORTANT: If nickname contains Chinese characters, URL-encode it first before passing to the command.

FORBIDDEN: aliyun maxcompute GetQuota - use query-quota instead.

  • Parse JSON
  • Extract: nickName, name, id, status
  • Show all fields → Done

LIST Quotas:

⚠️ FOR LISTING QUOTAS: ONLY use MaxCompute ListQuotas, NOT BssOpenApi QueryAvailableInstances

When checking for existing pay-as-you-go quotas (before creation):

aliyun maxcompute list-quotas --billing-type payasyougo --region <R>

MUST include --billing-type payasyougo to filter at API level.

When listing all quotas (user request):

aliyun maxcompute list-quotas --billing-type ALL --region <R>

billingType parameter:

  • Valid values: payasyougo, subscription, ALL

  • If not set, defaults to ALL

  • Use payasyougo when checking for existing pay-as-you-go quotas

  • Parse JSON

  • Extract quotaInfoList array

  • Show list → Done


Quick Reference

See references/related-apis.md for complete CLI command reference and response format details.

Key Points:

  • Use list-quotas --billing-type payasyougo before creating
  • Use query-quota (not get-quota) for querying
  • Use CreateQuota (PascalCase) for creating
  • Always include --user-agent AlibabaCloud-Agent-Skills

Task Completion

Finish with:

  • Summary of what was done
  • Key results (nickname, region, status)
  • "✅ Complete"

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

Weekly Installs
5
GitHub Stars
28
First Seen
1 day ago
Installed on
opencode5
gemini-cli5
deepagents5
antigravity5
github-copilot5
amp5