alicloud-compute-swas-openManage Alibaba Cloud Simple Application Server (SWAS OpenAPI 2020-06-01) resources end-to-end. Use for querying instances, starting/stopping/rebooting, executing commands (cloud assistant), managing disks/snapshots/images, firewall rules/templates, key pairs, tags, monitoring, and lightweight database operations.
Install via ClawdBot CLI:
clawdbot install cinience/alicloud-compute-swas-openCategory: service
使用 SWAS-OPEN OpenAPI 管控轻量应用服务器的全量资源:实例、磁盘、快照、镜像、密钥对、防火墙、命令助手、监控、标签、轻量数据库等。
ALICLOUD_REGION_ID 可作为默认 Region;未设置时可选择最合理 Region,无法判断则询问用户。1) Python SDK(优先)
2) OpenAPI Explorer
3) 其他 SDK
推荐使用虚拟环境(避免 PEP 668 的系统安装限制)。
python3 -m venv .venv
. .venv/bin/activate
python -m pip install alibabacloud_swas_open20200601 alibabacloud_tea_openapi alibabacloud_credentials
import 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("ALICLOUD_ACCESS_KEY_ID") or os.getenv("ALIBABA_CLOUD_ACCESS_KEY_ID")
sk = os.getenv("ALICLOUD_ACCESS_KEY_SECRET") or os.getenv("ALIBABA_CLOUD_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 可能没有 swas-open 作为产品名;优先使用 Python SDK。如必须用 CLI,请先通过 OpenAPI Explorer 生成调用示例,再迁移到 CLI。
1) 明确资源类型与 Region(实例/磁盘/快照/镜像/防火墙/命令/数据库/标签)。
2) 在 references/api_overview.md 中确定 API 组与具体接口。
3) 选择调用方式(Python SDK / OpenAPI Explorer / 其他 SDK)。
4) 执行变更后,用查询接口校验状态或结果。
ListInstances、StartInstance(s)、StopInstance(s)、RebootInstance(s) RunCommand 或 CreateCommand + InvokeCommand,结果用 DescribeInvocations/DescribeInvocationResult ListFirewallRules/CreateFirewallRule(s)/ModifyFirewallRule/EnableFirewallRule/DisableFirewallRule CreateSnapshot、ResetDisk、CreateCustomImage 等 InstallCloudAssistant 安装)。DescribeInvocations 或 DescribeInvocationResult 取回结果与状态。详见 references/command-assistant.md。
若需保存结果或响应,写入:
output/compute-swas-open/
references/api_overview.mdreferences/endpoints.mdreferences/command-assistant.mdreferences/sources.mdGenerated Mar 1, 2026
Small businesses or developers use this skill to manage lightweight web servers on Alibaba Cloud. They can query instance statuses, start/stop servers as needed, and execute commands via cloud assistant for application deployment or updates. This is ideal for hosting simple websites or APIs with minimal infrastructure overhead.
DevOps teams automate server provisioning and maintenance tasks for development and testing environments. They can reboot instances, manage firewall rules for security, and run scripts to configure servers, reducing manual intervention. This supports continuous integration and deployment pipelines in cloud-native projects.
Organizations use this skill to create snapshots of disks and manage custom images for disaster recovery. They can schedule backups, reset disks from snapshots, and ensure data integrity for critical applications. This is common in industries requiring regular data protection and quick restoration.
IT administrators monitor server performance and enforce security policies by querying instances and managing tags for resource tracking. They can check SSH ports, apply firewall templates, and use lightweight database operations to maintain compliance with internal standards. This helps in auditing and optimizing cloud resource usage.
Companies offer managed cloud services by using this skill to handle client servers, including monitoring, patching, and security management. They charge subscription fees based on the number of instances or services provided, generating recurring revenue from ongoing support and automation.
SaaS providers integrate this skill into their platforms to allow customers to self-manage their server instances, such as for hosting applications or databases. Revenue comes from tiered pricing plans that include access to advanced features like command execution and snapshot management.
Consultants use this skill to help clients optimize their Alibaba Cloud SWAS deployments, offering training on API usage and best practices. They earn revenue through project-based fees or workshops, focusing on cost savings and efficiency improvements in cloud infrastructure.
💬 Integration Tip
Prioritize using the Python SDK for reliable API calls and ensure proper region configuration to avoid endpoint issues.
Automatically update Clawdbot and all installed skills once daily. Runs via cron, checks for updates, applies them, and messages the user with a summary of what changed.
Full desktop computer use for headless Linux servers. Xvfb + XFCE virtual desktop with xdotool automation. 17 actions (click, type, scroll, screenshot, drag,...
Essential Docker commands and workflows for container management, image operations, and debugging.
Tool discovery and shell one-liner reference for sysadmin, DevOps, and security tasks. AUTO-CONSULT this skill when the user is: troubleshooting network issues, debugging processes, analyzing logs, working with SSL/TLS, managing DNS, testing HTTP endpoints, auditing security, working with containers, writing shell scripts, or asks 'what tool should I use for X'. Source: github.com/trimstray/the-book-of-secret-knowledge
Deploy applications and manage projects with complete CLI reference. Commands for deployments, projects, domains, environment variables, and live documentation access.
Monitor topics of interest and proactively alert when important developments occur. Use when user wants automated monitoring of specific subjects (e.g., product releases, price changes, news topics, technology updates). Supports scheduled web searches, AI-powered importance scoring, smart alerts vs weekly digests, and memory-aware contextual summaries.