440 lines
12 KiB
JSON
440 lines
12 KiB
JSON
{
|
|
"components": {
|
|
"responses": {
|
|
"Error": {
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/Error"
|
|
}
|
|
}
|
|
},
|
|
"description": "Error"
|
|
}
|
|
},
|
|
"schemas": {
|
|
"Error": {
|
|
"description": "Error information from a response.",
|
|
"properties": {
|
|
"error_code": {
|
|
"type": "string"
|
|
},
|
|
"message": {
|
|
"type": "string"
|
|
},
|
|
"request_id": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"message",
|
|
"request_id"
|
|
],
|
|
"type": "object"
|
|
},
|
|
"ExtraMachineInfoResponse": {
|
|
"description": "Extra machine-specific information regarding a connected machine.",
|
|
"oneOf": [
|
|
{
|
|
"additionalProperties": false,
|
|
"properties": {
|
|
"Moonraker": {
|
|
"type": "object"
|
|
}
|
|
},
|
|
"required": [
|
|
"Moonraker"
|
|
],
|
|
"type": "object"
|
|
},
|
|
{
|
|
"additionalProperties": false,
|
|
"properties": {
|
|
"Usb": {
|
|
"type": "object"
|
|
}
|
|
},
|
|
"required": [
|
|
"Usb"
|
|
],
|
|
"type": "object"
|
|
},
|
|
{
|
|
"additionalProperties": false,
|
|
"properties": {
|
|
"Bambu": {
|
|
"type": "object"
|
|
}
|
|
},
|
|
"required": [
|
|
"Bambu"
|
|
],
|
|
"type": "object"
|
|
}
|
|
]
|
|
},
|
|
"MachineInfoResponse": {
|
|
"description": "Information regarding a connected machine.",
|
|
"properties": {
|
|
"extra": {
|
|
"allOf": [
|
|
{
|
|
"$ref": "#/components/schemas/ExtraMachineInfoResponse"
|
|
}
|
|
],
|
|
"description": "Additional, per-machine information which is specific to the underlying machine type.",
|
|
"nullable": true
|
|
},
|
|
"id": {
|
|
"description": "Machine Identifier (ID) for the specific Machine.",
|
|
"type": "string"
|
|
},
|
|
"machine_type": {
|
|
"allOf": [
|
|
{
|
|
"$ref": "#/components/schemas/MachineType"
|
|
}
|
|
],
|
|
"description": "Information regarding the method of manufacture."
|
|
},
|
|
"make_model": {
|
|
"allOf": [
|
|
{
|
|
"$ref": "#/components/schemas/MachineMakeModel"
|
|
}
|
|
],
|
|
"description": "Information regarding the make and model of the attached Machine."
|
|
},
|
|
"max_part_volume": {
|
|
"allOf": [
|
|
{
|
|
"$ref": "#/components/schemas/Volume"
|
|
}
|
|
],
|
|
"description": "Maximum part size that can be manufactured by this device. This may be some sort of theoretical upper bound, getting close to this limit seems like maybe a bad idea.\n\nThis may be `None` if the maximum size is not knowable by the Machine API.\n\nWhat \"close\" means is up to you!",
|
|
"nullable": true
|
|
}
|
|
},
|
|
"required": [
|
|
"id",
|
|
"machine_type",
|
|
"make_model"
|
|
],
|
|
"type": "object"
|
|
},
|
|
"MachineMakeModel": {
|
|
"description": "Information regarding the make/model of a discovered endpoint.",
|
|
"properties": {
|
|
"manufacturer": {
|
|
"description": "The manufacturer that built the connected Machine.",
|
|
"nullable": true,
|
|
"type": "string"
|
|
},
|
|
"model": {
|
|
"description": "The model of the connected Machine.",
|
|
"nullable": true,
|
|
"type": "string"
|
|
},
|
|
"serial": {
|
|
"description": "The unique serial number of the connected Machine.",
|
|
"nullable": true,
|
|
"type": "string"
|
|
}
|
|
},
|
|
"type": "object"
|
|
},
|
|
"MachineType": {
|
|
"description": "Specific technique by which this Machine takes a design, and produces a real-world 3D object.",
|
|
"oneOf": [
|
|
{
|
|
"description": "Use light to cure a resin to build up layers.",
|
|
"enum": [
|
|
"Stereolithography"
|
|
],
|
|
"type": "string"
|
|
},
|
|
{
|
|
"description": "Fused Deposition Modeling, layers of melted plastic.",
|
|
"enum": [
|
|
"FusedDeposition"
|
|
],
|
|
"type": "string"
|
|
},
|
|
{
|
|
"description": "\"Computer numerical control\" - machine that grinds away material from a hunk of material to construct a part.",
|
|
"enum": [
|
|
"Cnc"
|
|
],
|
|
"type": "string"
|
|
}
|
|
]
|
|
},
|
|
"Pong": {
|
|
"description": "The response from the `/ping` endpoint.",
|
|
"properties": {
|
|
"message": {
|
|
"description": "The pong response.",
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"message"
|
|
],
|
|
"type": "object"
|
|
},
|
|
"PrintJobResponse": {
|
|
"description": "The response from the `/print` endpoint.",
|
|
"properties": {
|
|
"job_id": {
|
|
"description": "The job id used for this print.",
|
|
"type": "string"
|
|
},
|
|
"parameters": {
|
|
"allOf": [
|
|
{
|
|
"$ref": "#/components/schemas/PrintParameters"
|
|
}
|
|
],
|
|
"description": "The parameters used for this print."
|
|
}
|
|
},
|
|
"required": [
|
|
"job_id",
|
|
"parameters"
|
|
],
|
|
"type": "object"
|
|
},
|
|
"PrintParameters": {
|
|
"description": "Parameters for printing.",
|
|
"properties": {
|
|
"job_name": {
|
|
"description": "The name for the job.",
|
|
"type": "string"
|
|
},
|
|
"machine_id": {
|
|
"description": "The machine id to print to.",
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"job_name",
|
|
"machine_id"
|
|
],
|
|
"type": "object"
|
|
},
|
|
"Volume": {
|
|
"description": "Set of three values to represent the extent of a 3-D Volume. This contains the width, depth, and height values, generally used to represent some maximum or minimum.\n\nAll measurements are in millimeters.",
|
|
"properties": {
|
|
"depth": {
|
|
"description": "Depth of the volume (\"front to back\"), in millimeters.",
|
|
"format": "double",
|
|
"type": "number"
|
|
},
|
|
"height": {
|
|
"description": "Height of the volume (\"up and down\"), in millimeters.",
|
|
"format": "double",
|
|
"type": "number"
|
|
},
|
|
"width": {
|
|
"description": "Width of the volume (\"left and right\"), in millimeters.",
|
|
"format": "double",
|
|
"type": "number"
|
|
}
|
|
},
|
|
"required": [
|
|
"depth",
|
|
"height",
|
|
"width"
|
|
],
|
|
"type": "object"
|
|
}
|
|
}
|
|
},
|
|
"info": {
|
|
"contact": {
|
|
"email": "machine-api@zoo.dev",
|
|
"url": "https://zoo.dev"
|
|
},
|
|
"description": "",
|
|
"title": "machine-api",
|
|
"version": "0.1.0"
|
|
},
|
|
"openapi": "3.0.3",
|
|
"paths": {
|
|
"/": {
|
|
"get": {
|
|
"operationId": "api_get_schema",
|
|
"responses": {
|
|
"200": {
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {}
|
|
}
|
|
},
|
|
"description": "successful operation"
|
|
},
|
|
"4XX": {
|
|
"$ref": "#/components/responses/Error"
|
|
},
|
|
"5XX": {
|
|
"$ref": "#/components/responses/Error"
|
|
}
|
|
},
|
|
"summary": "Return the OpenAPI schema in JSON format.",
|
|
"tags": [
|
|
"meta"
|
|
]
|
|
}
|
|
},
|
|
"/machines": {
|
|
"get": {
|
|
"operationId": "get_machines",
|
|
"responses": {
|
|
"200": {
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"items": {
|
|
"$ref": "#/components/schemas/MachineInfoResponse"
|
|
},
|
|
"title": "Array_of_MachineInfoResponse",
|
|
"type": "array"
|
|
}
|
|
}
|
|
},
|
|
"description": "successful operation"
|
|
},
|
|
"4XX": {
|
|
"$ref": "#/components/responses/Error"
|
|
},
|
|
"5XX": {
|
|
"$ref": "#/components/responses/Error"
|
|
}
|
|
},
|
|
"summary": "List available machines and their statuses",
|
|
"tags": [
|
|
"machines"
|
|
]
|
|
}
|
|
},
|
|
"/machines/{id}": {
|
|
"get": {
|
|
"operationId": "get_machine",
|
|
"parameters": [
|
|
{
|
|
"description": "The machine ID.",
|
|
"in": "path",
|
|
"name": "id",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/MachineInfoResponse"
|
|
}
|
|
}
|
|
},
|
|
"description": "successful operation"
|
|
},
|
|
"4XX": {
|
|
"$ref": "#/components/responses/Error"
|
|
},
|
|
"5XX": {
|
|
"$ref": "#/components/responses/Error"
|
|
}
|
|
},
|
|
"summary": "Get the status of a specific machine",
|
|
"tags": [
|
|
"machines"
|
|
]
|
|
}
|
|
},
|
|
"/ping": {
|
|
"get": {
|
|
"operationId": "ping",
|
|
"responses": {
|
|
"200": {
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/Pong"
|
|
}
|
|
}
|
|
},
|
|
"description": "successful operation"
|
|
},
|
|
"4XX": {
|
|
"$ref": "#/components/responses/Error"
|
|
},
|
|
"5XX": {
|
|
"$ref": "#/components/responses/Error"
|
|
}
|
|
},
|
|
"summary": "Return pong.",
|
|
"tags": [
|
|
"meta"
|
|
]
|
|
}
|
|
},
|
|
"/print": {
|
|
"post": {
|
|
"operationId": "print_file",
|
|
"requestBody": {
|
|
"content": {
|
|
"multipart/form-data": {
|
|
"schema": {
|
|
"format": "binary",
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"required": true
|
|
},
|
|
"responses": {
|
|
"200": {
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/PrintJobResponse"
|
|
}
|
|
}
|
|
},
|
|
"description": "successful operation"
|
|
},
|
|
"4XX": {
|
|
"$ref": "#/components/responses/Error"
|
|
},
|
|
"5XX": {
|
|
"$ref": "#/components/responses/Error"
|
|
}
|
|
},
|
|
"summary": "Print a given file. File must be a sliceable 3D model.",
|
|
"tags": [
|
|
"machines"
|
|
]
|
|
}
|
|
}
|
|
},
|
|
"tags": [
|
|
{
|
|
"description": "Utilities for making parts and discovering machines.",
|
|
"externalDocs": {
|
|
"url": "https://docs.zoo.dev/api/machines"
|
|
},
|
|
"name": "machines"
|
|
},
|
|
{
|
|
"description": "Meta information about the API.",
|
|
"externalDocs": {
|
|
"url": "https://docs.zoo.dev/api/meta"
|
|
},
|
|
"name": "meta"
|
|
}
|
|
]
|
|
} |