agentcore_cli.models
agentcore_cli.models
¶
Models package for AgentCore Platform CLI.
This package provides data models for the AgentCore Platform CLI.
ActionResult
¶
Bases: BaseAgentCoreModel
Base model for CLI action results.
Source code in agentcore_cli/models/responses.py
AgentCoreConfig
¶
Bases: BaseAgentCoreModel
Root configuration for AgentCore CLI.
This configuration uses an environment-first approach where each environment owns its agent runtimes. This design aligns with AWS AgentCore where: - Runtimes exist in specific regions - Environments represent deployment targets (dev/staging/prod) - Each environment can have different versions and endpoints
Source code in agentcore_cli/models/config.py
Python | |
---|---|
146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 |
|
ensure_current_environment_exists(model)
¶
Ensure the current environment exists.
Source code in agentcore_cli/models/config.py
get_agent_runtime(agent_name, environment=None)
¶
Get an agent runtime from the specified or current environment.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
agent_name
|
str
|
Name of the agent runtime |
required |
environment
|
str | None
|
Environment name, or None for current environment |
None
|
Returns:
Type | Description |
---|---|
AgentRuntime | None
|
AgentRuntime instance or None if not found |
Source code in agentcore_cli/models/config.py
get_current_env()
¶
get_ecr_repository(repository_name)
¶
Get an ECR repository by name.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
repository_name
|
str
|
Name of the ECR repository |
required |
Returns:
Type | Description |
---|---|
ECRRepository | None
|
ECRRepository instance or None if not found |
Source code in agentcore_cli/models/config.py
get_runtime_version_container_uri(agent_name, version_id, environment=None)
¶
Get the full container URI for a specific runtime version.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
agent_name
|
str
|
Name of the agent runtime |
required |
version_id
|
str
|
Version identifier |
required |
environment
|
str | None
|
Environment name, or None for current environment |
None
|
Returns:
Type | Description |
---|---|
str | None
|
Full container URI or None if not found |
Source code in agentcore_cli/models/config.py
list_all_agent_runtimes()
¶
List all agent runtimes across all environments.
Returns:
Type | Description |
---|---|
dict[str, list[str]]
|
Dict mapping environment names to lists of agent runtime names |
Source code in agentcore_cli/models/config.py
Python | |
---|---|
validate_ecr_repository_references(model)
¶
Validate that all ECR repository references exist in global_resources.ecr_repositories.
Source code in agentcore_cli/models/config.py
AgentCreationResult
¶
Bases: ActionResult
Result of agent creation.
Source code in agentcore_cli/models/responses.py
AgentDeletionResult
¶
Bases: ActionResult
Result of agent deletion.
Source code in agentcore_cli/models/responses.py
Python | |
---|---|
AgentEndpointStatusType
¶
Bases: StrEnum
Status of an agent runtime endpoint.
Endpoints go through these states during their lifecycle. Unlike runtimes, endpoints can be updated to point to different versions.
Source code in agentcore_cli/models/base.py
AgentInvocationResponse
¶
Bases: BaseAgentCoreModel
Response model for agent invocation.
This model handles both streaming and non-streaming responses from the boto3 invoke_agent_runtime API.
Source code in agentcore_cli/models/responses.py
from_nonstreaming_response(response, agent_name, endpoint_name, session_id)
classmethod
¶
Create a response object from a non-streaming API response.
Source code in agentcore_cli/models/responses.py
from_streaming_response(response, agent_name, endpoint_name, session_id)
classmethod
¶
Create a response object from a streaming API response.
Source code in agentcore_cli/models/responses.py
AgentRuntime
¶
Bases: ResourceBase
Configuration for an agent runtime.
Agent runtimes are associated with ECR repositories where their container images are stored. Each runtime can have multiple versions, each pointing to different image tags.
Source code in agentcore_cli/models/runtime.py
Python | |
---|---|
149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 |
|
ensure_default_endpoint(model)
¶
Ensure the DEFAULT endpoint exists and points to latest version.
Note: AWS AgentCore automatically creates and manages the DEFAULT endpoint. This validator ensures our model reflects this AWS behavior.
Source code in agentcore_cli/models/runtime.py
get_version_container_uri(version_id, ecr_repository)
¶
Get the full container URI for a specific version.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
version_id
|
str
|
Version identifier |
required |
ecr_repository
|
ECRRepository
|
ECR repository configuration |
required |
Returns:
Type | Description |
---|---|
str | None
|
Full container URI or None if version not found |
Source code in agentcore_cli/models/runtime.py
validate_runtime_name(v)
classmethod
¶
Validate agent runtime name format.
Source code in agentcore_cli/models/runtime.py
validate_version_repository_consistency(model)
¶
Validate that all versions reference valid ECR repositories.
Source code in agentcore_cli/models/runtime.py
AgentRuntimeEndpoint
¶
Bases: BaseAgentCoreModel
An endpoint for accessing a specific version of an agent runtime.
Source code in agentcore_cli/models/runtime.py
validate_endpoint_name(v)
classmethod
¶
Validate endpoint name format.
Source code in agentcore_cli/models/runtime.py
AgentRuntimeResponseAdapter
¶
Helper class to convert AWS API responses to our model structures.
Source code in agentcore_cli/models/adapters.py
Python | |
---|---|
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 |
|
from_aws_response(response)
staticmethod
¶
Convert AWS API response to AgentRuntime model.
Source code in agentcore_cli/models/adapters.py
Python | |
---|---|
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 |
|
from_endpoint_response(response, agent_runtime_id)
staticmethod
¶
Convert AWS API endpoint response to AgentRuntimeEndpoint model.
Source code in agentcore_cli/models/adapters.py
AgentRuntimeVersion
¶
Bases: BaseAgentCoreModel
A specific version of an agent runtime.
Each version references a specific ECR repository and image tag. The container URI is constructed from the repository + tag combination.
Source code in agentcore_cli/models/runtime.py
container_uri
property
¶
Get the full container URI by combining repository and tag.
Note: This requires access to the ECR repository configuration to build the full URI. Use get_container_uri() method with repository config for the complete URI.
is_immutable
property
¶
Check if this version is in an immutable state.
According to AWS documentation, versions are immutable once created, but status can change during creation/update process.
short_version
property
¶
Get a shortened version of the version ID for display.
get_container_uri(ecr_repository)
¶
Get the full container URI using the ECR repository configuration.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
ecr_repository
|
ECRRepository
|
ECR repository configuration |
required |
Returns:
Type | Description |
---|---|
str
|
Full container URI: registry/repository:tag |
Source code in agentcore_cli/models/runtime.py
Python | |
---|---|
AgentStatusType
¶
Bases: StrEnum
Status of an agent runtime.
These statuses reflect the lifecycle of an AWS AgentCore runtime. Runtimes transition through these states during creation, updates, and deletion.
Source code in agentcore_cli/models/base.py
AgentUpdateResult
¶
Bases: ActionResult
Result of agent update.
Source code in agentcore_cli/models/responses.py
AuthorizerConfig
¶
Bases: BaseAgentCoreModel
Authorizer configuration for AgentCore runtime.
Source code in agentcore_cli/models/runtime.py
BaseAgentCoreModel
¶
Bases: BaseModel
Base model with common configuration for all AgentCore models.
Provides strict validation and consistent behavior across all models. All AgentCore CLI models inherit from this base class.
Source code in agentcore_cli/models/base.py
CloudSyncResult
¶
Bases: BaseAgentCoreModel
Result of a cloud sync operation.
Source code in agentcore_cli/models/responses.py
CognitoConfig
¶
Bases: ResourceBase
Cognito user pool and identity pool configuration.
Source code in agentcore_cli/models/resources.py
CognitoIdentityPool
¶
Bases: BaseAgentCoreModel
Cognito identity pool configuration.
Source code in agentcore_cli/models/resources.py
CognitoUserPool
¶
Bases: BaseAgentCoreModel
Cognito user pool configuration.
Source code in agentcore_cli/models/resources.py
ContainerBuildInput
¶
Bases: BaseAgentCoreModel
Input for building and pushing a container image to ECR.
Source code in agentcore_cli/models/inputs.py
dockerfile
property
¶
Legacy property for backward compatibility.
CreateAgentRuntimeInput
¶
Bases: BaseAgentCoreModel
Input for creating a new agent runtime.
Maps directly to AWS create_agent_runtime API parameters.
Source code in agentcore_cli/models/inputs.py
CreateEndpointInput
¶
Bases: BaseAgentCoreModel
Input for creating an agent runtime endpoint.
Maps to AWS create_agent_runtime_endpoint API parameters.
Source code in agentcore_cli/models/inputs.py
CustomJWTAuthorizer
¶
Bases: BaseAgentCoreModel
JWT authorizer configuration for AgentCore runtime.
Source code in agentcore_cli/models/runtime.py
ECRRepository
¶
Bases: ResourceBase
ECR repository configuration.
Represents an Amazon ECR repository that can contain multiple image tags. Each AgentRuntimeVersion should reference this repository and specify an image tag.
Source code in agentcore_cli/models/resources.py
registry_url
property
¶
Get the ECR registry URL (without repository name).
get_image_uri(tag)
¶
Get the full container image URI for a specific tag.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
tag
|
str
|
Image tag (e.g., 'v1', 'latest', 'prod-2024-01-15') |
required |
Returns:
Type | Description |
---|---|
str
|
Full container URI: registry/repository:tag |
Source code in agentcore_cli/models/resources.py
validate_repository_uri(v)
classmethod
¶
Validate ECR repository URI format.
Source code in agentcore_cli/models/resources.py
EndpointCreationResult
¶
Bases: ActionResult
Result of endpoint creation.
Source code in agentcore_cli/models/responses.py
EndpointUpdateResult
¶
Bases: ActionResult
Result of endpoint update.
Source code in agentcore_cli/models/responses.py
EnvironmentConfig
¶
Bases: BaseAgentCoreModel
Configuration for a specific environment (dev, staging, prod).
Each environment owns its agent runtimes and exists in a specific AWS region. This design aligns with AWS AgentCore where runtimes are region-specific resources.
Source code in agentcore_cli/models/config.py
get_agent_endpoint(agent_runtime_name, endpoint_name=None)
¶
Get the agent runtime and endpoint for invocation.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
agent_runtime_name
|
str
|
Name of the agent runtime |
required |
endpoint_name
|
str | None
|
Specific endpoint name, or None to use DEFAULT |
None
|
Returns:
Type | Description |
---|---|
tuple[str, str] | None
|
Tuple of (runtime_name, endpoint_name) or None if not found |
Source code in agentcore_cli/models/config.py
set_creation_time(model)
¶
validate_default_agent(model)
¶
Validate that default_agent_runtime exists in agent_runtimes.
Source code in agentcore_cli/models/config.py
validate_runtime_regions(model)
¶
Ensure all agent runtimes in this environment match the environment's region.
Source code in agentcore_cli/models/config.py
EnvironmentCreationResult
¶
Bases: ActionResult
Result of environment creation.
Source code in agentcore_cli/models/responses.py
EnvironmentDeletionResult
¶
Bases: ActionResult
Result of environment deletion.
Source code in agentcore_cli/models/responses.py
EnvironmentInput
¶
Bases: BaseAgentCoreModel
Input for environment operations.
Source code in agentcore_cli/models/inputs.py
GlobalResourceConfig
¶
Bases: BaseAgentCoreModel
Global resources shared across environments.
Source code in agentcore_cli/models/config.py
IAMRoleConfig
¶
Bases: ResourceBase
IAM role configuration.
Source code in agentcore_cli/models/resources.py
ImageBuildResult
¶
InvokeAgentInput
¶
Bases: BaseAgentCoreModel
Input for invoking an agent runtime.
Maps directly to AWS invoke_agent_runtime API requirements. The API requires a full ARN and qualifier (endpoint name).
Source code in agentcore_cli/models/inputs.py
NetworkModeType
¶
Bases: StrEnum
Network mode for AgentCore runtimes.
Defines how the agent runtime is exposed within AWS networking: - PUBLIC: Runtime is accessible from the internet via public endpoints - PRIVATE: Runtime is only accessible within VPC (future AWS enhancement)
Source code in agentcore_cli/models/base.py
ResourceBase
¶
Bases: BaseAgentCoreModel
Base class for all AWS resource models.
Provides common fields that all AWS resources share: region, timestamps, and tags for resource management.
Source code in agentcore_cli/models/base.py
ResourceTag
¶
Bases: BaseAgentCoreModel
AWS resource tag for cost allocation and resource management.
Source code in agentcore_cli/models/base.py
ServerProtocolType
¶
Bases: StrEnum
Server protocol type for AgentCore runtimes.
Defines the communication protocol the agent runtime uses: - HTTP: Standard HTTP protocol for REST API communication - MCP: Model Context Protocol for advanced agent interactions
Source code in agentcore_cli/models/base.py
Python | |
---|---|
SyncConfig
¶
Bases: BaseAgentCoreModel
Configuration for cloud sync behavior.
Source code in agentcore_cli/models/config.py
SyncStatus
¶
Bases: BaseAgentCoreModel
Status of configuration synchronization.
Source code in agentcore_cli/models/responses.py
UpdateAgentRuntimeInput
¶
Bases: BaseAgentCoreModel
Input for updating an agent runtime.
Updates create a new immutable version. Maps to AWS update_agent_runtime API.
Source code in agentcore_cli/models/inputs.py
validate_at_least_one_update(model)
¶
Ensure at least one field is being updated.
Source code in agentcore_cli/models/inputs.py
UpdateEndpointInput
¶
Bases: BaseAgentCoreModel
Input for updating an agent runtime endpoint.
Maps to AWS update_agent_runtime_endpoint API parameters.
Source code in agentcore_cli/models/inputs.py
WorkloadIdentity
¶
Bases: BaseAgentCoreModel
Workload identity details for AgentCore runtime.