Skip to content

Resources

The unified inventory: every VM on every connection in one shape, whether Mayadyn created it or a sync found it. Today the only kind is vm. App host VMs appear here too (label mayadyn-app).

VM state values: provisioning, starting, running, stopping, stopped, terminating, terminated, error, unknown.

List VMs, newest first.

Auth: scope read. Project tokens see their project’s only.

Query parameters (all optional, exact match, combined with AND)

Name Description
provider oci, gcp
region e.g. me-jeddah-1
state e.g. running
connection connection id or name (unknown: 404)

Response 200:

{"items": [
{
"id": "3e4f5a6b-7c8d-4e9f-a0b1-c2d3e4f5a6b7",
"kind": "vm",
"project_id": "0c9d8e7f-1a2b-4c3d-8e5f-6a7b8c9d0e1f",
"connection_id": "9a7b6c5d-4e3f-4a2b-9c1d-0e8f7a6b5c4d",
"connection_name": "oci-jeddah",
"provider": "oci",
"provider_id": "ocid1.instance.oc1.me-jeddah-1.anqxkljr...",
"region": "me-jeddah-1",
"name": "web-1",
"state": "running",
"size": "VM.Standard.E4.Flex",
"image": "ubuntu-24.04",
"public_ip": "203.0.113.10",
"private_ip": "10.77.0.12",
"ssh_user": "ubuntu",
"labels": {"env": "staging", "managed-by": "mayadyn", "mayadyn-operation": "5d6e7f80-9a1b-4c2d-8e3f-4a5b6c7d8e9f"},
"created_at": "2026-11-30T09:12:44.512Z",
"updated_at": "2026-11-30T09:14:02.700Z"
}
]}

Fields: Resource. size and image hold the requested value until the cloud reports its own (often the native shape). detail (provider-specific, shown as-is) and synced_at (last time Mayadyn read its state from the cloud, by an operation or a sync) appear when set. provider_id is missing until the cloud has created the VM. On GCP provider_id is <zone>/<instance name>.

Terminal window
curl -s "$MAYADYN/v1/resources?connection=oci-jeddah&state=running" -H "Authorization: Bearer $TOKEN"

Get one VM, including IPs and the SSH user.

Auth: scope read.

Param In Description
id path resource UUID

Response 200 (Resource). Errors: 404 “resource not found” (malformed id: “id not found”).

Terminal window
curl -s "$MAYADYN/v1/resources/3e4f5a6b-7c8d-4e9f-a0b1-c2d3e4f5a6b7" -H "Authorization: Bearer $TOKEN"