Skip to content

update_agent_context

update_agent_context(
    agent_context_id: AgentContextIdentifier,
    *,
    config_overrides: Optional[ContextClientConfig] = None,
    name: Optional[ResourceName] = None,
    description: Optional[UserDefinedString] = None,
    connection_mappings: Optional[ConnectionMappingList] = None,
    trace_analysis_config: Optional[TraceAnalysisConfig] = None,
    workforce_sign_in_config: Optional[WorkforceSignInConfig] = None,
    entity_resolution_config: Optional[EntityResolutionConfig] = None,
    trusted_identity_sources: Optional[TrustedIdentitySourceList] = None,
) -> UpdateAgentContextResponse

Updates an agent context's configuration.

Parameters:

  • agent_context_id (AgentContextIdentifier) –

    The agent context to update, by its ID or ARN.

  • name (Optional[ResourceName], default: None ) –

    The new name. If you omit it, the name is unchanged.

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

    The new description. Absent leaves the description unchanged. An empty string removes it.

  • connection_mappings (Optional[ConnectionMappingList], default: None ) –

    The connection mappings for this agent context, 0–20 entries. If you provide a list, it replaces the stored set: AWS Context removes entries that are not in the list, adds new entries, and overwrites retained entries with exactly the values that you provide, without merging fields. An empty list removes all connection links. If you omit this member, the existing links are unchanged.

    Each newly referenced connection must exist, be owned by your account, and be ACTIVE. Order is significant. When several connections reach the same AWS Glue Data Catalog table, AWS Context tries the connection mapped first, with its own access, and then the next.

  • trace_analysis_config (Optional[TraceAnalysisConfig], default: None ) –

    Merged into the agent context's trace analysis settings: an absent member leaves its stored value unchanged. status ENABLED requires a role, supplied here or already on the agent context. A role supplied without status requires the agent context's status to read ENABLED.

  • workforce_sign_in_config (Optional[WorkforceSignInConfig], default: None ) –

    Merged into the agent context's workforce sign-in settings: an absent member leaves its stored value unchanged. signInUrl replaces the stored URL and reads ENABLED. status DISABLED removes the stored URL. status ENABLED requires a URL, supplied here or already on the agent context.

  • entity_resolution_config (Optional[EntityResolutionConfig], default: None ) –

    Merged into the agent context's entity resolution settings: an absent member leaves its stored value unchanged.

  • trusted_identity_sources (Optional[TrustedIdentitySourceList], default: None ) –

    Identity sources to trust in addition to your account. A present list replaces the stored list, [] clears it so only your account is trusted, and an absent field leaves it unchanged. Order is not significant: a list with the stored entries in another order changes nothing. A change takes effect within about a minute.

Raises:

  • AccessDeniedException –

    You don't have sufficient access to perform this operation. Verify that you have permission to perform the operation on the resource.

  • InternalServerException –

    The request failed because of an internal error. Retry the request.

  • ThrottlingException –

    The request was denied because it exceeded a request rate quota. Wait, then retry the request.

  • ValidationException –

    The input fails to satisfy the constraints of the operation. Correct the input before you retry the request.

  • ConflictException –

    The request conflicts with the current state of the resource. Check the resource's current state before you retry the request.

  • ResourceNotFoundException –

    The specified resource was not found. Check that the ID is correct and that the resource exists in your account and Region.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Examples:

Turn on trace analysis for an agent context The following example turns on trace analysis for the agent context ac-3f9c2e7a1b8d4c56a0e4f7b29d1c8e53 with an IAM role in the same account, and updates its description.

