WIP: add settings endpoint

This commit is contained in:
Wlad 2020-10-30 23:37:31 +01:00
parent 8f75b74af1
commit f156793e1b
8 changed files with 87 additions and 6 deletions

12
TODO.md
View File

@ -54,7 +54,7 @@
- [x] Model: Temperature State
- [x] Model: SD State
- [x] Model: Arbitrary Command Request
- [ ] Printer profile operations [link](https://docs.octoprint.org/en/master/api/printerprofiles.html)
- [x] Printer profile operations [link](https://docs.octoprint.org/en/master/api/printerprofiles.html)
- [x] Retrieve all printer profiles
- [x] Retrieve a single printer profile
- [x] Add a new printer profile
@ -63,11 +63,11 @@
- [x] Model: Profile list
- [x] Model: Add or update request
- [x] Model: Profile
- [ ] Settings [link](https://docs.octoprint.org/en/master/api/settings.html)
- [ ] Retrieve current settings
- [ ] Save settings
- [ ] Regenerate the system wide API key
- [ ] Fetch template data
- [x] Settings [link](https://docs.octoprint.org/en/master/api/settings.html)
- [x] Retrieve current settings
- [x] Save settings
- [x] Regenerate the system wide API key
- [x] Fetch template data
- [ ] Model: Config
- [ ] Slicing TBD [link](https://docs.octoprint.org/en/master/api/slicing.html)
- [ ] System [link](https://docs.octoprint.org/en/master/api/system.html)

View File

@ -0,0 +1,4 @@
type: object
description: >-
OctoPrint config (Work in Progress)
additionalProperties: true

View File

@ -0,0 +1,6 @@
type: object
required:
- id
- name
properties:
additionProperties: true

View File

@ -0,0 +1,13 @@
type: object
required:
- id
- name
properties:
id:
type: string
name:
type: string
plugin_id:
type: string
plugin_name:
type: string

View File

@ -0,0 +1,13 @@
summary: Regenerate the system wide API key
operation: regenerateApiKey
description: >-
Generates a new system wide API key.
Does not expect a body. Will return the generated API key as apikey property in the JSON object contained in the response body.
responses:
"200":
description: >-
ApiKey was regenerated
"403":
description: >-
No admin rights

View File

@ -0,0 +1,12 @@
summary: Retrieve current settings
operation: getSettings
description: >-
Retrieves the current configuration of OctoPrint.
responses:
"200":
description: >-
Current OctoPrint state
content:
application/json:
schema:
$ref: ../../components/schemas/Config.yaml

View File

@ -0,0 +1,19 @@
summary: Update Settings
operation: updateSettings
description: >-
Saves the provided settings in OctoPrint.
Expects a JSON object with the settings to change as request body. This can be either a full settings tree, or only a partial tree containing only those fields that should be updated.
requestBody:
content:
application/json:
schema:
$ref: ../../components/schemas/Config.yaml
responses:
"200":
description: >-
Current OctoPrint state
content:
application/json:
schema:
$ref: ../../components/schemas/Config.yaml

View File

@ -0,0 +1,14 @@
summary: Fetch template data
operation: getTemplates
description: >-
Fetch data (currently only the sorting order) of all registered template components in the system.
Use this to get a full list of the identifiers of all UI components provided either by core OctoPrint or any currently active plugins.
responses:
"200":
description: >-
Current OctoPrint state
content:
application/json:
schema:
$ref: ../../components/schemas/Templates.yaml