Manage Alibaba Cloud OpenSearch instances, including creation and query operations.
Terminology: OpenSearch instance and OpenSearch app group are synonymous. This document uses "instance" uniformly.
OpenSearch is Alibaba Cloud's intelligent search service. This skill covers core instance management operations:
Architecture: OpenSearch Instance (AppGroup)
text
Alibaba Cloud OpenSearch Instance Management
├── CreateAppGroup (Create Instance)
├── DescribeAppGroup (Describe Instance)
└── ListAppGroups (List Instances)
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 update required
[MUST] run
aliyun configure set --auto-plugin-install trueto enable automatic plugin installation. [MUST] runaliyun plugin updateto ensure that any existing plugins are always up-to-date.
bash
# Install/Upgrade Aliyun CLI
curl -fsSL https://aliyuncli.alicdn.com/setup.sh | bash
aliyun version # Ensure >= 3.3.3
# Enable auto plugin installation
aliyun configure set --auto-plugin-install true
# Update plugins
aliyun plugin update
[MUST] CLI User-Agent — Every aliyun CLI command invocation must include:
--user-agent AlibabaCloud-Agent-Skills/alibabacloud-opensearch-app-manage
[MUST] AI-Mode — Before executing CLI commands, run:
aliyun configure ai-mode enablealiyun configure ai-mode set-user-agent --user-agent "AlibabaCloud-Agent-Skills/alibabacloud-opensearch-app-manage"
After all CLI operations complete, run: aliyun configure ai-mode disablePre-check: Alibaba Cloud Credentials Required
Security Rules (MUST FOLLOW):
- NEVER read, echo, or print AK/SK values
- NEVER ask the user to input AK/SK directly in the conversation
- NEVER use
aliyun configure setwith literal credential values- NEVER accept AK/SK provided directly by users in the conversation
- ONLY read credentials from environment variables or pre-configured CLI profiles
⚠️ CRITICAL: Handling User-Provided Credentials
If a user attempts to provide AK/SK directly (e.g., "My AK is xxx, SK is yyy"):
STOP immediately - Do NOT execute any command
Reject the request politely with the following message: text
For your account security, please do not provide Alibaba Cloud AccessKey ID and AccessKey Secret directly in the conversation. Please use the following secure methods to configure credentials: Method 1: Interactive configuration via aliyun configure (Recommended) aliyun configure # Enter AK/SK as prompted, credentials will be securely stored in local config file Method 2: Configure via environment variables export ALIBABA_CLOUD_ACCESS_KEY_ID=<your-access-key-id> export ALIBABA_CLOUD_ACCESS_KEY_SECRET=<your-access-key-secret> After configuration, please retry your request.Do NOT proceed with any Alibaba Cloud operations until credentials are properly configured
Check CLI configuration:
bash
aliyun configure listCheck the output for a valid profile (AK, STS, or OAuth identity).
If no valid credentials exist, STOP here.
[MUST] RAM Permission Pre-check: Before executing any operation, ensure the current user has the required RAM permissions. See references/ram-policies.md for detailed permission list.
IMPORTANT: Parameter Confirmation — Before executing any command or API call, ALL user-customizable parameters (e.g., instance name, instance type, charge type, quota spec, etc.) MUST be confirmed with the user. Do NOT assume or use default values without explicit user approval.
ParameterRequiredDescriptionDefaultnameYesInstance nameNonetypeYesInstance type: standard (High-performance) / enhanced (Industry Algorithm)NonechargeTypeNoCharge type: POSTPAY / PREPAY``POSTPAY``quota.specYesSpec type (see table below)Nonequota.docSizeYesStorage capacity (GB)Nonequota.computeResourceYesCompute resource (LCU)NonedomainNoIndustry type (required for enhanced type, see table below)general``orderConditionalSubscription order info (required when PREPAY)Noneorder.durationConditionalSubscription period quantityNoneorder.pricingCycleConditionalPeriod unit: Year / MonthNoneorder.autoRenewNoAuto-renewalfalse
Spec CodeDescriptionopensearch.share.commonShared Commonopensearch.private.commonDedicated Commonopensearch.private.computeDedicated Computeopensearch.private.storageDedicated Storage
Industry CodeDescriptiongeneralGeneral (default)ecommerceE-commerceesportsGamingcommunityContent CommunityeducationEducation
Note: OpenSearch APIs use ROA (RESTful) style. You can use
--bodyto specify the HTTP request body as a JSON string. See examples in each task below.
Idempotency: For write operations (create, restart, delete, etc.), you MUST use
--client-tokenparameter for idempotency.
- Use a UUID format unique identifier as clientToken
- When request times out or fails, you can safely retry with the same clientToken; recommend waiting 10s before retry
- Repeated requests with the same clientToken will not execute the operation multiple times
- Generation:
uuidgen(macOS/Linux) or[guid]::NewGuid()(PowerShell)
bash
# Generate idempotency token
CLIENT_TOKEN=$(uuidgen)
aliyun opensearch create-app-group \
--client-token "$CLIENT_TOKEN" \
--body '{
"name": "<instance_name>",
"type": "<standard|enhanced>",
"chargeType": "<POSTPAY|PREPAY>",
"quota": {
"docSize": <storage_GB>,
"computeResource": <compute_LCU>,
"spec": "<spec_type>"
}
}' \
--connect-timeout 3 \
--read-timeout 10 \
--user-agent AlibabaCloud-Agent-Skills/alibabacloud-opensearch-app-manage
Optional Parameters (add in body):
domain - Industry type (only for enhanced type): general (default) / ecommerce / esports / community / educationIdempotency and Dry-run Support (via Query parameters):
--dryRun true - Dry-run mode, validates parameters without actual creation--client-token <unique_id> - Idempotency token, same token multiple requests only creates onceExample: Create an enhanced (Industry Algorithm) pay-as-you-go instance (E-commerce)
bash
# Generate idempotency token
CLIENT_TOKEN=$(uuidgen)
aliyun opensearch create-app-group \
--client-token "$CLIENT_TOKEN" \
--body '{
"name": "my_search_instance",
"type": "enhanced",
"chargeType": "POSTPAY",
"domain": "ecommerce",
"quota": {
"docSize": 100,
"computeResource": 2000,
"spec": "opensearch.private.common"
}
}' \
--connect-timeout 3 \
--read-timeout 10 \
--user-agent AlibabaCloud-Agent-Skills/alibabacloud-opensearch-app-manage
Example: Create a standard (High-performance) instance
bash
# Generate idempotency token
CLIENT_TOKEN=$(uuidgen)
aliyun opensearch create-app-group \
--client-token "$CLIENT_TOKEN" \
--body '{
"name": "my_standard_instance",
"type": "standard",
"chargeType": "POSTPAY",
"quota": {
"docSize": 50,
"computeResource": 1000,
"spec": "opensearch.share.common"
}
}' \
--connect-timeout 3 \
--read-timeout 10 \
--user-agent AlibabaCloud-Agent-Skills/alibabacloud-opensearch-app-manage
Example: Create a subscription (prepaid) instance
Note: Subscription instances MUST provide
orderparameter
bash
# Generate idempotency token
CLIENT_TOKEN=$(uuidgen)
aliyun opensearch create-app-group \
--client-token "$CLIENT_TOKEN" \
--body '{
"name": "my_prepay_instance",
"type": "enhanced",
"chargeType": "PREPAY",
"domain": "ecommerce",
"quota": {
"docSize": 100,
"computeResource": 2000,
"spec": "opensearch.private.common"
},
"order": {
"duration": 1,
"pricingCycle": "Year",
"autoRenew": true
}
}' \
--connect-timeout 3 \
--read-timeout 10 \
--user-agent AlibabaCloud-Agent-Skills/alibabacloud-opensearch-app-manage
Dry-run Mode Example (validates parameters only, no actual creation):
bash
aliyun opensearch create-app-group \
--dryRun true \
--body '{
"name": "my_search_instance",
"type": "enhanced",
"chargeType": "POSTPAY",
"quota": {
"docSize": 100,
"computeResource": 2000,
"spec": "opensearch.private.common"
}
}' \
--connect-timeout 3 \
--read-timeout 10 \
--user-agent AlibabaCloud-Agent-Skills/alibabacloud-opensearch-app-manage
Idempotent Creation Example (prevents duplicate creation):
bash
# Generate idempotency token
CLIENT_TOKEN=$(uuidgen)
aliyun opensearch create-app-group \
--client-token "$CLIENT_TOKEN" \
--body '{
"name": "my_search_instance",
"type": "enhanced",
"chargeType": "POSTPAY",
"quota": {
"docSize": 100,
"computeResource": 2000,
"spec": "opensearch.private.common"
}
}' \
--connect-timeout 3 \
--read-timeout 10 \
--user-agent AlibabaCloud-Agent-Skills/alibabacloud-opensearch-app-manage
bash
aliyun opensearch list-app-groups \
--engine-type ha3 \
--page-number <page> \
--page-size <size> \
--user-agent AlibabaCloud-Agent-Skills/alibabacloud-opensearch-app-manage
Supported Filter Parameters:
--engine-type ha3 - Engine type (default ha3, must specify)
--name <instance_name> - Filter by name
--instance-id <instance_id> - Filter by instance ID
--type <standard|enhanced> - Filter by type
standard: High-performanceenhanced: Industry Algorithm--sort-by <field> - Sort field
Example: List instances
bash
aliyun opensearch list-app-groups \
--engine-type ha3 \
--page-number 1 \
--page-size 10 \
--connect-timeout 3 \
--read-timeout 10 \
--user-agent AlibabaCloud-Agent-Skills/alibabacloud-opensearch-app-manage
bash
aliyun opensearch describe-app-group \
--app-group-identity <instance_name_or_id> \
--connect-timeout 3 \
--read-timeout 10 \
--user-agent AlibabaCloud-Agent-Skills/alibabacloud-opensearch-app-manage
Example: Get instance details
bash
aliyun opensearch describe-app-group \
--app-group-identity my_search_instance \
--connect-timeout 3 \
--read-timeout 10 \
--user-agent AlibabaCloud-Agent-Skills/alibabacloud-opensearch-app-manage
Response includes:
For operation verification, see references/verification-method.md
Verify Instance Creation:
bash
aliyun opensearch describe-app-group \
--app-group-identity <instance_name> \
--connect-timeout 3 \
--read-timeout 10 \
--user-agent AlibabaCloud-Agent-Skills/alibabacloud-opensearch-app-manage
Check if result.instanceId field is non-empty; if non-empty, instance creation succeeded.
To delete instances, please use OpenSearch Console.
For complete API list, see references/related-apis.md
OperationCLI CommandAPI ActionCreate Instancealiyun opensearch create-app-groupCreateAppGroupList Instancesaliyun opensearch list-app-groupsListAppGroupsDescribe Instancealiyun opensearch describe-app-groupDescribeAppGroup
Important: Before executing write operations (create instance, etc.), you MUST confirm the following parameters with the user:
Pre-creation Confirmation Checklist:
ParameterDescriptionExampleRegionInstance regioncn-hangzhou / cn-shanghai / cn-beijingInstance Name (name)User-specified name (lowercase, numbers, underscores)my_search_instanceInstance Type (type)High-performance / Industry Algorithmstandard / enhancedCharge Type (chargeType)Pay-as-you-go / SubscriptionPOSTPAY / PREPAYSpec Type (quota.spec)Shared / Dedicatedopensearch.share.commonStorage (quota.docSize)In GB100Compute (quota.computeResource)In LCU2000Industry (domain)Only for enhanced typeecommerce / generalSubscription Period (order)Only for PREPAY1 Year / 6 Months
Confirmation Flow Example:
text
You are about to create the following OpenSearch instance, please confirm:
- Region: cn-hangzhou (China East 1)
- Instance Name: my_search_instance
- Instance Type: Industry Algorithm (enhanced)
- Industry: E-commerce (ecommerce)
- Charge Type: Pay-as-you-go (POSTPAY)
- Spec Type: Dedicated Common (opensearch.private.common)
- Storage: 100 GB
- Compute: 2000 LCU
Confirm creation? (yes/no)
For write operations (create, restart, delete), follow these idempotency best practices:
uuidgen to generate UUIDbash
# Example: Safe retry pattern
CLIENT_TOKEN=$(uuidgen)
echo "Using clientToken: $CLIENT_TOKEN"
# First attempt
aliyun opensearch create-app-group --client-token $CLIENT_TOKEN ...
# If timeout, retry with same Token
aliyun opensearch create-app-group --client-token $CLIENT_TOKEN ...
Naming Convention: Instance name must start with a letter, only lowercase letters, numbers, and underscores (_) allowed, hyphens (-) are forbidden, max 30 characters
my_search_instance, video_search, product_search_2024my-search-instance, My_Search, 123_searchQuota Planning: Plan storage and compute resources based on actual data volume and query requirements
Charge Type Selection:
order parameter (including duration and pricingCycle)Instance Type Selection:
standard): Suitable for general search scenariosenhanced): Suitable for specific industry scenarios, requires domain parameterIndustry Selection (Industry Algorithm):
ecommerceesportscommunityeducationgeneral (default)Spec Selection:
Resource Cleanup: Delete unused pay-as-you-go instances promptly to avoid unnecessary costs
DocumentDescriptionreferences/related-apis.mdComplete API Listreferences/ram-policies.mdRAM Policiesreferences/verification-method.mdVerification Methodsreferences/cli-installation-guide.mdCLI Installation Guidereferences/acceptance-criteria.mdAcceptance Criteria