{
  "schemaVersion": "1.0",
  "item": {
    "slug": "alicloud-compute-ecs",
    "name": "Alicloud Compute Ecs",
    "source": "tencent",
    "type": "skill",
    "category": "开发工具",
    "sourceUrl": "https://clawhub.ai/cinience/alicloud-compute-ecs",
    "canonicalUrl": "https://clawhub.ai/cinience/alicloud-compute-ecs",
    "targetPlatform": "OpenClaw"
  },
  "install": {
    "downloadMode": "redirect",
    "downloadUrl": "/downloads/alicloud-compute-ecs",
    "sourceDownloadUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=alicloud-compute-ecs",
    "sourcePlatform": "tencent",
    "targetPlatform": "OpenClaw",
    "installMethod": "Manual import",
    "extraction": "Extract archive",
    "prerequisites": [
      "OpenClaw"
    ],
    "packageFormat": "ZIP package",
    "includedAssets": [
      "SKILL.md",
      "agents/openai.yaml",
      "references/api_overview.md",
      "references/command-assistant.md",
      "references/describe-instances.md",
      "references/disks.md"
    ],
    "primaryDoc": "SKILL.md",
    "quickSetup": [
      "Download the package from Yavira.",
      "Extract the archive and review SKILL.md first.",
      "Import or place the package into your OpenClaw setup."
    ],
    "agentAssist": {
      "summary": "Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.",
      "steps": [
        "Download the package from Yavira.",
        "Extract it into a folder your agent can access.",
        "Paste one of the prompts below and point your agent at the extracted folder."
      ],
      "prompts": [
        {
          "label": "New install",
          "body": "I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Tell me what you changed and call out any manual steps you could not complete."
        },
        {
          "label": "Upgrade existing",
          "body": "I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Summarize what changed and any follow-up checks I should run."
        }
      ]
    },
    "sourceHealth": {
      "source": "tencent",
      "status": "healthy",
      "reason": "direct_download_ok",
      "recommendedAction": "download",
      "checkedAt": "2026-04-23T16:43:11.935Z",
      "expiresAt": "2026-04-30T16:43:11.935Z",
      "httpStatus": 200,
      "finalUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=4claw-imageboard",
      "contentType": "application/zip",
      "probeMethod": "head",
      "details": {
        "probeUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=4claw-imageboard",
        "contentDisposition": "attachment; filename=\"4claw-imageboard-1.0.1.zip\"",
        "redirectLocation": null,
        "bodySnippet": null
      },
      "scope": "source",
      "summary": "Source download looks usable.",
      "detail": "Yavira can redirect you to the upstream package for this source.",
      "primaryActionLabel": "Download for OpenClaw",
      "primaryActionHref": "/downloads/alicloud-compute-ecs"
    },
    "validation": {
      "installChecklist": [
        "Use the Yavira download entry.",
        "Review SKILL.md after the package is downloaded.",
        "Confirm the extracted package contains the expected setup assets."
      ],
      "postInstallChecks": [
        "Confirm the extracted package includes the expected docs or setup files.",
        "Validate the skill or prompts are available in your target agent workspace.",
        "Capture any manual follow-up steps the agent could not complete."
      ]
    },
    "downloadPageUrl": "https://openagent3.xyz/downloads/alicloud-compute-ecs",
    "agentPageUrl": "https://openagent3.xyz/skills/alicloud-compute-ecs/agent",
    "manifestUrl": "https://openagent3.xyz/skills/alicloud-compute-ecs/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/alicloud-compute-ecs/agent.md"
  },
  "agentAssist": {
    "summary": "Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.",
    "steps": [
      "Download the package from Yavira.",
      "Extract it into a folder your agent can access.",
      "Paste one of the prompts below and point your agent at the extracted folder."
    ],
    "prompts": [
      {
        "label": "New install",
        "body": "I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Tell me what you changed and call out any manual steps you could not complete."
      },
      {
        "label": "Upgrade existing",
        "body": "I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Summarize what changed and any follow-up checks I should run."
      }
    ]
  },
  "documentation": {
    "source": "clawhub",
    "primaryDoc": "SKILL.md",
    "sections": [
      {
        "title": "Validation",
        "body": "mkdir -p output/alicloud-compute-ecs\npython -m py_compile skills/compute/ecs/alicloud-compute-ecs/scripts/list_instances_all_regions.py\npython -m py_compile skills/compute/ecs/alicloud-compute-ecs/scripts/query_instance_usage.py\npython -m py_compile skills/compute/ecs/alicloud-compute-ecs/scripts/run_remote_command.py\necho \"py_compile_ok\" > output/alicloud-compute-ecs/validate.txt\n\nPass criteria: command exits 0 and output/alicloud-compute-ecs/validate.txt is generated."
      },
      {
        "title": "Output And Evidence",
        "body": "Save list/summarize outputs under output/alicloud-compute-ecs/.\nKeep command arguments and region scope in each evidence file.\n\nUse Alibaba Cloud OpenAPI (RPC) with official SDKs or OpenAPI Explorer to manage ECS resources.\nPrefer the Python SDK for all examples and execution."
      },
      {
        "title": "Prerequisites",
        "body": "Prepare AccessKey (RAM user/role with least privilege).\nChoose the correct region and endpoint (public/VPC).\nECS OpenAPI is RPC style; prefer SDK or OpenAPI Explorer to avoid manual signing."
      },
      {
        "title": "API behavior notes (from ECS docs)",
        "body": "Most list/describe APIs support pagination via PageNumber + PageSize or NextToken + MaxResults.\nDescribeInstances returns an empty list if the RAM user/role lacks permissions; use DryRun to validate permissions.\nFor DescribeInstances, NextToken + MaxResults is the recommended paged query pattern; use the returned NextToken to fetch subsequent pages.\nDescribeInstances requires RegionId in the request even if the client has a region set.\nFilters are ANDed; set only the filters you need."
      },
      {
        "title": "Workflow",
        "body": "Confirm region, resource identifiers, and desired action.\nFind API group and exact operation name in references/api_overview.md.\nCall API with Python SDK (preferred) or OpenAPI Explorer.\nVerify results with describe/list APIs.\nIf you need repeatable inventory or summaries, use scripts/ and write outputs under output/alicloud-compute-ecs/."
      },
      {
        "title": "SDK priority",
        "body": "Python SDK (preferred)\nOpenAPI Explorer\nOther SDKs (only if Python is not feasible)"
      },
      {
        "title": "Python SDK quickstart (list instances)",
        "body": "Virtual environment is recommended (avoid PEP 668 system install restrictions).\n\npython3 -m venv .venv\n. .venv/bin/activate\npython -m pip install alibabacloud_ecs20140526 alibabacloud_tea_openapi alibabacloud_credentials\n\nfrom alibabacloud_ecs20140526.client import Client as Ecs20140526Client\nfrom alibabacloud_ecs20140526 import models as ecs_models\nfrom alibabacloud_tea_openapi import models as open_api_models\n\n\ndef create_client(region_id: str) -> Ecs20140526Client:\n    config = open_api_models.Config(\n        # Use env vars or shared config files per AccessKey priority.\n        region_id=region_id,\n        endpoint=f\"ecs.{region_id}.aliyuncs.com\",\n    )\n    return Ecs20140526Client(config)\n\n\ndef list_instances(region_id: str):\n    client = create_client(region_id)\n    resp = client.describe_instances(ecs_models.DescribeInstancesRequest(\n        region_id=region_id,\n        page_number=1,\n        page_size=50,\n    ))\n    for inst in resp.body.instances.instance:\n        print(inst.instance_id, inst.instance_name, inst.instance_type, inst.status)\n\n\nif __name__ == \"__main__\":\n    list_instances(\"cn-hangzhou\")"
      },
      {
        "title": "Python SDK scripts (recommended for inventory)",
        "body": "List all instances across regions (TSV/JSON): scripts/list_instances_all_regions.py\nQuery resource usage (CPU/Memory/Network) for one instance: scripts/query_instance_usage.py\nRun remote commands via Cloud Assistant (RunCommand): scripts/run_remote_command.py\nSummarize instance specs across regions: scripts/summary_instance_specs.py\nSummarize instance counts by region (optional status breakdown): scripts/summary_instances_by_region.py\nSummarize instance counts by status: scripts/summary_instances_by_status.py\nSummarize instance counts by instance type: scripts/summary_instances_by_instance_type.py\nSummarize instance counts by VPC: scripts/summary_instances_by_vpc.py\nSummarize instance counts by security group: scripts/summary_instances_by_security_group.py"
      },
      {
        "title": "Python SDK: query one instance resource usage",
        "body": "Install dependencies (add CMS SDK):\n\npython -m pip install alibabacloud_ecs20140526 alibabacloud_cms20190101 alibabacloud_tea_openapi alibabacloud_credentials\n\nExample (last 1 hour, 5-minute period):\n\npython skills/compute/ecs/alicloud-compute-ecs/scripts/query_instance_usage.py \\\n  --instance-id i-xxxxxxxxxxxxxxxxx \\\n  --region-id cn-shanghai \\\n  --hours 1 \\\n  --period 300 \\\n  --summary-only \\\n  --output output/alicloud-compute-ecs/ecs-usage-i-xxxxxxxxxxxxxxxxx-1h.json\n\nRecommended default metrics:\n\nCPUUtilization\nmemory_usedutilization\nInternetInRate, InternetOutRate\nIntranetInRate, IntranetOutRate"
      },
      {
        "title": "Python SDK: run remote command on one ECS instance",
        "body": "Example (ps -ef):\n\npython skills/compute/ecs/alicloud-compute-ecs/scripts/run_remote_command.py \\\n  --instance-id i-xxxxxxxxxxxxxxxxx \\\n  --region-id cn-shanghai \\\n  --command 'ps -ef' \\\n  --output output/alicloud-compute-ecs/runcommand-i-xxxxxxxxxxxxxxxxx-ps-ef.json\n\nBehavior:\n\nSubmit RunCommand with RunShellScript.\nPoll DescribeInvocationResults until final status.\nDecode base64 stdout and save normalized JSON evidence."
      },
      {
        "title": "Python SDK: list instances for all regions",
        "body": "from alibabacloud_ecs20140526.client import Client as Ecs20140526Client\nfrom alibabacloud_ecs20140526 import models as ecs_models\nfrom alibabacloud_tea_openapi import models as open_api_models\n\n\ndef create_client(region_id: str) -> Ecs20140526Client:\n    config = open_api_models.Config(\n        region_id=region_id,\n        endpoint=f\"ecs.{region_id}.aliyuncs.com\",\n    )\n    return Ecs20140526Client(config)\n\n\ndef list_regions() -> list[str]:\n    client = create_client(\"cn-hangzhou\")\n    resp = client.describe_regions(ecs_models.DescribeRegionsRequest())\n    return [r.region_id for r in resp.body.regions.region]\n\n\ndef list_instances_all_regions():\n    for region_id in list_regions():\n        client = create_client(region_id)\n        req = ecs_models.DescribeInstancesRequest(\n            region_id=region_id,\n            page_number=1,\n            page_size=100,\n        )\n        resp = client.describe_instances(req)\n        print(f\"== {region_id} ({resp.body.total_count}) ==\")\n        for inst in resp.body.instances.instance:\n            print(inst.instance_id, inst.instance_name, inst.instance_type, inst.status)\n\n\nif __name__ == \"__main__\":\n    list_instances_all_regions()"
      },
      {
        "title": "Python SDK: paginated instance listing",
        "body": "from alibabacloud_ecs20140526.client import Client as Ecs20140526Client\nfrom alibabacloud_ecs20140526 import models as ecs_models\nfrom alibabacloud_tea_openapi import models as open_api_models\n\n\ndef create_client(region_id: str) -> Ecs20140526Client:\n    config = open_api_models.Config(\n        region_id=region_id,\n        endpoint=f\"ecs.{region_id}.aliyuncs.com\",\n    )\n    return Ecs20140526Client(config)\n\n\ndef list_instances_paged(region_id: str):\n    client = create_client(region_id)\n    page_number = 1\n    page_size = 100\n    while True:\n        resp = client.describe_instances(ecs_models.DescribeInstancesRequest(\n            region_id=region_id,\n            page_number=page_number,\n            page_size=page_size,\n        ))\n        for inst in resp.body.instances.instance:\n            print(inst.instance_id, inst.instance_name, inst.instance_type, inst.status)\n        total = resp.body.total_count\n        if page_number * page_size >= total:\n            break\n        page_number += 1\n\n\nif __name__ == \"__main__\":\n    list_instances_paged(\"cn-hangzhou\")"
      },
      {
        "title": "Python SDK: list instance types and pricing inputs",
        "body": "from alibabacloud_ecs20140526.client import Client as Ecs20140526Client\nfrom alibabacloud_ecs20140526 import models as ecs_models\nfrom alibabacloud_tea_openapi import models as open_api_models\n\n\ndef create_client(region_id: str) -> Ecs20140526Client:\n    config = open_api_models.Config(\n        region_id=region_id,\n        endpoint=f\"ecs.{region_id}.aliyuncs.com\",\n    )\n    return Ecs20140526Client(config)\n\n\ndef list_types(region_id: str, zone_id: str | None = None, instance_type_family: str | None = None):\n    client = create_client(region_id)\n    req = ecs_models.DescribeInstanceTypesRequest(\n        zone_id=zone_id,\n        instance_type_family=instance_type_family,\n    )\n    resp = client.describe_instance_types(req)\n    for t in resp.body.instance_types.instance_type:\n        print(t.instance_type_id, t.cpu_core_count, t.memory_size)\n\n\nif __name__ == \"__main__\":\n    list_types(\"cn-hangzhou\", \"cn-hangzhou-k\")"
      },
      {
        "title": "Common operation mapping",
        "body": "Instance lifecycle: RunInstances, CreateInstance, StartInstance(s), StopInstance(s), RebootInstance(s), DeleteInstance(s)\nInstance details: DescribeInstances, DescribeInstanceStatus, DescribeInstanceAttribute\nSpec changes: ModifyInstanceSpec, ModifyPrepayInstanceSpec, DescribeResourcesModification\nSystem disk changes: ReplaceSystemDisk, ResetDisk\nData disks: CreateDisk, AttachDisk, DetachDisk, ResizeDisk, DescribeDisks\nSnapshots: CreateSnapshot, CopySnapshot, DescribeSnapshots, DeleteSnapshot\nImages: CreateImage, CopyImage, DescribeImages, DeleteImage, ModifyImageAttribute\nSecurity groups: CreateSecurityGroup, AuthorizeSecurityGroup, RevokeSecurityGroup, DescribeSecurityGroupAttribute\nKey pairs: CreateKeyPair, ImportKeyPair, DescribeKeyPairs, DeleteKeyPairs\nENI: CreateNetworkInterface, AttachNetworkInterface, DetachNetworkInterface, DescribeNetworkInterfaces\nTags: TagResources, UntagResources, ListTagResources\nMonitoring/events: DescribeInstancesFullStatus, DescribeInstanceHistoryEvents, DescribeInstanceMonitorData"
      },
      {
        "title": "Query patterns",
        "body": "List instances: DescribeInstances (supports filters such as VpcId, VSwitchId, ZoneId, SecurityGroupId, InstanceIds)\nCount instances: DescribeInstances with PageSize=1 and read TotalCount\nRegion discovery: DescribeRegions then loop all regions for inventory"
      },
      {
        "title": "Cloud Assistant (RunCommand) tips",
        "body": "Instances must be in Running state.\nEnsure the Cloud Assistant agent is installed and online.\nUse shell for Linux, PowerShell for Windows.\nPoll results via DescribeInvocations and DescribeInvocationResults.\n\nSee references/command-assistant.md."
      },
      {
        "title": "AccessKey priority (must follow, align with README)",
        "body": "Environment variables: ALICLOUD_ACCESS_KEY_ID / ALICLOUD_ACCESS_KEY_SECRET / ALICLOUD_REGION_ID\nRegion policy: ALICLOUD_REGION_ID is an optional default. If unset, decide the most reasonable region for the task; if unclear, ask the user.\nShared config file: ~/.alibabacloud/credentials (region still from env)"
      },
      {
        "title": "Auth setup (README-aligned)",
        "body": "Environment variables:\n\nexport ALICLOUD_ACCESS_KEY_ID=\"your-ak\"\nexport ALICLOUD_ACCESS_KEY_SECRET=\"your-sk\"\nexport ALICLOUD_REGION_ID=\"cn-hangzhou\"\n\nAlso supported by the Alibaba Cloud SDKs:\n\nexport ALIBABA_CLOUD_ACCESS_KEY_ID=\"your-ak\"\nexport ALIBABA_CLOUD_ACCESS_KEY_SECRET=\"your-sk\"\n\nShared config file:\n\n~/.alibabacloud/credentials\n\n[default]\ntype = access_key\naccess_key_id = your-ak\naccess_key_secret = your-sk"
      },
      {
        "title": "API discovery",
        "body": "Product code: Ecs\nDefault API version: 2014-05-26\nUse OpenAPI metadata endpoints to list APIs and get schemas (see references)."
      },
      {
        "title": "Output policy",
        "body": "If you need to save responses or generated artifacts, write them under:\noutput/alicloud-compute-ecs/\n\nResource usage query evidence example:\noutput/alicloud-compute-ecs/ecs-usage-<instance-id>-<window>.json\n\nRemote command evidence example:\noutput/alicloud-compute-ecs/runcommand-<instance-id>-<name>.json"
      },
      {
        "title": "References",
        "body": "API overview: references/api_overview.md\nEndpoints: references/endpoints.md\nCloud Assistant: references/command-assistant.md\nDescribeInstances: references/describe-instances.md\nInstances: references/instances.md\nDisks: references/disks.md\nSnapshots: references/snapshots.md\nImages: references/images.md\nSecurity groups: references/security-groups.md\nNetwork interfaces: references/network-interfaces.md\nKey pairs: references/keypairs.md\nTags: references/tags.md\nMonitoring/events: references/monitoring-events.md\nSources: references/sources.md"
      }
    ],
    "body": "Category: service\n\nElastic Compute Service (ECS)\nValidation\nmkdir -p output/alicloud-compute-ecs\npython -m py_compile skills/compute/ecs/alicloud-compute-ecs/scripts/list_instances_all_regions.py\npython -m py_compile skills/compute/ecs/alicloud-compute-ecs/scripts/query_instance_usage.py\npython -m py_compile skills/compute/ecs/alicloud-compute-ecs/scripts/run_remote_command.py\necho \"py_compile_ok\" > output/alicloud-compute-ecs/validate.txt\n\n\nPass criteria: command exits 0 and output/alicloud-compute-ecs/validate.txt is generated.\n\nOutput And Evidence\nSave list/summarize outputs under output/alicloud-compute-ecs/.\nKeep command arguments and region scope in each evidence file.\n\nUse Alibaba Cloud OpenAPI (RPC) with official SDKs or OpenAPI Explorer to manage ECS resources. Prefer the Python SDK for all examples and execution.\n\nPrerequisites\nPrepare AccessKey (RAM user/role with least privilege).\nChoose the correct region and endpoint (public/VPC).\nECS OpenAPI is RPC style; prefer SDK or OpenAPI Explorer to avoid manual signing.\nAPI behavior notes (from ECS docs)\nMost list/describe APIs support pagination via PageNumber + PageSize or NextToken + MaxResults.\nDescribeInstances returns an empty list if the RAM user/role lacks permissions; use DryRun to validate permissions.\nFor DescribeInstances, NextToken + MaxResults is the recommended paged query pattern; use the returned NextToken to fetch subsequent pages.\nDescribeInstances requires RegionId in the request even if the client has a region set.\nFilters are ANDed; set only the filters you need.\nWorkflow\nConfirm region, resource identifiers, and desired action.\nFind API group and exact operation name in references/api_overview.md.\nCall API with Python SDK (preferred) or OpenAPI Explorer.\nVerify results with describe/list APIs.\nIf you need repeatable inventory or summaries, use scripts/ and write outputs under output/alicloud-compute-ecs/.\nSDK priority\nPython SDK (preferred)\nOpenAPI Explorer\nOther SDKs (only if Python is not feasible)\nPython SDK quickstart (list instances)\n\nVirtual environment is recommended (avoid PEP 668 system install restrictions).\n\npython3 -m venv .venv\n. .venv/bin/activate\npython -m pip install alibabacloud_ecs20140526 alibabacloud_tea_openapi alibabacloud_credentials\n\nfrom alibabacloud_ecs20140526.client import Client as Ecs20140526Client\nfrom alibabacloud_ecs20140526 import models as ecs_models\nfrom alibabacloud_tea_openapi import models as open_api_models\n\n\ndef create_client(region_id: str) -> Ecs20140526Client:\n    config = open_api_models.Config(\n        # Use env vars or shared config files per AccessKey priority.\n        region_id=region_id,\n        endpoint=f\"ecs.{region_id}.aliyuncs.com\",\n    )\n    return Ecs20140526Client(config)\n\n\ndef list_instances(region_id: str):\n    client = create_client(region_id)\n    resp = client.describe_instances(ecs_models.DescribeInstancesRequest(\n        region_id=region_id,\n        page_number=1,\n        page_size=50,\n    ))\n    for inst in resp.body.instances.instance:\n        print(inst.instance_id, inst.instance_name, inst.instance_type, inst.status)\n\n\nif __name__ == \"__main__\":\n    list_instances(\"cn-hangzhou\")\n\nPython SDK scripts (recommended for inventory)\nList all instances across regions (TSV/JSON): scripts/list_instances_all_regions.py\nQuery resource usage (CPU/Memory/Network) for one instance: scripts/query_instance_usage.py\nRun remote commands via Cloud Assistant (RunCommand): scripts/run_remote_command.py\nSummarize instance specs across regions: scripts/summary_instance_specs.py\nSummarize instance counts by region (optional status breakdown): scripts/summary_instances_by_region.py\nSummarize instance counts by status: scripts/summary_instances_by_status.py\nSummarize instance counts by instance type: scripts/summary_instances_by_instance_type.py\nSummarize instance counts by VPC: scripts/summary_instances_by_vpc.py\nSummarize instance counts by security group: scripts/summary_instances_by_security_group.py\nPython SDK: query one instance resource usage\n\nInstall dependencies (add CMS SDK):\n\npython -m pip install alibabacloud_ecs20140526 alibabacloud_cms20190101 alibabacloud_tea_openapi alibabacloud_credentials\n\n\nExample (last 1 hour, 5-minute period):\n\npython skills/compute/ecs/alicloud-compute-ecs/scripts/query_instance_usage.py \\\n  --instance-id i-xxxxxxxxxxxxxxxxx \\\n  --region-id cn-shanghai \\\n  --hours 1 \\\n  --period 300 \\\n  --summary-only \\\n  --output output/alicloud-compute-ecs/ecs-usage-i-xxxxxxxxxxxxxxxxx-1h.json\n\n\nRecommended default metrics:\n\nCPUUtilization\nmemory_usedutilization\nInternetInRate, InternetOutRate\nIntranetInRate, IntranetOutRate\nPython SDK: run remote command on one ECS instance\n\nExample (ps -ef):\n\npython skills/compute/ecs/alicloud-compute-ecs/scripts/run_remote_command.py \\\n  --instance-id i-xxxxxxxxxxxxxxxxx \\\n  --region-id cn-shanghai \\\n  --command 'ps -ef' \\\n  --output output/alicloud-compute-ecs/runcommand-i-xxxxxxxxxxxxxxxxx-ps-ef.json\n\n\nBehavior:\n\nSubmit RunCommand with RunShellScript.\nPoll DescribeInvocationResults until final status.\nDecode base64 stdout and save normalized JSON evidence.\nPython SDK: list instances for all regions\nfrom alibabacloud_ecs20140526.client import Client as Ecs20140526Client\nfrom alibabacloud_ecs20140526 import models as ecs_models\nfrom alibabacloud_tea_openapi import models as open_api_models\n\n\ndef create_client(region_id: str) -> Ecs20140526Client:\n    config = open_api_models.Config(\n        region_id=region_id,\n        endpoint=f\"ecs.{region_id}.aliyuncs.com\",\n    )\n    return Ecs20140526Client(config)\n\n\ndef list_regions() -> list[str]:\n    client = create_client(\"cn-hangzhou\")\n    resp = client.describe_regions(ecs_models.DescribeRegionsRequest())\n    return [r.region_id for r in resp.body.regions.region]\n\n\ndef list_instances_all_regions():\n    for region_id in list_regions():\n        client = create_client(region_id)\n        req = ecs_models.DescribeInstancesRequest(\n            region_id=region_id,\n            page_number=1,\n            page_size=100,\n        )\n        resp = client.describe_instances(req)\n        print(f\"== {region_id} ({resp.body.total_count}) ==\")\n        for inst in resp.body.instances.instance:\n            print(inst.instance_id, inst.instance_name, inst.instance_type, inst.status)\n\n\nif __name__ == \"__main__\":\n    list_instances_all_regions()\n\nPython SDK: paginated instance listing\nfrom alibabacloud_ecs20140526.client import Client as Ecs20140526Client\nfrom alibabacloud_ecs20140526 import models as ecs_models\nfrom alibabacloud_tea_openapi import models as open_api_models\n\n\ndef create_client(region_id: str) -> Ecs20140526Client:\n    config = open_api_models.Config(\n        region_id=region_id,\n        endpoint=f\"ecs.{region_id}.aliyuncs.com\",\n    )\n    return Ecs20140526Client(config)\n\n\ndef list_instances_paged(region_id: str):\n    client = create_client(region_id)\n    page_number = 1\n    page_size = 100\n    while True:\n        resp = client.describe_instances(ecs_models.DescribeInstancesRequest(\n            region_id=region_id,\n            page_number=page_number,\n            page_size=page_size,\n        ))\n        for inst in resp.body.instances.instance:\n            print(inst.instance_id, inst.instance_name, inst.instance_type, inst.status)\n        total = resp.body.total_count\n        if page_number * page_size >= total:\n            break\n        page_number += 1\n\n\nif __name__ == \"__main__\":\n    list_instances_paged(\"cn-hangzhou\")\n\nPython SDK: list instance types and pricing inputs\nfrom alibabacloud_ecs20140526.client import Client as Ecs20140526Client\nfrom alibabacloud_ecs20140526 import models as ecs_models\nfrom alibabacloud_tea_openapi import models as open_api_models\n\n\ndef create_client(region_id: str) -> Ecs20140526Client:\n    config = open_api_models.Config(\n        region_id=region_id,\n        endpoint=f\"ecs.{region_id}.aliyuncs.com\",\n    )\n    return Ecs20140526Client(config)\n\n\ndef list_types(region_id: str, zone_id: str | None = None, instance_type_family: str | None = None):\n    client = create_client(region_id)\n    req = ecs_models.DescribeInstanceTypesRequest(\n        zone_id=zone_id,\n        instance_type_family=instance_type_family,\n    )\n    resp = client.describe_instance_types(req)\n    for t in resp.body.instance_types.instance_type:\n        print(t.instance_type_id, t.cpu_core_count, t.memory_size)\n\n\nif __name__ == \"__main__\":\n    list_types(\"cn-hangzhou\", \"cn-hangzhou-k\")\n\nCommon operation mapping\nInstance lifecycle: RunInstances, CreateInstance, StartInstance(s), StopInstance(s), RebootInstance(s), DeleteInstance(s)\nInstance details: DescribeInstances, DescribeInstanceStatus, DescribeInstanceAttribute\nSpec changes: ModifyInstanceSpec, ModifyPrepayInstanceSpec, DescribeResourcesModification\nSystem disk changes: ReplaceSystemDisk, ResetDisk\nData disks: CreateDisk, AttachDisk, DetachDisk, ResizeDisk, DescribeDisks\nSnapshots: CreateSnapshot, CopySnapshot, DescribeSnapshots, DeleteSnapshot\nImages: CreateImage, CopyImage, DescribeImages, DeleteImage, ModifyImageAttribute\nSecurity groups: CreateSecurityGroup, AuthorizeSecurityGroup, RevokeSecurityGroup, DescribeSecurityGroupAttribute\nKey pairs: CreateKeyPair, ImportKeyPair, DescribeKeyPairs, DeleteKeyPairs\nENI: CreateNetworkInterface, AttachNetworkInterface, DetachNetworkInterface, DescribeNetworkInterfaces\nTags: TagResources, UntagResources, ListTagResources\nMonitoring/events: DescribeInstancesFullStatus, DescribeInstanceHistoryEvents, DescribeInstanceMonitorData\nQuery patterns\nList instances: DescribeInstances (supports filters such as VpcId, VSwitchId, ZoneId, SecurityGroupId, InstanceIds)\nCount instances: DescribeInstances with PageSize=1 and read TotalCount\nRegion discovery: DescribeRegions then loop all regions for inventory\nCloud Assistant (RunCommand) tips\nInstances must be in Running state.\nEnsure the Cloud Assistant agent is installed and online.\nUse shell for Linux, PowerShell for Windows.\nPoll results via DescribeInvocations and DescribeInvocationResults.\n\nSee references/command-assistant.md.\n\nAccessKey priority (must follow, align with README)\nEnvironment variables: ALICLOUD_ACCESS_KEY_ID / ALICLOUD_ACCESS_KEY_SECRET / ALICLOUD_REGION_ID Region policy: ALICLOUD_REGION_ID is an optional default. If unset, decide the most reasonable region for the task; if unclear, ask the user.\nShared config file: ~/.alibabacloud/credentials (region still from env)\nAuth setup (README-aligned)\n\nEnvironment variables:\n\nexport ALICLOUD_ACCESS_KEY_ID=\"your-ak\"\nexport ALICLOUD_ACCESS_KEY_SECRET=\"your-sk\"\nexport ALICLOUD_REGION_ID=\"cn-hangzhou\"\n\n\nAlso supported by the Alibaba Cloud SDKs:\n\nexport ALIBABA_CLOUD_ACCESS_KEY_ID=\"your-ak\"\nexport ALIBABA_CLOUD_ACCESS_KEY_SECRET=\"your-sk\"\n\n\nShared config file:\n\n~/.alibabacloud/credentials\n\n[default]\ntype = access_key\naccess_key_id = your-ak\naccess_key_secret = your-sk\n\nAPI discovery\nProduct code: Ecs\nDefault API version: 2014-05-26\nUse OpenAPI metadata endpoints to list APIs and get schemas (see references).\nOutput policy\n\nIf you need to save responses or generated artifacts, write them under: output/alicloud-compute-ecs/\n\nResource usage query evidence example: output/alicloud-compute-ecs/ecs-usage-<instance-id>-<window>.json\n\nRemote command evidence example: output/alicloud-compute-ecs/runcommand-<instance-id>-<name>.json\n\nReferences\nAPI overview: references/api_overview.md\nEndpoints: references/endpoints.md\nCloud Assistant: references/command-assistant.md\nDescribeInstances: references/describe-instances.md\nInstances: references/instances.md\nDisks: references/disks.md\nSnapshots: references/snapshots.md\nImages: references/images.md\nSecurity groups: references/security-groups.md\nNetwork interfaces: references/network-interfaces.md\nKey pairs: references/keypairs.md\nTags: references/tags.md\nMonitoring/events: references/monitoring-events.md\nSources: references/sources.md"
  },
  "trust": {
    "sourceLabel": "tencent",
    "provenanceUrl": "https://clawhub.ai/cinience/alicloud-compute-ecs",
    "publisherUrl": "https://clawhub.ai/cinience/alicloud-compute-ecs",
    "owner": "cinience",
    "version": "1.0.3",
    "license": null,
    "verificationStatus": "Indexed source record"
  },
  "links": {
    "detailUrl": "https://openagent3.xyz/skills/alicloud-compute-ecs",
    "downloadUrl": "https://openagent3.xyz/downloads/alicloud-compute-ecs",
    "agentUrl": "https://openagent3.xyz/skills/alicloud-compute-ecs/agent",
    "manifestUrl": "https://openagent3.xyz/skills/alicloud-compute-ecs/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/alicloud-compute-ecs/agent.md"
  }
}