Skip to content

list_retrieval_instruction_versions

list_retrieval_instruction_versions(
    retrieval_instruction_id: RetrievalInstructionId,
    *,
    config_overrides: Optional[BedrockAgentClientConfig] = None,
    max_results: Optional[RetrievalInstructionMaxResults] = None,
    next_token: Optional[NextToken] = None,
) -> ListRetrievalInstructionVersionsResponse

Lists the numbered versions of a retrieval instruction, newest first. DRAFT is not listed; read it with GetRetrievalInstruction without retrievalInstructionVersion. Results are paginated. Use the nextToken parameter to retrieve additional results.

Parameters:

  • retrieval_instruction_id (RetrievalInstructionId) –

    The identifier of the retrieval instruction whose versions to list.

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

    Specifies the maximum number of versions to return in a single page. The service enforces the effective upper bound.

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

    The pagination token from a previous ListRetrievalInstructionVersions response.

Raises:

Source code in docs_src/capo_bedrock_agent/_services/bedrock_agent.py
def list_retrieval_instruction_versions(
    self,
    retrieval_instruction_id: "capo_bedrock_agent.types.retrieval_instruction_id.RetrievalInstructionId",
    *,
    config_overrides: Optional[BedrockAgentClientConfig] = None,
    max_results: Optional[
        "capo_bedrock_agent.types.retrieval_instruction_max_results.RetrievalInstructionMaxResults"
    ] = None,
    next_token: Optional["capo_bedrock_agent.types.next_token.NextToken"] = None,
) -> "capo_bedrock_agent.types.list_retrieval_instruction_versions_response.ListRetrievalInstructionVersionsResponse":
    """<p>Lists the numbered versions of a retrieval instruction, newest first. DRAFT is not listed; read it with GetRetrievalInstruction without retrievalInstructionVersion. Results are paginated. Use the nextToken parameter to retrieve additional results.</p>

    Args:
        retrieval_instruction_id: <p>The identifier of the retrieval instruction whose versions to list.</p>
        max_results: <p>Specifies the maximum number of versions to return in a single page. The service enforces the effective upper bound.</p>
        next_token: <p>The pagination token from a previous ListRetrievalInstructionVersions response.</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.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.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.
    """

    def _handler(
        req: "OperationRequest[capo_bedrock_agent.types.list_retrieval_instruction_versions_request.ListRetrievalInstructionVersionsRequest]",
    ) -> OperationResponse[
        "capo_bedrock_agent.types.list_retrieval_instruction_versions_response.ListRetrievalInstructionVersionsResponse"
    ]:
        import capo_bedrock_agent._operations.amazon_bedrock_agent_build_time_lambda.list_retrieval_instruction_versions

        output, http_response = (
            capo_bedrock_agent._operations.amazon_bedrock_agent_build_time_lambda.list_retrieval_instruction_versions.list_retrieval_instruction_versions(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListRetrievalInstructionVersions")
    )
    input_: capo_bedrock_agent.types.list_retrieval_instruction_versions_request.ListRetrievalInstructionVersionsRequest = {
        "retrieval_instruction_id": retrieval_instruction_id
    }
    if max_results is not None:
        input_["max_results"] = max_results
    if next_token is not None:
        input_["next_token"] = next_token

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