View a markdown version of this page

列出配置包 - Amazon Bedrock AgentCore

列出配置包

列出您账户中的配置捆绑包,或列出特定捆绑包的版本。有两种操作可供选择:

  • ListConfigurationBundles— 返回您账户中的所有捆绑包以及摘要信息。

  • ListConfigurationBundleVersions— 返回特定捆绑包的所有版本,可选择按分支或创建源进行筛选。

这两个操作都支持分页。

代码示例

AgentCore CLI

列出捆绑包的版本:

agentcore config-bundle versions --name myAgentConfig

按分支筛选:

agentcore config-bundle versions --name myAgentConfig --branch mainline

仅显示每个分支的最新版本:

agentcore config-bundle versions --name myAgentConfig --latest-per-branch

按创建者筛选(例如,推荐任务创建的版本):

agentcore config-bundle versions --name myAgentConfig --created-by recommendation
AWS SDK (boto3)

列出所有带分页的捆绑包:

import boto3 client = boto3.client("bedrock-agentcore-control", region_name="us-west-2") paginator = client.get_paginator("list_configuration_bundles") for page in paginator.paginate(maxResults=20): for bundle in page["bundles"]: print(f"{bundle['bundleId']} - {bundle['bundleName']}")

列出特定捆绑包的版本:

response = client.list_configuration_bundle_versions( bundleId="myAgentConfig-a1b2c3d4e5", filter={"branchName": "mainline"}, maxResults=20, ) for version in response["versions"]: lineage = version.get("lineageMetadata", {}) print( f"{version['versionId']} " f"{version['versionCreatedAt']} " f"{lineage.get('commitMessage', '')}" )

请求参数

ListConfigurationBundles

参数 Type 必需 说明

maxResults

整数

每页返回的最大结果数。射程:1—100。

nextToken

字符串

来自先前响应的分页标记。

ListConfigurationBundleVersions

参数 Type 必需 描述

bundleId

字符串

配置包的 ID。作为路径参数传递。

filter

对象

可选过滤器。请参阅下面的版本筛选器

maxResults

整数

每页返回的最大结果数。射程:1—100。

nextToken

字符串

来自先前响应的分页标记。

版本筛选器

字段 Type 说明

branchName

字符串

仅返回此分支上的版本。

createdByName

字符串

仅返回由此源名称创建的版本(例如,optimization-jobrecommendation)。

latestPerBranch

布尔值

Whentrue,仅返回每个分支的最新版本。可以与组合使用branchName以获取特定分支的最新信息。

响应

ListConfigurationBundles

字段 Type 说明

bundles

列表

捆绑包摘要列表。每个都包含bundleArnbundleIdbundleName、和description

nextToken

字符串

下一页的分页标记。没有更多结果时不存在。

ListConfigurationBundleVersions

字段 Type 说明

versions

列表

版本摘要列表。每个都包含bundleArnbundleIdversionIdlineageMetadata、和versionCreatedAt

nextToken

字符串

下一页的分页标记。没有更多结果时不存在。

错误

错误 HTTP 状态 说明

ValidationException

400

请求参数无效。

ResourceNotFoundException

404

指定的bundleId不存在(ListConfigurationBundleVersions 仅限)。

AccessDeniedException

403

权限不足。

ThrottlingException

429

超出请求速率。使用指数回退进行重试。

InternalServerException

500

Service-side 错误。重试请求。