>>> client.update_agent_context(agent_context_id='ac-3f9c2e7a1b8d4c56a0e4f7b29d1c8e53', description='Sales pipeline, revenue, and forecast tables for the analytics agents.', trace_analysis_config={'status': 'ENABLED', 'traceAnalysisRole': 'arn:aws:iam::111122223333:role/ContextTraceAnalysisRole'})
Source code in docs_src/capo_context/_services/context.py
def update_agent_context(
    self,
    agent_context_id: "capo_context.types.agent_context_identifier.AgentContextIdentifier",
    *,
    config_overrides: Optional[ContextClientConfig] = None,
    name: Optional["capo_context.types.resource_name.ResourceName"] = None,
    description: Optional[
        "capo_context.types.user_defined_string.UserDefinedString"
    ] = None,
    connection_mappings: Optional[
        "capo_context.types.connection_mapping_list.ConnectionMappingList"
    ] = None,
    trace_analysis_config: Optional[
        "capo_context.types.trace_analysis_config.TraceAnalysisConfig"
    ] = None,
    workforce_sign_in_config: Optional[
        "capo_context.types.workforce_sign_in_config.WorkforceSignInConfig"
    ] = None,
    entity_resolution_config: Optional[
        "capo_context.types.entity_resolution_config.EntityResolutionConfig"
    ] = None,
    trusted_identity_sources: Optional[
        "capo_context.types.trusted_identity_source_list.TrustedIdentitySourceList"
    ] = None,
) -> "capo_context.types.update_agent_context_response.UpdateAgentContextResponse":
    """<p>Updates an agent context's configuration.</p>

    Args:
        agent_context_id: <p>The agent context to update, by its ID or ARN.</p>
        name: <p>The new name. If you omit it, the name is unchanged.</p>
        description: <p>The new description. Absent leaves the description unchanged. An empty string removes it.</p>
        connection_mappings: <p>The connection mappings for this agent context, 0–20 entries. If you provide a list, it replaces the stored set: AWS Context removes entries that are not in the list, adds new entries, and overwrites retained entries with exactly the values that you provide, without merging fields. An empty list removes all connection links. If you omit this member, the existing links are unchanged.</p> <p>Each newly referenced connection must exist, be owned by your account, and be <code>ACTIVE</code>. Order is significant. When several connections reach the same AWS Glue Data Catalog table, AWS Context tries the connection mapped first, with its own access, and then the next.</p>
        trace_analysis_config: <p>Merged into the agent context's trace analysis settings: an absent member leaves its stored value unchanged. <code>status</code> ENABLED requires a role, supplied here or already on the agent context. A role supplied without <code>status</code> requires the agent context's <code>status</code> to read ENABLED.</p>
        workforce_sign_in_config: <p>Merged into the agent context's workforce sign-in settings: an absent member leaves its stored value unchanged. <code>signInUrl</code> replaces the stored URL and reads ENABLED. <code>status</code> DISABLED removes the stored URL. <code>status</code> ENABLED requires a URL, supplied here or already on the agent context.</p>
        entity_resolution_config: <p>Merged into the agent context's entity resolution settings: an absent member leaves its stored value unchanged.</p>
        trusted_identity_sources: <p>Identity sources to trust in addition to your account. A present list replaces the stored list, <code>[]</code> clears it so only your account is trusted, and an absent field leaves it unchanged. Order is not significant: a list with the stored entries in another order changes nothing. A change takes effect within about a minute.</p>

    Raises:
        capo_context.errors.access_denied_exception.AccessDeniedException: <p>You don't have sufficient access to perform this operation. Verify that you have permission to perform the operation on the resource.</p>
        capo_context.errors.internal_server_exception.InternalServerException: <p>The request failed because of an internal error. Retry the request.</p>
        capo_context.errors.throttling_exception.ThrottlingException: <p>The request was denied because it exceeded a request rate quota. Wait, then retry the request.</p>
        capo_context.errors.validation_exception.ValidationException: <p>The input fails to satisfy the constraints of the operation. Correct the input before you retry the request.</p>
        capo_context.errors.conflict_exception.ConflictException: <p>The request conflicts with the current state of the resource. Check the resource's current state before you retry the request.</p>
        capo_context.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource was not found. Check that the ID is correct and that the resource exists in your account and Region.</p>
        capo_context.errors.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        Turn on trace analysis for an agent context
        The following example turns on trace analysis for the agent context ac-3f9c2e7a1b8d4c56a0e4f7b29d1c8e53 with an IAM role in the same account, and updates its description.

        >>> client.update_agent_context(agent_context_id='ac-3f9c2e7a1b8d4c56a0e4f7b29d1c8e53', description='Sales pipeline, revenue, and forecast tables for the analytics agents.', trace_analysis_config={'status': 'ENABLED', 'traceAnalysisRole': 'arn:aws:iam::111122223333:role/ContextTraceAnalysisRole'})
    """

    def _handler(
        req: "OperationRequest[capo_context.types.update_agent_context_request.UpdateAgentContextRequest]",
    ) -> OperationResponse[
        "capo_context.types.update_agent_context_response.UpdateAgentContextResponse"
    ]:
        import capo_context._operations.context.update_agent_context

        output, http_response = (
            capo_context._operations.context.update_agent_context.update_agent_context(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdateAgentContext")
    )
    input_: capo_context.types.update_agent_context_request.UpdateAgentContextRequest = {
        "agent_context_id": agent_context_id
    }
    if name is not None:
        input_["name"] = name
    if description is not None:
        input_["description"] = description
    if connection_mappings is not None:
        input_["connection_mappings"] = connection_mappings
    if trace_analysis_config is not None:
        input_["trace_analysis_config"] = trace_analysis_config
    if workforce_sign_in_config is not None:
        input_["workforce_sign_in_config"] = workforce_sign_in_config
    if entity_resolution_config is not None:
        input_["entity_resolution_config"] = entity_resolution_config
    if trusted_identity_sources is not None:
        input_["trusted_identity_sources"] = trusted_identity_sources

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output