{"command":{"effect":"write","timeoutSeconds":30,"inputSchema":{"type":"object","description":"To create a MicroVM, send a POST request to `/v2/microvms`.\n\n`name` and `source` are required. Set `source.oci_ref` to create the MicroVM from a\n`linux/amd64` container image, or `source.checkpoint_id` to create it from a checkpoint.\nWith `oci_ref`, `region` and `size` are also required.\n\nA MicroVM created from an image is returned with `state` set to `creating`. Poll\n`GET /v2/microvms/{microvm_id}` until `state` is `running`. A MicroVM created from a\ncheckpoint is usually returned already `running`.\n\nAll settings are fixed at creation. There is no update endpoint.\n","properties":{"body":{"$ref":"#/definitions/microvm_create","examples":[{"name":"example-microvm","region":"mkc1","size":{"cpu":1,"memory":2048},"source":{"oci_ref":"docker.io/library/nginx:latest"},"http_port":80,"http_protocol":"http","auto_pause":{"idle_timeout":"5m"},"tags":["example"]}]}},"required":["body"],"additionalProperties":false,"definitions":{"microvm_create":{"type":"object","description":"The request body for creating a MicroVM. With `source.oci_ref`, `region` and `size` are required. With `source.checkpoint_id`, the MicroVM inherits the checkpoint's region, size, container image, and environment variables, and a different `region` or `size`, or any `environment`, is rejected.","properties":{"name":{"type":"string","pattern":"^[a-z0-9-]{1,63}$","description":"The name of the MicroVM. Must be unique in the region and contain 1 to 63 lowercase letters, digits, and hyphens.","examples":["example-microvm"]},"source":{"$ref":"#/definitions/microvm_source"},"region":{"type":"string","description":"The slug of the region to create the MicroVM in. Required with `source.oci_ref`.","examples":["mkc1"]},"size":{"$ref":"#/definitions/microvm_size"},"networking":{"type":"string","enum":["public","vpc"],"default":"public","description":"`public` sends outbound traffic through a shared NAT gateway. `vpc` places the MicroVM in the VPC network set by `vpc_uuid`.","examples":["public"]},"vpc_uuid":{"type":"string","format":"uuid","description":"The ID of a VPC network in the same region that belongs to your team. Required when `networking` is `vpc`.","examples":["5a4981aa-9653-4bd1-bef5-d6bff52042e4"]},"auto_pause":{"$ref":"#/definitions/microvm_auto_pause"},"auto_resume":{"type":"boolean","default":true,"description":"Whether an HTTP request, command, or console session resumes the MicroVM when it is paused. Set to `false` to require a manual resume.","examples":[true]},"http_port":{"type":"integer","default":8080,"description":"The guest port the workload serves HTTP on. Defaults to `8080`. Not returned in responses. When creating from a checkpoint without `ports`, must be one of the checkpoint's ports.","examples":[80]},"http_protocol":{"type":"string","enum":["http","http2"],"description":"The protocol the HTTP port serves.","examples":["http"]},"ports":{"type":"array","maxItems":5,"items":{"type":"integer"},"description":"The guest ports to declare, up to five. Must include `http_port`. Defaults to only the HTTP port. During the public preview, only the HTTP port is reachable through the MicroVM's endpoint.","examples":[[80]]},"environment":{"type":"object","additionalProperties":{"type":"string"},"description":"Environment variables passed into the MicroVM at boot, as key and value pairs. Not returned in responses.","examples":[{"APP_ENV":"production"}]},"tags":{"type":"array","items":{"type":"string"},"description":"Tags to apply to the MicroVM.","examples":[["example"]]}},"required":["name","source"]},"microvm_source":{"type":"object","description":"What the MicroVM runs. Set exactly one of `oci_ref` or `checkpoint_id`.","properties":{"oci_ref":{"type":"string","description":"A reference to a `linux/amd64` container image in the form `registry/repository:tag`. The image can be public, such as an image on Docker Hub, or private in your team's DigitalOcean Container Registry.","examples":["docker.io/library/nginx:latest"]},"checkpoint_id":{"type":"string","format":"uuid","description":"The ID of a checkpoint to create the MicroVM from. The new MicroVM inherits the checkpoint's region, size, container image, and environment variables.","examples":["01a0ed98-0a74-75dd-a625-e4856adbc298"]}}},"microvm_size":{"type":"object","description":"The MicroVM's size. `cpu` and `memory` must be one of the pairs `1`/`2048`, `2`/`4096`, `8`/`16384`, or `16`/`32768`. The size sets the disk, which is returned in responses.","properties":{"cpu":{"type":"integer","description":"The number of vCPUs.","examples":[1]},"memory":{"type":"integer","description":"The amount of memory, in MiB.","examples":[2048]}},"required":["cpu","memory"]},"microvm_auto_pause":{"type":"object","description":"Automatic pause settings. A MicroVM always pauses after it is idle for `idle_timeout`. Sending `enabled` set to `false` is rejected.","properties":{"enabled":{"type":"boolean","description":"Whether auto-pause is on. Always `true`.","examples":[true]},"idle_timeout":{"type":"string","description":"How long the MicroVM is idle before it pauses, as a duration such as `30s`, `5m`, or `1h`. Defaults to `5m`. The maximum is `4h`. Responses show the duration in the form `5m0s`.","examples":["5m0s"]}}}}},"name":"Create a MicroVM","id":"digitalocean.microvms_create","example":{"body":{"name":"example-microvm","source":{}}},"maxRequests":1,"summary":false}}