Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Use when managing Alibaba Cloud Simple Application Server (SWAS OpenAPI 2020-06-01) resources end-to-end, including querying instances, starting/stopping/rebooting, executing commands (cloud assistant), managing disks/snapshots/images, firewall rules/templates, key pairs, tags, monitoring, and lightweight database operations.
| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-04 | ✗→✓ | ▲ Improved | 100% | 0% |
| case-05 | ✗→✓ | ▲ Improved | 25% | 0% |
| case-10 | ✗→✓ | ▲ Improved | 53% | 0% |
| case-15 | ✗→✓ | ▲ Improved | 112% | 0% |
| case-19 | ✗→✓ | ▲ Improved | 124% | 0% |
Category: service
Use SWAS-OPEN OpenAPI to manage full SAS resources: instances, disks, snapshots, images, key pairs, firewall, Cloud Assistant, monitoring, tags, and lightweight databases.
ALIBABACLOUD_REGION_ID can be used as default region; if unset choose the most reasonable region, ask user if unclear.1) Python SDK (preferred) 2) OpenAPI Explorer 3) Other SDKs
Virtual environment is recommended (avoid PEP 668 system install restrictions).
bashpython3 -m venv .venv . .venv/bin/activate python -m pip install alibabacloud_swas_open20200601 alibabacloud_tea_openapi alibabacloud_credentials
pythonimport os from alibabacloud_swas_open20200601.client import Client as SwasClient from alibabacloud_swas_open20200601 import models as swas_models from alibabacloud_tea_openapi import models as open_api_models def create_client(region_id: str) -> SwasClient: config = open_api_models.Config( region_id=region_id, endpoint=f"swas.{region_id}.aliyuncs.com", ) ak = ( os.getenv("ALIBABACLOUD_ACCESS_KEY_ID") or os.getenv("ALIBABA_CLOUD_ACCESS_KEY_ID") or os.getenv("ALICLOUD_ACCESS_KEY_ID") ) sk = ( os.getenv("ALIBABACLOUD_ACCESS_KEY_SECRET") or os.getenv("ALIBABA_CLOUD_ACCESS_KEY_SECRET") or os.getenv("ALICLOUD_ACCESS_KEY_SECRET") ) if ak and sk: config.access_key_id = ak config.access_key_secret = sk return SwasClient(config) def list_regions(): client = create_client("cn-hangzhou") resp = client.list_regions(swas_models.ListRegionsRequest()) return [r.region_id for r in resp.body.regions] def list_instances(region_id: str): client = create_client(region_id) resp = client.list_instances(swas_models.ListInstancesRequest(region_id=region_id)) return resp.body.instances def main(): for region_id in list_regions(): for inst in list_instances(region_id): ip = getattr(inst, "public_ip_address", None) or getattr(inst, "inner_ip_address", None) spec = getattr(inst, "plan_name", None) or getattr(inst, "plan_id", None) print(inst.instance_id, ip or "-", spec or "-", region_id) if __name__ == "__main__": main()
scripts/list_instances_all_regions.pyscripts/summary_instances_by_plan.pyscripts/summary_instances_by_status.pyscripts/fix_ssh_access.pyscripts/get_ssh_port.pyaliyun CLI may not expose swas-open as product name; prefer Python SDK.If CLI is mandatory, generate request examples in OpenAPI Explorer first, then migrate to CLI.
1) Confirm resource type and region (instance/disk/snapshot/image/firewall/command/database/tag). 2) Identify API group and operation in references/api_overview.md. 3) Choose invocation method (Python SDK / OpenAPI Explorer / other SDK). 4) After mutations, verify state/results with query APIs.
ListInstances、StartInstance(s)、StopInstance(s)、RebootInstance(s) RunCommand or CreateCommand + InvokeCommand; use DescribeInvocations/DescribeInvocationResult ListFirewallRules/CreateFirewallRule(s)/ModifyFirewallRule/EnableFirewallRule/DisableFirewallRule CreateSnapshot、ResetDisk、CreateCustomImage etc. InstallCloudAssistant).DescribeInvocations or DescribeInvocationResult to fetch status and outputs.See references/command-assistant.md for details.
If you need to save results or responses, write to: output/compute-swas-open/
bashmkdir -p output/aliyun-swas-manage for f in skills/compute/swas/aliyun-swas-manage/scripts/*.py; do python3 -m py_compile "$f" done echo "py_compile_ok" > output/aliyun-swas-manage/validate.txt
Pass criteria: command exits 0 and output/aliyun-swas-manage/validate.txt is generated.
output/aliyun-swas-manage/.ALIBABACLOUD_ACCESS_KEY_ID, ALIBABACLOUD_ACCESS_KEY_SECRET, optional ALIBABACLOUD_REGION_ID.1) Confirm user intent, region, identifiers, and whether the operation is read-only or mutating. 2) Run one minimal read-only query first to verify connectivity and permissions. 3) Execute the target operation with explicit parameters and bounded scope. 4) Verify results and save output/evidence files.
references/api_overview.mdreferences/endpoints.mdreferences/command-assistant.mdreferences/sources.mdOther measured skills in the registry, with their headline benchmark lift.