Skip to content

list_available_module_versions

list_available_module_versions(
    module_id: ModuleId,
    *,
    config_overrides: Optional[RTBFabricClientConfig] = None,
    status: Optional[ModuleVersionStatus] = None,
    max_results: Optional[int] = None,
    next_token: Optional[str] = None,
) -> ListAvailableModuleVersionsResponse

Lists the ACTIVE and DEPRECATED versions of a module that you can attach, highest version first (numerically by MAJOR, then MINOR, then PATCH). If you can't attach the module, the operation returns ResourceNotFoundException, the same as for a missing one. If the module has no ACTIVE or DEPRECATED versions, the operation returns an empty list. The operation lists DEPRECATED versions so that you can inspect one that you've attached, but you can't attach them. Results are paginated. Use nextToken to get the next page.

Parameters:

  • module_id (ModuleId) –

    The module's ID.

  • status (Optional[ModuleVersionStatus], default: None ) –

    Lists only versions in this status. Only ACTIVE and DEPRECATED versions are listed, so another value returns an empty list.

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

    The maximum number of results for each page, from 1 to 10. The default is 10.

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

    If nextToken is returned, there are more results available. Make the call again using the returned token to retrieve the next page. Keep all other arguments unchanged. Each pagination token expires after 24 hours; using an expired token fails with ValidationException.

Raises:

  • AccessDeniedException –

    The request could not be completed because you do not have sufficient access to perform this action.

  • InternalServerException –

    The request could not be completed because of an internal server error. Try your call again.

  • ResourceNotFoundException –

    The request could not be completed because the resource does not exist.

  • ThrottlingException –

    The request was denied due to request throttling.

  • ValidationException –

    The request could not be completed because it fails satisfy the constraints specified by the service.

  • UnknownServiceError –

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

Examples:

List a module's versions Lists the versions of a module that you can attach, highest version first.

>>> client.list_available_module_versions(module_id='module-8kq2p9wx3fnv1c5htj7bd0ral', max_results=10)
Source code in docs_src/capo_rtbfabric/_services/rtb_fabric.py
def list_available_module_versions(
    self,
    module_id: "capo_rtbfabric.types.module_id.ModuleId",
    *,
    config_overrides: Optional[RTBFabricClientConfig] = None,
    status: Optional[
        "capo_rtbfabric.types.module_version_status.ModuleVersionStatus"
    ] = None,
    max_results: Optional[int] = None,
    next_token: Optional[str] = None,
) -> "capo_rtbfabric.types.list_available_module_versions_response.ListAvailableModuleVersionsResponse":
    """<p>Lists the ACTIVE and DEPRECATED versions of a module that you can attach, highest version first (numerically by MAJOR, then MINOR, then PATCH). If you can't attach the module, the operation returns ResourceNotFoundException, the same as for a missing one. If the module has no ACTIVE or DEPRECATED versions, the operation returns an empty list. The operation lists DEPRECATED versions so that you can inspect one that you've attached, but you can't attach them. Results are paginated. Use <code>nextToken</code> to get the next page.</p>

    Args:
        module_id: <p>The module's ID.</p>
        status: <p>Lists only versions in this status. Only ACTIVE and DEPRECATED versions are listed, so another value returns an empty list.</p>
        max_results: <p>The maximum number of results for each page, from 1 to 10. The default is 10.</p>
        next_token: <p>If nextToken is returned, there are more results available. Make the call again using the returned token to retrieve the next page. Keep all other arguments unchanged. Each pagination token expires after 24 hours; using an expired token fails with ValidationException.</p>

    Raises:
        capo_rtbfabric.errors.access_denied_exception.AccessDeniedException: <p>The request could not be completed because you do not have sufficient access to perform this action.</p>
        capo_rtbfabric.errors.internal_server_exception.InternalServerException: <p>The request could not be completed because of an internal server error. Try your call again.</p>
        capo_rtbfabric.errors.resource_not_found_exception.ResourceNotFoundException: <p>The request could not be completed because the resource does not exist.</p>
        capo_rtbfabric.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling.</p>
        capo_rtbfabric.errors.validation_exception.ValidationException: <p>The request could not be completed because it fails satisfy the constraints specified by the service.</p>
        capo_rtbfabric.errors.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        List a module's versions
        Lists the versions of a module that you can attach, highest version first.

        >>> client.list_available_module_versions(module_id='module-8kq2p9wx3fnv1c5htj7bd0ral', max_results=10)
    """

    def _handler(
        req: "OperationRequest[capo_rtbfabric.types.list_available_module_versions_request.ListAvailableModuleVersionsRequest]",
    ) -> OperationResponse[
        "capo_rtbfabric.types.list_available_module_versions_response.ListAvailableModuleVersionsResponse"
    ]:
        import capo_rtbfabric._operations.rtb_fabric.list_available_module_versions

        output, http_response = (
            capo_rtbfabric._operations.rtb_fabric.list_available_module_versions.list_available_module_versions(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListAvailableModuleVersions")
    )
    input_: capo_rtbfabric.types.list_available_module_versions_request.ListAvailableModuleVersionsRequest = {
        "module_id": module_id
    }
    if status is not None:
        input_["status"] = status
    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