Category: service
Alibaba Cloud DevOps (Yunxiao)
Purpose
Use Alibaba Cloud DevOps OpenAPI to support:
- - project, repository, and pipeline inventory
- work item and test resource inspection
- release and execution status checks
- metadata-driven API discovery before production changes
Prerequisites
- - Configure least-privilege Alibaba Cloud credentials.
- Install Python SDK dependencies for local scripts:
CODEBLOCK0
- - Prefer environment variables:
-
ALICLOUD_ACCESS_KEY_ID
-
ALICLOUD_ACCESS_KEY_SECRET
- optional INLINECODE2
AccessKey Priority
1) Environment variables: ALICLOUD_ACCESS_KEY_ID / ALICLOUD_ACCESS_KEY_SECRET / ALICLOUD_REGION_ID
2) Shared credentials file: INLINECODE6
If region/environment is unclear, confirm with user before mutating operations.
Workflow
1) Confirm target organization/project scope and change window.
2) Run API discovery and confirm exact API names and required parameters.
3) Execute read-only APIs first (List* / Get* / Query*).
4) Run mutating APIs only after rollback and owner confirmation.
5) Save outputs and evidence to output/aliyun-devops-manage/.
API Discovery
- - Product code: INLINECODE11
- Default API version: INLINECODE12
- Metadata source: INLINECODE13
Minimal Executable Quickstart
CODEBLOCK1
Optional arguments:
CODEBLOCK2
List projects (read-only):
CODEBLOCK3
List repositories (read-only):
CODEBLOCK4
List pipelines (read-only):
CODEBLOCK5
Common Operation Map
- - Project and membership:
CreateProject, GetProject, ListProjectMembers, INLINECODE17 - Code repository:
CreateRepository, GetRepository, ListRepositories, INLINECODE21 - Pipeline and release:
CreatePipeline, GetPipeline, ListPipelines, INLINECODE25 - Work items and test:
CreateWorkitem, GetWorkitemDetail, ListTestCase, INLINECODE29
See references/api_quick_map.md for grouped APIs.
Script Catalog
- -
scripts/list_openapi_meta_apis.py: fetch metadata and generate API inventory files. - INLINECODE32 : list projects in one organization.
- INLINECODE33 : list repositories in one organization.
- INLINECODE34 : list pipelines in one organization.
Validation
CODEBLOCK6
Pass criteria: command exits 0 and output/aliyun-devops-manage/validate.txt is generated.
Output And Evidence
- - Save artifacts, command outputs, and API response summaries under
output/aliyun-devops-manage/. - Include key parameters (region/resource id/time range) in evidence files for reproducibility.
References
- - Source list: INLINECODE37
- API quick map: INLINECODE38
- Operation templates: INLINECODE39
技能名称: aliyun-devops-manage
详细描述:
类别: 服务
阿里云 DevOps(云效)
目的
使用阿里云 DevOps OpenAPI 支持:
- - 项目、仓库和流水线清单管理
- 工作项和测试资源检查
- 发布与执行状态验证
- 生产变更前的元数据驱动 API 发现
前置条件
- - 配置最小权限的阿里云凭证。
- 为本地脚本安装 Python SDK 依赖:
bash
python3 -m venv .venv
. .venv/bin/activate
python -m pip install -U alibabaclouddevops20210625 alibabacloudtea_openapi
- ALICLOUD
ACCESSKEY_ID
- ALICLOUD
ACCESSKEY_SECRET
- 可选 ALICLOUD
REGIONID
AccessKey 优先级
1) 环境变量:ALICLOUDACCESSKEYID / ALICLOUDACCESSKEYSECRET / ALICLOUDREGIONID
2) 共享凭证文件:~/.alibabacloud/credentials
如果区域/环境不明确,在执行变更操作前需与用户确认。
工作流程
1) 确认目标组织/项目范围及变更窗口。
2) 执行 API 发现,确认准确的 API 名称和必需参数。
3) 优先执行只读 API(List / Get / Query*)。
4) 仅在确认回滚方案和所有者同意后,执行变更类 API。
5) 将输出和证据保存至 output/aliyun-devops-manage/。
API 发现
- - 产品代码:devops
- 默认 API 版本:2021-06-25
- 元数据来源:https://api.aliyun.com/meta/v1/products/devops/versions/2021-06-25/api-docs.json
最小可执行快速入门
bash
python skills/platform/devops/aliyun-devops-manage/scripts/listopenapimeta_apis.py
可选参数:
bash
python skills/platform/devops/aliyun-devops-manage/scripts/listopenapimeta_apis.py \
--product-code devops \
--version 2021-06-25 \
--output-dir output/aliyun-devops-manage
列出项目(只读):
bash
python skills/platform/devops/aliyun-devops-manage/scripts/list_projects.py \
--organization-id <组织ID> \
--region cn-hangzhou \
--max-results 20 \
--output output/aliyun-devops-manage/projects.txt
列出仓库(只读):
bash
python skills/platform/devops/aliyun-devops-manage/scripts/list_repositories.py \
--organization-id <组织ID> \
--region cn-hangzhou \
--page 1 \
--per-page 20 \
--output output/aliyun-devops-manage/repositories.txt
列出流水线(只读):
bash
python skills/platform/devops/aliyun-devops-manage/scripts/list_pipelines.py \
--organization-id <组织ID> \
--region cn-hangzhou \
--max-results 20 \
--output output/aliyun-devops-manage/pipelines.txt
常用操作映射
- - 项目和成员管理:CreateProject、GetProject、ListProjectMembers、UpdateProject
- 代码仓库:CreateRepository、GetRepository、ListRepositories、CreateMergeRequest
- 流水线和发布:CreatePipeline、GetPipeline、ListPipelines、RunPipeline
- 工作项和测试:CreateWorkitem、GetWorkitemDetail、ListTestCase、CreateTestCase
分组 API 详情请参见 references/apiquickmap.md。
脚本目录
- - scripts/listopenapimetaapis.py:获取元数据并生成 API 清单文件。
- scripts/listprojects.py:列出指定组织中的项目。
- scripts/listrepositories.py:列出指定组织中的仓库。
- scripts/listpipelines.py:列出指定组织中的流水线。
验证
bash
mkdir -p output/aliyun-devops-manage
for f in skills/platform/devops/aliyun-devops-manage/scripts/*.py; do
python3 -m py_compile $f
done
echo pycompileok > output/aliyun-devops-manage/validate.txt
通过标准:命令退出码为 0 且成功生成 output/aliyun-devops-manage/validate.txt 文件。
输出与证据
- - 将产物、命令输出和 API 响应摘要保存至 output/aliyun-devops-manage/ 目录下。
- 在证据文件中包含关键参数(区域/资源 ID/时间范围),确保结果可复现。
参考资料
- - 来源列表:references/sources.md
- API 快速映射:references/apiquickmap.md
- 操作模板:references/templates.md