Skill: cinience/aliyun-cdn-manage (version 1.0.0)

--- name: aliyun-cdn-manage description: Use when managing Alibaba Cloud CDN via OpenAPI/SDK, including CDN domain onboarding and lifecycle operations, cache refresh/preload, HTTPS certificate updates, and log/monitoring data queries. version: 1.0.0 --- Category: service # Alibaba Cloud CDN ## Purpose Use Alibaba Cloud CDN OpenAPI (RPC) for common operations and integrations including: - accelerated domain lifecycle (create/configure/start-stop/delete) - cache refresh and preload (directory/file/domain) - HTTPS certificate configuration and updates - log and monitoring queries (real-time/offline) ## Prerequisites - least-privilege RAM credentials are ready (STS temporary creds recommended). - domain ownership and acceleration scope policy are confirmed (mainland/global). - before mutating operations, validate current state using read-only APIs. ## Workflow 1) Define target resources: accelerated domains, business type, change window, and rollback criteria. 2) Run API discovery and confirm target API names, required parameters, and version. 3) Query current config/state with read-only APIs (`Describe*`) first. 4) Execute mutating APIs (`Add*`/`Set*`/`BatchSet*`/`Delete*`) and record request context. 5) Validate changes with monitoring/log APIs and save evidence in `output/aliyun-cdn-manage/`. ## AccessKey Priority 1) Environment variables:`ALICLOUD_ACCESS_KEY_ID` / `ALICLOUD_ACCESS_KEY_SECRET` / `ALICLOUD_REGION_ID` 2) Shared credentials file:`~/.alibabacloud/credentials` If region/environment is unclear, confirm with user before mutating operations. ## API Discovery - Product code: `cdn` - Default API version: `2018-05-10` - Metadata source: `https://api.aliyun.com/meta/v1/products/cdn/versions/2018-05-10/api-docs.json` ## Minimal Executable Quickstart ```bash python skills/network/cdn/aliyun-cdn-manage/scripts/list_openapi_meta_apis.py ``` Optional arguments: ```bash python skills/network/cdn/aliyun-cdn-manage/scripts/list_openapi_meta_apis.py \ --product-code cdn \ --version 2018-05-10 \ --output-dir output/aliyun-cdn-manage ``` ## Common Operation Map - Domain management:`AddCdnDomain`、`DescribeUserDomains`、`DescribeCdnDomainDetail`、`DeleteCdnDomain` - Cache refresh/preload:`RefreshObjectCaches`（refresh）、`PushObjectCache`（preload） - HTTPS certificate: `SetDomainServerCertificate`, `DescribeDomainCertificateInfo` - Logs and monitoring:`DescribeCdnDomainLogs`、[REDACTED_SECRET]、`DescribeDomainRealTimeBpsData` ## Output Policy Write generated files and execution evidence to: `output/aliyun-cdn-manage/` ## Validation ```bash mkdir -p output/aliyun-cdn-manage for f in skills/network/cdn/aliyun-cdn-manage/scripts/*.py; do python3 -m py_compile "$f" done echo "py_compile_ok" > output/aliyun-cdn-manage/validate.txt ``` Pass criteria: command exits 0 and `output/aliyun-cdn-manage/validate.txt` is generated. ## Output And Evidence - Save artifacts, command outputs, and API response summaries under `output/aliyun-cdn-manage/`. - Include key parameters (region/resource id/time range) in evidence files for reproducibility. ## Prerequisites - Configure least-privilege Alibaba Cloud credentials before execution. - Prefer environment variables: `ALICLOUD_ACCESS_KEY_ID`, `ALICLOUD_ACCESS_KEY_SECRET`, optional `ALICLOUD_REGION_ID`. - If region is unclear, ask the user before running mutating operations. ## References - Source list: `references/sources.md`

path: agents/openai.yaml
content: interface:
  display_name: "Alibaba Cloud Network CDN"
  short_description: "CDN domain, cache, HTTPS, and monitoring API workflows"
  default_prompt: "Use $alicloud-network-cdn to complete this network/cdn task on Alibaba Cloud."


