分页列出当前工作空间下的运行环境,按 created_at 倒序返回。默认不包含已归档项。
前提
已完成 Endpoint 与鉴权配置,详见API 总览与认证。
接口
GET
/environments查询参数
limitint默认 20每页数量,最大 100
pagestring默认 —首次不传,后续传上一次响应的 next_page
include_archivedbool默认 false是否包含已归档环境
请求示例
curl "$AGENTSTUDIO_URL/environments?limit=20" \
-H "Authorization: Bearer $DASHSCOPE_API_KEY"
for env in client.environments.list(include_archived=False, limit=20):
print(env.id, env.name)
CursorPage<Environment> page = client.environments().list(EnvironmentListParam.builder()
.includeArchived(false)
.limit(20)
.build());
for (Environment e : page.getData()) System.out.println(e.getId() + " " + e.getName());
响应字段
dataarray<Environment>Environment 对象数组
data[] Environment 对象字段
idstring环境 ID,格式 env_<ULID>
typestring固定为 environment
namestring环境名称
descriptionstring环境用途说明
scopestring作用域。organization:工作空间全部成员可见与复用
configobject完整运行时配置。包含以下子字段:
typestringcloud 云端容器
packagesobject预装依赖,按包管理器分组。键为 apt / pip / npm,值为包名数组
aptarray<string>Debian/Ubuntu 包名列表
piparray<string>Python 包名列表
npmarray<string>Node.js 包名列表
networkingobject网络策略对象,结构 {"type": "unrestricted"}
typestring目前仅支持 unrestricted
metadataobject业务自定义键值,不影响运行行为
archived_atstring / null归档时间,未归档时为 null
created_atstring创建时间,ISO 8601
updated_atstring最近更新时间,ISO 8601
next_pagestring / null下一页游标;无更多数据时不返回或为 null
request_idstring本次请求的唯一标识
响应示例
{
"data": [
{
"id": "env_xxx",
"type": "environment",
"name": "data-sandbox",
"description": "数据分析沙箱",
"config": {
"type": "cloud",
"packages": {"apt": ["ffmpeg"], "pip": ["pandas", "numpy", "matplotlib"]},
"networking": {"type": "unrestricted"}
},
"metadata": {"team": "infra"},
"scope": "organization",
"archived_at": null,
"created_at": "2026-06-16T12:45:34+08:00",
"updated_at": "2026-06-16T12:45:34+08:00"
}
],
"next_page": "xxx",
"request_id": "xxx"
}
该文章对您有帮助吗?