Skip to content

update_microvm_image_version async

update_microvm_image_version(
    image_identifier: MicrovmImageIdentifier,
    image_version: NonBlankString,
    status: MicrovmImageVersionStatus,
    *,
    config_overrides: Optional[AsyncLambdaMicrovmsClientConfig] = None,
) -> UpdateMicrovmImageVersionResponse

Updates the status of a specific MicroVM image version.

Parameters:

Raises:

Source code in docs_src/capo_lambda_microvms/_services/async_lambda_microvms.py
async def update_microvm_image_version(
    self,
    image_identifier: "capo_lambda_microvms.types.microvm_image_identifier.MicrovmImageIdentifier",
    image_version: "capo_lambda_microvms.types.non_blank_string.NonBlankString",
    status: "capo_lambda_microvms.types.microvm_image_version_status.MicrovmImageVersionStatus",
    *,
    config_overrides: Optional[AsyncLambdaMicrovmsClientConfig] = None,
) -> "capo_lambda_microvms.types.update_microvm_image_version_response.UpdateMicrovmImageVersionResponse":
    """<p>Updates the status of a specific MicroVM image version.</p>

    Args:
        image_identifier: <p>The unique identifier (ARN or ID) of the MicroVM image.</p>
        image_version: <p>The version of the MicroVM image to update.</p>
        status: <p>The new status to set for the MicroVM image version.</p>

    Raises:
        capo_lambda_microvms.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient access to perform this action.</p>
        capo_lambda_microvms.errors.internal_server_exception.InternalServerException: <p>An internal server error occurred. Retry the request later.</p>
        capo_lambda_microvms.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling. Retry the request later.</p>
        capo_lambda_microvms.errors.validation_exception.ValidationException: <p>The input does not satisfy the constraints specified by the service.</p>
        capo_lambda_microvms.errors.conflict_exception.ConflictException: <p>The request could not be completed due to a conflict with the current state of the resource.</p>
        capo_lambda_microvms.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource does not exist.</p>
        capo_lambda_microvms.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_lambda_microvms.types.update_microvm_image_version_request.UpdateMicrovmImageVersionRequest]",
    ) -> AsyncOperationResponse[
        "capo_lambda_microvms.types.update_microvm_image_version_response.UpdateMicrovmImageVersionResponse"
    ]:
        import capo_lambda_microvms._operations.lambda_microvms.update_microvm_image_version

        (
            output,
            http_response,
        ) = await capo_lambda_microvms._operations.lambda_microvms.update_microvm_image_version.async_update_microvm_image_version(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    def _redact_output(
        output: "capo_lambda_microvms.types.update_microvm_image_version_response.UpdateMicrovmImageVersionResponse",
    ) -> dict[str, Any]:
        import capo_lambda_microvms.types.update_microvm_image_version_response

        return capo_lambda_microvms.types.update_microvm_image_version_response.redact_sensitive(
            output
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("UpdateMicrovmImageVersion", redact_output=_redact_output),
    )
    input_: capo_lambda_microvms.types.update_microvm_image_version_request.UpdateMicrovmImageVersionRequest = {
        "image_identifier": image_identifier,
        "image_version": image_version,
        "status": status,
    }

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