Updating a machine via API does not return mounts

Hi, I’m attempting to update a machine configuration with the machines API. I have a machine with an attached volume, and I’m sending a variation of the following request (including the mounts with the correct volume/name/region leads to an “error”: “invalid_argument: unable to add volume after machine is created”).

{
		"region": "cdg",
		"config": {
				"image": "registry-1.docker.io/library/ubuntu:latest",
				"guest": {
				     "cpu_kind": "shared",
				     "cpus": 1,
				     "memory_mb": 512,
				}
		}
}

The machine is being updated properly, but the object being returned does not have any mention of the attached volume (result below).

{
	"id": "*******",
	"name": "test1",
	"state": "created",
	"region": "ams",
	"instance_id": "*******",
	"private_ip": "*******",
	"config": {
		"init": {},
		"guest": {
			"cpu_kind": "shared",
			"cpus": 1,
			"memory_mb": 512
		},
		"image": "registry-1.docker.io/library/ubuntu:latest",
		"restart": {}
	},
	"image_ref": {
		"registry": "registry-1.docker.io",
		"repository": "library/ubuntu",
		"tag": "latest",
		"digest": "sha256:bbf3d1baa208b7649d1d0264ef7d522e1dc0deeeaaf6085bf8e4618867f03494",
		"labels": {
			"org.opencontainers.image.ref.name": "ubuntu",
			"org.opencontainers.image.version": "22.04"
		}
	},
	"created_at": "2024-01-11T08:46:29Z",
	"updated_at": "2024-01-11T08:48:59Z",
	"events": [
		{
			"id": "01HKVVBPBT55HY0FAP7HNAWTCH",
			"type": "launch",
			"status": "created",
			"source": "user",
			"timestamp": 1704962939258
		}
	]
}

Interestingly, after creating a machine (we’ll call this machine A) and making a GET call to the https://api.machines.dev/v1/apps/app_name/machines/ endpoint (which essentially returns a list of all the machines in the app), the mounts object is present in the object representing A. After attempting to update A, the same GET call returns an object representing A without its mount.

This behavior is quite odd to me — I’ve taken a look at the docs and API spec and haven’t found anything referencing it, although I might be missing something. Any guidance would be much appreciated.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.