Skip to content

list_change_sets async

list_change_sets(
    agent_context_id: AgentContextIdentifier,
    status: ChangeSetStatus,
    *,
    config_overrides: Optional[AsyncContextClientConfig] = None,
    access_control: Optional[AccessControl] = None,
    generated_by: Optional[Activity] = None,
    max_results: Optional[MaxResults] = None,
    next_token: Optional[PaginationToken] = None,
) -> ListChangeSetsResponse

Lists an agent context's change sets that have the specified status, newest first. Each item is a summary of the change set, without its operations. To see what a change set wrote, call ListChangeSetOperations with its id as changeSetId.

Parameters:

  • agent_context_id (AgentContextIdentifier) –

    The agent context whose change sets you want to list, by its ID or ARN.

  • status (ChangeSetStatus) –

    The status of the change sets to list, for example PUBLISHED. Required. A request lists one status, so to list several statuses, make one request for each. If you specify a value that isn't listed, the request fails with ValidationException.

  • access_control (Optional[AccessControl], default: None ) –

    The accessControl value to list change sets for. If you omit it, every change set in the status is listed, each with its accessControl. If you specify a value that isn't listed, the request fails with ValidationException.

    Valid values:

    • ACL_RESTRICTED - Only an allowed end user can read the content (its operations), and the change set can't be edited. Every caller can read its metadata, and its proposal's title names no nodes or edges.

    • NO_ACL - Every caller can read the content.

  • generated_by (Optional[Activity], default: None ) –

    The activity that generated the change sets to list, for example ENTITY_RESOLUTION. If you omit it, change sets from every activity are listed. If you specify a value that isn't listed, the request fails with ValidationException. A change set without a generatedBy, for example one that AWS Context wrote when it loaded an ontology's schema, matches no value.

    Valid values:

    • DATA_SOURCE_EXTRACTION - AWS Context extracted the content from a connected data source with a model, for example from the documents of an Amazon Bedrock knowledge base.

    • DATA_SOURCE_INGESTION - AWS Context ingested content from a connected data source as a repeatable projection of the source, such as an AWS Glue Data Catalog sync.

    • ENTITY_RESOLUTION - AWS Context merged duplicate entities into one canonical entity.

    • ONTOLOGY_GROUNDING - AWS Context linked an ontology class to the data entities that instantiate it.

    • TRACE_ANALYSIS - AWS Context derived skills and instructions from recorded agent sessions.

    • IMPORT_DATA_DICTIONARY_TASK - An IMPORT_DATA_DICTIONARY task wrote the content. Change sets from earlier IMPORT_VERIFIED_QUERIES tasks can also carry this value.

    • IMPORT_VERIFIED_QUERIES_TASK - An IMPORT_VERIFIED_QUERIES task wrote the content.

    • IMPORT_ONTOLOGY_TASK - An IMPORT_ONTOLOGY task imported an ontology.

    • DIRECT_MODIFICATION - A person, an agent, or an application called CreateChangeSet directly.

  • max_results (Optional[MaxResults], default: None ) –

    Maximum number of results per page (upper bound, not a target). The service might return fewer.

  • next_token (Optional[PaginationToken], default: None ) –

    Opaque pagination cursor from a prior response. Omit for the first page.

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.

  • 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:

List published change sets The following example lists an agent context's published change sets, newest first, two per page.

