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.
FeatureCLI SupportSDK SupportNotesCreate Pay-as-you-go Quota✅ Yes✅ YesFully supportedCreate Subscription Quota❌ Not Supported❌ Not SupportedTemporarily unavailableQuery Quota (get-quota)✅ Yes✅ Yes⚠️ Deprecated - Use query-quota insteadQuery Quota (query-quota)✅ Yes✅ YesRecommended replacement for get-quotaList Quotas✅ Yes✅ YesFully supported (both payasyougo and subscription)Delete Quota❌ No API❌ No APINot available via API - Must use ConsoleModify Quota❌ Not in scope❌ Not in scopeNot 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
text
Alibaba Cloud Account → MaxCompute Service → Quota Resources (CU)
├── Pay-as-you-go Quota (后付费) ← **Creation Supported**
└── Subscription Quota (预付费) ← Query/List only
Pre-check: Aliyun CLI >= 3.3.3 required Run
aliyun versionto verify >= 3.3.3. If not installed or version too low, runcurl -fsSL https://aliyuncli.alicdn.com/setup.sh | bashto 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
bash
# Verify CLI version
aliyun version
# Install maxcompute plugin (confirm when prompted)
aliyun plugin install maxcompute
# Update 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:
bash
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.
bash
aliyun configure ai-mode disable
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)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.
ParameterValidation RulesRegionIdMust be valid Alibaba Cloud region ID (e.g., cn-hangzhou, cn-shanghai)nicknameMax 64 characters; alphanumeric, hyphens (-), underscores (_); URL-encode if contains Chinese characterschargeTypeMust be payasyougo (subscription not supported)commodityCodeMust be odps, odpsplus, odps_intl, or odpsplus_intl``billingTypeMust 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 NameRequired/OptionalDescriptionDefault ValueRegionIdRequiredAlibaba Cloud region (e.g., cn-hangzhou, cn-shanghai)-chargeTypeRequiredBilling type: payasyougo only (subscription not supported)-commodityCodeRequiredProduct code (see table below)-billingTypeOptionalFilter for listing: subscription or payasyougo or ALL``ALL``maxItemOptionalMax items per page for listing100
SiteCommodity CodeChina (国内站)odpsInternational (国际站)odps_intl
Security: Never expose credentials
aliyun configure set with hardcoded valuesCheck credentials:
bash
aliyun configure list
If no credentials, ask user to run aliyun configure first, then continue.
🚨 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:
OperationFirst CommandThenCREATE quotalist-quotasIf empty → Create; If exists → StopQUERY quotaquery-quotaShow resultsLIST quotaslist-quotasShow 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-type🚨 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
bash
aliyun maxcompute list-quotas --billing-type payasyougo --region <R>
DO NOT proceed to Step 2 until you get list-quotas result
Use MaxCompute service ( aliyun maxcompute), NOT Quota Center ( aliyun quotas).
AFTER list-quotas result (STEP 2):
ResultActionList shows quotaDO NOT CREATE - Inform user "Quota already exists" → DoneList is emptyGo to Step 3 (Create)
STEP 3 - ONLY IF LIST WAS EMPTY:
PRE-CREATE CHECKLIST - ALL MUST BE TRUE:
bash
aliyun maxcompute create-quota --charge-type payasyougo --commodity-code odps --region <R> --client-token <UNIQUE_TOKEN>
For International Site:
bash
aliyun maxcompute create-quota --charge-type payasyougo --commodity-code odps_intl --region <R> --client-token <UNIQUE_TOKEN>
CRITICAL:
create-quotaodps or odpsplusodps_intl or odpsplus_intlmaxcompute as commodityCodechargeType=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 <directory> 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.
PRIORITY: Use query-quota as the primary API for querying specific quota details by nickname.
CHECKLIST:
query-quota (NOT get-quota)USE THIS COMMAND:
bash
aliyun maxcompute query-quota --nickname <N> --region <R>
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, status⚠️ FOR LISTING QUOTAS: ONLY use MaxCompute list-quotas, NOT BssOpenApi
When checking for existing pay-as-you-go quotas (before creation):
bash
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):
bash
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
Response field odpsSpecCode enum values:
odpsSpecCodeDescriptionOdpsStandardODPS Pay-as-you-go ResourceOdpsSpotODPS Spot/Off-peak Resource (Pay-as-you-go)OdpsDevDeveloper Resource TypeOdpsPlusStandardSubscription ResourceOdpsPlusHaHigh Availability ResourceOdpsPlusElasticCUODPS Non-reserved Elastic CU Subscription Resource
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-manageOutput Files — MUST create before finishing:
mkdir -p outputs ran_scripts — ensure directories exist firstoutputs/existing_quotas.jsonran_scripts/actions_log.txtIMPORTANT: Always run
mkdir -pfor any target directory BEFORE writing files. Never assume directories already exist.
Finish with:
outputs/existing_quotas.json, ran_scripts/actions_log.txt)Error CodeWhat to DoQuotaAlreadyExistsQuota exists → Query it and show details → Task completeQuotaNotFoundQuota doesn't exist → Inform userInvalidParameterWrong parameter format → Check with userForbiddenNo permission → Direct to ConsoleINTERNAL_ERRORRetry once or contact support
No Delete API - Must use Console to delete quotas
See references/related-apis.md for complete API reference, CLI commands, and response formats.
ReferenceDescriptionreferences/related-apis.mdComplete CLI commands and API referencereferences/ram-policies.mdRequired RAM permissionsreferences/verification-method.mdSuccess verification stepsreferences/acceptance-criteria.mdTesting acceptance criteriareferences/cli-installation-guide.mdCLI installation guide