path: references/sources.md
content: # CDN Official Sources

- CDN API overview (2018-05-10):
  - https://www.alibabacloud.com/help/en/cdn/developer-reference/api-cdn-2018-05-10-overview
- CDN product page in API Explorer:
  - https://api.aliyun.com/product/cdn
- CDN OpenAPI metadata (machine-readable):
  - https://api.aliyun.com/meta/v1/products/cdn/versions/2018-05-10/api-docs.json
- CDN API: RefreshObjectCaches (refresh/preload):
  - https://www.alibabacloud.com/help/en/cdn/developer-reference/api-cdn-2018-05-10-refreshobjectcaches
- CDN API: SetDomainServerCertificate (HTTPS certificate):
  - https://www.alibabacloud.com/help/en/cdn/developer-reference/api-cdn-2018-05-10-setdomainservercertificate
- CDN API: DescribeDomainRealTimeRequestStatData (monitoring):
  - https://www.alibabacloud.com/help/en/cdn/developer-reference/api-cdn-2018-05-10-describedomainrealtimerequeststatdata
- Alibaba Cloud API Explorer:
  - https://api.aliyun.com/


path: scripts/list_openapi_meta_apis.py
content: #!/usr/bin/env python3
"""Fetch CDN OpenAPI metadata API list and save artifacts to output/."""

from __future__ import annotations

import argparse
import json
import os
import pathlib
import urllib.request

DEFAULT_PRODUCT_CODE = "cdn"
DEFAULT_VERSION = "2018-05-10"
OUTPUT_DIR = pathlib.Path("output/aliyun-cdn-manage")


def fetch_json(url: str, timeout: int) -> dict:
    req = urllib.request.Request(url, headers={"User-Agent": "codex-skill"})
    with urllib.request.urlopen(req, timeout=timeout) as resp:
        return json.loads(resp.read().decode("utf-8"))


def parse_api_names(payload: dict) -> list[str]:
    raw_apis = payload.get("apis", {})
    if isinstance(raw_apis, dict):
        return sorted(raw_apis.keys())
    if isinstance(raw_apis, list):
        names = []
        for item in raw_apis:
            if isinstance(item, dict):
                name = item.get("name") or item.get("apiName")
                if name:
                    names.append(name)
            elif isinstance(item, str):
                names.append(item)
        return sorted(set(names))
    return []


def main() -> None:
    parser = argparse.ArgumentParser()
    parser.add_argument("--product-code", default=DEFAULT_PRODUCT_CODE)
    parser.add_argument("--version", default=DEFAULT_VERSION)
    parser.add_argument("--output-dir", default=str(OUTPUT_DIR))
    args = parser.parse_args()

    timeout = int(os.getenv("OPENAPI_META_TIMEOUT", "20"))
    output_dir = pathlib.Path(args.output_dir)
    output_dir.mkdir(parents=True, exist_ok=True)

    url = (
        f"https://api.aliyun.com/meta/v1/products/{args.product_code}"
        f"/versions/{args.version}/api-docs.json"
    )
    payload = fetch_json(url, timeout)
    api_names = parse_api_names(payload)

    json_file = output_dir / f"{args.product_code}_{args.version}_api_docs.json"
    md_file = output_dir / f"{args.product_code}_{args.version}_api_list.md"

    json_file.write_text(json.dumps(payload, ensure_ascii=False, indent=2), encoding="utf-8")
    lines = [
        f"# {args.product_code} {args.version} API List",
        "",
        f"- Source: {url}",
        f"- API count: {len(api_names)}",
        "",
    ]
    lines.extend([f"- `{name}`" for name in api_names])
    md_file.write_text("\n".join(lines) + "\n", encoding="utf-8")

    print(f"Saved: {json_file}")
    print(f"Saved: {md_file}")


if __name__ == "__main__":
    main()


Security scan verdicts — ClawScan: clean | static analysis: clean | VirusTotal: clean | SkillSpector: clean (LOW)