Fly.io
Machines

Update Machine

View as Markdown

Update a Machine's configuration using the details provided in the request body.

POST
/apps/{app_name}/machines/{machine_id}

Update a Machine's configuration using the details provided in the request body.

Authorization

bearerAuth
AuthorizationBearer <token>

A Fly.io access token. Create one with fly tokens create.

In: header

Path Parameters

app_name*string

Fly App Name

machine_id*string

Machine ID

Request Body

application/json

Request body

config?

An object defining the Machine configuration

current_version?string
lease_ttl?integer
min_secrets_version?integer
name?string

Unique name for this Machine. If omitted, one is generated for you

region?string

The target region. Omitting this param launches in the same region as your WireGuard peer connection (somewhere near you).

skip_launch?boolean
skip_secrets?boolean
skip_service_registration?boolean

Response Body

application/json

application/json

curl -X POST "https://example.com/apps/string/machines/string" \  -H "Content-Type: application/json" \  -d '{}'
{  "checks": [    {      "name": "string",      "output": "string",      "status": "string",      "updated_at": "string"    }  ],  "config": {    "auto_destroy": true,    "cache_drive": {      "size_mb": 0    },    "checks": {      "property1": {        "grace_period": "1s",        "headers": [          {            "name": "string",            "values": [              "string"            ]          }        ],        "interval": "15s",        "kind": "informational",        "method": "string",        "path": "string",        "port": 0,        "protocol": "string",        "timeout": "2s",        "tls_server_name": "string",        "tls_skip_verify": true,        "type": "string"      },      "property2": {        "grace_period": "1s",        "headers": [          {            "name": "string",            "values": [              "string"            ]          }        ],        "interval": "15s",        "kind": "informational",        "method": "string",        "path": "string",        "port": 0,        "protocol": "string",        "timeout": "2s",        "tls_server_name": "string",        "tls_skip_verify": true,        "type": "string"      }    },    "containers": [      {        "cmd": [          "string"        ],        "depends_on": [          {            "condition": {},            "name": "string"          }        ],        "entrypoint": [          "string"        ],        "env": {          "property1": "string",          "property2": "string"        },        "env_from": [          {            "env_var": "string",            "field_ref": "id"          }        ],        "exec": [          "string"        ],        "files": [          {            "guest_path": "string",            "image_config": "string",            "mode": 0,            "raw_value": "string",            "secret_name": "string"          }        ],        "healthchecks": [          {            "exec": {              "command": [                "string"              ]            },            "failure_threshold": 0,            "grace_period": 0,            "http": {              "headers": [                {                  "name": "string",                  "values": [                    "string"                  ]                }              ],              "method": "string",              "path": "string",              "port": 0,              "scheme": {},              "tls_server_name": "string",              "tls_skip_verify": true            },            "interval": 0,            "kind": {},            "name": "string",            "success_threshold": 0,            "tcp": {              "port": 0            },            "timeout": 0,            "unhealthy": {}          }        ],        "image": "string",        "name": "string",        "restart": {          "gpu_bid_price": 0,          "max_retries": 0,          "policy": "no"        },        "secrets": [          {            "env_var": "string",            "name": "string"          }        ],        "stop": {          "signal": "SIGHUP",          "timeout": "10s"        },        "user": "string"      }    ],    "disable_machine_autostart": true,    "dns": {      "dns_forward_rules": [        {          "addr": "string",          "basename": "string"        }      ],      "hostname": "string",      "hostname_fqdn": "string",      "nameservers": [        "string"      ],      "options": [        {          "name": "string",          "value": "string"        }      ],      "searches": [        "string"      ],      "skip_registration": true    },    "env": {      "property1": "string",      "property2": "string"    },    "files": [      {        "guest_path": "string",        "image_config": "string",        "mode": 0,        "raw_value": "string",        "secret_name": "string"      }    ],    "guest": {      "cpu_kind": "string",      "cpus": 0,      "gpu_kind": "string",      "gpus": 0,      "host_dedication_id": "string",      "kernel_args": [        "string"      ],      "max_memory_mb": 0,      "memory_mb": 0,      "persist_rootfs": "never"    },    "image": "string",    "init": {      "cmd": [        "string"      ],      "entrypoint": [        "string"      ],      "exec": [        "string"      ],      "kernel_args": [        "string"      ],      "swap_size_mb": 0,      "tty": true    },    "metadata": {      "property1": "string",      "property2": "string"    },    "metrics": {      "https": true,      "path": "string",      "port": 0    },    "mounts": [      {        "add_size_gb": 0,        "encrypted": true,        "extend_threshold_percent": 0,        "name": "string",        "path": "string",        "size_gb": 0,        "size_gb_limit": 0,        "volume": "string"      }    ],    "processes": [      {        "cmd": [          "string"        ],        "entrypoint": [          "string"        ],        "env": {          "property1": "string",          "property2": "string"        },        "env_from": [          {            "env_var": "string",            "field_ref": "id"          }        ],        "exec": [          "string"        ],        "ignore_app_secrets": true,        "secrets": [          {            "env_var": "string",            "name": "string"          }        ],        "user": "string"      }    ],    "restart": {      "gpu_bid_price": 0,      "max_retries": 0,      "policy": "no"    },    "rootfs": {      "persist": "never",      "size_gb": 0    },    "schedule": "string",    "services": [      {        "autostart": true,        "autostop": "off",        "checks": [          {            "grace_period": "1s",            "headers": [              {                "name": "string",                "values": [                  "string"                ]              }            ],            "interval": "15s",            "method": "string",            "path": "string",            "port": 0,            "protocol": "string",            "timeout": "2s",            "tls_server_name": "string",            "tls_skip_verify": true,            "type": "string"          }        ],        "concurrency": {          "hard_limit": 0,          "soft_limit": 0,          "type": "string"        },        "force_instance_description": "string",        "force_instance_key": "string",        "internal_port": 0,        "min_machines_running": 0,        "ports": [          {            "end_port": 0,            "force_https": true,            "handlers": [              "string"            ],            "http_options": {              "compress": true,              "h2_backend": true,              "headers_read_timeout": 0,              "idle_timeout": 0,              "replay_cache": [                {                  "allow_bypass": true,                  "name": "string",                  "path_prefix": "string",                  "ttl_seconds": 0,                  "type": "cookie"                }              ],              "response": {                "headers": {                  "property1": {},                  "property2": {}                },                "pristine": true              }            },            "port": 0,            "proxy_proto_options": {              "version": "string"            },            "start_port": 0,            "tls_options": {              "alpn": [                "string"              ],              "default_self_signed": true,              "versions": [                "string"              ]            }          }        ],        "protocol": "string"      }    ],    "size": "string",    "spot": {      "max_price_fraction": 0    },    "standbys": [      "string"    ],    "statics": [      {        "guest_path": "string",        "index_document": "string",        "tigris_bucket": "string",        "url_prefix": "string"      }    ],    "stop_config": {      "signal": "SIGHUP",      "timeout": "10s"    }  },  "cordoned": true,  "created_at": "string",  "events": [    {      "id": "string",      "request": {},      "source": "string",      "status": "string",      "timestamp": 0,      "type": "string"    }  ],  "host_status": "ok",  "id": "string",  "image_ref": {    "digest": "string",    "labels": {      "property1": "string",      "property2": "string"    },    "registry": "string",    "repository": "string",    "tag": "string"  },  "incomplete_config": {    "auto_destroy": true,    "cache_drive": {      "size_mb": 0    },    "checks": {      "property1": {        "grace_period": "1s",        "headers": [          {            "name": "string",            "values": [              "string"            ]          }        ],        "interval": "15s",        "kind": "informational",        "method": "string",        "path": "string",        "port": 0,        "protocol": "string",        "timeout": "2s",        "tls_server_name": "string",        "tls_skip_verify": true,        "type": "string"      },      "property2": {        "grace_period": "1s",        "headers": [          {            "name": "string",            "values": [              "string"            ]          }        ],        "interval": "15s",        "kind": "informational",        "method": "string",        "path": "string",        "port": 0,        "protocol": "string",        "timeout": "2s",        "tls_server_name": "string",        "tls_skip_verify": true,        "type": "string"      }    },    "containers": [      {        "cmd": [          "string"        ],        "depends_on": [          {            "condition": {},            "name": "string"          }        ],        "entrypoint": [          "string"        ],        "env": {          "property1": "string",          "property2": "string"        },        "env_from": [          {            "env_var": "string",            "field_ref": "id"          }        ],        "exec": [          "string"        ],        "files": [          {            "guest_path": "string",            "image_config": "string",            "mode": 0,            "raw_value": "string",            "secret_name": "string"          }        ],        "healthchecks": [          {            "exec": {              "command": [                "string"              ]            },            "failure_threshold": 0,            "grace_period": 0,            "http": {              "headers": [                {                  "name": "string",                  "values": [                    "string"                  ]                }              ],              "method": "string",              "path": "string",              "port": 0,              "scheme": {},              "tls_server_name": "string",              "tls_skip_verify": true            },            "interval": 0,            "kind": {},            "name": "string",            "success_threshold": 0,            "tcp": {              "port": 0            },            "timeout": 0,            "unhealthy": {}          }        ],        "image": "string",        "name": "string",        "restart": {          "gpu_bid_price": 0,          "max_retries": 0,          "policy": "no"        },        "secrets": [          {            "env_var": "string",            "name": "string"          }        ],        "stop": {          "signal": "SIGHUP",          "timeout": "10s"        },        "user": "string"      }    ],    "disable_machine_autostart": true,    "dns": {      "dns_forward_rules": [        {          "addr": "string",          "basename": "string"        }      ],      "hostname": "string",      "hostname_fqdn": "string",      "nameservers": [        "string"      ],      "options": [        {          "name": "string",          "value": "string"        }      ],      "searches": [        "string"      ],      "skip_registration": true    },    "env": {      "property1": "string",      "property2": "string"    },    "files": [      {        "guest_path": "string",        "image_config": "string",        "mode": 0,        "raw_value": "string",        "secret_name": "string"      }    ],    "guest": {      "cpu_kind": "string",      "cpus": 0,      "gpu_kind": "string",      "gpus": 0,      "host_dedication_id": "string",      "kernel_args": [        "string"      ],      "max_memory_mb": 0,      "memory_mb": 0,      "persist_rootfs": "never"    },    "image": "string",    "init": {      "cmd": [        "string"      ],      "entrypoint": [        "string"      ],      "exec": [        "string"      ],      "kernel_args": [        "string"      ],      "swap_size_mb": 0,      "tty": true    },    "metadata": {      "property1": "string",      "property2": "string"    },    "metrics": {      "https": true,      "path": "string",      "port": 0    },    "mounts": [      {        "add_size_gb": 0,        "encrypted": true,        "extend_threshold_percent": 0,        "name": "string",        "path": "string",        "size_gb": 0,        "size_gb_limit": 0,        "volume": "string"      }    ],    "processes": [      {        "cmd": [          "string"        ],        "entrypoint": [          "string"        ],        "env": {          "property1": "string",          "property2": "string"        },        "env_from": [          {            "env_var": "string",            "field_ref": "id"          }        ],        "exec": [          "string"        ],        "ignore_app_secrets": true,        "secrets": [          {            "env_var": "string",            "name": "string"          }        ],        "user": "string"      }    ],    "restart": {      "gpu_bid_price": 0,      "max_retries": 0,      "policy": "no"    },    "rootfs": {      "persist": "never",      "size_gb": 0    },    "schedule": "string",    "services": [      {        "autostart": true,        "autostop": "off",        "checks": [          {            "grace_period": "1s",            "headers": [              {                "name": "string",                "values": [                  "string"                ]              }            ],            "interval": "15s",            "method": "string",            "path": "string",            "port": 0,            "protocol": "string",            "timeout": "2s",            "tls_server_name": "string",            "tls_skip_verify": true,            "type": "string"          }        ],        "concurrency": {          "hard_limit": 0,          "soft_limit": 0,          "type": "string"        },        "force_instance_description": "string",        "force_instance_key": "string",        "internal_port": 0,        "min_machines_running": 0,        "ports": [          {            "end_port": 0,            "force_https": true,            "handlers": [              "string"            ],            "http_options": {              "compress": true,              "h2_backend": true,              "headers_read_timeout": 0,              "idle_timeout": 0,              "replay_cache": [                {                  "allow_bypass": true,                  "name": "string",                  "path_prefix": "string",                  "ttl_seconds": 0,                  "type": "cookie"                }              ],              "response": {                "headers": {                  "property1": {},                  "property2": {}                },                "pristine": true              }            },            "port": 0,            "proxy_proto_options": {              "version": "string"            },            "start_port": 0,            "tls_options": {              "alpn": [                "string"              ],              "default_self_signed": true,              "versions": [                "string"              ]            }          }        ],        "protocol": "string"      }    ],    "size": "string",    "spot": {      "max_price_fraction": 0    },    "standbys": [      "string"    ],    "statics": [      {        "guest_path": "string",        "index_document": "string",        "tigris_bucket": "string",        "url_prefix": "string"      }    ],    "stop_config": {      "signal": "SIGHUP",      "timeout": "10s"    }  },  "instance_id": "string",  "lease": {    "description": "string",    "expires_at": 0,    "owner": "string"  },  "name": "string",  "nonce": "string",  "private_ip": "string",  "region": "string",  "state": "string",  "updated_at": "string"}
{  "details": {},  "error": "string",  "status": "unknown"}