>>> await client.list_change_sets(agent_context_id='ac-4f2a9c1e7b3d4a6f8e0c2b5d7a9f1e3c', status='PUBLISHED', max_results=2)
Source code in docs_src/capo_context/_services/async_context.py
async def list_change_sets(
    self,
    agent_context_id: "capo_context.types.agent_context_identifier.AgentContextIdentifier",
    status: "capo_context.types.change_set_status.ChangeSetStatus",
    *,
    config_overrides: Optional[AsyncContextClientConfig] = None,
    access_control: Optional[
        "capo_context.types.access_control.AccessControl"
    ] = None,
    generated_by: Optional["capo_context.types.activity.Activity"] = None,
    max_results: Optional["capo_context.types.max_results.MaxResults"] = None,
    next_token: Optional[
        "capo_context.types.pagination_token.PaginationToken"
    ] = None,
) -> "capo_context.types.list_change_sets_response.ListChangeSetsResponse":
    """<p>Lists an agent context's change sets that have the specified <code>status</code>, newest first. Each item is a summary of the change set, without its operations. To see what a change set wrote, call ListChangeSetOperations with its <code>id</code> as <code>changeSetId</code>.</p>

    Args:
        agent_context_id: <p>The agent context whose change sets you want to list, by its ID or ARN.</p>
        status: <p>The status of the change sets to list, for example <code>PUBLISHED</code>. Required. A request lists one status, so to list several statuses, make one request for each. If you specify a value that isn't listed, the request fails with <code>ValidationException</code>.</p>
        access_control: <p>The <code>accessControl</code> value to list change sets for. If you omit it, every change set in the status is listed, each with its <code>accessControl</code>. If you specify a value that isn't listed, the request fails with <code>ValidationException</code>.</p> <p>Valid values:</p> <ul> <li> <p> <code>ACL_RESTRICTED</code> - Only an allowed end user can read the content (its operations), and the change set can't be edited. Every caller can read its metadata, and its proposal's <code>title</code> names no nodes or edges.</p> </li> <li> <p> <code>NO_ACL</code> - Every caller can read the content.</p> </li> </ul>
        generated_by: <p>The activity that generated the change sets to list, for example <code>ENTITY_RESOLUTION</code>. If you omit it, change sets from every activity are listed. If you specify a value that isn't listed, the request fails with <code>ValidationException</code>. A change set without a <code>generatedBy</code>, for example one that AWS Context wrote when it loaded an ontology's schema, matches no value.</p> <p>Valid values:</p> <ul> <li> <p> <code>DATA_SOURCE_EXTRACTION</code> - AWS Context extracted the content from a connected data source with a model, for example from the documents of an Amazon Bedrock knowledge base.</p> </li> <li> <p> <code>DATA_SOURCE_INGESTION</code> - AWS Context ingested content from a connected data source as a repeatable projection of the source, such as an AWS Glue Data Catalog sync.</p> </li> <li> <p> <code>ENTITY_RESOLUTION</code> - AWS Context merged duplicate entities into one canonical entity.</p> </li> <li> <p> <code>ONTOLOGY_GROUNDING</code> - AWS Context linked an ontology class to the data entities that instantiate it.</p> </li> <li> <p> <code>TRACE_ANALYSIS</code> - AWS Context derived skills and instructions from recorded agent sessions.</p> </li> <li> <p> <code>IMPORT_DATA_DICTIONARY_TASK</code> - An <code>IMPORT_DATA_DICTIONARY</code> task wrote the content. Change sets from earlier <code>IMPORT_VERIFIED_QUERIES</code> tasks can also carry this value.</p> </li> <li> <p> <code>IMPORT_VERIFIED_QUERIES_TASK</code> - An <code>IMPORT_VERIFIED_QUERIES</code> task wrote the content.</p> </li> <li> <p> <code>IMPORT_ONTOLOGY_TASK</code> - An <code>IMPORT_ONTOLOGY</code> task imported an ontology.</p> </li> <li> <p> <code>DIRECT_MODIFICATION</code> - A person, an agent, or an application called <code>CreateChangeSet</code> directly.</p> </li> </ul>
        max_results: <p>Maximum number of results per page (upper bound, not a target). The service might return fewer.</p>
        next_token: <p>Opaque pagination cursor from a prior response. Omit for the first page.</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.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:
        List published change sets
        The following example lists an agent context's published change sets, newest first, two per page.

        >>> await client.list_change_sets(agent_context_id='ac-4f2a9c1e7b3d4a6f8e0c2b5d7a9f1e3c', status='PUBLISHED', max_results=2)
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_context.types.list_change_sets_request.ListChangeSetsRequest]",
    ) -> AsyncOperationResponse[
        "capo_context.types.list_change_sets_response.ListChangeSetsResponse"
    ]:
        import capo_context._operations.context.list_change_sets

        (
            output,
            http_response,
        ) = await capo_context._operations.context.list_change_sets.async_list_change_sets(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListChangeSets")
    )
    input_: capo_context.types.list_change_sets_request.ListChangeSetsRequest = {
        "agent_context_id": agent_context_id,
        "status": status,
    }
    if access_control is not None:
        input_["access_control"] = access_control
    if generated_by is not None:
        input_["generated_by"] = generated_by
    if max_results is not None:
        input_["max_results"] = max_results
    if next_token is not None:
        input_["next_token"] = next_token

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