Equipment
Model
- class pytm4srv.models.Equipment
Represents a piece of non-machine equipment or a subsystem present on a machine.
- description: Mapped[str]
User-specified, persistent description/notes about the equipment.
- id: MappedColumn object at 0x7b55cc329c60>]]
Unique, numeric ID for the equipment in OnTakt.
- machine_id: Mapped[int | None]
The ID of the machine this equipment (subsystem) belongs to, or
NULL
if it is standalone.
- name: Mapped[str]
User-specified name for the equipment.
Endpoints
- GET /api/equipment/
Get all currently registered pieces of equipment.
- Query Parameters:
machine (int) – specify to get equipment (subsystems) belonging to a single machine. Set to
0
to get only standalone equipment (does not belong to a machine).
- Returns:
an object mapping equipment ID to Equipment object
- GET /api/equipment/(int: equipment_id)
Get details about a single piece of equipment.
- Parameters:
equipment_id – the ID of the equipment
- Status Codes:
404 Not Found – if the equipment does not exist
- Returns:
an Equipment object
- PUT /api/equipment/
Create a new piece of equipment. Any Equipment object fields can be provided, but the
name
field is required.- Request JSON Object:
name (str) – the name for the new equipment
- Status Codes:
201 Created – on success
400 Bad Request – if the
name
parameter is missing
- Returns:
the new Equipment object
- PATCH /api/equipment/(int: equipment_id)
Edit a piece of equipment.
- Parameters:
equipment_id – the ID of the Equipment object to modify
- Status Codes:
404 Not Found – if the equipment ID does not exist
- Returns:
the modified Equipment object
- DELETE /api/equipment/(int: equipment_id)
Delete a piece of equipment.
- Parameters:
equipment_id – the ID of the Equipment object to delete
- Status Codes:
404 Not Found – if the equipment ID does not exist
204 No Content – on success