diff --git a/TODO.md b/TODO.md index 673ad39..59925a8 100644 --- a/TODO.md +++ b/TODO.md @@ -38,7 +38,7 @@ - [ ] Model: File information - [ ] Model: References - [ ] Printer operations [link](https://docs.octoprint.org/en/master/api/printer.html) - - [ ] Retrieve the current printer state + - [x] Retrieve the current printer state - [ ] Issue a print head command - [ ] Issue a tool command - [ ] Retrieve the current tool state diff --git a/openapi/openapi.yaml b/openapi/openapi.yaml index 9a70ec1..eb268b2 100644 --- a/openapi/openapi.yaml +++ b/openapi/openapi.yaml @@ -19,8 +19,7 @@ paths: $ref: paths/version.yaml /connection: $ref: paths/connection.yaml - /printer: - $ref: paths/printer.yaml + /files/{location}: get: $ref: paths/files/{location}/get.yaml @@ -39,5 +38,8 @@ paths: $ref: paths/job/get.yaml post: $ref: paths/job/post.yaml + /printer: + get: + $ref: paths/printer/get.yaml /printer/tool: $ref: paths/printer@tool.yaml diff --git a/openapi/paths/printer.yaml b/openapi/paths/printer.yaml deleted file mode 100644 index cada1fd..0000000 --- a/openapi/paths/printer.yaml +++ /dev/null @@ -1,7 +0,0 @@ -get: - summary: Printer State - description: Retrieves the current state of the printer. - operationId: getPrinterState - responses: - "200": - description: Current Printer state. diff --git a/openapi/paths/printer/bed-get.yaml b/openapi/paths/printer/bed-get.yaml new file mode 100644 index 0000000..e69de29 diff --git a/openapi/paths/printer/bed-post.yaml b/openapi/paths/printer/bed-post.yaml new file mode 100644 index 0000000..e69de29 diff --git a/openapi/paths/printer/chamber-get.yaml b/openapi/paths/printer/chamber-get.yaml new file mode 100644 index 0000000..e69de29 diff --git a/openapi/paths/printer/chamber-post.yaml b/openapi/paths/printer/chamber-post.yaml new file mode 100644 index 0000000..e69de29 diff --git a/openapi/paths/printer/get.yaml b/openapi/paths/printer/get.yaml new file mode 100644 index 0000000..13069c6 --- /dev/null +++ b/openapi/paths/printer/get.yaml @@ -0,0 +1,36 @@ +summary: Printer State +description: Retrieves the current state of the printer. +operationId: getPrinterState +parameters: + - in: query + name: exclude + schema: + type: string + enum: + - temperature + - sd + - state + description: >- + An optional comma-separated list of fields to exclude from the response (e.g. if not needed by the client). Valid values to supply here are temperature, sd and state. + - in: query + name: history + schema: + type: string + enum: + - yes + - y + - "1" + description: >- + If set to true (or: yes, y, 1), history information will be included in the response too. If no limit parameter is given, all available temperature history data will be returned. + - in: query + name: limit + schema: + type: integer + description: >- + If set to an integer (n), only the last n data points from the printer’s temperature history will be returned. Will be ignored if history is not enabled. + +responses: + "200": + description: Current Printer state. + "409": + description: If the printer is not operational. diff --git a/openapi/paths/printer/printhead-post.yaml b/openapi/paths/printer/printhead-post.yaml new file mode 100644 index 0000000..e69de29 diff --git a/openapi/paths/printer/tool-get.yaml b/openapi/paths/printer/tool-get.yaml new file mode 100644 index 0000000..e69de29 diff --git a/openapi/paths/printer/tool-post.yaml b/openapi/paths/printer/tool-post.yaml new file mode 100644 index 0000000..e69de29