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

Integer

每個頁面要傳回的結果數目上限。範圍:1–100。

nextToken

String

上一個回應的分頁字符。

ListConfigurationBundleVersions

參數 Type 必要 描述

bundleId

String

組態套件的 ID。以路徑參數傳遞。

filter

物件

選用篩選條件。請參閱以下 版本篩選條件

maxResults

Integer

每個頁面要傳回的結果數目上限。範圍:1–100。

nextToken

String

上一個回應的分頁字符。

版本篩選條件

欄位 Type Description

branchName

String

僅傳回此分支上的版本。

createdByName

String

僅傳回此來源名稱建立的版本 (例如 optimization-jobrecommendation)。

latestPerBranch

Boolean

當 時true, 只會傳回每個分支的最新版本。可與 結合branchName,以取得特定分支的最新 。

回應

ListConfigurationBundles

欄位 Type 說明

bundles

清單

套件摘要的清單。每個 都包含 bundleArnbundleNamebundleIddescription

nextToken

String

下一頁的分頁字符。當沒有更多結果時不存在。

ListConfigurationBundleVersions

欄位 Type 說明

versions

清單

版本摘要的清單。每個 都包含 bundleArnbundleIdlineageMetadataversionIdversionCreatedAt

nextToken

String

下一頁的分頁字符。當沒有更多結果時不存在。

錯誤

錯誤 HTTP 狀態 說明

ValidationException

400

無效的請求參數。

ResourceNotFoundException

404

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

AccessDeniedException

403

許可不足。

ThrottlingException

429

超過請求率。以指數退避重試。

InternalServerException

500

服務端錯誤。重試 請求。