Skip to content

Device

Represents a physical machine or facility.

Field Type Required Description
name string Yes Short, unique name (e.g. mast, mastu). Stored lower-cased, so /devices/MAST and /devices/mast resolve the same device
title string No Display name, e.g. MAST Upgrade for the device named mastu. Clients show this in preference to name
description string No Extended description
type string No Machine type (tokamak, stellarator, …)
publisher string No Institution making the device catalog available (dct:publisher)
creator string No Person or team responsible for the device (dct:creator)
access_level enum No Default access level inherited by Shots and Datasets

Register one with a POST (see Access Control → Authentication for TOKEN):

curl -X POST "$API/devices/" \
  -H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" \
  -d '{"name": "mast", "title": "MAST", "type": "tokamak",
       "description": "Spherical tokamak experiment at UKAEA Culham, studying plasma confinement at low aspect ratio.",
       "access_level": "public"}'
requests.post(
    f"{API}/devices/",
    headers=headers,
    json={
        "name": "mast",
        "title": "MAST",
        "type": "tokamak",
        "description": "Spherical tokamak experiment at UKAEA Culham, studying plasma confinement at low aspect ratio.",
        "access_level": "public",
    },
).raise_for_status()
httpx.post(
    f"{API}/devices/",
    headers=headers,
    json={
        "name": "mast",
        "title": "MAST",
        "type": "tokamak",
        "description": "Spherical tokamak experiment at UKAEA Culham, studying plasma confinement at low aspect ratio.",
        "access_level": "public",
    },
).raise_for_status()
await fetch(`${API}/devices/`, {
  method: "POST",
  headers: { Authorization: `Bearer ${TOKEN}`, "Content-Type": "application/json" },
  body: JSON.stringify({
    name: "mast",
    title: "MAST",
    type: "tokamak",
    description: "Spherical tokamak experiment at UKAEA Culham, studying plasma confinement at low aspect ratio.",
    access_level: "public",
  }),
});