pub struct RunMicrovmRequest {
pub image_identifier: String,
pub image_version: Option<String>,
pub execution_role_arn: Option<String>,
pub connectors: Vec<ConnectorIntent>,
pub run_hook_payload: RunHookPayload,
pub max_duration_sec: u32,
pub max_idle_sec: u32,
pub suspended_sec: u32,
pub auto_resume: bool,
pub token_scope: Option<String>,
}Expand description
Everything RunMicrovm needs.
run_hook_payload is a RunHookPayload, which cannot hold an over-ceiling value —
so TRAP-5 is closed before this struct exists rather than checked when it is used.
Fields§
§image_identifier: StringThe image ARN or ID to launch.
image_version: Option<String>imageVersion, or None for the image’s own latest active version.
§The launch half of blue/green
None is what this client always sent, and it means “whatever
latestActiveImageVersion is now” — which is right for the ordinary case and wrong for
the two that matter. A canary wants to launch against exactly the version it is
testing, not against whatever became latest while it was starting. And a rollback wants
to re-pin to the known-good version, which “latest” cannot express at all once a bad
version is the latest one.
With ControlPlane::set_image_version_status the three moves compose: build v2,
canary-launch pinned to v2, and on failure set v2 INACTIVE and re-pin to v1. A version
set INACTIVE refuses to launch when pinned here, which is what makes the retire real
rather than advisory.
Checked against the Version shape before the call — see
require_valid_version on why a rollback is the worst moment for a rejection about
the request.
execution_role_arn: Option<String>The execution role. Optional in the model; every real launch needs one.
connectors: Vec<ConnectorIntent>The connectors to request, as intents (TRAP-4). Ingress is required for a session to work at all; omitting egress is how you get no outbound network.
run_hook_payload: RunHookPayloadThe already-validated payload carrying the agent token.
max_duration_sec: u32maximumDurationInSeconds, checked against 1..=28800 when the request is sent.
max_idle_sec: u32idlePolicy.maxIdleDurationSeconds, checked against the model’s min: 60 before the call.
This comment used to say the guard was deliberately absent, because min is one of the four
keys botocore’s VALIDATED_METADATA_ATTRS enforces locally. True of botocore, and this
client never touches it — see require_idle_duration. 59 reached the wire.
suspended_sec: u32idlePolicy.suspendedDurationSeconds.
The model’s min is 0, so every u32 satisfies it and there is no guard — an absence
with a reason rather than an oversight, and the drift gate pins the 0 so a future floor is
noticed. Its ceiling is unstated.
This value exists only in the request — the client is the only party that can name the window it asked for, which is what STATE-12’s refusal rests on.
auto_resume: boolidlePolicy.autoResumeEnabled.
token_scope: Option<String>A label for the run token, defaulting to the image identifier (TRAP-1).
Implementations§
Source§impl RunMicrovmRequest
impl RunMicrovmRequest
Sourcepub fn new(
image_identifier: impl Into<String>,
run_hook_payload: RunHookPayload,
) -> Self
pub fn new( image_identifier: impl Into<String>, run_hook_payload: RunHookPayload, ) -> Self
A launch with the measured defaults: ingress only, ten-minute idle and suspended windows, a one-hour maximum duration, no auto-resume.
Sourcepub fn with_egress(self) -> Self
pub fn with_egress(self) -> Self
Adds the egress connector, which is what gives the VM outbound network.
Sourcepub fn with_image_version(self, version: impl Into<String>) -> Self
pub fn with_image_version(self, version: impl Into<String>) -> Self
Pins the launch to one imageVersion. See the field for why that matters.
Trait Implementations§
Source§impl Clone for RunMicrovmRequest
impl Clone for RunMicrovmRequest
Source§fn clone(&self) -> RunMicrovmRequest
fn clone(&self) -> RunMicrovmRequest
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for RunMicrovmRequest
impl RefUnwindSafe for RunMicrovmRequest
impl Send for RunMicrovmRequest
impl Sync for RunMicrovmRequest
impl Unpin for RunMicrovmRequest
impl UnsafeUnpin for RunMicrovmRequest
impl UnwindSafe for RunMicrovmRequest
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more