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: INLINECODE9
If region/environment is unclear, confirm with user before mutating operations.
API Discovery
- - Product code: INLINECODE10
- Default API version: INLINECODE11
- Metadata source: INLINECODE12
Minimal Executable Quickstart
CODEBLOCK0
Optional arguments:
CODEBLOCK1
Common Operation Map
- - Domain management:
AddCdnDomain、DescribeUserDomains、DescribeCdnDomainDetail、 INLINECODE16 - Cache refresh/preload:
RefreshObjectCaches(refresh)、PushObjectCache(preload) - HTTPS certificate:
SetDomainServerCertificate, INLINECODE20 - Logs and monitoring:
DescribeCdnDomainLogs、DescribeDomainRealTimeRequestStatData、 INLINECODE23
Output Policy
Write generated files and execution evidence to:
INLINECODE24
Validation
CODEBLOCK2
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: INLINECODE30
技能名称: aliyun-cdn-manage
详细描述:
类别: 服务
阿里云 CDN
目的
使用阿里云 CDN OpenAPI(RPC)进行常见操作和集成,包括:
- - 加速域名生命周期(创建/配置/启动-停止/删除)
- 缓存刷新和预热(目录/文件/域名)
- HTTPS 证书配置和更新
- 日志和监控查询(实时/离线)
前提条件
- - 已准备好最小权限 RAM 凭证(建议使用 STS 临时凭证)。
- 已确认域名所有权和加速范围策略(中国大陆/全球)。
- 在执行变更操作前,使用只读 API 验证当前状态。
工作流程
1) 定义目标资源:加速域名、业务类型、变更窗口和回滚标准。
2) 运行 API 发现,确认目标 API 名称、所需参数和版本。
3) 首先使用只读 API(Describe*)查询当前配置/状态。
4) 执行变更 API(Add/Set/BatchSet/Delete)并记录请求上下文。
5) 使用监控/日志 API 验证变更,并将证据保存到 output/aliyun-cdn-manage/。
AccessKey 优先级
1) 环境变量:ALICLOUDACCESSKEYID / ALICLOUDACCESSKEYSECRET / ALICLOUDREGIONID
2) 共享凭证文件:~/.alibabacloud/credentials
如果区域/环境不明确,请在执行变更操作前与用户确认。
API 发现
- - 产品代码:cdn
- 默认 API 版本:2018-05-10
- 元数据来源:https://api.aliyun.com/meta/v1/products/cdn/versions/2018-05-10/api-docs.json
最小可执行快速启动
bash
python skills/network/cdn/aliyun-cdn-manage/scripts/listopenapimeta_apis.py
可选参数:
bash
python skills/network/cdn/aliyun-cdn-manage/scripts/listopenapimeta_apis.py \
--product-code cdn \
--version 2018-05-10 \
--output-dir output/aliyun-cdn-manage
常见操作映射
- - 域名管理:AddCdnDomain、DescribeUserDomains、DescribeCdnDomainDetail、DeleteCdnDomain
- 缓存刷新/预热:RefreshObjectCaches(刷新)、PushObjectCache(预热)
- HTTPS 证书:SetDomainServerCertificate、DescribeDomainCertificateInfo
- 日志和监控:DescribeCdnDomainLogs、DescribeDomainRealTimeRequestStatData、DescribeDomainRealTimeBpsData
输出策略
将生成的文件和执行证据写入:
output/aliyun-cdn-manage/
验证
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 pycompileok > output/aliyun-cdn-manage/validate.txt
通过标准:命令退出码为 0,且生成了 output/aliyun-cdn-manage/validate.txt。
输出和证据
- - 将产物、命令输出和 API 响应摘要保存到 output/aliyun-cdn-manage/ 下。
- 在证据文件中包含关键参数(区域/资源 ID/时间范围),以确保可复现性。
前提条件
- - 执行前配置最小权限的阿里云凭证。
- 优先使用环境变量:ALICLOUDACCESSKEYID、ALICLOUDACCESSKEYSECRET,可选 ALICLOUDREGIONID。
- 如果区域不明确,请在运行变更操作前询问用户。
参考资料
- - 来源列表:references/sources.md