---
title: Microvm
description: A MicroVM as GetMicrovm last described it.
---

```python
@final
class Microvm
```

A MicroVM as `GetMicrovm` last described it.

## Constructor

`Microvm` declares no `__new__` or `__init__`, so it is not constructed directly: an instance comes back from another call in this package.

## Properties

### `endpoint`

```python
endpoint: str
```

The proxy endpoint. Pair it with the agent token in `Session.attach`.

### `id`

```python
id: str
```

### `idle_policy`

```python
idle_policy: IdlePolicy | None
```

The idle policy the service reports, or `None` when it sent none.

### `image_arn`

```python
image_arn: str
```

### `image_version`

```python
image_version: str
```

### `maximum_duration_seconds`

```python
maximum_duration_seconds: int | None
```

`maximumDurationInSeconds`. Suspended time counts toward it.

### `started_at`

```python
started_at: float | None
```

When the VM first started, as Unix seconds.

### `state`

```python
state: str
```

`"PENDING"`, `"RUNNING"`, `"SUSPENDING"`, `"SUSPENDED"`, `"TERMINATING"`, or
`"TERMINATED"`, as the service spells it. Eventually consistent.

### `state_reason`

```python
state_reason: str | None
```

Why the VM is in this state, when the service said.

### `terminated_at`

```python
terminated_at: float | None
```

When the VM terminated, as Unix seconds, once it has.

## Special methods

### `__repr__`

```python
def __repr__() -> str
```

## Provenance

This page is generated from `bindings/microvms-py/microvms.pyi` by Griffe 2.3.0, run from `site/scripts/gen-reference.mjs` on every `pnpm run sync`, so an edit made here is overwritten by the next run.

To change the page, change the doc comment in the binding's Rust source, then regenerate the declarations with `mise run stubs`. `mise run stubs:check` fails when the committed file no longer matches the source.