Skip to content

update_agent_alias async

update_agent_alias(
    agent_id: Id,
    agent_alias_id: AgentAliasId,
    agent_alias_name: Name,
    *,
    config_overrides: Optional[AsyncBedrockAgentClientConfig] = None,
    description: Optional[Description] = None,
    routing_configuration: Optional[AgentAliasRoutingConfiguration] = None,
    alias_invocation_state: Optional[AliasInvocationState] = None,
) -> UpdateAgentAliasResponse

Updates configurations for an alias of an agent.

Parameters:

  • agent_id (Id) –

    The unique identifier of the agent.

  • agent_alias_id (AgentAliasId) –

    The unique identifier of the alias.

  • agent_alias_name (Name) –

    Specifies a new name for the alias.

  • description (Optional[Description], default: None ) –

    Specifies a new description for the alias.

  • routing_configuration (Optional[AgentAliasRoutingConfiguration], default: None ) –

    Contains details about the routing configuration of the alias.

  • alias_invocation_state (Optional[AliasInvocationState], default: None ) –

    The invocation state for the agent alias. To pause the agent alias, set the value to REJECT_INVOCATIONS. To start the agent alias running again, set the value to ACCEPT_INVOCATIONS. Use the GetAgentAlias, or ListAgentAliases, operation to get the invocation state of an agent alias.

Raises:

Source code in docs_src/capo_bedrock_agent/_services/async_bedrock_agent.py
async def update_agent_alias(
    self,
    agent_id: "capo_bedrock_agent.types.id.Id",
    agent_alias_id: "capo_bedrock_agent.types.agent_alias_id.AgentAliasId",
    agent_alias_name: "capo_bedrock_agent.types.name.Name",
    *,
    config_overrides: Optional[AsyncBedrockAgentClientConfig] = None,
    description: Optional[
        "capo_bedrock_agent.types.description.Description"
    ] = None,
    routing_configuration: Optional[
        "capo_bedrock_agent.types.agent_alias_routing_configuration.AgentAliasRoutingConfiguration"
    ] = None,
    alias_invocation_state: Optional[
        "capo_bedrock_agent.types.alias_invocation_state.AliasInvocationState"
    ] = None,
) -> (
    "capo_bedrock_agent.types.update_agent_alias_response.UpdateAgentAliasResponse"
):
    """<p>Updates configurations for an alias of an agent.</p>

    Args:
        agent_id: <p>The unique identifier of the agent.</p>
        agent_alias_id: <p>The unique identifier of the alias.</p>
        agent_alias_name: <p>Specifies a new name for the alias.</p>
        description: <p>Specifies a new description for the alias.</p>
        routing_configuration: <p>Contains details about the routing configuration of the alias.</p>
        alias_invocation_state: <p>The invocation state for the agent alias. To pause the agent alias, set the value to <code>REJECT_INVOCATIONS</code>. To start the agent alias running again, set the value to <code>ACCEPT_INVOCATIONS</code>. Use the <code>GetAgentAlias</code>, or <code>ListAgentAliases</code>, operation to get the invocation state of an agent alias.</p>

    Raises:
        capo_bedrock_agent.errors.access_denied_exception.AccessDeniedException: <p>The request is denied because of missing access permissions.</p>
        capo_bedrock_agent.errors.conflict_exception.ConflictException: <p>There was a conflict performing an operation.</p>
        capo_bedrock_agent.errors.internal_server_exception.InternalServerException: <p>An internal server error occurred. Retry your request.</p>
        capo_bedrock_agent.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource Amazon Resource Name (ARN) was not found. Check the Amazon Resource Name (ARN) and try your request again.</p>
        capo_bedrock_agent.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>The number of requests exceeds the service quota. Resubmit your request later.</p>
        capo_bedrock_agent.errors.throttling_exception.ThrottlingException: <p>The number of requests exceeds the limit. Resubmit your request later.</p>
        capo_bedrock_agent.errors.validation_exception.ValidationException: <p>Input validation failed. Check your request parameters and retry the request.</p>
        capo_bedrock_agent.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_bedrock_agent.types.update_agent_alias_request.UpdateAgentAliasRequest]",
    ) -> AsyncOperationResponse[
        "capo_bedrock_agent.types.update_agent_alias_response.UpdateAgentAliasResponse"
    ]:
        import capo_bedrock_agent._operations.amazon_bedrock_agent_build_time_lambda.update_agent_alias

        (
            output,
            http_response,
        ) = await capo_bedrock_agent._operations.amazon_bedrock_agent_build_time_lambda.update_agent_alias.async_update_agent_alias(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdateAgentAlias")
    )
    input_: capo_bedrock_agent.types.update_agent_alias_request.UpdateAgentAliasRequest = {
        "agent_id": agent_id,
        "agent_alias_id": agent_alias_id,
        "agent_alias_name": agent_alias_name,
    }
    if description is not None:
        input_["description"] = description
    if routing_configuration is not None:
        input_["routing_configuration"] = routing_configuration
    if alias_invocation_state is not None:
        input_["alias_invocation_state"] = alias_invocation_state

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output