Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
25dc81a5d2 | ||
|
|
9e27744a05 | ||
|
|
77df620237 | ||
|
|
a0a6f958d9 | ||
|
|
16d156b530 | ||
|
|
420226b6c0 | ||
|
|
da8e72b0d6 | ||
|
|
ef13cbecfd | ||
|
|
5910bba30e | ||
|
|
19ba3b1f99 | ||
|
|
23bc6b8df7 | ||
|
|
69bea0f5b0 | ||
|
|
3c53394f4b | ||
|
|
8741053dfc | ||
|
|
8752f70ff3 | ||
|
|
2b66df39b6 | ||
|
|
17bb0e693d | ||
|
|
94e5b5fdaf | ||
|
|
497ec5c6b2 | ||
|
|
eaeae8d5ec | ||
|
|
3a05a2653b | ||
|
|
0ca63017c7 | ||
|
|
ea3416693c | ||
|
|
6dc56af3fa | ||
|
|
af297c2031 | ||
|
|
024cf81238 | ||
|
|
9d5a500b25 | ||
|
|
4bab1975c8 | ||
|
|
eae4153158 | ||
|
|
a92aa96623 | ||
|
|
ccf0ab3b51 | ||
|
|
7259c1c2ef | ||
|
|
d66675c672 | ||
|
|
38483b0c67 | ||
|
|
19de4053fe | ||
|
|
d0ff6d1579 | ||
|
|
105b68c807 | ||
|
|
97a6d8a15e | ||
|
|
26fa3df4aa | ||
|
|
9a336336d7 | ||
|
|
047d7f5046 | ||
|
|
4fc561dab5 | ||
|
|
785ac07de9 | ||
|
|
41c6978880 | ||
|
|
f7ebc4ec11 | ||
|
|
c06e8f47f0 | ||
|
|
dceb5dccd3 | ||
|
|
7a50138ae3 | ||
|
|
43cead8249 | ||
|
|
8492944fb5 | ||
|
|
f7433de2bf | ||
|
|
bbd46fd3a6 | ||
|
|
077486c838 | ||
|
|
baedab5931 | ||
|
|
36c8f25fd1 | ||
|
|
b3050f1058 | ||
|
|
a04a61f61b | ||
|
|
58204248bb | ||
|
|
a47740ae28 | ||
|
|
48d6a27fad | ||
|
|
5ffcd78f27 | ||
|
|
de9dd77b50 | ||
|
|
51c77be7a2 | ||
|
|
f98563cbe9 | ||
|
|
8c8059db30 | ||
|
|
fa586426fa | ||
|
|
60a1bf0d43 | ||
|
|
a48f194350 | ||
|
|
78f0ec94ea | ||
|
|
44f9e756da | ||
|
|
3d992d56cd | ||
|
|
72f7b4627f | ||
|
|
5c1f165079 | ||
|
|
95755ba515 | ||
|
|
791e4e26a9 | ||
|
|
4d61963894 | ||
|
|
5622a9c565 | ||
|
|
2e5069d5a1 | ||
|
|
4cd692e061 | ||
|
|
216a88c00c | ||
|
|
10f1917589 | ||
|
|
26f7d6e517 | ||
|
|
b7b2e99ab1 | ||
|
|
0966b231e8 | ||
|
|
00e1a1962b |
No files matched your search
@@ -1,21 +0,0 @@
|
||||
# This file is for unifying the coding style for different editors and IDEs
|
||||
# editorconfig.org
|
||||
|
||||
root = true
|
||||
|
||||
[*]
|
||||
end_of_line = lf
|
||||
charset = utf-8
|
||||
insert_final_newline = true
|
||||
trim_trailing_whitespace = true
|
||||
|
||||
[**.py]
|
||||
indent_style = tab
|
||||
|
||||
[src/octoprint/static/js/app/**.js]
|
||||
indent_style = space
|
||||
indent_size = 4
|
||||
|
||||
[.travis.yml]
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
@@ -1,10 +1 @@
|
||||
src/octoprint/_version.py export-subst
|
||||
|
||||
src/octoprint/static/js/lib/* linguist-vendored
|
||||
src/octoprint/static/less/bootstrap/* linguist-vendored
|
||||
src/octoprint/static/less/font-awesome.less linguist-vendored
|
||||
src/octoprint/static/less/mixins.less linguist-vendored
|
||||
src/octoprint/static/less/variables.less linguist-vendored
|
||||
versioneer.py linguist-vendored
|
||||
|
||||
docs/* linguist-documentation
|
||||
@@ -1,108 +0,0 @@
|
||||
READ THE FOLLOWING FIRST:
|
||||
|
||||
If not already done, please read the "guidelines for contributing"
|
||||
aka the Contribution Guidelines that are linked ^-- just up there
|
||||
in the big yellow box.
|
||||
|
||||
Also read the FAQ: https://github.com/foosel/OctoPrint/wiki/FAQ.
|
||||
|
||||
This is a bug and feature tracker, please only use it to report bugs
|
||||
or request features within OctoPrint (not OctoPi, not any OctoPrint
|
||||
plugins and not unofficial OctoPrint versions).
|
||||
|
||||
Do not seek support here ("I need help with ...", "I have a
|
||||
question ..."), that belongs on the mailing list or the G+ community
|
||||
(both linked in the "guidelines for contributing" linked above, read
|
||||
them!), NOT here.
|
||||
|
||||
Mark requests with a "[Request]" prefix in the title please. For bug
|
||||
reports fully fill out the bug reporting template (if you don't know
|
||||
where to find some information - it's all described in the Contribution
|
||||
Guidelines linked up there in the big yellow box).
|
||||
|
||||
When reporting a bug do NOT delete ANY lines from the template but
|
||||
those enclosed in [ and ] - and those please DO delete, they are
|
||||
only provided for your information and removing them makes your
|
||||
ticket more readable :)
|
||||
|
||||
Make sure any bug you want to report is still present with the CURRENT
|
||||
OctoPrint version and that it does not vanish when you start OctoPrint
|
||||
in safe mode - how to do that is also explained in the Contribution
|
||||
Guidelines linked up there in the big yellow box.
|
||||
|
||||
Thank you!
|
||||
|
||||
(Before submitting your ticket, please delete this text up to and
|
||||
including the line too - it's only here for you, we already know it
|
||||
by heart ;))
|
||||
|
||||
----
|
||||
|
||||
#### What were you doing?
|
||||
|
||||
[Please be as specific as possible here. The maintainers will need to
|
||||
reproduce your issue in order to fix it and that is not possible if they
|
||||
don't know what you did to get it to happen in the first place.
|
||||
|
||||
Ideally provide exact steps to follow in order to reproduce your problem:
|
||||
|
||||
1. ...
|
||||
2. ...
|
||||
3. ...
|
||||
|
||||
If you encountered a problem with specific files of any sorts, make sure
|
||||
to also include a link to a file with which to reproduce the problem.]
|
||||
|
||||
#### What did you expect to happen?
|
||||
|
||||
#### What happened instead?
|
||||
|
||||
#### Did the same happen when running OctoPrint in safe mode?
|
||||
|
||||
[Try to reproduce your problem in safe mode. You can find information
|
||||
on how to enable safe mode in the Contribution Guidelines.]
|
||||
|
||||
#### Branch & Commit or Version of OctoPrint
|
||||
|
||||
[Can be found in the lower left corner of the web interface. ALWAYS INCLUDE.]
|
||||
|
||||
#### Operating System running OctoPrint
|
||||
|
||||
[OctoPi, Linux, Windows, MacOS, something else? With version please.
|
||||
OctoPi's version can be found in /etc/octopi_version]
|
||||
|
||||
#### Printer model & used firmware incl. version
|
||||
|
||||
[If applicable, always include if unsure.]
|
||||
|
||||
#### Browser and Version of Browser, Operating System running Browser
|
||||
|
||||
[If applicable, always include if unsure.]
|
||||
|
||||
#### Link to octoprint.log
|
||||
|
||||
[On gist.github.com or pastebin.com. ALWAYS INCLUDE and never truncate.
|
||||
The Contribution Guidelines tell you where to find that.]
|
||||
|
||||
#### Link to contents of terminal tab or serial.log
|
||||
|
||||
[On gist.github.com or pastebin.com. If applicable, always include if unsure or
|
||||
reporting communication issues. Never truncate.
|
||||
|
||||
serial.log is usually not written due to performance reasons and must be
|
||||
enabled explicitly. Provide at the very least the FULL contents of your
|
||||
terminal tab at the time of the bug occurrence, even if you do not have
|
||||
a serial.log (which the Contribution Guidelines tell you where to find).]
|
||||
|
||||
#### Link to contents of Javascript console in the browser
|
||||
|
||||
[On gist.github.com or pastebin.com or alternatively a screenshot. If applicable -
|
||||
always include if unsure or reporting UI issues.
|
||||
|
||||
The Contribution Guidelines tell you where to find that.]
|
||||
|
||||
#### Screenshot(s)/video(s) showing the problem:
|
||||
|
||||
[If applicable. Always include if unsure or reporting UI issues.]
|
||||
|
||||
I have read the FAQ.
|
||||
@@ -1,51 +0,0 @@
|
||||
Thank you for your interest into contributing to OctoPrint, it's
|
||||
highly appreciated!
|
||||
|
||||
Please make sure you have read the "guidelines for contributing" as
|
||||
linked just above this form, there's a section on Pull Requests in there
|
||||
as well that contains important information.
|
||||
|
||||
As a summary, please make sure you have ticked all points on this
|
||||
checklist:
|
||||
|
||||
* [ ] Your changes are not possible to do through a plugin and relevant
|
||||
to a large audience (ideally all users of OctoPrint)
|
||||
* [ ] If your changes are large or otherwise disruptive: You have
|
||||
made sure your changes don't interfere with current development by
|
||||
talking it through with the maintainers, e.g. through a
|
||||
Brainstorming ticket
|
||||
* [ ] Your PR targets OctoPrint's devel branch, or maintenance if it's
|
||||
a bug fix for an issue present in the current stable version (no PRs
|
||||
against master or anything else)
|
||||
* [ ] Your PR was opened from a custom branch on your repository
|
||||
(no PRs from your version of master, maintenance or devel please),
|
||||
e.g. dev/my_new_feature
|
||||
* [ ] Your PR only contains relevant changes: no unrelated files,
|
||||
no dead code, ideally only one commit - rebase your PR if necessary!
|
||||
* [ ] Your changes follow the existing coding style
|
||||
* [ ] If your changes include style sheets: You have modified the
|
||||
.less source files, not the .css files (those are generated with
|
||||
lessc)
|
||||
* [ ] You have tested your changes (please state how!) - ideally you
|
||||
have added unit tests
|
||||
* [ ] You have run the existing unit tests against your changes and
|
||||
nothing broke
|
||||
* [ ] You have added yourself to the AUTHORS.md file :)
|
||||
|
||||
Feel free to delete all this help text, then describe
|
||||
your PR further. You may use the template provided below to do that.
|
||||
The more details the better!
|
||||
|
||||
----
|
||||
|
||||
#### What does this PR do and why is it necessary?
|
||||
|
||||
#### How was it tested? How can it be tested by the reviewer?
|
||||
|
||||
#### Any background context you want to provide?
|
||||
|
||||
#### What are the relevant tickets if any?
|
||||
|
||||
#### Screenshots (if appropriate)
|
||||
|
||||
#### Further notes
|
||||
@@ -1,10 +1,3 @@
|
||||
src/octoprint/templates/_data/AUTHORS.md
|
||||
src/octoprint/templates/_data/CHANGELOG.md
|
||||
src/octoprint/templates/_data/SUPPORTERS.md
|
||||
src/octoprint/templates/_data/THIRDPARTYLICENSES.md
|
||||
|
||||
devtools
|
||||
|
||||
*.tar.bz2
|
||||
*.tar.gz
|
||||
*.7z
|
||||
@@ -29,11 +22,3 @@ OctoPrint.egg-info
|
||||
*.orig
|
||||
|
||||
*.codekit
|
||||
|
||||
venv
|
||||
venv26
|
||||
venv27
|
||||
venv33
|
||||
venv34
|
||||
venv35
|
||||
venv36
|
||||
@@ -2,11 +2,8 @@
|
||||
|
||||
language: python
|
||||
python:
|
||||
- "2.7"
|
||||
- "2.7"
|
||||
install:
|
||||
- pip install -e .[develop]
|
||||
- pip install -r requirements.txt
|
||||
script:
|
||||
- nosetests --with-doctest
|
||||
sudo: false
|
||||
git:
|
||||
depth: 250
|
||||
- nosetests
|
||||
@@ -2,7 +2,7 @@
|
||||
host = https://www.transifex.com
|
||||
|
||||
[octoprint.messages]
|
||||
file_filter = translations/<lang>/LC_MESSAGES/messages.po
|
||||
source_file = translations/messages.pot
|
||||
file_filter = src/octoprint/translations/<lang>/LC_MESSAGES/messages.po
|
||||
source_file = src/octoprint/translations/messages.pot
|
||||
source_lang = en
|
||||
|
||||
@@ -7,23 +7,12 @@
|
||||
# The file is processed from top to bottom, the first matching line wins. If <tag> or <reference commit> are left out,
|
||||
# the lookup table does not apply to the matched branches
|
||||
|
||||
# master and rc shall not use the lookup table, only tags
|
||||
# master and staging shall not use the lookup table
|
||||
master
|
||||
rc/.*
|
||||
prerelease
|
||||
staging
|
||||
|
||||
# neither should disconnected checkouts, e.g. 'git checkout <tag>'
|
||||
HEAD
|
||||
\(detached.*
|
||||
# fix/ branches are fixes for master, so we don't handle those either
|
||||
fix/.*
|
||||
|
||||
# maintenance is currently the branch for preparation of maintenance release 1.3.3
|
||||
# so are any fix/... and improve/... branches
|
||||
maintenance 1.3.3 0a69dbeddb301d5a32827a3f0d561f875df24234 pep440-dev
|
||||
fix/.* 1.3.3 0a69dbeddb301d5a32827a3f0d561f875df24234 pep440-dev
|
||||
improve/.* 1.3.3 0a69dbeddb301d5a32827a3f0d561f875df24234 pep440-dev
|
||||
|
||||
# staging/maintenance is currently the branch for preparation of 1.3.3rc4 (if we'll need that)
|
||||
staging/maintenance 1.3.3rc4 ce1541e956778b732458599a21f38b6783a0c2ec pep440-dev
|
||||
|
||||
# every other branch is a development branch and thus gets resolved to 1.4.0-dev for now
|
||||
.* 1.4.0 7f5d03d0549bcbd26f40e7e4a3297ea5204fb1cc pep440-dev
|
||||
# every other branch is a development branch and thus gets resolved to 1.2.0-dev for now
|
||||
.* 1.2.0-dev 50cf776e70b9
|
||||
@@ -1,87 +0,0 @@
|
||||
# Authors
|
||||
|
||||
The following people have contributed to OctoPrint's code base (ordered by
|
||||
date of first contribution):
|
||||
|
||||
* [Gina Häußge](https://github.com/foosel)
|
||||
* [Thomas Sanladerer](https://github.com/imitation)
|
||||
* [Alex Ustyantsev](https://github.com/hudbrog)
|
||||
* [Andrew Dalgleish](https://github.com/ajd4096)
|
||||
* [Dale Price](https://github.com/daprice)
|
||||
* [Václav "ax" Hůla](https://github.com/AxTheB)
|
||||
* [Tom Perry](https://github.com/daftscience)
|
||||
* [Andreas Gohr](https://github.com/splitbrain)
|
||||
* [Lars Norpchen](https://github.com/norpchen)
|
||||
* [Marlon Wünnemann](https://github.com/marwue)
|
||||
* ["algspd"](https://github.com/algspd)
|
||||
* [Peter Uithoven](https://github.com/peteruithoven)
|
||||
* [Bryan Mayland](https://github.com/CapnBry)
|
||||
* [Ross Hendrickson](https://github.com/savorywatt)
|
||||
* [Dan Lipsitt](https://github.com/DanLipsitt)
|
||||
* [James Gao](https://github.com/jamesgao)
|
||||
* [Tonnerre Lombard](https://github.com/tonnerre)
|
||||
* [Marc Hannappel](https://github.com/Salandora)
|
||||
* [Brad Pitcher](https://github.com/brad)
|
||||
* [Gabe Rosenhouse](https://github.com/rosenhouse)
|
||||
* [chriskoz](https://github.com/chriskoz)
|
||||
* [Ilya Novoselov](https://github.com/nullie)
|
||||
* [Corey C](https://github.com/C-o-r-E)
|
||||
* [Jarek Szczepanski](https://github.com/imrahil)
|
||||
* [Jon Nordby](https://github.com/jonnor)
|
||||
* [Aaron Bieber](https://github.com/qbit)
|
||||
* [Guy Sheffer](https://github.com/guysoft)
|
||||
* [Dattas Moonchaser](https://github.com/dattas)
|
||||
* [Pim Rutgers](https://github.com/Booli)
|
||||
* [Koen Kooi](https://github.com/koenkooi)
|
||||
* [Colin Wallace](https://github.com/Wallacoloo)
|
||||
* [Michael Ang](https://github.com/mangtronix)
|
||||
* [Philipp Engel](https://github.com/nosyjoe)
|
||||
* [Giles Hall](https://github.com/vishnubob)
|
||||
* [Bevaz](https://github.com/Bevaz)
|
||||
* [Bortek](https://github.com/bortek)
|
||||
* [Rob Speed](https://github.com/rspeed)
|
||||
* [Renha](https://github.com/Renha)
|
||||
* [Antoine Bertin](https://github.com/Diaoul)
|
||||
* [Teja Philipp](https://github.com/hungerpirat)
|
||||
* ["matobago"](https://github.com/matobago)
|
||||
* ["nophead"](https://github.com/nophead)
|
||||
* [Bob Clough](https://github.com/thinkl33t)
|
||||
* [Mikk Kiilaspää](https://github.com/Mikk36)
|
||||
* [Jack Minardi](https://github.com/jminardi)
|
||||
* [Mark Walker](https://github.com/markwal)
|
||||
* [Lucas Clemente](https://github.com/lucas-clemente)
|
||||
* [Andrew Erickson](https://github.com/aerickson)
|
||||
* [Nicanor Romero Venier](https://github.com/nicanor-romero)
|
||||
* [Thomas Hou](https://github.com/masterhou)
|
||||
* [Mark Bastiaans](https://github.com/markbastiaans)
|
||||
* [Marcel Hellwig](https://github.com/punkkeks)
|
||||
* [Kevin Murphy](https://github.com/kevingelion)
|
||||
* [Richard Joyce](https://github.com/richjoyce)
|
||||
* ["bwgan"](https://github.com/bwgan)
|
||||
* [Siim Raud](https://github.com/2ndalpha)
|
||||
* ["geoporalis"](https://github.com/geoporalis)
|
||||
* [Andrew Malota](https://github.com/2bitoperations)
|
||||
* [Alexander Leisentritt](https://github.com/Alex9779)
|
||||
* [therealbstern](https://github.com/therealbstern)
|
||||
* [Ishwar Agarwal](https://github.com/agarwali)
|
||||
* [Kye Hoover](https://github.com/eykrevooh)
|
||||
* [Philipp Baum](https://github.com/philphilphil)
|
||||
* [Kyle Evans](https://github.com/kevans91)
|
||||
* [Javier Martínez Arrieta](https://github.com/Javierma)
|
||||
* ["MirceaDan"](https://github.com/ByReaL)
|
||||
* [Ovidiu Hossu](https://github.com/MoonshineSG)
|
||||
* [Eyck Jentzsch](https://github.com/eyck)
|
||||
* [Mathias Rangel Wulff](https://github.com/mathiasrw)
|
||||
* [Clemens Niemeyer](https://github.com/clemniem)
|
||||
* ["I-am-me"](https://github.com/I-am-me)
|
||||
* [Noah Martin](https://github.com/noahsmartin)
|
||||
* [Eyal Soha](https://github.com/eyal0)
|
||||
* [Greg Hulands](https://github.com/ghulands)
|
||||
* [Andreas Werner](https://github.com/gallore)
|
||||
* [Shawn Bruce](https://github.com/kantlivelong)
|
||||
* [Claudiu Ceia] (https://github.com/ClaudiuCeia)
|
||||
|
||||
OctoPrint started off as a fork of [Cura](https://github.com/daid/Cura) by
|
||||
[Daid Braam](https://github.com/daid). Parts of its communication layer and
|
||||
the server side GCODE interpreter are still based on Cura's code base from
|
||||
December 2012 and hence on the work of its authors up until then.
|
||||
@@ -1,445 +1,22 @@
|
||||
# Contribution Guidelines
|
||||
Issues, Tickets, however you may call them
|
||||
------------------------------------------
|
||||
|
||||
This document outlines what you need to know before **[creating tickets](#issues-tickets-however-you-may-call-them)**
|
||||
or **[creating pull requests](#pull-requests)**.
|
||||
Read the following short instructions **fully** and **follow them** if you want your ticket to be taken care of and not closed again directly!
|
||||
|
||||
## Contents
|
||||
- Always create **one ticket for one purpose**. So don't mix two or more feature requests, support requests, bugs etc into one ticket. If you do, your ticket will be treated as if only describing the first purpose, the others will be ignored!
|
||||
- If you want to report a bug, **READ AND FOLLOW [How to file a bug report](https://github.com/foosel/OctoPrint/wiki/How-to-file-a-bug-report)!** Tickets will be automatically checked if they comply with the requirements outlined in that wiki node! Other then what's written in there (**and really EVERYTHING that is written in there!**) you don't have to do anything special with your ticket.
|
||||
- If you want to post a **request** of any kind (feature request, documentation request, ...), **add [Request] to your issue's title!**
|
||||
- If you need **support** with a problem of your installation (e.g. if you have problems getting the webcam to work), **add [Support] to your issue's title!**. Note that for problems like these, the [Mailinglist](https://groups.google.com/group/octoprint) or the [Google+ Community](https://plus.google.com/communities/102771308349328485741) will probably get you help faster!
|
||||
- If you have a general **question**, **add [Question] to your issue's title!**. Note that for problems like these, the [Mailinglist](https://groups.google.com/group/octoprint) or the [Google+ Community](https://plus.google.com/communities/102771308349328485741) will probably get you help faster!
|
||||
- If you have another reason for creating a ticket that doesn't fit any of the above categories, think hard if it might not be something better suited for the [Mailinglist](https://groups.google.com/group/octoprint) or the [Google+ Community](https://plus.google.com/communities/102771308349328485741). If you are sure it needs to be reported here, **add [Misc] to your issue's title!**
|
||||
|
||||
* [Issues, Tickets, however you may call them](#issues-tickets-however-you-may-call-them)
|
||||
* [How to file a bug report](#how-to-file-a-bug-report)
|
||||
* [What should I do before submitting a bug report?](#what-should-i-do-before-submitting-a-bug-report)
|
||||
* [What should I include in a bug report?](#what-should-i-include-in-a-bug-report)
|
||||
* [Where can I find which version and branch I'm on?](#where-can-i-find-which-version-and-branch-im-on)
|
||||
* [Where can I find those log files you keep talking about?](#where-can-i-find-those-log-files-you-keep-talking-about)
|
||||
* [Where can I find my browser's error console?](#where-can-i-find-my-browsers-error-console)
|
||||
* [Setting up a development environment](#setting-up-a-development-environment)
|
||||
* [Pull requests](#pull-requests)
|
||||
* [What do the branches mean?](#what-do-the-branches-mean)
|
||||
* [How OctoPrint is versioned](#how-octoprint-is-versioned)
|
||||
* [History](#history)
|
||||
* [Footnotes](#footnotes)
|
||||
Following these guidelines (**especially EVERYTHING mentioned in ["How to file a bug report"](https://github.com/foosel/OctoPrint/wiki/How-to-file-a-bug-report)**) is necessary so the tickets stay manageable - you are not the only one with an open issue, so please respect that you have to **play by the rules** so that your problem can be taken care of. Tickets not playing by the rules **will be closed without further investigation!**.
|
||||
|
||||
## Issues, Tickets, however you may call them
|
||||
Pull Requests
|
||||
-------------
|
||||
|
||||
Please read the following short instructions fully and follow them. You can
|
||||
help the project tremendously this way: not only do you help the maintainers
|
||||
to **address problems in a timely manner** but also keep it possible for them
|
||||
to **fix bugs, add new and improve on existing functionality** instead of doing
|
||||
nothing but ticket management.
|
||||
1. Please create all pull requests against the `devel` branch.
|
||||
2. Create **one pull request per feature/bug fix**.
|
||||
3. Create a custom branch for your feature/bug fix and use that as base for your pull request. Pull requests directly against your version of `devel` will be closed.
|
||||
4. In your pull request's description, state what your pull request is doing, as in, what feature does it implement, what bug does it fix.
|
||||
|
||||

|
||||
|
||||
- **[Read the FAQ](https://github.com/foosel/OctoPrint/wiki/FAQ)**
|
||||
- If you want to report a **bug**, [read "How to file a bug report" below](#how-to-file-a-bug-report)
|
||||
and *[use the provided template](#what-should-i-include-in-a-ticket)*.
|
||||
You do not need to do anything else with your ticket.
|
||||
- If you want to post a **feature request** or a **documentation request**, add `[Request]`
|
||||
to your issue's title (e.g. `[Request] Awesome new feature`). A question on how to run/change/setup
|
||||
something is **not** what qualifies as a request here, use the
|
||||
[Mailinglist](https://groups.google.com/group/octoprint) or the
|
||||
[Google+ Community](https://plus.google.com/communities/102771308349328485741) for
|
||||
such support issues.
|
||||
- If you are a **developer** that wants to brainstorm a pull request or possible
|
||||
changes to the plugin system, add [Brainstorming] to your issue's title (e.g.
|
||||
`[Brainstorming] New plugin hook for doing some cool stuff`).
|
||||
- If you need **support**, have a **question** or some **other reason** that
|
||||
doesn't fit any of the above categories, the issue tracker is not the right place.
|
||||
Consult the [Mailinglist](https://groups.google.com/group/octoprint) or the
|
||||
[Google+ Community](https://plus.google.com/communities/102771308349328485741) instead.
|
||||
|
||||
No matter what kind of ticket you create, never mix two or more "ticket reasons"
|
||||
into one ticket: One ticket per bug, request, brainstorming thread please.
|
||||
|
||||
----
|
||||
|
||||
**Note**: A bot is in place that monitors new tickets, automatically
|
||||
categorizes them and checks new bug reports for usage of the provided template.
|
||||
That bot will only bother you if you open a ticket that appears to be a bug (no
|
||||
`[Request]` or `[Brainstorming]` in the title) without the template, and it
|
||||
will do that only to ensure that all information needed to solve the issue is
|
||||
available for the maintainers to directly start tackling that problem.
|
||||
|
||||
----
|
||||
|
||||
## How to file a bug report
|
||||
|
||||
If you encounter an issue with OctoPrint, you are welcome to
|
||||
[submit a bug report](https://github.com/foosel/OctoPrint/issues/new).
|
||||
|
||||
Before you do that for the first time though please take a moment to read the
|
||||
following section *completely* and also follow the instructions in the
|
||||
"new issue" form. Thank you! :)
|
||||
|
||||
### What should I do before submitting a bug report?
|
||||
|
||||
1. **Make sure you are at the right location**. This is the Github repository
|
||||
of the official version of OctoPrint, which is the 3D print server and
|
||||
corresponding web interface itself.
|
||||
|
||||
**This is not the Github respository of OctoPi**, which is the preconfigured
|
||||
Raspberry Pi image including OctoPrint among other things - that one can be found
|
||||
[here](https://github.com/guysoft/OctoPi). Please note that while we do have
|
||||
some entries regarding OctoPi in the FAQ, any bugs should be reported in the
|
||||
[proper bug tracker](https://github.com/guysoft/OctoPi/issues) which - again -
|
||||
is not here.
|
||||
|
||||
**This is also not the Github repository of any OctoPrint Plugins you
|
||||
might have installed**. Report any issues with those in their corresponding
|
||||
bug tracker (probably linked to from the plugin's homepage).
|
||||
|
||||
Finally, **this is also not the right issue tracker if you are running a
|
||||
forked version of OctoPrint**. Seek help for such unofficial versions from
|
||||
the people maintaining them instead.
|
||||
|
||||
2. Please make sure to **test out the current version** of OctoPrint to see
|
||||
whether the problem you are encountering still exists, and **test without
|
||||
any third-party plugins enabled** to make sure it's not a misbehaving
|
||||
plugin causing the issue at hand. For that please restart OctoPrint in
|
||||
**safe mode**, either by selecting "Restart OctoPrint in safe mode" from
|
||||
the "System" menu, or by starting OctoPrint from the command line with
|
||||
`octoprint serve --safe`. Then try to reproduce your issue. Find out
|
||||
more about safe mode in the [docs](http://docs.octoprint.org/en/master/features/safemode.html).
|
||||
|
||||
You might also want to try the current development version of OctoPrint
|
||||
(if you aren't already). Refer to the [FAQ](https://github.com/foosel/OctoPrint/wiki/FAQ)
|
||||
for information on how to do this.
|
||||
|
||||
3. The problem still exists? Then please **look through the
|
||||
[existing tickets](https://github.com/foosel/OctoPrint/issues?state=open)
|
||||
(use the [search](https://github.com/foosel/OctoPrint/search?q=&ref=cmdform&type=Issues))**
|
||||
to check if there already exists a report of the issue you are encountering.
|
||||
Sorting through duplicates of the same issue sometimes causes more work than
|
||||
fixing it. Take the time to filter through possible duplicates and be really
|
||||
sure that your problem definitely is a new one. Try more than one search query
|
||||
(e.g. do not only search for "webcam" if you happen to run into an issue
|
||||
with your webcam, also search for "timelapse" etc). Do not only read the subject lines
|
||||
of tickets that look like they might be related, but also read the ticket itself!
|
||||
|
||||
**Very important:** Please make absolutely sure that if you find a bug that looks like
|
||||
it is the same as your's, it actually behaves the same as your's. E.g. if someone gives steps
|
||||
to reproduce his bug that looks like your's, reproduce the bug like that if possible,
|
||||
and only add a "me too" if you actually can reproduce the same
|
||||
issue. Also **provide all information** as [described below](#what-should-i-include-in-a-bug-report)
|
||||
and whatever was additionally requested over the course of the ticket
|
||||
even if you "only" add to an existing ticket. The more information available regarding a bug, the higher
|
||||
the chances of reproducing and solving it. But "me too" on an actually unrelated ticket
|
||||
makes it more difficult due to on top of having to figure out the original problem
|
||||
there's now also a [red herring](https://en.wikipedia.org/wiki/Red_herring) interfering - so please be
|
||||
very diligent here!
|
||||
|
||||
### What should I include in a bug report?
|
||||
|
||||
First of all make sure your use **a descriptive title**. "It doesn't work"
|
||||
and similar unspecific complaints are NOT descriptive titles.
|
||||
|
||||
**Always use the following template** (please remove what's within `[...]`, that's
|
||||
only provided here as some additional information for you), **even if only adding a
|
||||
"me too" to an existing ticket**:
|
||||
|
||||
#### What were you doing?
|
||||
|
||||
[Please be as specific as possible here. The maintainers will need to
|
||||
reproduce your issue in order to fix it and that is not possible if they
|
||||
don't know what you did to get it to happen in the first place.
|
||||
|
||||
Ideally provide exact steps to follow in order to reproduce your problem:
|
||||
|
||||
1. ...
|
||||
2. ...
|
||||
3. ...
|
||||
|
||||
If you encountered a problem with specific files of any sorts, make sure
|
||||
to also include a link to a file with which to reproduce the problem.]
|
||||
|
||||
#### What did you expect to happen?
|
||||
|
||||
#### What happened instead?
|
||||
|
||||
#### Did the same happen when running OctoPrint in safe mode?
|
||||
|
||||
[Try to reproduce your problem in safe mode. You can find information
|
||||
on how to enable safe mode in the Contribution Guidelines.]
|
||||
|
||||
#### Branch & Commit or Version of OctoPrint
|
||||
|
||||
[Can be found in the lower left corner of the web interface. ALWAYS INCLUDE.]
|
||||
|
||||
#### Operating System running OctoPrint
|
||||
|
||||
[OctoPi, Linux, Windows, MacOS, something else? With version please,
|
||||
OctoPi's version can be found in /etc/octopi_version]
|
||||
|
||||
#### Printer model & used firmware incl. version
|
||||
|
||||
[If applicable, always include if unsure.]
|
||||
|
||||
#### Browser and Version of Browser, Operating System running Browser
|
||||
|
||||
[If applicable, always include if unsure.]
|
||||
|
||||
#### Link to octoprint.log
|
||||
|
||||
[On gist.github.com or pastebin.com. ALWAYS INCLUDE and never truncate.
|
||||
The Contribution Guidelines tell you where to find that.]
|
||||
|
||||
#### Link to contents of terminal tab or serial.log
|
||||
|
||||
[On gist.github.com or pastebin.com. If applicable, always include if unsure or
|
||||
reporting communication issues. Never truncate.
|
||||
|
||||
serial.log is usually not written due to performance reasons and must be
|
||||
enabled explicitly. Provide at the very least the FULL contents of your
|
||||
terminal tab at the time of the bug occurrence, even if you do not have
|
||||
a serial.log.]
|
||||
|
||||
#### Link to contents of Javascript console in the browser
|
||||
|
||||
[On gist.github.com or pastebin.com or alternatively a screenshot. If applicable -
|
||||
always include if unsure or reporting UI issues.
|
||||
|
||||
The Contribution Guidelines tell you where to find that.]
|
||||
|
||||
#### Screenshot(s)/video(s) showing the problem:
|
||||
|
||||
[If applicable. Always include if unsure or reporting UI issues.]
|
||||
|
||||
I have read the FAQ.
|
||||
|
||||
Copy-paste this template **completely** (or use the version that gets pre-filled
|
||||
into the "new issue" form). Do not skip any lines or the bot *will* complain! Provide
|
||||
all requested information or your ticket will be closed.
|
||||
|
||||
### Where can I find which version and branch I'm on?
|
||||
|
||||
You can find out all of them by taking a look into the lower left corner of the
|
||||
OctoPrint UI:
|
||||
|
||||

|
||||
|
||||
If you don't have access to the UI you can find out that information via the
|
||||
command line as well. Either `octoprint --version` or `python setup.py version`
|
||||
in OctoPrint's folder will tell you the version of OctoPrint you are running
|
||||
(note: if it doesn't then you are running a version older than 1.1.0,
|
||||
*upgrade now*). A `git branch` in your OctoPrint installation folder will mark
|
||||
the branch you are on with a little *. `git rev-parse HEAD` will tell you the
|
||||
current commit.
|
||||
|
||||
### Where can I find those log files you keep talking about?
|
||||
|
||||
OctoPrint by default provides two log outputs, a third one can be enabled if
|
||||
more information is needed.
|
||||
|
||||
One is contained in the **"Terminal" tab** within OctoPrint's UI and is a log
|
||||
of the last 300 lines of communication with the printer. Please copy-paste
|
||||
this *completely* somewhere (disable auto scroll to make copying the contents easier) -
|
||||
e.g. http://pastebin.com or http://gist.github.com - and include a link in
|
||||
your bug report.
|
||||
|
||||
There is also **OctoPrint's application log file** or in short `octoprint.log`,
|
||||
which is by default located at `~/.octoprint/logs/octoprint.log` on Linux,
|
||||
`%APPDATA%\OctoPrint\logs\octoprint.log` on Windows and
|
||||
`~/Library/Application Support/OctoPrint/logs/octoprint.log` on MacOS. You can
|
||||
also access it directly through OctoPrint via Settings > Logs. Please
|
||||
copy-paste this *completely* to pastebin or gist as well and include a link in your bug
|
||||
report.
|
||||
|
||||
It might happen that you are asked to provide a more **thorough log of the
|
||||
communication with the printer** if you haven't already done so, the `serial.log`.
|
||||
This is not written by default due to performance reasons, but you can enable
|
||||
it in the settings dialog. After enabling that log, please reproduce the problem
|
||||
again (connect to the printer, do whatever triggers it), then copy-paste
|
||||
`~/.octoprint/logs/serial.log` (Windows: `%APPDATA%\OctoPrint\logs\serial.log`,
|
||||
MacOS: `~/Library/Application Support/OctoPrint/logs/serial.log`) to pastebin
|
||||
or gist and include the link in the bug report.
|
||||
|
||||
You might also be asked to provide a log with an increased log level. You can
|
||||
find information on how to do just that in the
|
||||
[docs](http://docs.octoprint.org/en/master/configuration/logging_yaml.html).
|
||||
|
||||
### Where can I find my browser's error console?
|
||||
|
||||
See [How to open the Javascript Console in different browsers](https://webmasters.stackexchange.com/questions/8525/how-to-open-the-javascript-console-in-different-browsers)
|
||||
|
||||
## Setting up a development environment
|
||||
|
||||
See [the corresponding chapter in the documentation](http://docs.octoprint.org/en/master/development/index.html#setting-up-a-development-environment).
|
||||
|
||||
## Pull requests
|
||||
|
||||
1. If you want to add a new feature to OctoPrint, **please always first
|
||||
consider if it wouldn't be better suited for a plugin.** As a general rule
|
||||
of thumb, any feature that is only of interest to a small sub group should
|
||||
be moved into a plugin. If the current plugin system doesn't allow you to
|
||||
implement your feature as a plugin, create a "Brainstorming" ticket to get
|
||||
the discussion going on how best to solve *this* in OctoPrint's plugin
|
||||
system - maybe that's the actual PR you have been waiting for to contribute :)
|
||||
2. If you plan to make **any large or otherwise disruptive changes to the
|
||||
code or appearance, please open a "Brainstorming" ticket first** so
|
||||
that we can determine if it's a good time for your specific pull
|
||||
request. It might be that we're currently in the process of making
|
||||
heavy changes to the code locations you'd target as well, or your
|
||||
approach doesn't fit the general "project vision", and that would
|
||||
just cause unnecessary work and frustration for everyone or
|
||||
possibly get the PR rejected.
|
||||
3. Create your pull request **from a custom branch** on your end (e.g.
|
||||
`dev/myNewFeature`)[1].
|
||||
4. Create your pull request **only against the `maintenance` or `devel` branch**:
|
||||
* if it's a bug fix for a bug in the current stable version: `maintenance` branch
|
||||
* otherwise: `devel` branch
|
||||
5. Create **one pull request per feature/bug fix**.
|
||||
6. Make sure there are **only relevant changes** included in your PR. No
|
||||
changes to unrelated files, no additional files that don't belong (e.g.
|
||||
commits of your full virtual environment). Make sure your PR consists
|
||||
**ideally of only one commit** (use git's rebase and squash functionality).
|
||||
7. Make sure you **follow the current coding style**. This means:
|
||||
* Tabs instead of spaces in the Python files[2]
|
||||
* Spaces instead of tabs in the JavaScript sources
|
||||
* English language (code, variables, comments, ...)
|
||||
* Comments where necessary: Tell *why* the code does something like it does
|
||||
it, structure your code
|
||||
* Following the general architecture
|
||||
* If your PR needs to make changes to the Stylesheets, change the
|
||||
``.less`` files from which the CSS is compiled.
|
||||
* Make sure you do not add dead code (e.g. commented out left-overs
|
||||
from experiments).
|
||||
8. Ensure your changes **pass the existing unit tests**. PRs that break
|
||||
those cannot be accepted.
|
||||
9. **Test your changes thoroughly**. That also means testing with usage
|
||||
scenarios you don't normally use, e.g. if you only use access control, test
|
||||
without and vice versa. If you only test with your printer, test with the
|
||||
virtual printer and vice versa. State in your pull request how you tested
|
||||
your changes. Ideally **add unit tests** - OctoPrint severely lacks in that
|
||||
department, but we are trying to change that, so any new code already covered
|
||||
with a test suite helps a lot!
|
||||
10. In your pull request's description, **state what your pull request does**,
|
||||
as in, what feature does it implement, what bug does it fix. The more
|
||||
thoroughly you explain your intent behind the PR here, the higher the
|
||||
chances it will get merged fast. There is a template provided below
|
||||
that can help you here.
|
||||
11. Don't forget to **add yourself to the [AUTHORS](./AUTHORS.md)
|
||||
file** :)
|
||||
|
||||
Template to use for Pull Request descriptions:
|
||||
|
||||
```
|
||||
#### What does this PR do and why is it necessary?
|
||||
|
||||
#### How was it tested? How can it be tested by the reviewer?
|
||||
|
||||
#### Any background context you want to provide?
|
||||
|
||||
#### What are the relevant tickets if any?
|
||||
|
||||
#### Screenshots (if appropriate)
|
||||
|
||||
#### Further notes
|
||||
```
|
||||
|
||||
## What do the branches mean?
|
||||
|
||||
There are three main branches in OctoPrint:
|
||||
|
||||
* `master`: The master branch always contains the current stable release. It
|
||||
is *only* updated on new releases. Will have a version number following
|
||||
the scheme `<x>.<y>.<z>` (e.g. `1.2.9`) or - if it's absolutely necessary to
|
||||
add a commit after release to this branch - `<x>.<y>.<z>.post<commits since x.y.z>`
|
||||
(e.g. `1.2.9.post1`).
|
||||
* `maintenance`: Improvements and fixes of the current release that make up
|
||||
the next release go here. More or less continuously updated. You can consider
|
||||
this a preview of the next release version. It should be very stable at all
|
||||
times. Anything you spot in here helps tremendously with getting a rock solid
|
||||
next stable release, so if you want to help out development, running the
|
||||
`maintenance` branch and reporting back anything you find is a very good way
|
||||
to do that. Will usually have a version number following the scheme
|
||||
`<x>.<y>.<z+1>.dev<commits since increase of z>` for an OctoPrint version of `<x>.<y>.<z>`
|
||||
(e.g. `1.2.10.dev12`).
|
||||
* `devel`: Ongoing development of new features that will go into the next bigger
|
||||
release (MINOR version number increases) will happen on this branch. Usually
|
||||
kept stable, sometimes stuff can break though or lose backwards compatibility
|
||||
temporarily. Can be considered the "bleeding edge". All PRs should target
|
||||
*this* branch. Important improvements and fixes from PRs here are backported to
|
||||
`maintenance` as needed. Will usually have a version number following the
|
||||
scheme `<x>.<y+1>.0.dev<commits since increase of y>` for a current OctoPrint version
|
||||
of `<x>.<y>.<z>` (e.g. `1.3.0.dev123`).
|
||||
* `rc/maintenance`: This branch is reserved for future releases that have graduated from
|
||||
the `maintenance` branch and are now being pushed on the "Maintenance"
|
||||
pre release channel for further testing. Version number follows the scheme
|
||||
`<x>.<y>.<z>rc<n>` (e.g. `1.2.9rc1`).
|
||||
* `staging/maintenance`: Any preparation for potential follow-up RCs takes place here.
|
||||
Version number follows the scheme `<x>.<y>.<z>rc<n+1>.dev<commits since increase of n>` (e.g.
|
||||
`1.2.9rc1.dev3`) for a current Maintenance RC of `<x>.<y>.<z>rc<n>`.
|
||||
* `rc/devel`: This branch is reserved for future releases that have graduated from
|
||||
the `devel` branch and are now being pushed on the "Devel" pre release channel
|
||||
for further testing. Version number follows the scheme `<x>.<y+1>.0rc<n>` (e.g. `1.3.0rc1`)
|
||||
for a current stable OctoPrint version of `<x>.<y>.<z>`.
|
||||
* `staging/devel`: Any preparation for potential follow-up Devel RCs takes place
|
||||
here. Version number follows the scheme `<x>.<y>.0rc<n+1>.dev<commits since increase of n>` (e.g.
|
||||
`1.3.0rc1.dev12`) for a current Devel RC of `<x>.<y>.0rc<n>`.
|
||||
|
||||
Additionally, from time to time you might see other branches pop up in the repository.
|
||||
Those usually have one of the following prefixes:
|
||||
|
||||
* `fix/...`: Fixes under development that are to be merged into the `maintenance`
|
||||
and `devel` branches.
|
||||
* `improve/...`: Improvements under development that are to be merged into the
|
||||
`maintenance` and `devel` branches.
|
||||
* `dev/...` or `feature/...`: New functionality under development that is to be merged
|
||||
into the `devel` branch.
|
||||
|
||||
There is also the `gh-pages` branch, which holds OctoPrint's web page, and a few
|
||||
older development branches that are slowly being migrated or deleted.
|
||||
|
||||
## How OctoPrint is versioned
|
||||
|
||||
OctoPrint follows the [semantic versioning scheme](http://semver.org/) of **MAJOR.MINOR.PATCH**.
|
||||
|
||||
The **PATCH** version number is the one increasing most often due to OctoPrint's maintenance releases.
|
||||
Releases that only change the patch number indicate that they contain bug fixes and small improvements
|
||||
of existing functionality. Example: 1.2.8 to 1.2.9.
|
||||
|
||||
The **MINOR** version number increases with releases that add a lot of new functionality and
|
||||
large features. Example: 1.2.x to 1.3.0.
|
||||
|
||||
Finally, the **MAJOR** version number increases if there are breaking API changes that concern any of the
|
||||
documented interfaces (REST API, plugin interfaces, ...). So far this hasn't happened. Example: 1.x.y to 2.0.0.
|
||||
|
||||
OctoPrint's version numbers are automatically generated using [versioneer](https://github.com/warner/python-versioneer)
|
||||
and depend on the selected git branch, nearest git tag and commits. The generated version number
|
||||
should always be [PEP440](https://www.python.org/dev/peps/pep-0440/) compatible. Unless a git tag
|
||||
is used for version number determination, the version number will also contain the git hash within
|
||||
the local version identifier to allow for an exact determination of the active code base
|
||||
(e.g. `1.2.9.dev68+g46c7a9c`). Additionally, instances with active uncommitted changes will contain
|
||||
`.dirty` in the local version identifier.
|
||||
|
||||
## History
|
||||
|
||||
* 2015-01-23: More guidelines for creating pull requests, support/questions
|
||||
redirected to Mailinglist/G+ community
|
||||
* 2015-01-27: Added another explicit link to the FAQ
|
||||
* 2015-07-07: Added step to add yourself to AUTHORS when creating a PR :)
|
||||
* 2015-12-01: Heavily reworked to include examples, better structure and
|
||||
all information in one document.
|
||||
* 2016-02-10: Added information about branch structure and versioning.
|
||||
* 2016-02-16: Added requirement to add information from template to existing
|
||||
tickets as well, explained issue with "me too" red herrings.
|
||||
* 2016-03-14: Some more requirements for PRs, and a PR template.
|
||||
* 2016-06-08: New `prerelease` and `rc` branches explained.
|
||||
* 2016-09-09: New `rc/*` branches explained.
|
||||
* 2016-09-23: Some more work on "How to file a bug report" based on recent
|
||||
experiences
|
||||
* 2017-01-25: Fixed a typo
|
||||
* 2017-03-09: Allow PRs against `maintenance` branch for bugs in stable.
|
||||
* 2017-03-10: Reproduce bugs in safe mode to make sure they are really caused
|
||||
by OctoPrint itself and not a misbehaving plugin.
|
||||
* 2017-03-27: Added safe mode section to ticket template.
|
||||
|
||||
## Footnotes
|
||||
* [1] - If you are wondering why, the problem is that anything that you add
|
||||
to your PR's branch will also become part of your PR, so if you create a
|
||||
PR from your version of `devel` chances are high you'll add changes to the
|
||||
PR that do not belong to the PR.
|
||||
* [2] - Yes, we know that this goes against PEP-8. OctoPrint started out as
|
||||
a fork of Cura and hence stuck to the coding style found therein. Changing
|
||||
it now would make the history and especially `git blame` completely
|
||||
unusable, so for now we'll have to deal with it (this decision might be
|
||||
revisited in the future).
|
||||
@@ -1,10 +1,4 @@
|
||||
recursive-include src/octoprint/static *
|
||||
recursive-include src/octoprint/templates *
|
||||
recursive-include src/octoprint/plugins *
|
||||
recursive-include src/octoprint/translations *
|
||||
include src/octoprint/util/piptestballoon/setup.py
|
||||
include versioneer.py
|
||||
include src/octoprint/_version.py
|
||||
include requirements.txt
|
||||
include *.md
|
||||
exclude CONTRIBUTING.md
|
||||
@@ -1,137 +1,81 @@
|
||||
# OctoPrint
|
||||
OctoPrint
|
||||
=========
|
||||
|
||||
[](https://badge.fury.io/gh/foosel%2FOctoPrint)
|
||||
[](https://flattr.com/submit/auto?user_id=foosel&url=https://github.com/foosel/OctoPrint&title=OctoPrint&language=&tags=github&category=software)
|
||||
|
||||
OctoPrint provides a snappy web interface for controlling consumer 3D printers. It is Free Software
|
||||
OctoPrint provides a responsive web interface for controlling a 3D printer (RepRap, Ultimaker, ...). It is Free Software
|
||||
and released under the [GNU Affero General Public License V3](http://www.gnu.org/licenses/agpl.html).
|
||||
|
||||
Its website can be found at [octoprint.org](http://octoprint.org).
|
||||
|
||||
The documentation is located at [docs.octoprint.org](http://docs.octoprint.org).
|
||||
Contributing
|
||||
------------
|
||||
|
||||
The official plugin repository can be reached at [plugins.octoprint.org](http://plugins.octoprint.org).
|
||||
Please see the project's [Contribution Guidelines](https://github.com/foosel/OctoPrint/blob/master/CONTRIBUTING.md).
|
||||
|
||||
OctoPrint's development wouldn't be possible without the [financial support by its community](http://octoprint.org/support-octoprint/).
|
||||
If you enjoy OctoPrint, please consider becoming a regular supporter!
|
||||
Installation
|
||||
------------
|
||||
|
||||

|
||||
Installation instructions for installing from source for different operating systems can be found [on the wiki](https://github.com/foosel/OctoPrint/wiki#assorted-guides).
|
||||
|
||||
You are currently looking at the source code repository of OctoPrint. If you already installed it
|
||||
(e.g. by using the Raspberry Pi targeted distribution [OctoPi](https://github.com/guysoft/OctoPi)) and only
|
||||
want to find out how to use it, [the documentation](http://docs.octoprint.org/) and [the public wiki](https://github.com/foosel/OctoPrint/wiki)
|
||||
might be of more interest for you. You might also want to subscribe to [the mailing list](https://groups.google.com/group/octoprint)
|
||||
or the [G+ Community](https://plus.google.com/communities/102771308349328485741) where there are other active users who might be
|
||||
able to help you with any questions you might have.
|
||||
|
||||
## Contributing
|
||||
|
||||
Contributions of all kinds are welcome, not only in the form of code but also with regards to the
|
||||
[official documentation](http://docs.octoprint.org/) or [the public wiki](https://github.com/foosel/OctoPrint/wiki), support
|
||||
of other users in the [bug tracker](https://github.com/foosel/OctoPrint/issues),
|
||||
[the Mailinglist](https://groups.google.com/group/octoprint) or
|
||||
[the G+ Community](https://plus.google.com/communities/102771308349328485741) and also [financially](http://octoprint.org/support-octoprint/).
|
||||
|
||||
If you think something is bad about OctoPrint or its documentation the way it is, please help
|
||||
in any way to make it better instead of just complaining about it -- this is an Open Source Project
|
||||
after all :)
|
||||
|
||||
For information about how to go about submitting bug reports or pull requests, please see the project's
|
||||
[Contribution Guidelines](https://github.com/foosel/OctoPrint/blob/master/CONTRIBUTING.md).
|
||||
|
||||
## Installation
|
||||
|
||||
Installation instructions for installing from source for different operating
|
||||
systems can be found [on the wiki](https://github.com/foosel/OctoPrint/wiki#assorted-guides).
|
||||
|
||||
If you want to run OctoPrint on a Raspberry Pi, you might want to take a look at [OctoPi](https://github.com/guysoft/OctoPi)
|
||||
If you want to run OctoPrint on a Raspberry Pi you might want to take a look at [OctoPi](https://github.com/guysoft/OctoPi)
|
||||
which is a custom SD card image that includes OctoPrint plus dependencies.
|
||||
|
||||
The generic steps that should basically be done regardless of operating system
|
||||
and runtime environment are the following (as *regular
|
||||
user*, please keep your hands *off* of the `sudo` command here!) - this assumes
|
||||
you already have Python 2.7, pip and virtualenv set up on your system:
|
||||
Dependencies
|
||||
------------
|
||||
|
||||
1. Checkout OctoPrint: `git clone https://github.com/foosel/OctoPrint.git`
|
||||
2. Change into the OctoPrint folder: `cd OctoPrint`
|
||||
3. Create a user-owned virtual environment therein: `virtualenv venv`
|
||||
4. Install OctoPrint *into that virtual environment*: `./venv/bin/python setup.py install`
|
||||
|
||||
You may then start the OctoPrint server via `/path/to/OctoPrint/venv/bin/octoprint`, see [Usage](#usage)
|
||||
for details.
|
||||
|
||||
After installation, please make sure you follow the first-run wizard and set up
|
||||
access control as necessary. If you want to not only be notified about new
|
||||
releases, but also be able to automatically upgrade to them from within
|
||||
OctoPrint, take a look [at the documentation of the Software Update Plugin](https://github.com/foosel/OctoPrint/wiki/Plugin:-Software-Update#making-octoprint-updateable-on-existing-installations)
|
||||
and at its settings.
|
||||
|
||||
## Dependencies
|
||||
|
||||
OctoPrint depends on a few python modules to do its job. Those are automatically installed when installing
|
||||
OctoPrint depends on a couple of python modules to do its job. Those are automatically installed when installing
|
||||
OctoPrint via `setup.py`:
|
||||
|
||||
python setup.py install
|
||||
|
||||
You should do this every time after pulling from the repository, since the dependencies may have changed.
|
||||
You should also do this every time after pulling from the repository, since the dependencies might have changed.
|
||||
|
||||
OctoPrint currently only supports Python 2.7.
|
||||
|
||||
## Usage
|
||||
Usage
|
||||
-----
|
||||
|
||||
Running the `setup.py` script via
|
||||
|
||||
python setup.py install
|
||||
|
||||
installs the `octoprint` script in your Python installation's scripts folder
|
||||
(which, depending on whether you installed OctoPrint globally or into a virtual env, will be in your `PATH` or not). The
|
||||
following usage examples assume that the `octoprint` script is on your `PATH`.
|
||||
Running the `setup.py` script installs the `octoprint` script in your Python installation's scripts folder
|
||||
(which depending on whether you installed OctoPrint globally or into a virtual env will be on your `PATH` or not). The
|
||||
following usage examples assume that said `octoprint` script is on your `PATH`.
|
||||
|
||||
You can start the server via
|
||||
|
||||
octoprint serve
|
||||
octoprint
|
||||
|
||||
By default it binds to all interfaces on port 5000 (so pointing your browser to `http://127.0.0.1:5000`
|
||||
will do the trick). If you want to change that, use the additional command line parameters `host` and `port`,
|
||||
which accept the host ip to bind to and the numeric port number respectively. If for example you want the server
|
||||
to only listen on the local interface on port 8080, the command line would be
|
||||
|
||||
octoprint serve --host=127.0.0.1 --port=8080
|
||||
octoprint --host=127.0.0.1 --port=8080
|
||||
|
||||
Alternatively, the host and port on which to bind can be defined via the config file.
|
||||
Alternatively, the host and port on which to bind can be defined via the configuration.
|
||||
|
||||
If you want to run OctoPrint as a daemon (only supported on Linux), use
|
||||
|
||||
octoprint daemon {start|stop|restart} [--pid PIDFILE]
|
||||
octoprint --daemon {start|stop|restart} [--pid PIDFILE]
|
||||
|
||||
If you do not supply a custom pidfile location via `--pid PIDFILE`, it will be created at `/tmp/octoprint.pid`.
|
||||
|
||||
You can also specify the config file or the base directory (for basing off the `uploads`, `timelapse` and `logs` folders),
|
||||
You can also specify the configfile or the base directory (for basing off the `uploads`, `timelapse` and `logs` folders),
|
||||
e.g.:
|
||||
|
||||
octoprint serve --config /path/to/another/config.yaml --basedir /path/to/my/basedir
|
||||
octoprint --config /path/to/another/config.yaml --basedir /path/to/my/basedir
|
||||
|
||||
To start OctoPrint in safe mode - which disables all third party plugins that do not come bundled with OctoPrint - use
|
||||
the ``--safe`` flag:
|
||||
See `octoprint --help` for further information.
|
||||
|
||||
octoprint serve --safe
|
||||
|
||||
See `octoprint --help` for more information on the available command line parameters.
|
||||
|
||||
OctoPrint also ships with a `run` script in its source directory. You can invoke it to start the server. It
|
||||
OctoPrint also ships with a `run` script in its source directory. You can also invoke that to start up the server, it
|
||||
takes the same command line arguments as the `octoprint` script.
|
||||
|
||||
## Configuration
|
||||
Configuration
|
||||
-------------
|
||||
|
||||
If not specified via the command line, the config file `config.yaml` for OctoPrint is expected in the settings folder,
|
||||
If not specified via the commandline, the configfile `config.yaml` for OctoPrint is expected in the settings folder,
|
||||
which is located at `~/.octoprint` on Linux, at `%APPDATA%/OctoPrint` on Windows and
|
||||
at `~/Library/Application Support/OctoPrint` on MacOS.
|
||||
|
||||
A comprehensive overview of all available configuration settings can be found
|
||||
[in the docs](http://docs.octoprint.org/en/master/configuration/config_yaml.html).
|
||||
Please note that the most commonly used configuration settings can also easily
|
||||
be edited from OctoPrint's settings dialog.
|
||||
|
||||
## Special Thanks
|
||||
|
||||
Cross-browser testing services are kindly provided by [BrowserStack](http://www.browserstack.com/).
|
||||
Profiling is done with the help of [PyVmMonitor](http://www.pyvmmonitor.com).
|
||||
[on the wiki](https://github.com/foosel/OctoPrint/wiki/Configuration). Please note that the most commonly used
|
||||
configuration settings can also easily be edited from OctoPrint's settings dialog.
|
||||
@@ -1,68 +0,0 @@
|
||||
# Supporters
|
||||
|
||||
Development of this version of OctoPrint wouldn't have been possible without
|
||||
[financial support by the community](http://octoprint.org/support-octoprint/) -
|
||||
thanks to everyone who contributed!
|
||||
|
||||
## Patreon Patrons
|
||||
|
||||
* 3D Moniak
|
||||
* Aleph Objects, Inc.
|
||||
* Andrew Moorby
|
||||
* Arnljot Arntsen
|
||||
* BEEVERYCREATIVE
|
||||
* Boris Hussein
|
||||
* Brad Jackson
|
||||
* Brian E. Tyler
|
||||
* Chris Day
|
||||
* Christian Petropolis
|
||||
* CreativeTools
|
||||
* D Brian Kimmel
|
||||
* DeltaMaker 3D Printers
|
||||
* Doug Johnson
|
||||
* E3D BigBox
|
||||
* Ernesto Martinez
|
||||
* Exovite
|
||||
* F. Kunsmann
|
||||
* Frank Sander
|
||||
* Gary Deen
|
||||
* Gary N McKinney
|
||||
* George Robles
|
||||
* günter weber
|
||||
* Ivan Krasin
|
||||
* James Seigel
|
||||
* Jamie R McGuigan
|
||||
* Jeff Moe
|
||||
* Josh Daniels
|
||||
* Kaile Riser
|
||||
* Kale Stedman
|
||||
* Kazuhiro Ogura
|
||||
* Lamin Kivelä
|
||||
* Makespace Madrid
|
||||
* Marcus Ackermann
|
||||
* Mark Qvist
|
||||
* Mark Walker
|
||||
* Masayoshi Mitsui
|
||||
* Michael Aumock
|
||||
* Miles Flavel
|
||||
* Mohammed khorakiwala
|
||||
* Noe Ruiz
|
||||
* Patrick McGinnis
|
||||
* Peter Grace
|
||||
* Peter Schmehl
|
||||
* PRINT3Dforum.com
|
||||
* Robert Gusek
|
||||
* Roger Strolz
|
||||
* Roy Cortes
|
||||
* Samer Najia
|
||||
* SD3D
|
||||
* SeeMeCNC
|
||||
* Simon Hallam
|
||||
* Stefan Krister
|
||||
* Stephane Schittly
|
||||
* Sven Mueller
|
||||
* Thomas Hatley
|
||||
* Timeshell.ca
|
||||
* Trent Shumay
|
||||
|
||||
and 1098 more wonderful people pledging on the [Patreon campaign](https://patreon.com/foosel)!
|
||||
@@ -1,72 +0,0 @@
|
||||
# Third Party Licenses
|
||||
|
||||
## Web Interface
|
||||
|
||||
* [AVLTree](https://gist.github.com/viking/2424106) (modified): GPL, LGPL (dual licensed)
|
||||
* [Babel JavaScript Support](https://github.com/mitsuhiko/babel/blob/master/contrib/babel.js): BSD
|
||||
* [Bootstrap](http://getbootstrap.com/): Apache License 2.0
|
||||
* [Bootstrap Modal](http://jschr.github.io/bootstrap-modal/): Apache License 2.0
|
||||
* [Bootstrap Slider Knockout Bindings](https://github.com/cosminstefanxp/bootstrap-slider-knockout-binding): MIT
|
||||
* [Bootstrap Slider](http://seiyria.com/bootstrap-slider/): Apache License 2.0
|
||||
* [Bootstrap Tabdrop](http://www.eyecon.ro/bootstrap-tabdrop): Apache License 2.0
|
||||
* [Detect Mobile Browser](http://detectmobilebrowsers.com/): Public Domain
|
||||
* [Flot](http://www.flotcharts.org/): MIT
|
||||
* [JavaScript MD5](https://github.com/blueimp/JavaScript-MD5): MIT
|
||||
* [JQuery](http://jquery.com/): MIT
|
||||
* [JQuery Bootstrap Wizard](http://github.com/VinceG/twitter-bootstrap-wizard): MIT, GPL (dual licensed)
|
||||
* [JQuery File Upload](https://github.com/blueimp/jQuery-File-Upload): MIT
|
||||
* [JQuery iframe transport](https://github.com/blueimp/jQuery-File-Upload/blob/master/js/jquery.iframe-transport.js): MIT
|
||||
* [JQuery QRCode](http://larsjung.de/jquery-qrcode/): MIT
|
||||
* [JQuery Slimscroll](http://rocha.la/jQuery-slimScroll): MIT, GPL (dual licensed)
|
||||
* [JQuery UI Core, Mouse, Slider and Widget](http://jqueryui.com): MIT
|
||||
* [Knockout](http://knockoutjs.com/): MIT
|
||||
* [LESS](http://lesscss.org): Apache License 2.0
|
||||
* [lodash](https://lodash.com): MIT
|
||||
* [Loglevel](https://github.com/pimterry/loglevel): MIT
|
||||
* [Modernizr](http://modernizr.com): MIT
|
||||
* [Moment.js](http://momentjs.com/): MIT
|
||||
* [PNotify](http://sciactive.com/pnotify/): GPL, LGPL, MPL (triple licensed)
|
||||
* [pusher.color.js](http://cache.preserve.io/5g18q0pw/index.html) (original link dead): MIT
|
||||
* [SockJS](https://github.com/sockjs/sockjs-client): MIT
|
||||
* [sprintf-js](http://alexei.ro/): BSD
|
||||
|
||||
## Server
|
||||
|
||||
* [appdirs](http://github.com/ActiveState/appdirs): MIT
|
||||
* [Awesome-Slugify](https://pypi.python.org/pypi/awesome-slugify): GPLv3
|
||||
* [chainmap](https://bitbucket.org/jeunice/chainmap): Python
|
||||
* [Click](http://click.pocoo.org/): BSD
|
||||
* [feedparser](https://github.com/kurtmckee/feedparser): BSD
|
||||
* [Flask](http://flask.pocoo.org/): BSD
|
||||
* [Flask-Assets](http://github.com/miracle2k/flask-assets): BSD
|
||||
* [Flask-Babel](http://github.com/mitsuhiko/flask-babel): BSD
|
||||
* [Flask-Login](https://github.com/maxcountryman/flask-login): MIT
|
||||
* [Flask-Markdown](http://github.com/dcolish/flask-markdown): BSD
|
||||
* [Flask-Principal](http://packages.python.org/Flask-Principal/): MIT
|
||||
* [future](https://python-future.org/): MIT
|
||||
* [netaddr](https://github.com/drkjam/netaddr/): BSD
|
||||
* [netifaces](https://bitbucket.org/al45tair/netifaces): MIT
|
||||
* [pkginfo](http://pypi.python.org/pypi/pkginfo/): Python
|
||||
* [psutil](https://github.com/giampaolo/psutil): BSD
|
||||
* [pylru](https://github.com/jlhutch/pylru): GPLv2
|
||||
* [pyserial](http://pyserial.sourceforge.net/): Python
|
||||
* [PyYAML](http://pyyaml.org/wiki/PyYAML): MIT
|
||||
* [requests](http://python-requests.org/): Apache License 2.0
|
||||
* [rsa](http://stuvel.eu/rsa): Apache License 2.0
|
||||
* [sarge](http://sarge.readthedocs.org/): BSD
|
||||
* [scandir](https://github.com/benhoyt/scandir): BSD
|
||||
* [semantic_version](https://github.com/rbarrois/python-semanticversion): BSD
|
||||
* [SockJS-Tornado](http://github.com/mrjoes/sockjs-tornado/): MIT
|
||||
* [Tornado](http://www.tornadoweb.org/): Apache License 2.0
|
||||
* [watchdog](http://github.com/gorakhargosh/watchdog): Apache License 2.0
|
||||
* [websocket-client](https://github.com/liris/websocket-client): LGPLv3
|
||||
|
||||
## Development (testing, documentation generation, etc)
|
||||
|
||||
* [ddt](https://github.com/txels/ddt): MIT
|
||||
* [mock](https://github.com/testing-cabal/mock): BSD
|
||||
* [nose](http://pythonhosted.org/nose/): LGPL
|
||||
* [pypandoc](https://github.com/bebraw/pypandoc): MIT
|
||||
* [Sphinx](http://sphinx-doc.org/): BSD
|
||||
* [sphinxcontrib-httpdomain](https://bitbucket.org/birkenfeld/sphinx-contrib/src/default/httpdomain/): BSD
|
||||
* [sphinx_rtd_theme](https://github.com/snide/sphinx_rtd_theme/): BSD
|
||||
@@ -1,8 +1,6 @@
|
||||
[python: src/octoprint/**.py]
|
||||
[jinja2: src/octoprint/templates/**.jinja2]
|
||||
[jinja2: src/octoprint/plugins/**.jinja2]
|
||||
extensions=jinja2.ext.autoescape, jinja2.ext.with_, webassets.ext.jinja2.AssetsExtension
|
||||
extensions=jinja2.ext.autoescape, jinja2.ext.with_
|
||||
|
||||
[javascript: src/octoprint/static/js/app/**.js]
|
||||
[javascript: src/octoprint/plugins/**.js]
|
||||
extract_messages = gettext, ngettext
|
||||
@@ -1,54 +0,0 @@
|
||||
/* override table width restrictions */
|
||||
.wy-table-responsive table td, .wy-table-responsive table th {
|
||||
/* !important prevents the common CSS stylesheets from
|
||||
overriding this as on RTD they are loaded after this stylesheet */
|
||||
white-space: normal !important;
|
||||
}
|
||||
|
||||
.wy-table-responsive {
|
||||
overflow: visible !important;
|
||||
}
|
||||
|
||||
/* style headlink for code block captions like other headlinks */
|
||||
.code-block-caption .headerlink {
|
||||
display: none;
|
||||
visibility: hidden;
|
||||
font-size: 14px;
|
||||
font-family: inherit;
|
||||
font-style: normal;
|
||||
font-weight: normal;
|
||||
line-height: 1;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
}
|
||||
|
||||
.code-block-caption:hover .headerlink {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.code-block-caption .headerlink:after {
|
||||
visibility: visible;
|
||||
content: "\f0c1";
|
||||
font-family: FontAwesome;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
/* make whitespace visualization in code listings not appear on same vertical position as dashes */
|
||||
.highlight .w {
|
||||
vertical-align: 10%;
|
||||
}
|
||||
|
||||
/* make code tags non-red again */
|
||||
code,
|
||||
.rst-content tt {
|
||||
color: #000 !important;
|
||||
}
|
||||
|
||||
a code,
|
||||
.rst-content a tt {
|
||||
color: #2980B9 !important;
|
||||
}
|
||||
|
||||
a:visited code,
|
||||
.rst-content a:visited tt {
|
||||
color: #9B59B6 !important;
|
||||
}
|
||||
@@ -75,14 +75,6 @@ Issue a connection command
|
||||
disconnect
|
||||
Instructs OctoPrint to disconnect from the printer.
|
||||
|
||||
fake_ack
|
||||
Fakes an acknowledgment message for OctoPrint in case one got lost on the serial line and the communication
|
||||
with the printer since stalled. This should only be used in "emergencies" (e.g. to save prints), the reason
|
||||
for the lost acknowledgment should always be properly investigated and removed instead of depending on this
|
||||
"symptom solver".
|
||||
|
||||
Requires user rights.
|
||||
|
||||
**Example Connect Request**
|
||||
|
||||
.. sourcecode:: http
|
||||
@@ -122,24 +114,7 @@ Issue a connection command
|
||||
|
||||
HTTP/1.1 204 No Content
|
||||
|
||||
**Example FakeAck Request**
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
POST /api/connection HTTP/1.1
|
||||
Host: example.com
|
||||
Content-Type: application/json
|
||||
X-Api-Key: abcdef...
|
||||
|
||||
{
|
||||
"command": "fake_ack"
|
||||
}
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
HTTP/1.1 204 No Content
|
||||
|
||||
:json string command: The command to issue, either ``connect``, ``disconnect`` or ``fake_ack``.
|
||||
:json string command: The command to issue, either ``connect`` or ``disconnect``
|
||||
:json string port: ``connect`` command: The port to connect to. If left out either the existing ``portPreference``
|
||||
will be used, or if that is not available OctoPrint will attempt auto detection. Must be part
|
||||
of the available ports.
|
||||
@@ -154,4 +129,4 @@ Issue a connection command
|
||||
startup. If not set no changes will be made to the current setting.
|
||||
:statuscode 204: No error
|
||||
:statuscode 400: If the selected `port` or `baudrate` for a ``connect`` command are not part of the available
|
||||
options.
|
||||
options.
|
||||
@@ -31,7 +31,7 @@ Printer State
|
||||
* - ``flags``
|
||||
- 1
|
||||
- Printer state flags
|
||||
- A few boolean printer state flags
|
||||
- A couple of boolean printer state flags
|
||||
* - ``flags.operational``
|
||||
- 1
|
||||
- Boolean
|
||||
@@ -232,68 +232,11 @@ File information
|
||||
* - ``name``
|
||||
- 1
|
||||
- String
|
||||
- The name of the file without path. E.g. "file.gco" for a file "file.gco" located anywhere in the file system.
|
||||
* - ``path``
|
||||
- 1
|
||||
- String
|
||||
- The path to the file within the location. E.g. "folder/subfolder/file.gco" for a file "file.gco" located within
|
||||
"folder" and "subfolder" relative to the root of the location.
|
||||
* - ``type``
|
||||
- 1
|
||||
- String
|
||||
- Type of file. ``model`` or ``machinecode``. Or ``folder`` if it's a folder, in which case the ``children``
|
||||
node will be populated
|
||||
* - ``typePath``
|
||||
- 1
|
||||
- list
|
||||
- Path to type of file in extension tree. E.g. ``["model", "stl"]`` for ``.stl`` files, or ``["machinecode", "gcode"]``
|
||||
for ``.gcode`` files. ``["folder"]`` for folders.
|
||||
|
||||
Additional properties depend on ``type``. For a ``type`` value of ``folder``, see "Folders". For any other value
|
||||
see "Files".
|
||||
|
||||
Folders
|
||||
'''''''
|
||||
|
||||
.. list-table::
|
||||
:widths: 15 5 10 30
|
||||
:header-rows: 1
|
||||
|
||||
* - Name
|
||||
- Multiplicity
|
||||
- Type
|
||||
- Description
|
||||
* - ``children``
|
||||
- 0..*
|
||||
- Array of :ref:`File information items <sec-api-datamodel-files-file>`
|
||||
- Contained children for entries of type ``folder``. Will only include children in subfolders in recursive
|
||||
listings. Not present in non recursive listings, this might be revisited in the future.
|
||||
- The name of the file
|
||||
* - ``size``
|
||||
- 0..1
|
||||
- Number
|
||||
- The size of all files contained in the folder and its subfolders. Not present in non recursive listings, this might
|
||||
be revisited in the future.
|
||||
|
||||
Files
|
||||
'''''
|
||||
|
||||
.. list-table::
|
||||
:widths: 15 5 10 30
|
||||
:header-rows: 1
|
||||
|
||||
* - Name
|
||||
- Multiplicity
|
||||
- Type
|
||||
- Description
|
||||
* - ``hash``
|
||||
- 0..1
|
||||
- String
|
||||
- MD5 hash of the file. Only available for ``local`` files.
|
||||
* - ``size``
|
||||
- 0..1
|
||||
- Number
|
||||
- The size of the file in bytes. Only available for ``local`` files or ``sdcard`` files if the printer
|
||||
supports file sizes for sd card files.
|
||||
- The size of the file in bytes. Only available for ``local`` files.
|
||||
* - ``date``
|
||||
- 0..1
|
||||
- Unix timestamp
|
||||
@@ -311,38 +254,10 @@ Files
|
||||
- 0..1
|
||||
- :ref:`GCODE analysis information <sec-api-datamodel-files-gcodeanalysis>`
|
||||
- Information from the analysis of the GCODE file, if available. Left out in abridged version.
|
||||
|
||||
.. _sec-api-datamodel-files-fileabridged:
|
||||
|
||||
Abridged file or folder information
|
||||
-----------------------------------
|
||||
|
||||
.. list-table::
|
||||
:widths: 15 5 10 30
|
||||
:header-rows: 1
|
||||
|
||||
* - Name
|
||||
- Multiplicity
|
||||
- Type
|
||||
- Description
|
||||
* - ``name``
|
||||
- 1
|
||||
- String
|
||||
- The name of the file or folder without path. E.g. "file.gco" for a file "file.gco" located anywhere in the file system.
|
||||
* - ``path``
|
||||
- 1
|
||||
- String
|
||||
- The path to the file or folder within the location. E.g. "folder/subfolder/file.gco" for a file "file.gco" located within
|
||||
"folder" and "subfolder" relative to the root of the location.
|
||||
* - ``origin``
|
||||
- 1
|
||||
- String, either ``local`` or ``sdcard``
|
||||
- The origin of the file, ``local`` when stored in OctoPrint's ``uploads`` folder, ``sdcard`` when stored on the
|
||||
printer's SD card (if available)
|
||||
* - ``refs``
|
||||
* - ``prints``
|
||||
- 0..1
|
||||
- :ref:`sec-api-datamodel-files-ref`
|
||||
- References relevant to this file or folder, left out in abridged version
|
||||
- :ref:`Print history <sec-api-datamodel-files-prints>`
|
||||
- Information regarding prints of this file, if available. Left out in abridged version.
|
||||
|
||||
.. _sec-api-datamodel-files-gcodeanalysis:
|
||||
|
||||
@@ -375,6 +290,40 @@ GCODE analysis information
|
||||
- The volume of filament used, in cm³
|
||||
|
||||
|
||||
.. _sec-api-datamodel-files-prints:
|
||||
|
||||
Print history
|
||||
-------------
|
||||
|
||||
.. list-table::
|
||||
:widths: 15 5 10 30
|
||||
:header-rows: 1
|
||||
|
||||
* - Name
|
||||
- Multiplicity
|
||||
- Type
|
||||
- Description
|
||||
* - ``failure``
|
||||
- 1
|
||||
- Number
|
||||
- The number of failed prints on record for the file
|
||||
* - ``success``
|
||||
- 1
|
||||
- Number
|
||||
- The number of successful prints on record for the file
|
||||
* - ``last``
|
||||
- 0..1
|
||||
- Object
|
||||
- Information regarding the last print on record for the file
|
||||
* - ``last.date``
|
||||
- 1
|
||||
- Unix timestamp
|
||||
- Timestamp when this file was printed last
|
||||
* - ``last.success``
|
||||
- 1
|
||||
- Boolean
|
||||
- Whether the last print on record was a success (``true``) or not (``false``)
|
||||
|
||||
.. _sec-api-datamodel-files-ref:
|
||||
|
||||
References
|
||||
@@ -391,14 +340,13 @@ References
|
||||
* - ``resource``
|
||||
- 1
|
||||
- URL
|
||||
- The resource that represents the file or folder (e.g. for issuing commands to or for deleting)
|
||||
- The resource that represents the file (e.g. for issuing commands to or for deleting)
|
||||
* - ``download``
|
||||
- 0..1
|
||||
- URL
|
||||
- The download URL for the file. Never present for folders.
|
||||
- The download URL for the file
|
||||
* - ``model``
|
||||
- 0..1
|
||||
- URL
|
||||
- The model from which this file was generated (e.g. an STL, currently not used). Never present for
|
||||
folders.
|
||||
- The model from which this file was generated (e.g. an STL, currently not used)
|
||||
|
||||
@@ -16,14 +16,9 @@ Retrieve all files
|
||||
Retrieve information regarding all files currently available and regarding the disk space still available
|
||||
locally in the system.
|
||||
|
||||
By default only returns the files and folders in the root directory. If the query parameter ``recursive``
|
||||
is provided and set to ``true``, returns all files and folders.
|
||||
|
||||
Returns a :ref:`Retrieve response <sec-api-fileops-datamodel-retrieveresponse>`.
|
||||
|
||||
**Example 1**:
|
||||
|
||||
Fetch only the files and folders from the root folder.
|
||||
**Example**:
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
@@ -40,10 +35,6 @@ Retrieve all files
|
||||
"files": [
|
||||
{
|
||||
"name": "whistle_v2.gcode",
|
||||
"path": "whistle_v2.gcode",
|
||||
"type": "machinecode",
|
||||
"typePath": ["machinecode", "gcode"],
|
||||
"hash": "...",
|
||||
"size": 1468987,
|
||||
"date": 1378847754,
|
||||
"origin": "local",
|
||||
@@ -69,140 +60,15 @@ Retrieve all files
|
||||
},
|
||||
{
|
||||
"name": "whistle_.gco",
|
||||
"path": "whistle_.gco",
|
||||
"type": "machinecode",
|
||||
"typePath": ["machinecode", "gcode"],
|
||||
"origin": "sdcard",
|
||||
"refs": {
|
||||
"resource": "http://example.com/api/files/sdcard/whistle_.gco"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "folderA",
|
||||
"path": "folderA",
|
||||
"type": "folder",
|
||||
"typePath": ["folder"],
|
||||
"children": [],
|
||||
"size": 1334
|
||||
}
|
||||
],
|
||||
"free": "3.2GB"
|
||||
}
|
||||
|
||||
**Example 2**
|
||||
|
||||
Recursively fetch all files and folders.
|
||||
|
||||
Fetch only the files and folders from the root folder.
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
GET /api/files?recursive=true HTTP/1.1
|
||||
Host: example.com
|
||||
X-Api-Key: abcdef...
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
HTTP/1.1 200 OK
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"files": [
|
||||
{
|
||||
"name": "whistle_v2.gcode",
|
||||
"path": "whistle_v2.gcode",
|
||||
"type": "machinecode",
|
||||
"typePath": ["machinecode", "gcode"],
|
||||
"hash": "...",
|
||||
"size": 1468987,
|
||||
"date": 1378847754,
|
||||
"origin": "local",
|
||||
"refs": {
|
||||
"resource": "http://example.com/api/files/local/whistle_v2.gcode",
|
||||
"download": "http://example.com/downloads/files/local/whistle_v2.gcode"
|
||||
},
|
||||
"gcodeAnalysis": {
|
||||
"estimatedPrintTime": 1188,
|
||||
"filament": {
|
||||
"length": 810,
|
||||
"volume": 5.36
|
||||
}
|
||||
},
|
||||
"print": {
|
||||
"failure": 4,
|
||||
"success": 23,
|
||||
"last": {
|
||||
"date": 1387144346,
|
||||
"success": true
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "whistle_.gco",
|
||||
"path": "whistle_.gco",
|
||||
"type": "machinecode",
|
||||
"typePath": ["machinecode", "gcode"],
|
||||
"origin": "sdcard",
|
||||
"refs": {
|
||||
"resource": "http://example.com/api/files/sdcard/whistle_.gco"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "folderA",
|
||||
"path": "folderA",
|
||||
"type": "folder",
|
||||
"typePath": ["folder"],
|
||||
"children": [
|
||||
{
|
||||
"name": "test.gcode",
|
||||
"path": "folderA/test.gcode",
|
||||
"type": "machinecode",
|
||||
"typePath": ["machinecode", "gcode"],
|
||||
"hash": "...",
|
||||
"size": 1234,
|
||||
"date": 1378847754,
|
||||
"origin": "local",
|
||||
"refs": {
|
||||
"resource": "http://example.com/api/files/local/folderA/test.gcode",
|
||||
"download": "http://example.com/downloads/files/local/folderA/test.gcode"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "subfolder",
|
||||
"path": "folderA/subfolder",
|
||||
"type": "folder",
|
||||
"typePath": ["folder"],
|
||||
"children": [
|
||||
{
|
||||
"name": "test.gcode",
|
||||
"path": "folderA/subfolder/test2.gcode",
|
||||
"type": "machinecode",
|
||||
"typePath": ["machinecode", "gcode"],
|
||||
"hash": "...",
|
||||
"size": 100,
|
||||
"date": 1378847754,
|
||||
"origin": "local",
|
||||
"refs": {
|
||||
"resource": "http://example.com/api/files/local/folderA/subfolder/test2.gcode",
|
||||
"download": "http://example.com/downloads/files/local/folderA/subfolder/test2.gcode"
|
||||
}
|
||||
},
|
||||
],
|
||||
"size": 100,
|
||||
"refs": {
|
||||
"resource": "http://example.com/api/files/local/folderA/subfolder",
|
||||
}
|
||||
],
|
||||
"size": 1334,
|
||||
"refs": {
|
||||
"resource": "http://example.com/api/files/local/folderA",
|
||||
}
|
||||
}
|
||||
],
|
||||
"free": "3.2GB"
|
||||
}
|
||||
|
||||
:param recursive: If set to ``true``, return all files and folders recursively. Otherwise only return items on same level.
|
||||
:statuscode 200: No error
|
||||
|
||||
.. _sec-api-fileops-retrievelocation:
|
||||
@@ -215,9 +81,6 @@ Retrieve files from specific location
|
||||
Retrieve information regarding the files currently available on the selected `location` and -- if targeting
|
||||
the ``local`` location -- regarding the disk space still available locally in the system.
|
||||
|
||||
By default only returns the files and folders in the root directory. If the query parameter ``recursive``
|
||||
is provided and set to ``true``, returns all files and folders.
|
||||
|
||||
Returns a :ref:`Retrieve response <sec-api-fileops-datamodel-retrieveresponse>`.
|
||||
|
||||
**Example**:
|
||||
@@ -237,10 +100,6 @@ Retrieve files from specific location
|
||||
"files": [
|
||||
{
|
||||
"name": "whistle_v2.gcode",
|
||||
"path": "whistle_v2.gcode",
|
||||
"type": "machinecode",
|
||||
"typePath": ["machinecode", "gcode"],
|
||||
"hash": "...",
|
||||
"size": 1468987,
|
||||
"date": 1378847754,
|
||||
"origin": "local",
|
||||
@@ -271,35 +130,25 @@ Retrieve files from specific location
|
||||
:param location: The origin location from which to retrieve the files. Currently only ``local`` and ``sdcard`` are
|
||||
supported, with ``local`` referring to files stored in OctoPrint's ``uploads`` folder and ``sdcard``
|
||||
referring to files stored on the printer's SD card (if available).
|
||||
:param recursive: If set to ``true``, return all files and folders recursively. Otherwise only return items on same level.
|
||||
:statuscode 200: No error
|
||||
:statuscode 404: If `location` is neither ``local`` nor ``sdcard``
|
||||
|
||||
.. _sec-api-fileops-uploadfile:
|
||||
|
||||
Upload file or create folder
|
||||
============================
|
||||
Upload file
|
||||
===========
|
||||
|
||||
.. http:post:: /api/files/(string:location)
|
||||
|
||||
Upload a file to the selected ``location`` or create a new empty folder on it.
|
||||
Upload a file to the selected `location`.
|
||||
|
||||
Other than most of the other requests on OctoPrint's API which are expected as JSON, this request is expected as
|
||||
``Content-Type: multipart/form-data`` due to the included file upload.
|
||||
|
||||
To upload a file, the request body must at least contain the ``file`` form field with the
|
||||
contents and file name of the file to upload.
|
||||
|
||||
To create a new folder, the request body must at least contain the ``foldername`` form field,
|
||||
specifying the name of the new folder. Note that folder creation is currently only supported on
|
||||
the ``local`` file system.
|
||||
|
||||
Returns a :http:statuscode:`201` response with a ``Location`` header set to the management URL of the uploaded
|
||||
file and an :ref:`Upload Response <sec-api-fileops-datamodel-uploadresponse>` as the body upon successful completion.
|
||||
|
||||
Requires user rights.
|
||||
|
||||
**Example for uploading a file**
|
||||
**Example**
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
@@ -312,10 +161,18 @@ Upload file or create folder
|
||||
Content-Disposition: form-data; name="file"; filename="whistle_v2.gcode"
|
||||
Content-Type: application/octet-stream
|
||||
|
||||
;Generated with Cura_SteamEngine 13.11.2
|
||||
M109 T0 S220.000000
|
||||
T0
|
||||
G21
|
||||
G90
|
||||
;Sliced at: Wed 11-12-2013 16:53:12
|
||||
;Basic settings: Layer height: 0.2 Walls: 0.8 Fill: 20
|
||||
;Print time: #P_TIME#
|
||||
;Filament used: #F_AMNT#m #F_WGHT#g
|
||||
;Filament cost: #F_COST#
|
||||
;M190 S70 ;Uncomment to add your own bed temperature line
|
||||
;M109 S220 ;Uncomment to add your own temperature line
|
||||
G21 ;metric values
|
||||
G90 ;absolute positioning
|
||||
...
|
||||
------WebKitFormBoundaryDeC2E3iWbTv1PwMC
|
||||
Content-Disposition: form-data; name="select"
|
||||
@@ -331,15 +188,12 @@ Upload file or create folder
|
||||
|
||||
HTTP/1.1 200 OK
|
||||
Content-Type: application/json
|
||||
Location: http://example.com/api/files/sdcard/whistle_v2.gcode
|
||||
Location: http://example.com/api/files/sdcard/whistle_.gcode
|
||||
|
||||
{
|
||||
"files": {
|
||||
"local": {
|
||||
"name": "whistle_v2.gcode",
|
||||
"path": "whistle_v2.gcode",
|
||||
"type": "machinecode",
|
||||
"typePath": ["machinecode", "gcode"],
|
||||
"origin": "local",
|
||||
"refs": {
|
||||
"resource": "http://example.com/api/files/local/whistle_v2.gcode",
|
||||
@@ -348,129 +202,44 @@ Upload file or create folder
|
||||
},
|
||||
"sdcard": {
|
||||
"name": "whistle_.gco",
|
||||
"path": "whistle_.gco",
|
||||
"origin": "sdcard",
|
||||
"refs": {
|
||||
"resource": "http://example.com/api/files/sdcard/whistle_.gco"
|
||||
}
|
||||
}
|
||||
},
|
||||
"done": false
|
||||
}
|
||||
|
||||
**Example with UTF-8 encoded filename following RFC 5987**
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
POST /api/files/local HTTP/1.1
|
||||
Host: example.com
|
||||
X-Api-Key: abcdef...
|
||||
Content-Type: multipart/form-data; boundary=----WebKitFormBoundaryDeC2E3iWbTv1PwMC
|
||||
|
||||
------WebKitFormBoundaryDeC2E3iWbTv1PwMC
|
||||
Content-Disposition: form-data; name="file"; filename*=utf-8''20mm-%C3%BCml%C3%A4ut-b%C3%B6x.gcode
|
||||
Content-Type: application/octet-stream
|
||||
|
||||
M109 T0 S220.000000
|
||||
T0
|
||||
G21
|
||||
G90
|
||||
...
|
||||
------WebKitFormBoundaryDeC2E3iWbTv1PwMC--
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
HTTP/1.1 200 OK
|
||||
Content-Type: application/json
|
||||
Location: http://example.com/api/files/local/20mm-umlaut-box.gcode
|
||||
|
||||
{
|
||||
"files": {
|
||||
"local": {
|
||||
"name": "20mm-umlaut-box",
|
||||
"origin": "local",
|
||||
"refs": {
|
||||
"resource": "http://example.com/api/files/local/whistle_v2.gcode",
|
||||
"download": "http://example.com/downloads/files/local/whistle_v2.gcode"
|
||||
}
|
||||
}
|
||||
},
|
||||
"done": true
|
||||
}
|
||||
|
||||
**Example for creating a folder**
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
POST /api/files/local HTTP/1.1
|
||||
Host: example.com
|
||||
X-Api-Key: abcdef...
|
||||
Content-Type: multipart/form-data; boundary=----WebKitFormBoundaryDeC2E3iWbTv1PwMD
|
||||
|
||||
------WebKitFormBoundaryDeC2E3iWbTv1PwMD
|
||||
Content-Disposition: form-data; name="foldername"
|
||||
|
||||
subfolder
|
||||
------WebKitFormBoundaryDeC2E3iWbTv1PwMD
|
||||
Content-Disposition: form-data; name="path"
|
||||
|
||||
folder/
|
||||
------WebKitFormBoundaryDeC2E3iWbTv1PwMD--
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
HTTP/1.1 200 OK
|
||||
Content-Type: application/json
|
||||
Location: http://example.com/api/files/local/folder/subfolder
|
||||
|
||||
{
|
||||
"folder": {
|
||||
"name": "subfolder",
|
||||
"path": "folder/subfolder",
|
||||
"origin": "local"
|
||||
},
|
||||
"done": true
|
||||
}
|
||||
|
||||
:param location: The target location to which to upload the file. Currently only ``local`` and ``sdcard`` are supported
|
||||
here, with ``local`` referring to OctoPrint's ``uploads`` folder and ``sdcard`` referring to
|
||||
the printer's SD card. If an upload targets the SD card, it will also be stored locally first.
|
||||
:form file: The file to upload, including a valid ``filename``.
|
||||
:form path: The path within the ``location`` to upload the file to or create the folder in (without the future
|
||||
filename or ``foldername`` - basically the parent folder). If unset will be taken from the provided
|
||||
``file``'s name or ``foldername`` and default to the root folder of the ``location``.
|
||||
:form select: Whether to select the file directly after upload (``true``) or not (``false``). Optional, defaults
|
||||
to ``false``. Ignored when creating a folder.
|
||||
:form print: Whether to start printing the file directly after upload (``true``) or not (``false``). If set, ``select``
|
||||
is implicitely ``true`` as well. Optional, defaults to ``false``. Ignored when creating a folder.
|
||||
:form userdata: [Optional] An optional string that if specified will be interpreted as JSON and then saved along
|
||||
with the file as metadata (metadata key ``userdata``). Ignored when creating a folder.
|
||||
:form foldername: The name of the folder to create. Ignored when uploading a file.
|
||||
:statuscode 201: No error
|
||||
:statuscode 400: If no ``file`` or ``foldername`` are included in the request, ``userdata`` was provided but could
|
||||
not be parsed as JSON or the request is otherwise invalid.
|
||||
:statuscode 404: If ``location`` is neither ``local`` nor ``sdcard`` or trying to upload to SD card and SD card support
|
||||
is disabled
|
||||
:statuscode 409: If the upload of the file would override the file that is currently being printed or if an upload
|
||||
to SD card was requested and the printer is either not operational or currently busy with a print job.
|
||||
:statuscode 415: If the file is neither a ``gcode`` nor an ``stl`` file (or it is an ``stl`` file but slicing support
|
||||
is disabled)
|
||||
:statuscode 500: If the upload failed internally
|
||||
:param location: The target location to which to upload the file. Currently only ``local`` and ``sdcard`` are supported
|
||||
here, with ``local`` referring to OctoPrint's ``uploads`` folder and ``sdcard`` referring to
|
||||
the printer's SD card. If an upload targets the SD card, it will also be stored locally first.
|
||||
:form file: The file to upload, including a valid ``filename``.
|
||||
:form select: Whether to select the file directly after upload (``true``) or not (``false``). Optional, defaults
|
||||
to ``false``.
|
||||
:form print: Whether to start printing the file directly after upload (``true``) or not (``false``). If set, `select`
|
||||
is implicitely ``true`` as well. Optional, defaults to ``false``.
|
||||
:statuscode 201: No error
|
||||
:statuscode 400: If no `file` is included in the request, or the request is otherwise invalid.
|
||||
:statuscode 404: If `location` is neither ``local`` nor ``sdcard`` or trying to upload to SD card and SD card support
|
||||
is disabled
|
||||
:statuscode 409: If the upload of the file would override the file that is currently being printed or if an upload
|
||||
to SD card was requested and the printer is either not operational or currently busy with a print job.
|
||||
:statuscode 415: If the file is neither a ``gcode`` nor an ``stl`` file (or it is an ``stl`` file but slicing support
|
||||
is disabled)
|
||||
:statuscode 500: If the upload failed internally
|
||||
|
||||
.. _sec-api-fileops-retrievefileinfo:
|
||||
|
||||
Retrieve a specific file's or folder's information
|
||||
==================================================
|
||||
Retrieve a specific file's information
|
||||
======================================
|
||||
|
||||
.. http:get:: /api/files/(string:location)/(path:filename)
|
||||
|
||||
Retrieves the selected file's or folder's information.
|
||||
Retrieves the selected file's information.
|
||||
|
||||
If the file is unknown, a :http:statuscode:`404` is returned.
|
||||
|
||||
If the targeted path is a folder, by default only its direct children will be returned. If ``recursive`` is
|
||||
provided and set to ``true``, all sub folders and their children will be returned too.
|
||||
|
||||
On success, a :http:statuscode:`200` is returned, with a :ref:`file information item <sec-api-datamodel-files-file>`
|
||||
as the response body.
|
||||
|
||||
@@ -515,9 +284,8 @@ Retrieve a specific file's or folder's information
|
||||
|
||||
:param location: The location of the file for which to retrieve the information, either ``local`` or ``sdcard``.
|
||||
:param filename: The filename of the file for which to retrieve the information
|
||||
:param recursive: If set to ``true``, return all files and folders recursively. Otherwise only return items on same level.
|
||||
:statuscode 200: No error
|
||||
:statuscode 404: If ``target`` is neither ``local`` nor ``sdcard``, ``sdcard`` but SD card support is disabled or the
|
||||
:statuscode 404: If `target` is neither ``local`` nor ``sdcard``, ``sdcard`` but SD card support is disabled or the
|
||||
requested file was not found
|
||||
|
||||
.. _sec-api-fileops-filecommand:
|
||||
@@ -525,7 +293,7 @@ Retrieve a specific file's or folder's information
|
||||
Issue a file command
|
||||
====================
|
||||
|
||||
.. http:post:: /api/files/(string:location)/(path:path)
|
||||
.. http:post:: /api/files/(string:target)/(path:filename)
|
||||
|
||||
Issue a file command to an existing file. Currently supported commands are:
|
||||
|
||||
@@ -536,8 +304,6 @@ Issue a file command
|
||||
is not operational when this parameter is present and set to ``true``, the request will fail with a response
|
||||
of ``409 Conflict``.
|
||||
|
||||
Upon success, a status code of :http:statuscode:`204` and an empty body is returned.
|
||||
|
||||
slice
|
||||
Slices an STL file into GCODE. Note that this is an asynchronous operation that will take place in the background
|
||||
after the response has been sent back to the client. Additional parameters are:
|
||||
@@ -565,34 +331,7 @@ Issue a file command
|
||||
also mean that if it was supposed to be directly selected and start printing after the slicing finished, this will not
|
||||
take place anymore and whether this will happen with the new sliced file depends entirely on the new request!
|
||||
|
||||
Upon success, a status code of :http:statuscode:`202` and a :ref:`sec-api-datamodel-files-fileabridged` in the response
|
||||
body will be returned.
|
||||
|
||||
copy
|
||||
Copies the file or folder to a new ``destination`` on the same ``location``. Additional parameters are:
|
||||
|
||||
* ``destination``: The path of the parent folder to which to copy the file or folder. It must already exist.
|
||||
|
||||
If there already exists a file or folder of the same name at ``destination``, the request will return a :http:statuscode:`409`.
|
||||
If the ``destination`` folder does not exist, a :http:statuscode:`404` will be returned.
|
||||
|
||||
Upon success, a status code of :http:statuscode:`201` and a :ref:`sec-api-datamodel-files-fileabridged` in the response
|
||||
body will be returned.
|
||||
|
||||
move
|
||||
Moves the file or folder to a new ``destination`` on the same ``location``. Additional parameters are:
|
||||
|
||||
* ``destination``: The path of the parent folder to which to move the file or folder.
|
||||
|
||||
If there already exists a file or folder of the same name at ``destination``, the request will return a :http:statuscode:`409`.
|
||||
If the ``destination`` folder does not exist, a :http:statuscode:`404` will be returned. If the ``path`` is currently
|
||||
in use by OctoPrint (e.g. it is a GCODE file that's currently being printed) a :http:statuscode:`409` will be
|
||||
returned.
|
||||
|
||||
Upon success, a status code of :http:statuscode:`201` and a :ref:`sec-api-datamodel-files-fileabridged` in the response
|
||||
body will be returned.
|
||||
|
||||
Requires user rights.
|
||||
Upon success, a status code of :http:statuscode:`204` and an empty body is returned, unless specified otherwise.
|
||||
|
||||
**Example Select Request**
|
||||
|
||||
@@ -616,7 +355,7 @@ Issue a file command
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
POST /api/files/local/some_folder/some_model.stl HTTP/1.1
|
||||
POST /api/files/local/some_model.stl HTTP/1.1
|
||||
Host: example.com
|
||||
Content-Type: application/json
|
||||
X-Api-Key: abcdef...
|
||||
@@ -641,73 +380,16 @@ Issue a file command
|
||||
{
|
||||
"origin": "local",
|
||||
"name": "some_model.first_try.gcode",
|
||||
"path": "some_folder/some_model.first_try.gcode",
|
||||
"refs": {
|
||||
"download": "http://example.com/downloads/files/local/some_folder/some_model.first_try.gcode",
|
||||
"resource": "http://example.com/api/files/local/some_folder/some_model.first_try.gcode"
|
||||
"download": "http://example.com/downloads/files/local/some_model.first_try.gcode",
|
||||
"resource": "http://example.com/api/files/local/some_model.first_try.gcode"
|
||||
}
|
||||
}
|
||||
|
||||
**Example Copy Request**
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
POST /api/files/local/some_folder/some_model.gcode HTTP/1.1
|
||||
Host: example.com
|
||||
Content-Type: application/json
|
||||
X-Api-Key: abcdef...
|
||||
|
||||
{
|
||||
"command": "copy",
|
||||
"destination": "some_other_folder/subfolder"
|
||||
}
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
HTTP/1.1 201 Created
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"origin": "local",
|
||||
"name": "some_model.gcode",
|
||||
"path": "some_other_folder/subfolder/some_model.gcode",
|
||||
"refs": {
|
||||
"download": "http://example.com/downloads/files/local/some_other_folder/subfolder/some_model.gcode",
|
||||
"resource": "http://example.com/api/files/local/some_other_folder/subfolder/some_model.gcode"
|
||||
}
|
||||
}
|
||||
|
||||
**Example Move Request**
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
POST /api/files/local/some_folder/and_a_subfolder HTTP/1.1
|
||||
Host: example.com
|
||||
Content-Type: application/json
|
||||
X-Api-Key: abcdef...
|
||||
|
||||
{
|
||||
"command": "move",
|
||||
"destination": "some_other_folder"
|
||||
}
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
HTTP/1.1 201 Created
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"origin": "local",
|
||||
"name": "and_a_subfolder",
|
||||
"path": "some_other_folder/and_a_subfolder",
|
||||
"refs": {
|
||||
"resource": "http://example.com/api/files/local/some_other_folder/and_a_subfolder"
|
||||
}
|
||||
}
|
||||
|
||||
:param location: The target location on which to send the command for is located, either ``local`` (for OctoPrint's ``uploads``
|
||||
:param target: The target location on which to delete the file, either ``local`` (for OctoPrint's ``uploads``
|
||||
folder) or ``sdcard`` for the printer's SD card (if available)
|
||||
:param path: The path of the file for which to issue the command
|
||||
:param filename: The filename of the file for which to issue the command
|
||||
:json string command: The command to issue for the file, currently only ``select`` is supported
|
||||
:json boolean print: ``select`` and ``slice`` command: Optional, whether to start printing the file directly after selection
|
||||
or slicing, defaults to ``false``.
|
||||
@@ -725,7 +407,7 @@ Issue a file command
|
||||
:statuscode 202: No error for a ``slice`` command.
|
||||
:statuscode 400: If the ``command`` is unknown or the request is otherwise invalid
|
||||
:statuscode 415: If a ``slice`` command was issued against something other than an STL file.
|
||||
:statuscode 404: If ``location`` is neither ``local`` nor ``sdcard`` or the requested file was not found
|
||||
:statuscode 404: If `target` is neither ``local`` nor ``sdcard`` or the requested file was not found
|
||||
:statuscode 409: If a selected file is supposed to start printing directly but the printer is not operational or
|
||||
if a file to be sliced is supposed to be selected or start printing directly but the printer
|
||||
is not operational or already printing.
|
||||
@@ -735,16 +417,14 @@ Issue a file command
|
||||
Delete file
|
||||
===========
|
||||
|
||||
.. http:delete:: /api/files/(string:location)/(path:path)
|
||||
.. http:delete:: /api/files/(string:target)/(path:filename)
|
||||
|
||||
Delete the selected ``path`` on the selected ``location``.
|
||||
Delete the selected `filename` on the selected `target`.
|
||||
|
||||
If the file to be deleted is currently being printed, a :http:statuscode:`409` will be returned.
|
||||
|
||||
Returns a :http:statuscode:`204` after successful deletion.
|
||||
|
||||
Requires user rights.
|
||||
|
||||
**Example Request**
|
||||
|
||||
.. sourcecode:: http
|
||||
@@ -753,17 +433,17 @@ Delete file
|
||||
Host: example.com
|
||||
X-Api-Key: abcdef...
|
||||
|
||||
:param location: The target location on which to delete the file, either ``local`` (for OctoPrint's ``uploads``
|
||||
:param target: The target location on which to delete the file, either ``local`` (for OctoPrint's ``uploads``
|
||||
folder) or ``sdcard`` for the printer's SD card (if available)
|
||||
:param path: The path of the file to delete
|
||||
:param filename: The filename of the file to delete
|
||||
:statuscode 204: No error
|
||||
:statuscode 404: If ``location`` is neither ``local`` nor ``sdcard`` or the requested file was not found
|
||||
:statuscode 404: If `target` is neither ``local`` nor ``sdcard`` or the requested file was not found
|
||||
:statuscode 409: If the file to be deleted is currently being printed
|
||||
|
||||
.. _sec-api-fileops-datamodel:
|
||||
|
||||
Data model
|
||||
==========
|
||||
Datamodel
|
||||
=========
|
||||
|
||||
.. _sec-api-fileops-datamodel-retrieveresponse:
|
||||
|
||||
@@ -802,28 +482,24 @@ Upload response
|
||||
- Type
|
||||
- Description
|
||||
* - ``files``
|
||||
- 0..1
|
||||
- 1
|
||||
- Object
|
||||
- Abridged information regarding the file that was just uploaded. If only uploaded to ``local`` this will only
|
||||
contain the ``local`` property. If uploaded to SD card, this will contain both ``local`` and ``sdcard`` properties.
|
||||
Only contained if a file was uploaded, not present if only a new folder was created.
|
||||
* - ``files.local``
|
||||
- 1
|
||||
- :ref:`sec-api-datamodel-files-fileabridged`
|
||||
- The information regarding the file that was just uploaded to the local storage.
|
||||
- :ref:`sec-api-datamodel-files-file`
|
||||
- The information regarding the file that was just uploaded to the local storage (only the fields ``name``,
|
||||
``origin`` and ``refs`` will be set).
|
||||
* - ``files.sdcard``
|
||||
- 0..1
|
||||
- :ref:`sec-api-datamodel-files-fileabridged`
|
||||
- The information regarding the file that was just uploaded to the printer's SD card.
|
||||
* - ``folder``
|
||||
- 0..1
|
||||
- :ref:`sec-api-datamodel-files-fileabridged`
|
||||
- Abridged information regarding the folder that was just created. Only contained if a folder
|
||||
was created, not present if a file was uploaded.
|
||||
- :ref:`sec-api-datamodel-files-file`
|
||||
- The information regarding the file that was just uploaded to the printer's SD card (only the fields ``name``,
|
||||
``origin`` and ``refs`` will be set).
|
||||
* - ``done``
|
||||
- 1
|
||||
- Boolean
|
||||
- Whether any file processing after upload has already finished (``true``) or not, e.g. due to first needing
|
||||
- Whether the file processing after upload has already finished (``true``) or not, e.g. due to first needing
|
||||
to perform a slicing step (``false``). Clients may use this information to direct progress displays related to
|
||||
the upload.
|
||||
|
||||
@@ -74,19 +74,7 @@ Encoding
|
||||
|
||||
OctoPrint uses UTF-8 as charset.
|
||||
|
||||
That also includes headers in ``multipart/form-data`` requests, in order to allow the full UTF-8 range of characters
|
||||
for uploaded filenames. If a ``multipart/form-data`` sub header cannot be decoded as UTF-8, OctoPrint will also attempt
|
||||
to decode it as ISO-8859-1.
|
||||
|
||||
Additionally, OctoPrint supports replacing the ``filename`` field in the ``Content-Disposition`` header of a
|
||||
multipart field with a ``filename*`` field following `RFC 5987, Section 3.2 <https://tools.ietf.org/html/rfc5987#section-3.2>`_,
|
||||
which allows defining the charset used for encoding the filename. If both ``filename`` and ``filename*`` fields are
|
||||
present, following the recommendation of the RFC ``filename*`` will be used.
|
||||
|
||||
For an example on how to send a request utilizing RFC 5987 for the ``filename*`` attribute, see the second example
|
||||
in :ref:`Upload file <sec-api-fileops-uploadfile>`.
|
||||
|
||||
.. _sec-api-general-crossorigin:
|
||||
.. _sec-api-cross-origin:
|
||||
|
||||
Cross-origin requests
|
||||
=====================
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
.. _sec-api:
|
||||
|
||||
########
|
||||
REST API
|
||||
########
|
||||
#################
|
||||
API Documentation
|
||||
#################
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 2
|
||||
@@ -10,19 +10,12 @@ REST API
|
||||
general.rst
|
||||
version.rst
|
||||
apps.rst
|
||||
fileops.rst
|
||||
connection.rst
|
||||
files.rst
|
||||
job.rst
|
||||
languages.rst
|
||||
logs.rst
|
||||
printer.rst
|
||||
printerprofiles.rst
|
||||
settings.rst
|
||||
job.rst
|
||||
logs.rst
|
||||
slicing.rst
|
||||
system.rst
|
||||
timelapse.rst
|
||||
users.rst
|
||||
util.rst
|
||||
wizard.rst
|
||||
push.rst
|
||||
datamodel.rst
|
||||
@@ -19,48 +19,25 @@ Issue a job command
|
||||
Starts the print of the currently selected file. For selecting a file, see :ref:`Issue a file command <sec-api-fileops-filecommand>`.
|
||||
If a print job is already active, a :http:statuscode:`409` will be returned.
|
||||
|
||||
cancel
|
||||
Cancels the current print job. If no print job is active (either paused or printing), a :http:statuscode:`409`
|
||||
will be returned.
|
||||
|
||||
restart
|
||||
Restart the print of the currently selected file from the beginning. There must be an active print job for this to work
|
||||
and the print job must currently be paused. If either is not the case, a :http:statuscode:`409` will be returned.
|
||||
|
||||
Equivalent to issuing a ``cancel`` command while paused, directly followed by a ``start`` command.
|
||||
|
||||
pause
|
||||
Pauses/resumes/toggles the current print job. Accepts one optional additional parameter ``action``
|
||||
specifying which action to take. Valid values for this parameter are:
|
||||
Pauses/unpauses the current print job. If no print job is active (either paused or printing), a :http:statuscode:`409`
|
||||
will be returned.
|
||||
|
||||
pause
|
||||
Pauses the current job if it's printing, does nothing if it's already paused.
|
||||
resume
|
||||
Resumes the current job if it's paused, does nothing if it's printing.
|
||||
toggle
|
||||
Toggles the pause state of the job, pausing it if it's printing and resuming it if it's currently paused.
|
||||
|
||||
In order to stay backwards compatible to earlier iterations of this API, the default
|
||||
action to take if no ``action`` parameter is supplied is to toggle the print job status.
|
||||
|
||||
If no print job is active (either paused or printing), a :http:statuscode:`409` will be returned.
|
||||
|
||||
.. note::
|
||||
|
||||
While the approach to implement pause/resume/toggle behaviour through sub commands via the ``action``
|
||||
parameter instead of having dedicated ``pause``, ``resume`` and ``toggle`` commands seems clumsy, this path
|
||||
was chosen to have the API stay backwards compatible to prior versions which only offered the toggle
|
||||
behaviour under the ``pause`` command.
|
||||
cancel
|
||||
Cancels the current print job. If no print job is active (either paused or printing), a :http:statuscode:`409`
|
||||
will be returned.
|
||||
|
||||
Upon success, a status code of :http:statuscode:`204` and an empty body is returned.
|
||||
|
||||
Requires user rights.
|
||||
|
||||
**Example Start Request**
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
POST /api/job HTTP/1.1
|
||||
POST /api/control/job HTTP/1.1
|
||||
Host: example.com
|
||||
Content-Type: application/json
|
||||
X-Api-Key: abcdef...
|
||||
@@ -73,28 +50,11 @@ Issue a job command
|
||||
|
||||
HTTP/1.1 204 No Content
|
||||
|
||||
**Example Cancel Request**
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
POST /api/job HTTP/1.1
|
||||
Host: example.com
|
||||
Content-Type: application/json
|
||||
X-Api-Key: abcdef...
|
||||
|
||||
{
|
||||
"command": "cancel"
|
||||
}
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
HTTP/1.1 204 No Content
|
||||
|
||||
**Example Restart Request**
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
POST /api/job HTTP/1.1
|
||||
POST /api/control/job HTTP/1.1
|
||||
Host: example.com
|
||||
Content-Type: application/json
|
||||
X-Api-Key: abcdef...
|
||||
@@ -111,50 +71,30 @@ Issue a job command
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
POST /api/job HTTP/1.1
|
||||
POST /api/control/job HTTP/1.1
|
||||
Host: example.com
|
||||
Content-Type: application/json
|
||||
X-Api-Key: abcdef...
|
||||
|
||||
{
|
||||
"command": "pause",
|
||||
"action": "pause"
|
||||
"command": "pause"
|
||||
}
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
HTTP/1.1 204 No Content
|
||||
|
||||
**Example Resume Request**
|
||||
**Example Cancel Request**
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
POST /api/job HTTP/1.1
|
||||
POST /api/control/job HTTP/1.1
|
||||
Host: example.com
|
||||
Content-Type: application/json
|
||||
X-Api-Key: abcdef...
|
||||
|
||||
{
|
||||
"command": "pause",
|
||||
"action": "resume"
|
||||
}
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
HTTP/1.1 204 No Content
|
||||
|
||||
**Example Pause Toggle Request**
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
POST /api/job HTTP/1.1
|
||||
Host: example.com
|
||||
Content-Type: application/json
|
||||
X-Api-Key: abcdef...
|
||||
|
||||
{
|
||||
"command": "pause",
|
||||
"action": "toggle"
|
||||
"command": "cancel"
|
||||
}
|
||||
|
||||
.. sourcecode:: http
|
||||
@@ -216,8 +156,8 @@ Retrieve information about the current job
|
||||
|
||||
.. _sec-api-job-datamodel:
|
||||
|
||||
Data model
|
||||
==========
|
||||
Datamodel
|
||||
=========
|
||||
|
||||
.. _sec-api-job-datamodel-response:
|
||||
|
||||
|
||||
@@ -1,232 +0,0 @@
|
||||
.. _sec-api-languages:
|
||||
|
||||
*********
|
||||
Languages
|
||||
*********
|
||||
|
||||
.. note::
|
||||
|
||||
All language pack management operations require admin rights.
|
||||
|
||||
.. contents::
|
||||
|
||||
.. _sec-api-languages-list:
|
||||
|
||||
Retrieve installed language packs
|
||||
=================================
|
||||
|
||||
.. http:get:: /api/languages
|
||||
|
||||
Retrieves a list of installed language packs.
|
||||
|
||||
The response body will contain a :ref:`list response <sec-api-languages-datamodel-listresponse>`.
|
||||
|
||||
**Example**
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
GET /api/languages HTTP/1.1
|
||||
Host: example.com
|
||||
X-Api-Key: abcdef...
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
HTTP/1.1 200 OK
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"language_packs": {
|
||||
"_core": {
|
||||
"identifier": "_core",
|
||||
"name": "Core",
|
||||
"languages": [
|
||||
...
|
||||
]
|
||||
},
|
||||
"some_plugin": {
|
||||
"identifier": "some_plugin",
|
||||
"name": "Some Plugin",
|
||||
"languages": [
|
||||
{
|
||||
"locale": "de",
|
||||
"locale_display": "Deutsch",
|
||||
"locale_english": "German",
|
||||
"last_update": 1474574597,
|
||||
"author": "Gina Häußge"
|
||||
},
|
||||
{
|
||||
"locale": "it",
|
||||
"locale_display": "Italiano",
|
||||
"locale_english": "Italian",
|
||||
"last_update": 1470859680,
|
||||
"author": "The italian Transifex Team"
|
||||
}
|
||||
...
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
:statuscode 200: No error
|
||||
|
||||
.. _sec-api-languages-upload:
|
||||
|
||||
Upload a language pack
|
||||
======================
|
||||
|
||||
.. http:post:: /api/languages
|
||||
|
||||
Uploads a new language pack to OctoPrint.
|
||||
|
||||
Other than most of the other requests on OctoPrint's API which are expected as JSON, this request is expected as
|
||||
``Content-Type: multipart/form-data`` due to the included file upload.
|
||||
|
||||
To upload a file, the request body must contain the ``file`` form field with the
|
||||
contents and file name of the file to upload.
|
||||
|
||||
Only files with one of the extensions ``zip``, ``tar.gz``, ``tgz`` or ``tar`` will be
|
||||
processed, for other file extensions a :http:statuscode:`400` will be returned.
|
||||
|
||||
Will return a list of installed language packs upon completion, as described in
|
||||
:ref:`Retrieve installed language packs <sec-api-languages-list>`.
|
||||
|
||||
:form file: The language pack file to upload
|
||||
:statuscode 200: The file was uploaded successfully
|
||||
|
||||
.. _sec-api-languages-delete:
|
||||
|
||||
Delete a language pack
|
||||
======================
|
||||
|
||||
.. http:delete:: /api/languages/(string:locale)/(string:pack)
|
||||
|
||||
Deletes the language pack ``pack`` for locale ``locale``. Can be either
|
||||
the ``_core`` pack (containing translations for core OctoPrint) or
|
||||
the language pack for a plugin specified by the plugin identifier.
|
||||
|
||||
Returns a list of installed language packs, as described in
|
||||
:ref:`Retrieve installed language packs <sec-api-languages-list>`.
|
||||
|
||||
**Example**
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
DELETE /api/languages/it/some_plugin HTTP/1.1
|
||||
Host: example.com
|
||||
X-Api-Key: abcdef...
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
HTTP/1.1 200 OK
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"language_packs": {
|
||||
"_core": {
|
||||
"identifier": "_core",
|
||||
"name": "Core",
|
||||
"languages": [
|
||||
...
|
||||
]
|
||||
},
|
||||
"some_plugin": {
|
||||
"identifier": "some_plugin",
|
||||
"name": "Some Plugin",
|
||||
"languages": [
|
||||
{
|
||||
"locale": "de",
|
||||
"locale_display": "Deutsch",
|
||||
"locale_english": "German",
|
||||
"last_update": 1474574597,
|
||||
"author": "Gina Häußge"
|
||||
},
|
||||
...
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
:param locale: The locale for which to delete the language pack
|
||||
:param pack: The language pack to delete
|
||||
:statuscode 200: The language pack was deleted
|
||||
|
||||
.. _sec-api-languages-datamodel:
|
||||
|
||||
Data model
|
||||
==========
|
||||
|
||||
.. _sec-api-languages-datamodel-listresponse:
|
||||
|
||||
List response
|
||||
-------------
|
||||
|
||||
.. list-table::
|
||||
:widths: 15 5 10 30
|
||||
:header-rows: 1
|
||||
|
||||
* - Name
|
||||
- Multiplicity
|
||||
- Type
|
||||
- Description
|
||||
* - ``language_packs``
|
||||
- 0..*
|
||||
- Map of :ref:`component lists <sec-api-languages-datamodel-componentlist>`
|
||||
- Map of component lists, indexed by the component's identifier
|
||||
|
||||
.. _sec-api-languages-datamodel-componentlist:
|
||||
|
||||
Component list
|
||||
--------------
|
||||
|
||||
.. list-table::
|
||||
:widths: 15 5 10 30
|
||||
:header-rows: 1
|
||||
|
||||
* - Name
|
||||
- Multiplicity
|
||||
- Type
|
||||
- Description
|
||||
* - ``identifier``
|
||||
- 1
|
||||
- string
|
||||
- The plugin's identifier, ``_core`` for core OctoPrint, the plugin's identifier for plugins
|
||||
* - ``display``
|
||||
- 1
|
||||
- string
|
||||
- Displayable name of the component, ``Core`` for core OctoPrint, the plugin's name for plugins
|
||||
* - ``languages``
|
||||
- 0..*
|
||||
- List of :ref:`language pack meta data <sec-api-languages-datamodel-packmeta>`
|
||||
- Language packs for the component
|
||||
|
||||
.. _sec-api-languages-datamodel-packmeta:
|
||||
|
||||
Language pack metadata
|
||||
----------------------
|
||||
|
||||
.. list-table::
|
||||
:widths: 15 5 10 30
|
||||
:header-rows: 1
|
||||
|
||||
* - Name
|
||||
- Multiplicity
|
||||
- Type
|
||||
- Description
|
||||
* - ``locale``
|
||||
- 1
|
||||
- string
|
||||
- Locale of the language pack
|
||||
* - ``locale_display``
|
||||
- 1
|
||||
- string
|
||||
- Displayable name of the locale
|
||||
* - ``locale_english``
|
||||
- 1
|
||||
- string
|
||||
- English representation of the locale
|
||||
* - ``last_update``
|
||||
- 0..1
|
||||
- int
|
||||
- Timestamp of the last update of the language pack
|
||||
* - ``author``
|
||||
- 0..1
|
||||
- string
|
||||
- Author of the language pack
|
||||
@@ -15,7 +15,7 @@ Log file management
|
||||
Retrieve a list of available log files
|
||||
======================================
|
||||
|
||||
.. http:get:: /api/logs
|
||||
.. http:post:: /api/logs
|
||||
|
||||
Retrieve information regarding all log files currently available and regarding the disk space still available
|
||||
in the system on the location the log files are being stored.
|
||||
@@ -97,8 +97,8 @@ Delete a specific logfile
|
||||
|
||||
.. _sec-api-logs-datamodel:
|
||||
|
||||
Data model
|
||||
==========
|
||||
Datamodel
|
||||
=========
|
||||
|
||||
.. _sec-api-logs-datamodel-retrieveresponse:
|
||||
|
||||
|
||||
@@ -4,6 +4,12 @@
|
||||
Printer operations
|
||||
******************
|
||||
|
||||
.. warning::
|
||||
|
||||
This part of the API is still heavily in development, especially anything that has to do with temperature control.
|
||||
If you happen to want to develop against it, you should drop me an email to make sure I can give you a heads-up when
|
||||
something changes.
|
||||
|
||||
.. contents::
|
||||
|
||||
Printer control is mostly achieved through the use of commands, issued to resources reflecting components of the
|
||||
@@ -19,8 +25,7 @@ Tool
|
||||
See :ref:`sec-api-printer-toolcommand`.
|
||||
Bed
|
||||
Bed commands allow setting the temperature and temperature offset for the printer's heated bed. Querying the
|
||||
corresponding resource returns temperature information including an optional history. Note that Bed commands
|
||||
are only available if the currently selected printer profile has a heated bed.
|
||||
corresponding resource returns temperature information including an optional history.
|
||||
See :ref:`sec-api-printer-bedcommand`.
|
||||
SD card
|
||||
SD commands allow initialization, refresh and release of the printer's SD card (if available). Querying the
|
||||
@@ -29,29 +34,6 @@ SD card
|
||||
|
||||
Besides that, OctoPrint also provides a :ref:`full state report of the printer <sec-api-printer-state>`.
|
||||
|
||||
.. note::
|
||||
|
||||
You might be wondering why all command responses below only return a ``204`` with an empty body instead of
|
||||
the output of the just sent commands. There are two reasons for this.
|
||||
|
||||
OctoPrint's internal webserver is single threaded and can only handle one request at a time. This is
|
||||
not a problem generally since asynchronous programming allows to just have one request which is waiting for
|
||||
data from a long running backend operation to sleep while handling other requests. The internal framework
|
||||
used for providing the REST API though, Flask, is based on WSGI, which is synchrounous in nature. This means
|
||||
that it is impossible to wait in a non blocking wait while handling a request on the REST API. So in order to
|
||||
return the response of a command sent to the printer, the single thread of the webserver would have to be blocked
|
||||
by the API while the response wasn't available yet. Which in turn would mean that the whole web server would
|
||||
stop responding while waiting for the printer to reply, which, depending on the command in question (e.g. homing)
|
||||
can take a long while. That would be a bad idea.
|
||||
|
||||
The second reason is that thanks to a large number of firmwares out there having a `particular bug <https://github.com/MarlinFirmware/Marlin/commit/acc0e7527914948656ccabba35f7faedc94ef885>`_
|
||||
that makes it impossible to track the output of sent commands, identifying the correct response to a given
|
||||
sent command is pretty much hit-and-miss. That situation gets even worse considering that it's next to impossible
|
||||
to distinguish firmware versions which have that bug from firmware versions which don't have it.
|
||||
|
||||
Hence OctoPrint currently doesn't offer any synchronous way of retrieving the output of responses from the printer.
|
||||
If you need the printer's serial communication, you'll need to subscribe to :ref:`push updates <sec-api-push>`.
|
||||
|
||||
.. _sec-api-printer-state:
|
||||
|
||||
Retrieve the current printer state
|
||||
@@ -208,32 +190,20 @@ Issue a print head command
|
||||
jog
|
||||
Jogs the print head (relatively) by a defined amount in one or more axes. Additional parameters are:
|
||||
|
||||
* ``x``: Optional. Amount/coordinate to jog print head on x axis, must be a valid number corresponding to the distance to travel in mm.
|
||||
* ``y``: Optional. Amount/coordinate to jog print head on y axis, must be a valid number corresponding to the distance to travel in mm.
|
||||
* ``z``: Optional. Amount/coordinate to jog print head on z axis, must be a valid number corresponding to the distance to travel in mm.
|
||||
* ``absolute``: Optional. Boolean value specifying whether to move relative to current position (provided
|
||||
axes values are relative amounts) or to absolute position (provided axes values are coordinates)
|
||||
* ``speed``: Optiona. Speed at which to move. If not provided, minimum speed for all selected axes from printer
|
||||
profile will be used. If provided but ``false``, no speed parameter will be appended to the command. Otherwise
|
||||
interpreted as an integer signifying the speed in mm/s, to append to the command.
|
||||
* ``x``: Optional. Amount to jog print head on x axis, must be a valid number corresponding to the distance to travel in mm.
|
||||
* ``y``: Optional. Amount to jog print head on y axis, must be a valid number corresponding to the distance to travel in mm.
|
||||
* ``z``: Optional. Amount to jog print head on z axis, must be a valid number corresponding to the distance to travel in mm.
|
||||
|
||||
home
|
||||
Homes the print head in all of the given axes. Additional parameters are:
|
||||
|
||||
* ``axes``: A list of axes which to home, valid values are one or more of ``x``, ``y``, ``z``.
|
||||
|
||||
feedrate
|
||||
Changes the feedrate factor to apply to the movement's of the axes.
|
||||
|
||||
* ``factor``: The new factor, percentage as integer or float (percentage divided by 100) between 50 and 200%.
|
||||
|
||||
All of these commands except ``feedrate`` may only be sent if the printer is currently operational and not printing.
|
||||
Otherwise a :http:statuscode:`409` is returned.
|
||||
All of these commands may only be sent if the printer is currently operational and not printing. Otherwise a
|
||||
:http:statuscode:`409` is returned.
|
||||
|
||||
Upon success, a status code of :http:statuscode:`204` and an empty body is returned.
|
||||
|
||||
Requires user rights.
|
||||
|
||||
**Example Jog Request**
|
||||
|
||||
Jog the print head by 10mm in X, -5mm in Y and 0.02mm in Z.
|
||||
@@ -276,34 +246,13 @@ Issue a print head command
|
||||
|
||||
HTTP/1.1 204 No Content
|
||||
|
||||
**Example feed rate request**
|
||||
|
||||
Set the feed rate factor to 105%.
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
POST /api/printer/printhead HTTP/1.1
|
||||
Host: example.com
|
||||
Content-Type: application/json
|
||||
X-Api-Key: abcdef...
|
||||
|
||||
{
|
||||
"command": "feedrate",
|
||||
"factor": 105
|
||||
}
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
HTTP/1.1 204 No Content
|
||||
|
||||
:json string command: The command to issue, either ``jog`` or ``home``.
|
||||
:json number x: ``jog`` command: The amount to travel on the X axis in mm.
|
||||
:json number y: ``jog`` command: The amount to travel on the Y axis in mm.
|
||||
:json number z: ``jog`` command: The amount to travel on the Z axis in mm.
|
||||
:json array axes: ``home`` command: The axes which to home, valid values are one or more of ``x``, ``y`` and ``z``.
|
||||
:json number factor: ``feedrate`` command: The factor to apply to the feed rate, percentage between 50 and 200% as integer or float.
|
||||
:statuscode 204: No error
|
||||
:statuscode 400: Invalid axis specified, invalid value for travel amount for a jog command or factor for feed rate or otherwise invalid
|
||||
:statuscode 400: Invalid axis specified, invalid value for travel amount for a jog command or otherwise invalid
|
||||
request.
|
||||
:statuscode 409: If the printer is not operational or currently printing.
|
||||
|
||||
@@ -339,18 +288,12 @@ Issue a tool command
|
||||
|
||||
* ``amount``: The amount of filament to extrude in mm. May be negative to retract.
|
||||
|
||||
flowrate
|
||||
Changes the flow rate factor to apply to extrusion of the tool.
|
||||
|
||||
* ``factor``: The new factor, percentage as integer or float (percentage divided by 100) between 75 and 125%.
|
||||
|
||||
All of these commands may only be sent if the printer is currently operational and -- in case of ``select`` and
|
||||
``extrude`` -- not printing. Otherwise a :http:statuscode:`409` is returned.
|
||||
|
||||
Upon success, a status code of :http:statuscode:`204` and an empty body is returned.
|
||||
|
||||
Requires user rights.
|
||||
|
||||
**Example Target Temperature Request**
|
||||
|
||||
Set the target temperature for the printer's first hotend to 220°C and the printer's second extruder to 205°C.
|
||||
@@ -457,35 +400,14 @@ Issue a tool command
|
||||
|
||||
HTTP/1.1 204 No Content
|
||||
|
||||
**Example flow rate request**
|
||||
|
||||
Set the flow rate factor to 95%.
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
POST /api/printer/tool HTTP/1.1
|
||||
Host: example.com
|
||||
Content-Type: application/json
|
||||
X-Api-Key: abcdef...
|
||||
|
||||
{
|
||||
"command": "flowrate",
|
||||
"factor": 95
|
||||
}
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
HTTP/1.1 204 No Content
|
||||
|
||||
:json string command: The command to issue, either ``target``, ``offset``, ``select`` or ``extrude``.
|
||||
:json object targets: ``target`` command: The target temperatures to set. Valid properties have to match the format ``tool{n}``.
|
||||
:json object offsets: ``offset`` command: The offset temperature to set. Valid properties have to match the format ``tool{n}``.
|
||||
:json object tool: ``select`` command: The tool to select, value has to match the format ``tool{n}``.
|
||||
:json object amount: ``extrude`` command: The amount of filament to extrude from the currently selected tool.
|
||||
:json number factor: ``flowrate`` command: The factor to apply to the flow rate, percentage between 75 and 125% as integer or float.
|
||||
:statuscode 204: No error
|
||||
:statuscode 400: If ``targets`` or ``offsets`` contains a property or ``tool`` contains a value not matching the format
|
||||
``tool{n}``, the target/offset temperature, extrusion amount or flow rate factor is not a valid number or outside of
|
||||
``tool{n}``, the target/offset temperature or extrusion amount is not a valid number or outside of
|
||||
the supported range, or if the request is otherwise invalid.
|
||||
:statuscode 409: If the printer is not operational or -- in case of ``select`` or ``extrude`` -- currently printing.
|
||||
|
||||
@@ -591,11 +513,6 @@ Issue a bed command
|
||||
|
||||
Upon success, a status code of :http:statuscode:`204` and an empty body is returned.
|
||||
|
||||
If no heated bed is configured for the currently selected printer profile, the resource will return
|
||||
an :http:statuscode:`409`.
|
||||
|
||||
Requires user rights.
|
||||
|
||||
**Example Target Temperature Request**
|
||||
|
||||
Set the target temperature for the printer's heated bed to 75°C.
|
||||
@@ -642,8 +559,7 @@ Issue a bed command
|
||||
:statuscode 204: No error
|
||||
:statuscode 400: If ``target`` or ``offset`` is not a valid number or outside of the supported range, or if the
|
||||
request is otherwise invalid.
|
||||
:statuscode 409: If the printer is not operational or the selected printer profile
|
||||
does not have a heated bed.
|
||||
:statuscode 409: If the printer is not operational.
|
||||
|
||||
.. _sec-api-printer-bedstate:
|
||||
|
||||
@@ -660,9 +576,6 @@ Retrieve the current bed state
|
||||
|
||||
Returns a :http:statuscode:`200` with a Temperature Response in the body upon success.
|
||||
|
||||
If no heated bed is configured for the currently selected printer profile, the resource will return
|
||||
an :http:statuscode:`409`.
|
||||
|
||||
.. note::
|
||||
If you want both tool and bed temperature information at the same time, take a look at
|
||||
:ref:`Retrieve the current printer state <sec-api-printer-state>`.
|
||||
@@ -711,8 +624,7 @@ Retrieve the current bed state
|
||||
:query limit: 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.
|
||||
:statuscode 200: No error
|
||||
:statuscode 409: If the printer is not operational or the selected printer profile
|
||||
does not have a heated bed.
|
||||
:statuscode 409: If the printer is not operational.
|
||||
|
||||
.. _sec-api-printer-sdcommand:
|
||||
|
||||
@@ -727,7 +639,7 @@ Issue an SD command
|
||||
|
||||
init
|
||||
Initializes the printer's SD card, making it available for use. This also includes an initial retrieval of the
|
||||
list of files currently stored on the SD card, so after issuing that command a :ref:`retrieval of the files
|
||||
list of files currently stored on the SD card, so after issueing that command a :ref:`retrieval of the files
|
||||
on SD card <sec-api-fileops-retrievelocation>` will return a successful result.
|
||||
|
||||
.. note::
|
||||
@@ -745,8 +657,6 @@ Issue an SD command
|
||||
|
||||
Upon success, a status code of :http:statuscode:`204` and an empty body is returned.
|
||||
|
||||
Requires user rights.
|
||||
|
||||
**Example Init Request**
|
||||
|
||||
Initialize the SD card.
|
||||
@@ -845,67 +755,10 @@ Retrieve the current SD state
|
||||
:statuscode 200: No error
|
||||
:statuscode 404: If SD support has been disabled in OctoPrint's config.
|
||||
|
||||
.. _sec-api-printer-arbcommand:
|
||||
|
||||
Send an arbitrary command to the printer
|
||||
========================================
|
||||
|
||||
.. http:post:: /api/printer/command
|
||||
|
||||
Sends any command to the printer via the serial interface. Should be used with some care as some commands can interfere with
|
||||
or even stop a running print job.
|
||||
|
||||
Expects a :ref:`Arbitrary Command Request <sec-api-printer-datamodel-arbcommand>` as the request's body.
|
||||
|
||||
If successful returns a :http:statuscode:`204` and an empty body.
|
||||
|
||||
Requires user rights.
|
||||
|
||||
**Example for sending a single command**
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
POST /api/printer/command HTTP/1.1
|
||||
Host: example.com
|
||||
Content-Type: application/json
|
||||
X-Api-Key: abcdef...
|
||||
|
||||
{
|
||||
"command": "M106"
|
||||
}
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
HTTP/1.1 204 No Content
|
||||
|
||||
**Example for sending multiple commands**
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
POST /api/printer/command HTTP/1.1
|
||||
Host: example.com
|
||||
Content-Type: application/json
|
||||
X-Api-Key: abcdef...
|
||||
|
||||
{
|
||||
"commands": [
|
||||
"M18",
|
||||
"M106 S0"
|
||||
]
|
||||
}
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
HTTP/1.1 204 No Content
|
||||
|
||||
:json string command: Single command to send to the printer, mutually exclusive with ``commands``.
|
||||
:json string commands: List of commands to send to the printer, mutually exclusive with ``command``.
|
||||
:statuscode 204: No error
|
||||
|
||||
.. _sec-api-printer-datamodel:
|
||||
|
||||
Data model
|
||||
==========
|
||||
Datamodel
|
||||
=========
|
||||
|
||||
.. _sec-api-printer-datamodel-fullstate:
|
||||
|
||||
@@ -954,8 +807,7 @@ Temperature State
|
||||
* - ``bed``
|
||||
- 0..1
|
||||
- :ref:`Temperature Data <sec-api-datamodel-printer-tempdata>`
|
||||
- Current temperature stats for the printer's heated bed. Not included if querying only tool state or if
|
||||
the currently selected printer profile does not have a heated bed.
|
||||
- Current temperature stats for the printer's heated bed. Not included if querying only tool state.
|
||||
* - ``history``
|
||||
- 0..1
|
||||
- List of :ref:`Historic Temperature Datapoint <sec-api-datamodel-printer-temphistory>`
|
||||
@@ -979,36 +831,3 @@ SD State
|
||||
- Boolean
|
||||
- Whether the SD card has been initialized (``true``) or not (``false``).
|
||||
|
||||
.. _sec-api-printer-datamodel-arbcommand:
|
||||
|
||||
Arbitrary Command Request
|
||||
-------------------------
|
||||
|
||||
.. list-table::
|
||||
:widths: 15 5 10 30
|
||||
:header-rows: 1
|
||||
|
||||
* - Name
|
||||
- Multiplicity
|
||||
- Type
|
||||
- Description
|
||||
* - ``command``
|
||||
- 0..1
|
||||
- String
|
||||
- Single command to send to the printer, mutually exclusive with ``commands`` and ``script``.
|
||||
* - ``commands``
|
||||
- 0..*
|
||||
- Array of String
|
||||
- Multiple commands to send to the printer (in the given order), mutually exclusive with ``command`` and ``script``.
|
||||
* - ``script``
|
||||
- 0..*
|
||||
- String
|
||||
- Name of the GCODE script template to send to the printer, mutually exclusive with ``command`` and ``commands``.
|
||||
* - ``parameters``
|
||||
- 0..1
|
||||
- Map of key value pairs
|
||||
- Key value pairs of parameters to replace in sent commands/provide to the script renderer
|
||||
* - ``context``
|
||||
- 0..1
|
||||
- Map of key value pairs
|
||||
- (only if ``script`` is set) additional template variables to provide to the script renderer
|
||||
@@ -17,111 +17,6 @@ Retrieve all printer profiles
|
||||
|
||||
.. http:get:: /api/printerprofiles
|
||||
|
||||
Retrieves a list of all configured printer profiles.
|
||||
|
||||
Returns a :http:statuscode:`200` with a list of :ref:`profiles <sec-api-printerprofiles-datamodel-profile>`.
|
||||
|
||||
**Example**
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
GET /api/printerprofiles HTTP/1.1
|
||||
Host: example.com
|
||||
X-Api-Key: abcdef...
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
HTTP/1.1 200 OK
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"profiles": [
|
||||
{
|
||||
"id": "_default",
|
||||
"name": "Default",
|
||||
"color": "default",
|
||||
"model": "Generic RepRap Printer",
|
||||
"default": true,
|
||||
"current": true,
|
||||
"resource": "http://example.com/api/printerprofiles/_default",
|
||||
"volume": {
|
||||
"formFactor": "rectangular",
|
||||
"origin": "lowerleft",
|
||||
"width": 200,
|
||||
"depth": 200,
|
||||
"height": 200
|
||||
},
|
||||
"heatedBed": true,
|
||||
"axes": {
|
||||
"x": {
|
||||
"speed": 6000,
|
||||
"inverted": false
|
||||
},
|
||||
"y": {
|
||||
"speed": 6000,
|
||||
"inverted": false
|
||||
},
|
||||
"z": {
|
||||
"speed": 200,
|
||||
"inverted": false
|
||||
},
|
||||
"e": {
|
||||
"speed": 300,
|
||||
"inverted": false
|
||||
}
|
||||
},
|
||||
"extruder": {
|
||||
"count": 1,
|
||||
"offsets": [
|
||||
{"x": 0.0, "y": 0.0}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "my_profile",
|
||||
"name": "My Profile",
|
||||
"color": "default",
|
||||
"model": "My Custom Printer",
|
||||
"default": false,
|
||||
"current": false,
|
||||
"resource": "http://example.com/api/printerprofiles/my_profile",
|
||||
"volume": {
|
||||
"formFactor": "rectangular",
|
||||
"origin": "lowerleft",
|
||||
"width": 200,
|
||||
"depth": 200,
|
||||
"height": 200
|
||||
},
|
||||
"heatedBed": true,
|
||||
"axes": {
|
||||
"x": {
|
||||
"speed": 6000,
|
||||
"inverted": false
|
||||
},
|
||||
"y": {
|
||||
"speed": 6000,
|
||||
"inverted": false
|
||||
},
|
||||
"z": {
|
||||
"speed": 200,
|
||||
"inverted": false
|
||||
},
|
||||
"e": {
|
||||
"speed": 300,
|
||||
"inverted": false
|
||||
}
|
||||
},
|
||||
"extruder": {
|
||||
"count": 1,
|
||||
"offsets": [
|
||||
{"x": 0.0, "y": 0.0}
|
||||
]
|
||||
}
|
||||
},
|
||||
]
|
||||
}
|
||||
|
||||
|
||||
.. _sec-api-printerprofiles-add:
|
||||
|
||||
Add a new printer profile
|
||||
@@ -129,172 +24,6 @@ Add a new printer profile
|
||||
|
||||
.. http:post:: /api/printerprofiles
|
||||
|
||||
Adds a new printer profile based on either the current default profile
|
||||
or the profile identified in ``basedOn``.
|
||||
|
||||
The provided profile data will be merged with the profile data from the
|
||||
base profile.
|
||||
|
||||
If a profile with the same ``id`` does already exist, a :http:statuscode:`400`
|
||||
will be returned.
|
||||
|
||||
Returns a :http:statuscode:`200` with the saved profile as property ``profile``
|
||||
in the JSON body upon success.
|
||||
|
||||
Requires admin rights.
|
||||
|
||||
**Example 1**
|
||||
|
||||
Creating a new profile ``some_profile`` based on the current default profile.
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
POST /api/printerprofiles HTTP/1.1
|
||||
Host: example.com
|
||||
X-Api-Key: abcdef...
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"profile": {
|
||||
"id": "some_profile",
|
||||
"name": "Some profile",
|
||||
"model": "Some cool model"
|
||||
}
|
||||
}
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
HTTP/1.1 200 OK
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"profile": {
|
||||
"id": "some_profile",
|
||||
"name": "Some profile",
|
||||
"color": "default",
|
||||
"model": "Some cool model",
|
||||
"default": false,
|
||||
"current": false,
|
||||
"resource": "http://example.com/api/printerprofiles/some_profile",
|
||||
"volume": {
|
||||
"formFactor": "rectangular",
|
||||
"origin": "lowerleft",
|
||||
"width": 200,
|
||||
"depth": 200,
|
||||
"height": 200
|
||||
},
|
||||
"heatedBed": true,
|
||||
"axes": {
|
||||
"x": {
|
||||
"speed": 6000,
|
||||
"inverted": false
|
||||
},
|
||||
"y": {
|
||||
"speed": 6000,
|
||||
"inverted": false
|
||||
},
|
||||
"z": {
|
||||
"speed": 200,
|
||||
"inverted": false
|
||||
},
|
||||
"e": {
|
||||
"speed": 300,
|
||||
"inverted": false
|
||||
}
|
||||
},
|
||||
"extruder": {
|
||||
"count": 1,
|
||||
"offsets": [
|
||||
{"x": 0.0, "y": 0.0}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
**Example 2**
|
||||
|
||||
Creating a new profile ``some_other_profile`` based on existing profile
|
||||
``some_profile``.
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
POST /api/printerprofiles HTTP/1.1
|
||||
Host: example.com
|
||||
X-Api-Key: abcdef...
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"profile": {
|
||||
"id": "some_other_profile",
|
||||
"name": "Some other profile",
|
||||
"heatedBed": false,
|
||||
"volume": {
|
||||
"formFactor": "circular",
|
||||
"origin": "center",
|
||||
"width": "150",
|
||||
"height": "300"
|
||||
},
|
||||
"extruder": {
|
||||
"count": 2,
|
||||
"offsets": [
|
||||
{"x": 0.0, "y": 0.0},
|
||||
{"x": 21.6, "y": 0.0}
|
||||
]
|
||||
}
|
||||
},
|
||||
"basedOn": "some_profile"
|
||||
}
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
HTTP/1.1 200 OK
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"profile": {
|
||||
"id": "some_other_profile",
|
||||
"name": "Some other profile",
|
||||
"color": "default",
|
||||
"model": "Some cool model",
|
||||
"default": false,
|
||||
"current": false,
|
||||
"resource": "http://example.com/api/printerprofiles/some_other_profile",
|
||||
"volume": {
|
||||
"formFactor": "circular",
|
||||
"origin": "center",
|
||||
"width": 150,
|
||||
"depth": 150,
|
||||
"height": 300
|
||||
},
|
||||
"heatedBed": false,
|
||||
"axes": {
|
||||
"x": {
|
||||
"speed": 6000,
|
||||
"inverted": false
|
||||
},
|
||||
"y": {
|
||||
"speed": 6000,
|
||||
"inverted": false
|
||||
},
|
||||
"z": {
|
||||
"speed": 200,
|
||||
"inverted": false
|
||||
},
|
||||
"e": {
|
||||
"speed": 300,
|
||||
"inverted": false
|
||||
}
|
||||
},
|
||||
"extruder": {
|
||||
"count": 2,
|
||||
"offsets": [
|
||||
{"x": 0.0, "y": 0.0},
|
||||
{"x": 21.6, "y": 0.0}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.. _sec-api-printerporfiles-update:
|
||||
|
||||
Update an existing printer profile
|
||||
@@ -302,85 +31,6 @@ Update an existing printer profile
|
||||
|
||||
.. http:patch:: /api/printerprofiles/(string:profile)
|
||||
|
||||
Updates an existing printer profile by its ``profile`` identifier.
|
||||
|
||||
The updated (potentially partial) profile is expected in the request's body as part of
|
||||
an :ref:`Add or update request <sec-api-printerprofiles-datamodel-update>`.
|
||||
|
||||
Returns a :http:statuscode:`200` with the saved profile as property ``profile``
|
||||
in the JSON body upon success.
|
||||
|
||||
Requires admin rights.
|
||||
|
||||
**Example**
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
PATCH /api/printerprofiles/some_profile HTTP/1.1
|
||||
Host: example.com
|
||||
X-Api-Key: abcdef...
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"profile": {
|
||||
"name": "Some edited profile",
|
||||
"volume": {
|
||||
"depth": "300"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
HTTP/1.1 200 OK
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"profile": {
|
||||
"id": "some_profile",
|
||||
"name": "Some edited profile",
|
||||
"color": "default",
|
||||
"model": "Some cool model",
|
||||
"default": false,
|
||||
"current": false,
|
||||
"resource": "http://example.com/api/printerprofiles/some_profile",
|
||||
"volume": {
|
||||
"formFactor": "rectangular",
|
||||
"origin": "lowerleft",
|
||||
"width": 200,
|
||||
"depth": 300,
|
||||
"height": 200
|
||||
},
|
||||
"heatedBed": true,
|
||||
"axes": {
|
||||
"x": {
|
||||
"speed": 6000,
|
||||
"inverted": false
|
||||
},
|
||||
"y": {
|
||||
"speed": 6000,
|
||||
"inverted": false
|
||||
},
|
||||
"z": {
|
||||
"speed": 200,
|
||||
"inverted": false
|
||||
},
|
||||
"e": {
|
||||
"speed": 300,
|
||||
"inverted": false
|
||||
}
|
||||
},
|
||||
"extruder": {
|
||||
"count": 2,
|
||||
"offsets": [
|
||||
{"x": 0.0, "y": 0.0},
|
||||
{"x": 21.6, "y": 0.0}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.. _sec-api-printerprofiles-delete:
|
||||
|
||||
Remove an existing printer profile
|
||||
@@ -388,32 +38,10 @@ Remove an existing printer profile
|
||||
|
||||
.. http:delete:: /api/printerprofiles/(string:profile)
|
||||
|
||||
Deletes an existing printer profile by its ``profile`` identifier.
|
||||
|
||||
If the profile to be deleted is the currently selected profile, a :http:statuscode:`409` will be
|
||||
returned.
|
||||
|
||||
Returns a :http:statuscode:`204` an empty body upon success.
|
||||
|
||||
Requires admin rights.
|
||||
|
||||
**Example**
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
DELETE /api/printerprofiles/some_profile HTTP/1.1
|
||||
Host: example.com
|
||||
X-Api-Key: abcdef...
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
HTTP/1.1 204 No Content
|
||||
|
||||
|
||||
.. _sec-api-printerprofiles-datamodel:
|
||||
|
||||
Data model
|
||||
==========
|
||||
Datamodel
|
||||
=========
|
||||
|
||||
.. _sec-api-printerprofiles-datamodel-profilelist:
|
||||
|
||||
@@ -437,7 +65,7 @@ Profile list
|
||||
- :ref:`Profile <sec-api-slicing-datamodel-profile>`
|
||||
- Information about a profile stored in the system.
|
||||
|
||||
.. _sec-api-printerprofiles-datamodel-update:
|
||||
.. _sec-api-slicing-datamodel-update:
|
||||
|
||||
Add or update request
|
||||
---------------------
|
||||
@@ -453,18 +81,10 @@ Add or update request
|
||||
* - ``profiles``
|
||||
- 1
|
||||
- :ref:`Profile <sec-api-slicing-datamodel-profile>`
|
||||
- Information about the profile being added/updated. Only the values to be overwritten need to be supplied.
|
||||
Unset fields will be taken from the base profile, which for add requests will be the
|
||||
current default profile unless a different base is defined in the ``basedOn`` property
|
||||
of the request. For update requests the current version of the profile to be updated will
|
||||
be used as base.
|
||||
* - ``basedOn``
|
||||
- 0..1
|
||||
- ``string``
|
||||
- Only for add requests, ignored on updates: The identifier of the profile to base the
|
||||
new profile on, if different than the current default profile.
|
||||
- Information about the profile being added/updated. For adding new profiles, all fields must be populated. For updating
|
||||
and existing profile, only the values to be overwritten need to be supplied.
|
||||
|
||||
.. _sec-api-printerprofiles-datamodel-profile:
|
||||
.. _sec-api-slicing-datamodel-profile:
|
||||
|
||||
Profile
|
||||
-------
|
||||
@@ -481,14 +101,12 @@ Profile
|
||||
- 0..1
|
||||
- ``string``
|
||||
- Identifier of the profile. Will always be
|
||||
returned in responses, is mandatory in add requests but
|
||||
can be left out of update requests.
|
||||
returned in responses but can be left out of save/update requests.
|
||||
* - ``name``
|
||||
- 0..1
|
||||
- ``string``
|
||||
- Display name of the profile. Will always be
|
||||
returned in responses, is mandatory in add requests but
|
||||
can be left out of update requests.
|
||||
returned in responses but can be left out of save/update requests.
|
||||
* - ``color``
|
||||
- 0..1
|
||||
- ``string``
|
||||
@@ -522,58 +140,18 @@ Profile
|
||||
- 0..1
|
||||
- ``string``
|
||||
- The form factor of the printer's bed, valid values are "rectangular" and "circular"
|
||||
* - ``volume.origin``
|
||||
- 0..1
|
||||
- ``string``
|
||||
- The location of the origin on the printer's bed, valid values are "lowerleft" and "center"
|
||||
* - ``volume.width``
|
||||
- 0..1
|
||||
- ``float``
|
||||
- The width of the print volume. For circular beds, the diameter of the bed.
|
||||
- The width of the print volume
|
||||
* - ``volume.depth``
|
||||
- 0..1
|
||||
- ``float``
|
||||
- The depth of the print volume. For circular beds, this is the diameter of the bed and will be forced to be the same
|
||||
as ``volume.width`` upon saving.
|
||||
- The depth of the print volume
|
||||
* - ``volume.height``
|
||||
- 0..1
|
||||
- ``float``
|
||||
- The height of the print volume
|
||||
* - ``volume.custom_box``
|
||||
- 0..1
|
||||
- ``boolean`` or ``object``
|
||||
- If the printer has a custom bounding box where the print head can be safely moved to, exceeding the defined print
|
||||
volume, that bounding box will be defined here. Otherwise (safe area == print volume) this value will be ``false``.
|
||||
* - ``volume.custom_box.min_x``
|
||||
- 0..1
|
||||
- ``float``
|
||||
- Minimum X coordinate defining the safe custom bounding box. Smaller value than the minimum X coordinate of the
|
||||
print volume.
|
||||
* - ``volume.custom_box.max_x``
|
||||
- 0..1
|
||||
- ``float``
|
||||
- Maximum X coordinate defining the safe custom bounding box. Larger value than the maximum X coordinate of the
|
||||
print volume.
|
||||
* - ``volume.custom_box.min_y``
|
||||
- 0..1
|
||||
- ``float``
|
||||
- Minimum Y coordinate defining the safe custom bounding box. Smaller value than the minimum Y coordinate of the
|
||||
print volume.
|
||||
* - ``volume.custom_box.max_y``
|
||||
- 0..1
|
||||
- ``float``
|
||||
- Maximum Y coordinate defining the safe custom bounding box. Larger value than the maximum Y coordinate of the
|
||||
print volume.
|
||||
* - ``volume.custom_box.min_z``
|
||||
- 0..1
|
||||
- ``float``
|
||||
- Minimum Z coordinate defining the safe custom bounding box. Smaller value than the minimum Z coordinate of the
|
||||
print volume.
|
||||
* - ``volume.custom_box.max_z``
|
||||
- 0..1
|
||||
- ``float``
|
||||
- Maximum Z coordinate defining the safe custom bounding box. Larger value than the maximum Z coordinate of the
|
||||
print volume.
|
||||
* - ``heatedBed``
|
||||
- 0..1
|
||||
- ``boolean``
|
||||
@@ -586,7 +164,7 @@ Profile
|
||||
* - ``axes.{axis}.speed``
|
||||
- 0..1
|
||||
- ``int``
|
||||
- Maximum speed of the axis in mm/min.
|
||||
- Maximum speed of the axis in mm/s.
|
||||
* - ``axes.{axis}.inverted``
|
||||
- 0..1
|
||||
- ``boolean``
|
||||
|
||||
@@ -12,7 +12,7 @@ Push updates
|
||||
|
||||
.. contents::
|
||||
|
||||
To enable real time information exchange between client and server, OctoPrint uses
|
||||
To enable real time information exchange between client and server, OctoPrint uses
|
||||
`SockJS <https://github.com/sockjs/sockjs-protocol>`_ to push
|
||||
status updates, temperature changes etc to connected web interface instances.
|
||||
|
||||
@@ -27,90 +27,26 @@ Each pushed message consists of a simple JSON object that follows this basic str
|
||||
``type`` indicates the type of message being pushed to the client, the attached ``payload`` is message specific. The
|
||||
following message types are currently available for usage by 3rd party clients:
|
||||
|
||||
* ``connected``: Initial connection information, sent only right after establishing the socket connection. See
|
||||
:ref:`the payload data model <sec-api-push-datamodel-connected>`.
|
||||
* ``current``: Rate limited general state update, payload contains information about the printer's state, job progress,
|
||||
accumulated temperature points and log lines since last update. OctoPrint will send these updates when new information
|
||||
is available, but not more often than twice per second in order to not flood the client with messages (e.g.
|
||||
during printing). See :ref:`the payload data model <sec-api-push-datamodel-currentandhistory>`.
|
||||
* ``history``: Current state, temperature and log history, sent upon initial connect to get the client up to date. Same
|
||||
payload data model as ``current``, see :ref:`the payload data model <sec-api-push-datamodel-currentandhistory>`.
|
||||
payload data model as ``current``, see :ref:`below <sec-api-push-datamodel-currentandhistory>`.
|
||||
* ``event``: Events triggered within OctoPrint, such as e.g. ``PrintFailed`` or ``MovieRenderDone``. Payload is the event
|
||||
type and payload, see :ref:`the payload data model <sec-api-push-datamodel-event>`. Sent when an event is triggered internally.
|
||||
type and payload, see :ref:`below <sec-api-push-datamodel-event>`. Sent when an event is triggered internally.
|
||||
* ``slicingProgress``: Progress updates from an active slicing background job, payload contains information about the
|
||||
model being sliced, the target file, the slicer being used and the progress as a percentage.
|
||||
See :ref:`the payload data model <sec-api-push-datamodel-slicingprogress>`.
|
||||
* ``plugin``: Messages generated by plugins. The payload data models are determined by the plugin which sent the
|
||||
message.
|
||||
|
||||
Clients must ignore any unknown messages.
|
||||
|
||||
The data model of the attached payloads is described further below.
|
||||
|
||||
OctoPrint's SockJS socket also accepts one command from the client to the server,
|
||||
the ``throttle`` command. Usually, OctoPrint will push the general state update
|
||||
in the ``current`` message twice per second. For some clients that might still
|
||||
be too fast, so they can signal a different factor to OctoPrint utilizing the
|
||||
``throttle`` message. OctoPrint expects a single integer here which represents
|
||||
the multiplier for the base rate limit of one message every 500ms. A value of
|
||||
1 hence will produce the default behaviour of getting every update. A value of
|
||||
2 will set the rate limit to maximally one message every 1s, 3 to maximally one
|
||||
message every 1.5s and so on.
|
||||
|
||||
Example for a ``throttle`` client-server-message:
|
||||
|
||||
.. sourcecode:: javascript
|
||||
|
||||
{
|
||||
"throttle": 2
|
||||
}
|
||||
|
||||
.. _sec-api-push-datamodel:
|
||||
|
||||
Data model
|
||||
==========
|
||||
|
||||
.. _sec-api-push-datamodel-connected:
|
||||
|
||||
``connected`` payload
|
||||
---------------------
|
||||
|
||||
.. list-table::
|
||||
:widths: 15 5 10 30
|
||||
:header-rows: 1
|
||||
|
||||
* - Name
|
||||
- Multiplicity
|
||||
- Type
|
||||
- Description
|
||||
* - ``apikey``
|
||||
- 1
|
||||
- String
|
||||
- Current UI API KEY. The UI API KEY is a special API key that gets regenerated on every server restart and
|
||||
has no rights attached other than accessing the REST API. An additional browser session is needed to
|
||||
send valid requests when the UI API KEY is used.
|
||||
* - ``version``
|
||||
- 1
|
||||
- String
|
||||
- The server's version.
|
||||
* - ``branch``
|
||||
- 1
|
||||
- String
|
||||
- The source code branch from which the server was built.
|
||||
* - ``display_version``
|
||||
- 1
|
||||
- String
|
||||
- The server's version and branch in a human readable format.
|
||||
* - ``plugin_hash``
|
||||
- 1
|
||||
- String
|
||||
- A hash of all installed plugins. This allows to detect if there have been plugin changes between server
|
||||
restarts.
|
||||
* - ``config_hash``
|
||||
- 1
|
||||
- String
|
||||
- A hash of the currently active config. This allows to detect if there have been configuration changes between
|
||||
server restarts.
|
||||
Datamodel
|
||||
=========
|
||||
|
||||
.. _sec-api-push-datamodel-currentandhistory:
|
||||
|
||||
|
||||
@@ -1,263 +0,0 @@
|
||||
.. _sec-api-settings:
|
||||
|
||||
********
|
||||
Settings
|
||||
********
|
||||
|
||||
.. contents::
|
||||
|
||||
.. _sec-api-settings-retrieve:
|
||||
|
||||
Retrieve current settings
|
||||
=========================
|
||||
|
||||
.. http:get:: /api/settings
|
||||
|
||||
Retrieves the current configuration of OctoPrint.
|
||||
|
||||
Returns a :http:statuscode:`200` with the current settings as a JSON object in the
|
||||
response body.
|
||||
|
||||
The :ref:`data model <sec-api-settings-datamodel>` is similar to what can be found in
|
||||
:ref:`config.yaml <sec-configuration-config_yaml>`, see below for details.
|
||||
|
||||
.. _sec-api-settings-save:
|
||||
|
||||
Save settings
|
||||
=============
|
||||
|
||||
.. http:post:: /api/settings
|
||||
|
||||
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.
|
||||
|
||||
Returns the currently active settings on success, as part of a :http:statuscode:`200` response.
|
||||
|
||||
Requires admin rights.
|
||||
|
||||
**Example**
|
||||
|
||||
Only change the UI color to black.
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
POST /api/settings HTTP/1.1
|
||||
Host: example.com
|
||||
X-Api-Key: abcdef...
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"appearance": {
|
||||
"color": "black"
|
||||
}
|
||||
}
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
HTTP/1.1 200 OK
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"api": {
|
||||
"enabled": true,
|
||||
// ...
|
||||
},
|
||||
// ...
|
||||
}
|
||||
|
||||
.. _sec-api-settings-generateapikey:
|
||||
|
||||
Regenerate the system wide API key
|
||||
==================================
|
||||
|
||||
.. http:post:: /api/settings/apikey
|
||||
|
||||
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.
|
||||
|
||||
Requires admin rights.
|
||||
|
||||
:status 200: No error
|
||||
:status 403: No admin rights
|
||||
|
||||
.. _sec-api-settings-datamodel:
|
||||
|
||||
Data model
|
||||
==========
|
||||
|
||||
The data model on the settings API mostly reflects the contents of
|
||||
:ref:`config.yaml <sec-configuration-config_yaml>`. The settings tree
|
||||
returned by the API contains the following fields, which are directly
|
||||
mapped from the same fields in ``config.yaml`` unless otherwise noted:
|
||||
|
||||
.. list-table::
|
||||
:header-rows: 1
|
||||
|
||||
* - Field
|
||||
- Notes
|
||||
* - ``api.enabled``
|
||||
-
|
||||
* - ``api.key``
|
||||
- Only maps to ``api.key`` in ``config.yaml`` if request is sent with admin rights, set to ``n/a`` otherwise.
|
||||
Starting with OctoPrint 1.3.3 setting this field via :ref:`the API <sec-api-settings-save>` is not possible,
|
||||
only :ref:`regenerting it <sec-api-settings-generateapikey>` is supported. Setting a custom value is only
|
||||
possible through `config.yaml`.
|
||||
* - ``api.allowCrossOrigin``
|
||||
-
|
||||
* - ``appearance.name``
|
||||
-
|
||||
* - ``appearance.color``
|
||||
-
|
||||
* - ``appearance.colorTransparent``
|
||||
-
|
||||
* - ``appearance.defaultLanguage``
|
||||
-
|
||||
* - ``appearance.showFahrenheitAlso``
|
||||
-
|
||||
* - ``feature.gcodeViewer``
|
||||
- Maps to ``gcodeViewer.enabled`` in ``config.yaml``
|
||||
* - ``feature.sizeThreshold``
|
||||
- Maps to ``gcodeViewer.sizeThreshold`` in ``config.yaml``
|
||||
* - ``feature.mobileSizeThreshold``
|
||||
- Maps to ``gcodeViewer.mobileSizeThreshold`` in ``config.yaml``
|
||||
* - ``feature.temperatureGraph``
|
||||
-
|
||||
* - ``feature.waitForStart``
|
||||
-
|
||||
* - ``feature.alwaysSendChecksum``
|
||||
-
|
||||
* - ``feature.neverSendChecksum``
|
||||
-
|
||||
* - ``feature.sdSupport``
|
||||
-
|
||||
* - ``feature.sdReleativePath``
|
||||
-
|
||||
* - ``feature.sdAlwaysAvailable``
|
||||
-
|
||||
* - ``feature.swallowOkAfterResend``
|
||||
-
|
||||
* - ``feature.repetierTargetTemp``
|
||||
-
|
||||
* - ``feature.externalHeatupDetection``
|
||||
-
|
||||
* - ``feature.keyboardControl``
|
||||
-
|
||||
* - ``feature.pollWatched``
|
||||
-
|
||||
* - ``feature.ignoreIdenticalResends``
|
||||
-
|
||||
* - ``feature.modelSizeDetection``
|
||||
-
|
||||
* - ``feature.firmwareDetection``
|
||||
-
|
||||
* - ``feature.printCancelConfirmation``
|
||||
-
|
||||
* - ``feature.blockWhileDwelling``
|
||||
-
|
||||
* - ``folder.uploads``
|
||||
-
|
||||
* - ``folder.timelapse``
|
||||
-
|
||||
* - ``folder.timelapseTmp``
|
||||
- Maps to ``folder.timelapse_tmp`` in ``config.yaml``
|
||||
* - ``folder.logs``
|
||||
-
|
||||
* - ``folder.watched``
|
||||
-
|
||||
* - ``plugins``
|
||||
- Plugin settings as available from ``config.yaml`` and :class:`~octoprint.plugin.SettingsPlugin` implementations
|
||||
* - ``printer.defaultExtrusionLength``
|
||||
- Maps to ``printerParameters.defaultExtrusionLength`` in ``config.yaml``
|
||||
* - ``scripts.gcode``
|
||||
- Whole subtree of configured :ref:`GCODE scripts <sec-features-gcode_scripts>`
|
||||
* - ``serial.port``
|
||||
- Current serial port
|
||||
* - ``serial.baudrate``
|
||||
- Current serial baudrate
|
||||
* - ``serial.portOptions``
|
||||
- Available serial ports
|
||||
* - ``serial.baudrateOptions``
|
||||
- Available serial baudrates
|
||||
* - ``serial.autoconnect``
|
||||
-
|
||||
* - ``serial.timeoutConnection``
|
||||
- Maps to ``serial.timeout.connection`` in ``config.yaml``
|
||||
* - ``serial.timeoutDetection``
|
||||
- Maps to ``serial.timeout.detection`` in ``config.yaml``
|
||||
* - ``serial.timeoutCommunication``
|
||||
- Maps to ``serial.timeout.communication`` in ``config.yaml``
|
||||
* - ``serial.timeoutTemperature``
|
||||
- Maps to ``serial.timeout.temperature`` in ``config.yaml``
|
||||
* - ``serial.timeoutTemperatureTargetSet``
|
||||
- Maps to ``serial.timeout.temperatureTargetSet`` in ``config.yaml``
|
||||
* - ``serial.timeoutSdStatus``
|
||||
- Maps to ``serial.timeout.sdStatus`` in ``config.yaml``
|
||||
* - ``serial.log``
|
||||
-
|
||||
* - ``serial.additionalPorts``
|
||||
-
|
||||
* - ``serial.additionalBaudrates``
|
||||
-
|
||||
* - ``serial.longRunningCommands``
|
||||
-
|
||||
* - ``serial.checksumRequiringCommands``
|
||||
-
|
||||
* - ``serial.helloCommand``
|
||||
-
|
||||
* - ``serial.ignoreErrorsFromFirmware``
|
||||
-
|
||||
* - ``serial.disconnectOnErrors``
|
||||
-
|
||||
* - ``serial.triggerOkForM29``
|
||||
-
|
||||
* - ``serial.supportResendsWIthoutOk``
|
||||
-
|
||||
* - ``serial.maxTimeoutsIdle``
|
||||
- Maps to ``serial.maxCommunicationTimeouts.idle`` in ``config.yaml``
|
||||
* - ``serial.maxTimeoutsPrinting``
|
||||
- Maps to ``serial.maxCommunicationTimeouts.printing`` in ``config.yaml``
|
||||
* - ``serial.maxTimeoutsLong``
|
||||
- Maps to ``serial.maxCommunicationTimeouts.long`` in ``config.yaml``
|
||||
* - ``server.commands.systemShutdownCommand``
|
||||
-
|
||||
* - ``server.commands.systemRestartCommand``
|
||||
-
|
||||
* - ``server.commands.serverRestartCommand``
|
||||
-
|
||||
* - ``server.diskspace.warning``
|
||||
-
|
||||
* - ``server.diskspace.critical``
|
||||
-
|
||||
* - ``system.actions``
|
||||
- Whole subtree taken from ``config.yaml``
|
||||
* - ``system.events``
|
||||
- Whole subtree taken from ``config.yaml``
|
||||
* - ``temperature.profiles``
|
||||
- Whole subtree taken from ``config.yaml``
|
||||
* - ``temperature.cutoff``
|
||||
-
|
||||
* - ``terminalFilters``
|
||||
- Whole subtree taken from ``config.yaml``
|
||||
* - ``webcam.streamUrl``
|
||||
- Maps to ``webcam.stream`` in ``config.yaml``
|
||||
* - ``webcam.snapshotUrl``
|
||||
- Maps to ``webcam.snapshot`` in ``config.yaml``
|
||||
* - ``webcam.ffmpegPath``
|
||||
- Maps to ``webcam.ffmpeg`` in ``config.yaml``
|
||||
* - ``webcam.bitrate``
|
||||
-
|
||||
* - ``webcam.ffmpegThreads``
|
||||
-
|
||||
* - ``webcam.watermark``
|
||||
-
|
||||
* - ``webcam.flipH``
|
||||
-
|
||||
* - ``webcam.flipV``
|
||||
-
|
||||
* - ``webcam.rotate90``
|
||||
-
|
||||
@@ -32,7 +32,7 @@ List All Slicers and Slicing Profiles
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
GET /api/slicing HTTP/1.1
|
||||
GET /api/slicing/profiles HTTP/1.1
|
||||
Host: example.com
|
||||
X-Api-Key: abcdef...
|
||||
|
||||
@@ -110,7 +110,7 @@ List Slicing Profiles of a Specific Slicer
|
||||
|
||||
:param slicer: The identifying key of the slicer for which to list the available profiles.
|
||||
:statuscode 200: No error
|
||||
:statuscode 404: If the ``slicer`` was unknown to the system or not yet configured.
|
||||
:statuscode 404: If the ``slicer`` was unknown to the system.
|
||||
|
||||
.. _sec-api-slicing-listspecific:
|
||||
|
||||
@@ -155,7 +155,7 @@ Retrieve Specific Profile
|
||||
:param slicer: The identifying key of the slicer for which to list the available profiles.
|
||||
:param name: The identifying key of the profile to retrieve
|
||||
:statuscode 200: No error
|
||||
:statuscode 404: If the ``slicer`` or the profile ``key`` was unknown to the system.
|
||||
:statuscode 404: If the ``slicer`` or the profile was unknown to the system.
|
||||
|
||||
.. _sec-api-slicing-add:
|
||||
|
||||
@@ -172,8 +172,6 @@ Add Slicing Profile
|
||||
Returns a :http:statuscode:`201` and an :ref:`abridged Profile <sec-api-slicing-datamodel-profile>` in the body
|
||||
upon successful completion.
|
||||
|
||||
Requires admin rights.
|
||||
|
||||
**Example**
|
||||
|
||||
.. sourcecode:: http
|
||||
@@ -217,10 +215,7 @@ Delete Slicing Profile
|
||||
|
||||
.. http:delete:: /api/slicing/(string:slicer)/profiles/(string:key)
|
||||
|
||||
Delete the slicing profile identified by ``key`` for the slicer ``slicer``. If the profile doesn't exist, the
|
||||
request will succeed anyway.
|
||||
|
||||
Requires admin rights.
|
||||
Delete the slicing profile identified by ``key`` for the slicer ``slicer``.
|
||||
|
||||
:param slicer: The identifying key of the slicer for which to delete the profile
|
||||
:param key: The identifying key of the profile to delete
|
||||
@@ -229,8 +224,8 @@ Delete Slicing Profile
|
||||
|
||||
.. _sec-api-slicing-datamodel:
|
||||
|
||||
Data model
|
||||
==========
|
||||
Datamodel
|
||||
=========
|
||||
|
||||
.. _sec-api-slicing-datamodel-slicerlist:
|
||||
|
||||
@@ -268,14 +263,9 @@ Slicer
|
||||
- ``string``
|
||||
- Identifier of the slicer
|
||||
* - ``displayName``
|
||||
- 1
|
||||
- 0..1
|
||||
- ``string``
|
||||
- Display name of the slicer
|
||||
* - ``sameDevice``
|
||||
- 1
|
||||
- ``boolean``
|
||||
- Whether the slicer runs on the same device as OctoPrint (``true``) and hence can't be used while printing,
|
||||
or not (``false``)
|
||||
* - ``default``
|
||||
- 1
|
||||
- ``boolean``
|
||||
|
||||
@@ -1,242 +0,0 @@
|
||||
.. _sec-api-system:
|
||||
|
||||
******
|
||||
System
|
||||
******
|
||||
|
||||
.. note::
|
||||
|
||||
All system operations require admin rights.
|
||||
|
||||
.. _sec-api-system-command-list:
|
||||
|
||||
List all registered system commands
|
||||
===================================
|
||||
|
||||
.. http:get:: /api/system/commands
|
||||
|
||||
Retrieves all configured system commands.
|
||||
|
||||
A :http:statuscode:`200` with a :ref:`List all response <sec-api-system-commands-listall>`
|
||||
will be returned.
|
||||
|
||||
**Example**
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
GET /api/system/commands/core HTTP/1.1
|
||||
Host: example.com
|
||||
X-Api-Key: abcdef...
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
HTTP/1.1 200 Ok
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"core": [
|
||||
{
|
||||
"action": "shutdown",
|
||||
"name": "Shutdown",
|
||||
"command": "sudo shutdown -h now",
|
||||
"confirm": "You are about to shutdown the system.",
|
||||
"async": true,
|
||||
"ignore": true,
|
||||
"source": "core",
|
||||
"resource": "http://example.com/api/system/commands/core/shutdown"
|
||||
},
|
||||
{
|
||||
"action": "reboot",
|
||||
"name": "Reboot",
|
||||
"command": "sudo reboot",
|
||||
"confirm": "You are about to reboot the system.",
|
||||
"async": true,
|
||||
"ignore": true,
|
||||
"source": "core",
|
||||
"resource": "http://example.com/api/system/commands/core/reboot"
|
||||
},
|
||||
{
|
||||
"action": "restart",
|
||||
"name": "Restart OctoPrint",
|
||||
"command": "sudo service octoprint restart",
|
||||
"confirm": "You are about to restart the OctoPrint server.",
|
||||
"async": true,
|
||||
"ignore": true,
|
||||
"source": "core",
|
||||
"resource": "http://example.com/api/system/commands/core/restart"
|
||||
}
|
||||
],
|
||||
"custom": []
|
||||
}
|
||||
|
||||
:statuscode 200: No error
|
||||
|
||||
.. _sec-api-system-command-listsource:
|
||||
|
||||
List all registered system commands for a source
|
||||
================================================
|
||||
|
||||
.. http:get:: /api/system/commands/(string:source)
|
||||
|
||||
Retrieves the configured system commands for the specified source.
|
||||
|
||||
The response will contain a list of :ref:`command definitions <sec-api-system-commands-definiton>`.
|
||||
|
||||
**Example**
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
GET /api/system/commands/core HTTP/1.1
|
||||
Host: example.com
|
||||
X-Api-Key: abcdef...
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
HTTP/1.1 200 Ok
|
||||
Content-Type: application/json
|
||||
|
||||
[
|
||||
{
|
||||
"action": "shutdown",
|
||||
"name": "Shutdown",
|
||||
"command": "sudo shutdown -h now",
|
||||
"confirm": "You are about to shutdown the system.",
|
||||
"async": true,
|
||||
"ignore": true,
|
||||
"source": "core",
|
||||
"resource": "http://example.com/api/system/commands/core/shutdown"
|
||||
},
|
||||
{
|
||||
"action": "reboot",
|
||||
"name": "Reboot",
|
||||
"command": "sudo reboot",
|
||||
"confirm": "You are about to reboot the system.",
|
||||
"async": true,
|
||||
"ignore": true,
|
||||
"source": "core",
|
||||
"resource": "http://example.com/api/system/commands/core/reboot"
|
||||
},
|
||||
{
|
||||
"action": "restart",
|
||||
"name": "Restart OctoPrint",
|
||||
"command": "sudo service octoprint restart",
|
||||
"confirm": "You are about to restart the OctoPrint server.",
|
||||
"async": true,
|
||||
"ignore": true,
|
||||
"source": "core",
|
||||
"resource": "http://example.com/api/system/commands/core/restart"
|
||||
}
|
||||
]
|
||||
|
||||
:param source: The source for which to list commands, currently either ``core`` or ``custom``
|
||||
:statuscode 200: No error
|
||||
:statuscode 404: If a ``source`` other than ``core`` or ``custom`` is specified.
|
||||
|
||||
.. _sec-api-system-command-execute:
|
||||
|
||||
Execute a registered system command
|
||||
===================================
|
||||
|
||||
.. http:post:: /api/system/commands/(string:source)/(string:action)
|
||||
|
||||
Execute the system command ``action`` on defined in ``source``.
|
||||
|
||||
**Example**
|
||||
|
||||
Restart OctoPrint via the core system command ``restart`` (which is available if the server
|
||||
restart command is configured).
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
POST /api/system/commands/core/restart HTTP/1.1
|
||||
Host: example.com
|
||||
X-Api-Key: abcdef...
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
204 No Content
|
||||
|
||||
:param source: The source for which to list commands, currently either ``core`` or ``custom``
|
||||
:param action: The identifier of the command, ``action`` from its definition
|
||||
:statuscode 204: No error
|
||||
:statuscode 400: If a ``divider`` is supposed to be executed or if the request is malformed otherwise
|
||||
:statuscode 404: If the command could not be found for ``source`` and ``action``
|
||||
:statuscode 500: If the command didn't define a ``command`` to execute, the command returned a non-zero
|
||||
return code and ``ignore`` was not ``true`` or some other internal server error occurred
|
||||
|
||||
.. _sec-api-system-datamodel:
|
||||
|
||||
Data model
|
||||
==========
|
||||
|
||||
.. _sec-api-system-commands-listall:
|
||||
|
||||
List all response
|
||||
-----------------
|
||||
|
||||
.. list-table::
|
||||
:widths: 15 5 10 30
|
||||
:header-rows: 1
|
||||
|
||||
* - Name
|
||||
- Multiplicity
|
||||
- Type
|
||||
- Description
|
||||
* - ``core``
|
||||
- 0..n
|
||||
- List of :ref:`command definitions <sec-api-system-commands-definiton>`
|
||||
- List of all core commands defined.
|
||||
* - ``custom``
|
||||
- 0..n
|
||||
- List of :ref:`command definitions <sec-api-system-commands-definiton>`
|
||||
- List of all custom commands defined in ``config.yaml``.
|
||||
|
||||
.. _sec-api-system-commands-definiton:
|
||||
|
||||
Command definition
|
||||
------------------
|
||||
|
||||
.. list-table::
|
||||
:widths: 15 5 10 30
|
||||
:header-rows: 1
|
||||
|
||||
* - Name
|
||||
- Multiplicity
|
||||
- Type
|
||||
- Description
|
||||
* - ``name``
|
||||
- 1
|
||||
- string
|
||||
- The name of the command to display in the System menu.
|
||||
* - ``command``
|
||||
- 1
|
||||
- string
|
||||
- The full command line to execute for the command.
|
||||
* - ``action``
|
||||
- 1
|
||||
- string
|
||||
- An identifier to refer to the command programmatically. The special ``action`` string
|
||||
``divider`` signifies a divider in the menu.
|
||||
* - ``confirm``
|
||||
- 0..1
|
||||
- string
|
||||
- If present and set, this text will be displayed to the user in a confirmation dialog
|
||||
they have to acknowledge in order to really execute the command.
|
||||
* - ``async``
|
||||
- 0..1
|
||||
- bool
|
||||
- Whether to execute the command asynchronously or wait for its result before responding
|
||||
to the HTTP execution request.
|
||||
* - ``ignore``
|
||||
- 0..1
|
||||
- bool
|
||||
- Whether to ignore the return code of the command's execution.
|
||||
* - ``source``
|
||||
- 1
|
||||
- string
|
||||
- Source of the command definition, currently either ``core`` (for system actions defined by
|
||||
OctoPrint itself) or ``custom`` (for custom system commands defined by the user through ``config.yaml``).
|
||||
* - ``resource``
|
||||
- 1
|
||||
- string
|
||||
- The URL of the command to use for executing it.
|
||||
@@ -1,255 +0,0 @@
|
||||
.. _sec-api-timelapse:
|
||||
|
||||
*********
|
||||
Timelapse
|
||||
*********
|
||||
|
||||
.. contents::
|
||||
|
||||
.. _sec-api-timelapse-list:
|
||||
|
||||
Retrieve a list of timelapses and the current config
|
||||
====================================================
|
||||
|
||||
.. http:get:: /api/timelapse
|
||||
|
||||
Retrieves a list of timelapses and the current config.
|
||||
|
||||
Returns a :ref:`timelapse list <sec-api-timelapse-datamodel-list>` in the
|
||||
response body.
|
||||
|
||||
:param unrendered: If provided and true, also include unrendered timelapses
|
||||
|
||||
.. _sec-api-timelapse-delete:
|
||||
|
||||
Delete a timelapse
|
||||
==================
|
||||
|
||||
.. http:delete:: /api/timelapse/(string:filename)
|
||||
|
||||
Delete the timelapse ``filename``.
|
||||
|
||||
Requires user rights.
|
||||
|
||||
.. _sec-api-timelapse-render:
|
||||
|
||||
Issue a command for an unrendered timelapse
|
||||
===========================================
|
||||
|
||||
.. http:post:: /api/timelapse/unrendered/(string:name)
|
||||
|
||||
Current only supports to render the unrendered timelapse ``name`` via the
|
||||
``render`` command.
|
||||
|
||||
Requires user rights.
|
||||
|
||||
:json command: The command to issue, currently only ``render`` is supported
|
||||
|
||||
.. _sec-api-timelapse-delete-unrendered:
|
||||
|
||||
Delete an unrendered timelapse
|
||||
==============================
|
||||
|
||||
.. http:delete:: /api/timelapse/unrendered/(string:name)
|
||||
|
||||
Delete the unrendered timelapse ``name``.
|
||||
|
||||
Requires user rights.
|
||||
|
||||
.. _sec-api-timelapse-saveconfig:
|
||||
|
||||
Change current timelapse config
|
||||
===============================
|
||||
|
||||
.. http:post:: /api/timelapse
|
||||
|
||||
Save a new :ref:`timelapse configuration <sec-api-timelapse-datamodel-config>` to use for the next print.
|
||||
|
||||
The configuration is expected as the request body.
|
||||
|
||||
Requires user rights.
|
||||
|
||||
.. _sec-api-timelapse-datamodel:
|
||||
|
||||
Data model
|
||||
==========
|
||||
|
||||
.. _sec-api-timelapse-datamodel-list:
|
||||
|
||||
Timelapse list
|
||||
--------------
|
||||
|
||||
.. list-table::
|
||||
:widths: 15 5 10 30
|
||||
:header-rows: 1
|
||||
|
||||
* - Name
|
||||
- Multiplicity
|
||||
- Type
|
||||
- Description
|
||||
* - ``config``
|
||||
- 1
|
||||
- :ref:`Timelapse config <sec-api-timelapse-datamodel-config>`
|
||||
- Current timelapse configuration
|
||||
* - ``files``
|
||||
- 0..*
|
||||
- List of :ref:`rendered timelapses <sec-api-timelapse-datamodel-rendered>`
|
||||
- List of rendered timelapse entries
|
||||
* - ``unrendered``
|
||||
- 0..*
|
||||
- List of :ref:`unrendered timelapses <sec-api-timelapse-datamodel-unrendered>`
|
||||
- List of unrendered timelapse entries, only present if requested
|
||||
|
||||
.. _sec-api-timelapse-datamodel-rendered:
|
||||
|
||||
Rendered timelapse
|
||||
------------------
|
||||
|
||||
.. list-table::
|
||||
:widths: 15 5 10 30
|
||||
:header-rows: 1
|
||||
|
||||
* - Name
|
||||
- Multiplicity
|
||||
- Type
|
||||
- Description
|
||||
* - ``name``
|
||||
- 1
|
||||
- string
|
||||
- Name of the timelapse file
|
||||
* - ``size``
|
||||
- 1
|
||||
- string
|
||||
- Formatted size of the timelapse file
|
||||
* - ``bytes``
|
||||
- 1
|
||||
- int
|
||||
- Size of the timelapse file in bytes
|
||||
* - ``date``
|
||||
- 1
|
||||
- string
|
||||
- Formatted timestamp of the the timelapse creation date
|
||||
* - ``url``
|
||||
- 1
|
||||
- string
|
||||
- URL for downloading the timelapse
|
||||
|
||||
.. _sec-api-timelapse-datamodel-unrendered:
|
||||
|
||||
Unrendered timelapse
|
||||
--------------------
|
||||
|
||||
.. list-table::
|
||||
:widths: 15 5 10 30
|
||||
:header-rows: 1
|
||||
|
||||
* - Name
|
||||
- Multiplicity
|
||||
- Type
|
||||
- Description
|
||||
* - ``name``
|
||||
- 1
|
||||
- string
|
||||
- Name of the unrendered timelapse job
|
||||
* - ``size``
|
||||
- 1
|
||||
- string
|
||||
- Formatted size of all files in the unrendered timelapse job
|
||||
* - ``bytes``
|
||||
- 1
|
||||
- int
|
||||
- Size of all files in the unrendered timelapse job in bytes
|
||||
* - ``date``
|
||||
- 1
|
||||
- string
|
||||
- Formatted timestamp of the the timelapse job creation date
|
||||
* - ``recording``
|
||||
- 1
|
||||
- bool
|
||||
- Whether the timelapse is still being recorded (true) or not (false)
|
||||
* - ``rendering``
|
||||
- 1
|
||||
- bool
|
||||
- Whether the timelapse is still being rendered (true) or not (false)
|
||||
* - ``processing``
|
||||
- 1
|
||||
- bool
|
||||
- Whether the timelapse is either still being recorded or rendered (true) or not (false)
|
||||
|
||||
|
||||
.. _sec-api-timelapse-datamodel-config:
|
||||
|
||||
Timelapse configuration
|
||||
-----------------------
|
||||
|
||||
.. list-table::
|
||||
:widths: 15 5 10 30
|
||||
:header-rows: 1
|
||||
|
||||
* - Name
|
||||
- Multiplicity
|
||||
- Type
|
||||
- Description
|
||||
* - ``type``
|
||||
- 1
|
||||
- string
|
||||
- Type of the timelapse, either ``off``, ``zchange`` or ``timed``.
|
||||
|
||||
Further fields are timelapse type specific, see below for details.
|
||||
|
||||
.. _sec-api-timelapse-datamodel-config-off:
|
||||
|
||||
Z-change-triggered timelapse
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
For timelapse type ``zchange``.
|
||||
|
||||
.. list-table::
|
||||
:widths: 15 5 10 30
|
||||
:header-rows: 1
|
||||
|
||||
* - Name
|
||||
- Multiplicity
|
||||
- Type
|
||||
- Description
|
||||
* - ``postRoll``
|
||||
- 1
|
||||
- int
|
||||
- Configured post roll in seconds
|
||||
* - ``fps``
|
||||
- 1
|
||||
- int
|
||||
- Frames per second to use for rendered video
|
||||
* - ``retractionZHop``
|
||||
- 1
|
||||
- float
|
||||
- Size of retraction Z hop to detect and ignore for z-based snapshots
|
||||
|
||||
.. _sec-api-timelapse-datamodel-config-timed:
|
||||
|
||||
Time triggered timelapse
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
For timelapse type ``timed``.
|
||||
|
||||
.. list-table::
|
||||
:widths: 15 5 10 30
|
||||
:header-rows: 1
|
||||
|
||||
* - Name
|
||||
- Multiplicity
|
||||
- Type
|
||||
- Description
|
||||
* - ``postRoll``
|
||||
- 1
|
||||
- int
|
||||
- Configured post roll in seconds
|
||||
* - ``fps``
|
||||
- 1
|
||||
- int
|
||||
- Frames per second to use for rendered video
|
||||
* - ``interval``
|
||||
- 1
|
||||
- int
|
||||
- Seconds between individual shots
|
||||
|
||||
@@ -1,314 +0,0 @@
|
||||
.. _sec-api-user:
|
||||
|
||||
****
|
||||
User
|
||||
****
|
||||
|
||||
.. contents::
|
||||
|
||||
.. _sec-api-users-list:
|
||||
|
||||
Retrieve a list of users
|
||||
========================
|
||||
|
||||
.. http:get:: /api/users
|
||||
|
||||
Retrieves a list of all registered users in OctoPrint.
|
||||
|
||||
Will return a :http:statuscode:`200` with a :ref:`user list response <sec-api-users-datamodel-userlistresponse>`
|
||||
as body.
|
||||
|
||||
Requires admin rights.
|
||||
|
||||
:status 200: No error
|
||||
|
||||
.. _sec-api-users-retrieve:
|
||||
|
||||
Retrieve a user
|
||||
===============
|
||||
|
||||
.. http:get:: /api/users/(string:username)
|
||||
|
||||
Retrieves information about a user.
|
||||
|
||||
Will return a :http:statuscode:`200` with a :ref:`user record <sec-api-users-datamodel-userrecord>`
|
||||
as body.
|
||||
|
||||
Requires either admin rights or to be logged in as the user.
|
||||
|
||||
:param username: Name of the user which to retrieve
|
||||
:status 200: No error
|
||||
:status 404: Unknown user
|
||||
|
||||
.. _sec-api-users-add:
|
||||
|
||||
Add a user
|
||||
==========
|
||||
|
||||
.. http:post:: /api/users
|
||||
|
||||
Adds a user to OctoPrint.
|
||||
|
||||
Expects a :ref:`user registration request <sec-api-users-datamodel-adduserrequest>`
|
||||
as request body.
|
||||
|
||||
Returns a list of registered users on success, see :ref:`Retrieve a list of users <sec-api-users-list>`.
|
||||
|
||||
Requires admin rights.
|
||||
|
||||
:json name: The user's name
|
||||
:json password: The user's password
|
||||
:json active: Whether to activate the account (true) or not (false)
|
||||
:json admin: Whether to give the account admin rights (true) or not (false)
|
||||
:status 200: No error
|
||||
:status 400: If any of the mandatory fields is missing or the request is otherwise
|
||||
invalid
|
||||
:status 409: A user with the provided name does already exist
|
||||
|
||||
.. _sec-api-users-update:
|
||||
|
||||
Update a user
|
||||
=============
|
||||
|
||||
.. http:put:: /api/users/(string:username)
|
||||
|
||||
Updates a user record.
|
||||
|
||||
Expects a :ref:`user update request <sec-api-users-datamodel-updateuserrequest>`
|
||||
as request body.
|
||||
|
||||
Returns a list of registered users on success, see :ref:`Retrieve a list of users <sec-api-users-list>`.
|
||||
|
||||
Requires admin rights.
|
||||
|
||||
:param username: Name of the user to update
|
||||
:json admin: Whether to mark the user as admin (true) or not (false), can be left out (no change)
|
||||
:json active: Whether to mark the account as activated (true) or deactivated (false), can be left out (no change)
|
||||
:status 200: No error
|
||||
:status 404: Unknown user
|
||||
|
||||
.. _sec-api-users-delete:
|
||||
|
||||
Delete a user
|
||||
=============
|
||||
|
||||
.. http:delete:: /api/users/(string:username)
|
||||
|
||||
Delete a user record.
|
||||
|
||||
Returns a list of registered users on success, see :ref:`Retrieve a list of users <sec-api-users-list>`.
|
||||
|
||||
Requires admin rights.
|
||||
|
||||
:param username: Name of the user to delete
|
||||
:status 200: No error
|
||||
:status 404: Unknown user
|
||||
|
||||
.. _sec-api-users-resetpassword:
|
||||
|
||||
Reset a user's password
|
||||
=======================
|
||||
|
||||
.. http:put:: /api/users/(string:username)/password
|
||||
|
||||
Changes the password of a user.
|
||||
|
||||
Expects a JSON object with a single property ``password`` as request body.
|
||||
|
||||
Requires admin rights or to be logged in as the user.
|
||||
|
||||
:param username: Name of the user to change the password for
|
||||
:json password: The new password to set
|
||||
:status 200: No error
|
||||
:status 400: If the request doesn't contain a ``password`` property or the request
|
||||
is otherwise invalid
|
||||
:status 403: No admin rights and not logged in as the user
|
||||
:status 404: The user is unknown
|
||||
|
||||
.. _sec-api-users-getsettings:
|
||||
|
||||
Retrieve a user's settings
|
||||
==========================
|
||||
|
||||
.. http:get:: /api/users/(string:username)/settings
|
||||
|
||||
Retrieves a user's settings.
|
||||
|
||||
Will return a :http:statuscode:`200` with a JSON object representing the user's
|
||||
personal settings (if any) as body.
|
||||
|
||||
Requires admin rights or to be logged in as the user.
|
||||
|
||||
:param username: Name of the user to retrieve the settings for
|
||||
:status 200: No error
|
||||
:status 403: No admin rights and not logged in as the user
|
||||
:status 404: The user is unknown
|
||||
|
||||
.. _sec-api-users-updatesettings:
|
||||
|
||||
Update a user's settings
|
||||
========================
|
||||
|
||||
.. http:patch:: /api/users/(string:username)/settings
|
||||
|
||||
Updates a user's settings.
|
||||
|
||||
Expects a new settings JSON object to merge with the current settings as
|
||||
request body.
|
||||
|
||||
Requires admin rights or to be logged in as the user.
|
||||
|
||||
:param username: Name of the user to retrieve the settings for
|
||||
:status 204: No error
|
||||
:status 403: No admin rights and not logged in as the user
|
||||
:status 404: The user is unknown
|
||||
|
||||
.. _sec-api-users-generateapikey:
|
||||
|
||||
Regenerate a user's personal API key
|
||||
====================================
|
||||
|
||||
.. http:post:: /api/users/(string:username)/apikey
|
||||
|
||||
Generates a new API key for the user.
|
||||
|
||||
Does not expect a body. Will return the generated API key as ``apikey``
|
||||
property in the JSON object contained in the response body.
|
||||
|
||||
Requires admin rights or to be logged in as the user.
|
||||
|
||||
:param username: Name of the user to retrieve the settings for
|
||||
:status 200: No error
|
||||
:status 403: No admin rights and not logged in as the user
|
||||
:status 404: The user is unknown
|
||||
|
||||
.. _sec-api-users-deleteapikey:
|
||||
|
||||
Delete a user's personal API key
|
||||
================================
|
||||
|
||||
.. http:delete:: /api/users/(string:username)/apikey
|
||||
|
||||
Deletes a user's personal API key.
|
||||
|
||||
Requires admin rights or to be logged in as the user.
|
||||
|
||||
:param username: Name of the user to retrieve the settings for
|
||||
:status 204: No error
|
||||
:status 403: No admin rights and not logged in as the user
|
||||
:status 404: The user is unknown
|
||||
|
||||
.. _sec-api-users-datamodel:
|
||||
|
||||
Data model
|
||||
==========
|
||||
|
||||
.. _sec-api-users-datamodel-userlistresponse:
|
||||
|
||||
User list response
|
||||
------------------
|
||||
|
||||
.. list-table::
|
||||
:widths: 15 5 10 30
|
||||
:header-rows: 1
|
||||
|
||||
* - Name
|
||||
- Multiplicity
|
||||
- Type
|
||||
- Description
|
||||
* - ``users``
|
||||
- 0..n
|
||||
- List of :ref:`user records <sec-api-users-datamodel-userrecord>`
|
||||
- The list of registered users
|
||||
|
||||
.. _sec-api-users-datamodel-userrecord:
|
||||
|
||||
User record
|
||||
-----------
|
||||
|
||||
.. list-table::
|
||||
:widths: 15 5 10 30
|
||||
:header-rows: 1
|
||||
|
||||
* - Name
|
||||
- Multiplicity
|
||||
- Type
|
||||
- Description
|
||||
* - ``name``
|
||||
- 1
|
||||
- string
|
||||
- The user's name
|
||||
* - ``active``
|
||||
- 1
|
||||
- bool
|
||||
- Whether the user's account is active (true) or not (false)
|
||||
* - ``user``
|
||||
- 1
|
||||
- bool
|
||||
- Whether the user has user rights. Should always be true.
|
||||
* - ``admin``
|
||||
- 1
|
||||
- bool
|
||||
- Whether the user has admin rights (true) or not (false)
|
||||
* - ``apikey``
|
||||
- 0..1
|
||||
- string
|
||||
- The user's personal API key
|
||||
* - ``settings``
|
||||
- 1
|
||||
- object
|
||||
- The user's personal settings, might be an empty object.
|
||||
|
||||
.. _sec-api-users-datamodel-adduserrequest:
|
||||
|
||||
User registration request
|
||||
-------------------------
|
||||
|
||||
.. list-table::
|
||||
:widths: 15 5 10 30
|
||||
:header-rows: 1
|
||||
|
||||
* - Name
|
||||
- Multiplicity
|
||||
- Type
|
||||
- Description
|
||||
* - ``name``
|
||||
- 1
|
||||
- string
|
||||
- The user's name
|
||||
* - ``password``
|
||||
- 1
|
||||
- string
|
||||
- The user's password
|
||||
* - ``active``
|
||||
- 1
|
||||
- bool
|
||||
- Whether to activate the account (true) or not (false)
|
||||
* - ``admin``
|
||||
- 0..1
|
||||
- bool
|
||||
- Whether to give the user admin rights (true) or not (false or not present)
|
||||
|
||||
.. _sec-api-users-datamodel-updateuserrequest:
|
||||
|
||||
User update request
|
||||
-------------------
|
||||
|
||||
.. list-table::
|
||||
:widths: 15 5 10 30
|
||||
:header-rows: 1
|
||||
|
||||
* - Name
|
||||
- Multiplicity
|
||||
- Type
|
||||
- Description
|
||||
* - ``active``
|
||||
- 0..1
|
||||
- bool
|
||||
- If present will set the user's active flag to the provided value. True for
|
||||
activating the account, false for deactivating it.
|
||||
* - ``admin``
|
||||
- 0..1
|
||||
- bool
|
||||
- If present will set the user's admin flag to the provided value. True for
|
||||
admin rights, false for no admin rights.
|
||||
@@ -1,308 +0,0 @@
|
||||
.. _sec-api-util:
|
||||
|
||||
****
|
||||
Util
|
||||
****
|
||||
|
||||
.. _sec-api-util-test:
|
||||
|
||||
Test paths or URLs
|
||||
==================
|
||||
|
||||
.. http:post:: /api/util/test
|
||||
|
||||
Provides commands to test paths or URLs for correctness.
|
||||
|
||||
Used by OctoPrint to validate paths or URLs that the user needs to enter in the
|
||||
settings.
|
||||
|
||||
The following commands are supported at the moment:
|
||||
|
||||
.. _sec-api-util-test-path:
|
||||
|
||||
path
|
||||
Tests whether or provided path exists and optionally if it also is either a file
|
||||
or a directory and whether OctoPrint's user has read, write and/or execute permissions
|
||||
on it. Supported parameters are:
|
||||
|
||||
* ``path``: The file system path to test. Mandatory.
|
||||
* ``check_type``: ``file`` or ``dir`` if the path should not only be checked for
|
||||
existence but also whether it is of the specified type. Optional.
|
||||
* ``check_access``: A list of any of ``r``, ``w`` and ``x``. If present it will also
|
||||
be checked if OctoPrint has read, write, execute permissions on the specified path.
|
||||
|
||||
The ``path`` command returns a :http:statuscode:`200` with a :ref:`path test result <sec-api-util-datamodel-pathtestresult>`
|
||||
when the test could be performed. The status code of the response does NOT reflect the
|
||||
test result!
|
||||
|
||||
.. _sec-api-util-test-url:
|
||||
|
||||
url
|
||||
Tests whether a provided url responds. Request method and expected status codes can
|
||||
optionally be specified as well. Supported parameters are:
|
||||
|
||||
* ``url``: The url to test. Mandatory.
|
||||
* ``method``: The request method to use for the test. Optional, defaults to ``HEAD``.
|
||||
* ``timeout``: A timeout for the request, in seconds. If no reply from the tested URL has been
|
||||
received within this time frame, the check will be considered a failure. Optional, defaults to 3 seconds.
|
||||
* ``status``: The status code(s) or named status range(s) to test for. Can be either a single
|
||||
value or a list of either HTTP status codes or any of the following named status ranges:
|
||||
|
||||
* ``informational``: Status codes from 100 to 199
|
||||
* ``success``: Status codes from 200 to 299
|
||||
* ``redirection``: Status codes from 300 to 399
|
||||
* ``client_error``: Status codes from 400 to 499
|
||||
* ``server_error``: Status codes from 500 to 599
|
||||
* ``normal``: Status codes from 100 to 399
|
||||
* ``error``: Status codes from 400 to 599
|
||||
* ``any``: Any status code starting from 100
|
||||
|
||||
The test will past the status code check if the status returned by the URL is within any of
|
||||
the specified ranges.
|
||||
* ``response``: If set to either ``true``, ``json`` or ``bytes``, the response body and the response headers
|
||||
from the URL check will be returned as part of the check result as well. ``json`` will attempt
|
||||
to parse the response as json and return the parsed result. ``true`` or ``bytes`` will base64 encode the body
|
||||
and return that.
|
||||
|
||||
The ``url`` command returns :http:statuscode:`200` with a :ref:`URL test result <sec-api-util-datamodel-urltestresult>`
|
||||
when the test could be performed. The status code of the response does NOT reflect the
|
||||
test result!
|
||||
|
||||
Requires admin rights.
|
||||
|
||||
**Example 1**
|
||||
|
||||
Test whether a path exists and is a file readable and executable by OctoPrint.
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
POST /api/util/test HTTP/1.1
|
||||
Host: example.com
|
||||
X-Api-Key: abcdef...
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"command": "path",
|
||||
"path": "/some/path/to/a/file",
|
||||
"check_type": "file",
|
||||
"check_access": ["r", "x"]
|
||||
}
|
||||
|
||||
.. sourcecode:: HTTP
|
||||
|
||||
HTTP/1.1 200 OK
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"path": "/some/path/to/a/file",
|
||||
"exists": true,
|
||||
"typeok": true,
|
||||
"access": true,
|
||||
"result": true
|
||||
}
|
||||
|
||||
**Example 2**
|
||||
|
||||
Test whether a path exists which doesn't exist.
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
POST /api/util/test HTTP/1.1
|
||||
Host: example.com
|
||||
X-Api-Key: abcdef...
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"command": "path",
|
||||
"path": "/some/path/to/a/missing_file",
|
||||
"check_type": "file",
|
||||
"check_access": ["r", "x"]
|
||||
}
|
||||
|
||||
.. sourcecode:: HTTP
|
||||
|
||||
HTTP/1.1 200 OK
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"path": "/some/path/to/a/missing_file",
|
||||
"exists": false,
|
||||
"typeok": false,
|
||||
"access": false,
|
||||
"result": false
|
||||
}
|
||||
|
||||
**Example 3**
|
||||
|
||||
Test whether a path exists and is a file which is a directory.
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
POST /api/util/test HTTP/1.1
|
||||
Host: example.com
|
||||
X-Api-Key: abcdef...
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"command": "path",
|
||||
"path": "/some/path/to/a/folder",
|
||||
"check_type": "file"
|
||||
}
|
||||
|
||||
.. sourcecode:: HTTP
|
||||
|
||||
HTTP/1.1 200 OK
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"path": "/some/path/to/a/folder",
|
||||
"exists": true,
|
||||
"typeok": false,
|
||||
"access": true,
|
||||
"result": false
|
||||
}
|
||||
|
||||
**Example 4**
|
||||
|
||||
Test whether a URL returns a normal status code for a HEAD request.
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
POST /api/util/test HTTP/1.1
|
||||
Host: example.com
|
||||
X-Api-Key: abcdef...
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"command": "url",
|
||||
"url": "http://example.com/some/url"
|
||||
}
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
HTTP/1.1 200 OK
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"url": "http://example.com/some/url",
|
||||
"status": 200,
|
||||
"result": true
|
||||
}
|
||||
|
||||
**Example 5**
|
||||
|
||||
Test whether a URL can be called at all via GET request, provide its raw body. Set a timeout of 1s.
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
POST /api/util/test HTTP/1.1
|
||||
Host: example.com
|
||||
X-Api-Key: abcdef...
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"command": "url",
|
||||
"url": "http://example.com/some/url",
|
||||
"method": "GET",
|
||||
"timeout": 1.0,
|
||||
"status": "any",
|
||||
"response": true
|
||||
}
|
||||
|
||||
.. sourcecode:: HTTP
|
||||
|
||||
HTTP/1.1 200 OK
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"url": "http://example.com/some/url",
|
||||
"status": 200,
|
||||
"result": true,
|
||||
"response": {
|
||||
"headers": {
|
||||
"content-type": "image/gif"
|
||||
},
|
||||
"content": "R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7"
|
||||
}
|
||||
}
|
||||
|
||||
:json command: The command to execute, currently either ``path`` or ``url``
|
||||
:json path: ``path`` command only: the path to test
|
||||
:json check_type: ``path`` command only: the type of path to test for, either ``file`` or ``dir``
|
||||
:json check_access: ``path`` command only: a list of access permissions to check for
|
||||
:json url: ``url`` command only: the URL to test
|
||||
:json status: ``url`` command only: one or more expected status codes
|
||||
:json method: ``url`` command only: the HTTP method to use for the check
|
||||
:json timeout: ``url`` command only: the timeout for the HTTP request
|
||||
:json response: ``url`` command only: whether to include response data and if so in what form
|
||||
:statuscode 200: No error occurred
|
||||
|
||||
.. _sec-api-util-datamodel:
|
||||
|
||||
Data model
|
||||
==========
|
||||
|
||||
.. _sec-api-util-datamodel-pathtestresult:
|
||||
|
||||
.. list-table::
|
||||
:widths: 15 5 10 30
|
||||
:header-rows: 1
|
||||
|
||||
* - Name
|
||||
- Multiplicity
|
||||
- Type
|
||||
- Description
|
||||
* - ``path``
|
||||
- 1
|
||||
- string
|
||||
- The path that was tested.
|
||||
* - ``exists``
|
||||
- 1
|
||||
- bool
|
||||
- ``true`` if the path exists, ``false`` otherwise.
|
||||
* - ``typeok``
|
||||
- 1
|
||||
- bool
|
||||
- ``true`` if a type check was not requested or it passed, ``false`` otherwise
|
||||
* - ``access``
|
||||
- 1
|
||||
- bool
|
||||
- ``true`` if a permission check was not requested or it passed, ``false`` otherwise
|
||||
* - ``result``
|
||||
- 1
|
||||
- bool
|
||||
- ``true`` if the overall check passed, ``false`` otherwise
|
||||
|
||||
.. _sec-api-util-datamodel-urltestresult:
|
||||
|
||||
.. list-table::
|
||||
:widths: 15 5 10 30
|
||||
:header-rows: 1
|
||||
|
||||
* - Name
|
||||
- Multiplicity
|
||||
- Type
|
||||
- Description
|
||||
* - ``url``
|
||||
- 1
|
||||
- string
|
||||
- The URL that was tested.
|
||||
* - ``status``
|
||||
- 1
|
||||
- int
|
||||
- The status code returned by the URL, 0 in case of a timeout.
|
||||
* - ``result``
|
||||
- 1
|
||||
- bool
|
||||
- ``true`` if the check passed.
|
||||
* - ``response``
|
||||
- 0..1
|
||||
- string or object
|
||||
- If ``response`` in the request was set to ``bytes``: The base64 encoded body of the checked URL's response.
|
||||
If ``response`` in the request was set to ``json``: The json decoded body of the checked URL's response.
|
||||
Not present if ``response`` in the request was not set.
|
||||
* - ``headers``
|
||||
- 0..1
|
||||
- object
|
||||
- A dictionary with all headers of the checked URL's response. Only present if ``response`` in the
|
||||
request was set.
|
||||
@@ -1,75 +0,0 @@
|
||||
.. _sec-api-wizard:
|
||||
|
||||
******
|
||||
Wizard
|
||||
******
|
||||
|
||||
.. note::
|
||||
|
||||
All wizard operations require either admin rights or the ``firstRun`` flag to be ``true``.
|
||||
|
||||
.. contents::
|
||||
|
||||
.. _sec-api-wizard-retrieve:
|
||||
|
||||
Retrieve additional data about registered wizards
|
||||
=================================================
|
||||
|
||||
.. http:get:: /setup/wizard
|
||||
|
||||
Retrieves additional data about the registered wizards.
|
||||
|
||||
Returns a :http:statuscode:`200` with an object mapping wizard identifiers to :ref:`wizard data entries <sec-api-wizard-datamodel-wizarddata>`.
|
||||
|
||||
.. _sec-api-wizard-finish:
|
||||
|
||||
Finish wizards
|
||||
==============
|
||||
|
||||
.. http:post:: /setup/wizard
|
||||
|
||||
Inform wizards that the wizard dialog has been finished.
|
||||
|
||||
Expects a JSON request body containing a property ``handled`` which holds a list of wizard identifiers
|
||||
which were handled (not skipped) in the wizard dialog.
|
||||
|
||||
Will call :func:`octoprint.plugin.WizardPlugin.on_wizard_finish` for all registered wizard plugins,
|
||||
supplying the information whether the wizard plugin's identifier was within the list of ``handled``
|
||||
wizards or not.
|
||||
|
||||
:json handled: A list of handled wizards
|
||||
|
||||
.. _sec-api-wizard-datamodel:
|
||||
|
||||
Data model
|
||||
==========
|
||||
|
||||
.. _sec-api-wizard-datamodel-wizarddata:
|
||||
|
||||
Wizard data entry
|
||||
-----------------
|
||||
|
||||
.. list-table::
|
||||
:widths: 15 5 10 30
|
||||
:header-rows: 1
|
||||
|
||||
* - Name
|
||||
- Multiplicity
|
||||
- Type
|
||||
- Description
|
||||
* - ``required``
|
||||
- 1
|
||||
- bool
|
||||
- Whether the wizard needs to be run (true) or not (false)
|
||||
* - ``details``
|
||||
- 1
|
||||
- object
|
||||
- Details for the wizard's UI provided by the wizard plugin
|
||||
* - ``version``
|
||||
- 1
|
||||
- int or null
|
||||
- Version of the wizard
|
||||
* - ``ignored``
|
||||
- 1
|
||||
- bool
|
||||
- Whether the wizard has already been seen/is ignored (true) or not (false)
|
||||
@@ -1,138 +0,0 @@
|
||||
.. _sec-bundledplugins_cura:
|
||||
|
||||
Cura
|
||||
====
|
||||
|
||||
The Cura Plugin allows slicing of STL files uploaded to OctoPrint directly via
|
||||
the `CuraEngine <http://github.com/Ultimaker/CuraEngine>`_ **up to and
|
||||
including version 15.04.x** and supersedes the slicing support integrated into
|
||||
OctoPrint so far. It comes bundled with OctoPrint starting with version 1.2.0.
|
||||
|
||||
.. note::
|
||||
|
||||
Versions of CuraEngine later than 15.04.x have changed their calling
|
||||
parameters in such a way that the current implementation of OctoPrint's Cura plugin
|
||||
is not compatible to it. For this reason, please use only CuraEngine versions up to
|
||||
and including 15.04 for now, as available in the ``legacy`` branch of the CuraEngine
|
||||
repository on Github.
|
||||
|
||||
The plugin offers a settings module that allows configuring the path to the
|
||||
CuraEngine executable to use, as well as importing and managing slicing
|
||||
profiles to be used. Please note that the Cura Plugin will use the printer
|
||||
parameters you configured within OctoPrint (meaning bed size and extruder
|
||||
count and offsets) for slicing.
|
||||
|
||||
.. _sec-bundledplugins-cura-firststeps:
|
||||
|
||||
First Steps
|
||||
-----------
|
||||
|
||||
Before you can slice from within OctoPrint, you'll need to
|
||||
|
||||
#. :ref:`Install CuraEngine <sec-bundledplugins-cura-installing>`
|
||||
#. :ref:`Configure the path to CuraEngine within OctoPrint <sec-bundledplugins-cura-configuring>`
|
||||
#. :ref:`Export a slicing profile from Cura and import it within OctoPrint <sec-bundledplugins-cura-profiles>`
|
||||
|
||||
.. note::
|
||||
|
||||
OctoPi 0.12.0 and later ships with steps 1 and 2 already done, you only need to
|
||||
supply one or more slicing profiles to get going :)
|
||||
|
||||
.. _sec-bundledplugins-cura-installing:
|
||||
|
||||
Installing CuraEngine
|
||||
---------------------
|
||||
|
||||
You'll need a build of ``legacy`` branch of `CuraEngine <http://github.com/Ultimaker/CuraEngine>`_
|
||||
in order to be able to use the Cura OctoPrint plugin. You can find the ``legacy`` branch
|
||||
`here <https://github.com/ultimaker/curaengine/tree/legacy>`_.
|
||||
|
||||
If you previously used the `old variant of the Cura integration <https://github.com/foosel/OctoPrint/wiki/Cura-Integration>`_,
|
||||
you probably still have a fully functional binary lying around in the
|
||||
installation folder of the full install of Cura you used then -- just put the
|
||||
path to that in the plugin settings.
|
||||
|
||||
.. _sec-bundledplugins-cura-installing-raspbian:
|
||||
|
||||
Compiling for Raspbian
|
||||
++++++++++++++++++++++
|
||||
|
||||
.. note::
|
||||
|
||||
A binary of CuraEngine 15.04.06 precompiled on Raspbian Jessie Lite 2016-03-18 is available
|
||||
`here <http://bit.ly/octopi_cura_engine_150406>`_. Don't forget to make it
|
||||
executable after copying it to your preferred destination on your Pi
|
||||
(suggestion: ``/usr/local/bin``) with ``chmod +x cura_engine``. Use at your
|
||||
own risk.
|
||||
|
||||
Raspbian Jessie
|
||||
~~~~~~~~~~~~~~~
|
||||
|
||||
Building on Raspbian Jessie is as easy as::
|
||||
|
||||
sudo apt-get -y install gcc-4.7 g++-4.7
|
||||
git clone -b legacy https://github.com/Ultimaker/CuraEngine.git
|
||||
cd CuraEngine
|
||||
make
|
||||
|
||||
After this has completed, you'll find your shiny new build of CuraEngine in
|
||||
the `build` folder (full path for above example:
|
||||
``~/CuraEngine/build/CuraEngine``).
|
||||
|
||||
Raspbian Wheezy
|
||||
~~~~~~~~~~~~~~~
|
||||
|
||||
You'll need to install a new version of gcc and g++ and patch CuraEngine's
|
||||
Makefile (see `this post <http://umforum.ultimaker.com/index.php?/topic/5943-recent-build-of-curaengine-wont-compile-on-raspberry-pi/#entry58539>`_)
|
||||
in order for the compilation to work on current Raspbian builds (e.g. OctoPi)::
|
||||
|
||||
sudo apt-get -y install gcc-4.7 g++-4.7
|
||||
git clone -b legacy https://github.com/Ultimaker/CuraEngine.git
|
||||
cd CuraEngine
|
||||
wget http://bit.ly/curaengine_makefile_patch -O CuraEngine.patch
|
||||
patch < CuraEngine.patch
|
||||
make CXX=g++-4.7
|
||||
|
||||
After this has completed, you'll find your shiny new build of CuraEngine in
|
||||
the `build` folder (full path for above example:
|
||||
``~/CuraEngine/build/CuraEngine``).
|
||||
|
||||
.. _sec-bundledplugins-cura-configuring:
|
||||
|
||||
Configuring the plugin
|
||||
----------------------
|
||||
|
||||
The Cura plugin needs to be configured with the full path to your copy of the
|
||||
CuraEngine executable that it's supposed to use. You can do this either via
|
||||
the Cura plugin settings dialog or by manually configuring the path to the
|
||||
executable via ``config.yaml``, example:
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
plugins:
|
||||
cura:
|
||||
cura_engine: /path/to/CuraEngine
|
||||
|
||||
.. _sec-bundledplugins-cura-profiles:
|
||||
|
||||
Using Cura Profiles
|
||||
-------------------
|
||||
|
||||
The Cura Plugin supports importing your existing profiles for Cura **up to and
|
||||
including Cura 15.04.x**. Newer Cura releases (e.g. 15.06 or 2.x) use a different
|
||||
internal format that will *not* work with the current version of the Cura Plugin.
|
||||
|
||||
You can find downloads of Cura 15.04.x for Windows, Mac and Linux `on Ultimaker's download page <https://ultimaker.com/en/products/cura-software/list>`_.
|
||||
|
||||
In order to export a slicing profile from the Cura desktop UI, open it,
|
||||
set up your profile, then click on "File" and there on "Save Profile". You can
|
||||
import the .ini-file this creates via the "Import Profile" button in the
|
||||
Cura Settings within OctoPrint.
|
||||
|
||||
.. _sec-bundledplugins-cura-sourcecode:
|
||||
|
||||
Source code
|
||||
-----------
|
||||
|
||||
The source of the Cura plugin is bundled with OctoPrint and can be found in
|
||||
its source repository under ``src/octoprint/plugins/cura``.
|
||||
@@ -1,191 +0,0 @@
|
||||
.. _sec-bundledplugins-discovery:
|
||||
|
||||
Discovery Plugin
|
||||
================
|
||||
|
||||
The OctoPrint Discovery Plugin comes bundled with OctoPrint (starting with 1.2.0).
|
||||
|
||||
It allows discovery of the OctoPrint instances via SSDP/UPNP. If
|
||||
`pybonjour <https://pypi.python.org/pypi/pybonjour>`_ is installed OctoPrint
|
||||
will additionally support discovery via ZeroConf, also known as Bonjour or Avahi.
|
||||
|
||||
The SSDP/UPNP support allows OctoPrint to announce itself to machines on the same
|
||||
network running Microsoft Windows. You will be able to just double click on the
|
||||
OctoPrint instance icon in "Networks > Other Devices" in your Windows Explorer,
|
||||
which will take you directly to the web frontend.
|
||||
|
||||
The ZeroConf support allows OctoPrint to announce itself to Safari on MacOS X
|
||||
on the same network.
|
||||
|
||||
Linux users should install `Avahi <http://avahi.org>`_ and can then use one
|
||||
of the various Avahi browsers (e.g. ``avahi-browse`` for the command
|
||||
line) to scan for available instances.
|
||||
|
||||
.. _fig-bundledplugins-discovery-windowsexplorer:
|
||||
.. figure:: ../images/bundledplugins-discovery-windowsexplorer.png
|
||||
:align: center
|
||||
:alt: OctoPrint instances in Windows Explorer
|
||||
|
||||
Various discovered OctoPrint instances in Windows Explorer
|
||||
|
||||
.. _sec-bundledplugins-discovery-firststeps:
|
||||
|
||||
First Steps
|
||||
-----------
|
||||
|
||||
.. _sec-bundledplugins-discovery-firststeps-pybonjour:
|
||||
|
||||
Installing pybonjour
|
||||
++++++++++++++++++++
|
||||
|
||||
.. note::
|
||||
|
||||
OctoPi versions 0.12.0 and later already come with pybonjour installed and ready to go,
|
||||
you don't need to perform these steps there.
|
||||
|
||||
.. note::
|
||||
|
||||
Currently there are no releases for pybonjour available on the Python Package Index PyPI. The latest pybonjour
|
||||
release is still available in the `Google Code Archive <https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/pybonjour/pybonjour-1.1.1.tar.gz>`_.
|
||||
Since that URL is hilariously long though, a shortened version is provided with https://goo.gl/SxQZ06 and
|
||||
used in the installation instructions below.
|
||||
|
||||
In order for the Zeroconf discovery to work, the
|
||||
`pybonjour package <https://pypi.python.org/pypi/pybonjour>`_ needs to be available
|
||||
to the Python installation running OctoPrint.
|
||||
|
||||
It can be installed via ``pip``. Let's assume you installed OctoPrint manually
|
||||
into some folder ``~/OctoPrint``. You executed ``python setup.py install`` within a
|
||||
virtualenv in the same folder called ``venv``. In order to install ``pybonjour``
|
||||
so it will be available to OctoPrint you'll need to do the following::
|
||||
|
||||
venv/bin/pip install https://goo.gl/SxQZ06
|
||||
|
||||
**Linux users:** You'll need to install an additional dependency for this to work, the
|
||||
libdnssd compatibility layer for libavahi. On Debian/Ubuntu that can be achieved with::
|
||||
|
||||
sudo apt-get install libavahi-compat-libdnssd-dev
|
||||
|
||||
|
||||
.. _sec-bundledplugins-discovery-configuration:
|
||||
|
||||
Configuring the plugin
|
||||
----------------------
|
||||
|
||||
The plugin supports the following configuration keys:
|
||||
|
||||
* ``publicPort``: Public port number OctoPrint is reachable under,
|
||||
optional, if not set the port OctoPrint itself was started under will be used
|
||||
* ``pathPrefix``: Path prefix OctoPrint is running under, optional, if not
|
||||
set ``/`` will be used
|
||||
* ``useSsl``: ``true`` if OctoPrint should be called via HTTPS, ``false`` otherwise
|
||||
* ``httpUsername``: HTTP Basic Auth username OctoPrint is reachable with, optional
|
||||
* ``httpPassword``: HTTP Basic Auth password OctoPrint is reachable with, optional
|
||||
* ``upnpUuid``: uPNP UUID used for SSDP service announcements, usually you will
|
||||
not have to touch this, will be autogenerated if not set
|
||||
* ``zeroConf``: A list of additional services to announce via ZeroConf, optional,
|
||||
see below.
|
||||
* ``model``:
|
||||
|
||||
* ``name``: Name of the device model OctoPrint is running on, optional
|
||||
* ``description``: Description of the device model OctoPrint is running on,
|
||||
optional, used only for SSDP
|
||||
* ``number``: Model number of the device OctoPrint is running on, optional,
|
||||
used only for SSDP
|
||||
* ``url``: URL with further details about the device OctoPrint is running on,
|
||||
optional, used only for SSDP
|
||||
* ``serial``: Serial number of the device OctoPrint is running on, optional,
|
||||
used only for SSDP
|
||||
* ``vendor``: Vendor of the device OctoPrint is running on, optional
|
||||
* ``vendorUrl``: URL with further details about the vendor of the device
|
||||
OctoPrint is running on, optional, used only for SSDP
|
||||
|
||||
.. _sec-bundledplugins-discovery-configuration-furtherzeroconf:
|
||||
|
||||
Further ZeroConf Services
|
||||
+++++++++++++++++++++++++
|
||||
|
||||
The configuration also allows specifying additional ZeroConf service OctoPrint should
|
||||
announce itself as. Each entry supports the following fields:
|
||||
|
||||
* ``service``: The service to announce, this is the only obligatory field
|
||||
* ``name``: The name to announce, defaults to the OctoPrint instance name if not
|
||||
supplied
|
||||
* ``port``: The port to announce, defaults to the OctoPrint was started under if
|
||||
not supplied
|
||||
* ``txt_record``: The TXT record to publish with the DNS-SD record, should be a
|
||||
map of keys and associated values.
|
||||
|
||||
.. _sec-bundledplugins-discovery-configuration-example:
|
||||
|
||||
Example
|
||||
+++++++
|
||||
|
||||
The following snippet is a valid configuration example for the discovery plugin in OctoPrint's
|
||||
:ref:`config.yaml <sec-configuration-config_yaml>`:
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
plugins:
|
||||
discovery:
|
||||
publicPort: 443
|
||||
useSsl: true
|
||||
zeroConf:
|
||||
- service: _someservice._tcp
|
||||
port: 1234
|
||||
txt_record:
|
||||
field1: value1
|
||||
field2: value2
|
||||
model:
|
||||
name: Some Model
|
||||
vendor: Some Vendor
|
||||
|
||||
.. _sec-bundledplugins-discovery-announcedservices:
|
||||
|
||||
Announced Services
|
||||
------------------
|
||||
|
||||
.. _sec-bundledplugins-discovery-announcedservices-http:
|
||||
|
||||
ZeroConf Service ``_http._tcp``
|
||||
+++++++++++++++++++++++++++++++
|
||||
|
||||
If :ref:`pybonjour <sec-bundledplugins-discovery-firststeps-pybonjour>` is
|
||||
correctly installed, OctoPrint will announce itself on the network via ZeroConf
|
||||
as service ``_http._tcp``, with the TXT record containing the standard fields.
|
||||
|
||||
See also `this documentation of _http._tcp TXT records <http://www.dns-sd.org/txtrecords.html>`_
|
||||
for more information.
|
||||
|
||||
.. _sec-bundledplugins-discovery-announcedservices-octoprint:
|
||||
|
||||
ZeroConf Service ``_octoprint._tcp``
|
||||
++++++++++++++++++++++++++++++++++++
|
||||
|
||||
If :ref:`pybonjour <sec-bundledplugins-discovery-firststeps-pybonjour>` is
|
||||
correctly installed, OctoPrint will announce itself on the network via ZeroConf
|
||||
as service ``_octoprint._tcp``. The TXT record may contain the following fields:
|
||||
|
||||
* ``path``: path prefix to actual OctoPrint instance, inherited from ``_http._tcp``
|
||||
* ``u``: username if HTTP Basic Auth is used, optional, inherited from ``_http._tcp``
|
||||
* ``p``: password if HTTP Basic Auth is used, optional, inherited from ``_http._tcp``
|
||||
* ``version``: OctoPrint software version
|
||||
* ``api``: OctoPrint API version
|
||||
* ``model``: Model of the device that is running OctoPrint, optional
|
||||
* ``vendor``: Vendor of the device that is running OctoPrint, optional
|
||||
|
||||
Clients should construct the full path to the OctoPrint instance from this information
|
||||
following this scheme::
|
||||
|
||||
http://[u[:p]@]host:port[path]
|
||||
|
||||
See also `this documentation of _http._tcp TXT records <http://www.dns-sd.org/txtrecords.html>`_
|
||||
for more information.
|
||||
|
||||
.. _sec-bundledplugins-discovery-sourcecode:
|
||||
|
||||
Source code
|
||||
-----------
|
||||
|
||||
The source of the Discovery plugin is bundled with OctoPrint and can be found in
|
||||
its source repository under ``src/octoprint/plugins/discovery``.
|
||||
@@ -1,13 +0,0 @@
|
||||
.. _sec-bundledplugins:
|
||||
|
||||
###############
|
||||
Bundled Plugins
|
||||
###############
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 2
|
||||
|
||||
cura.rst
|
||||
discovery.rst
|
||||
pluginmanager.rst
|
||||
softwareupdate.rst
|
||||
@@ -1,84 +0,0 @@
|
||||
.. _sec-bundledplugins-pluginmanager:
|
||||
|
||||
Plugin Manager
|
||||
==============
|
||||
|
||||
The OctoPrint Plugin Manager comes bundled with OctoPrint starting with
|
||||
version 1.2.0.
|
||||
|
||||
It allows management of installed plugins (listing, enabling, disabling
|
||||
and uninstalling) and installing new plugins from the official
|
||||
`OctoPrint Plugin Repository <http://plugins.octoprint.org>`_, web addresses
|
||||
or uploaded file archives.
|
||||
|
||||
.. _fig-bundledplugins-pluginmanager-mainscreen:
|
||||
.. figure:: ../images/bundledplugins-pluginmanager-mainscreen.png
|
||||
:align: center
|
||||
:alt: Plugin Manager
|
||||
|
||||
The main dialog of the Plugin Manager
|
||||
|
||||
.. _fig-bundledplugins-pluginmanager-installing:
|
||||
.. figure:: ../images/bundledplugins-pluginmanager-installing.png
|
||||
:align: center
|
||||
:alt: Installation dialog
|
||||
|
||||
Dialog for installing new plugins
|
||||
|
||||
.. _fig-bundledplugins-pluginmanager-repofilters:
|
||||
.. figure:: ../images/bundledplugins-pluginmanager-repofilters.png
|
||||
:align: center
|
||||
:alt: Filter options for the repository browser
|
||||
|
||||
Filter options for the repository browser
|
||||
|
||||
.. _sec-bundledplugins-pluginmanager-configuration:
|
||||
|
||||
Configuring the Plugin
|
||||
----------------------
|
||||
|
||||
The Plugin Manager plugin only has a handful of configuration settings
|
||||
which normally won't have to be touched.
|
||||
|
||||
You can modify them either through the plugin's configuration dialog that
|
||||
you can open when clicking the little wrench icon in the upper right corner
|
||||
under Settings > Plugin Manager, or by directly editing ``config.yaml``:
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
plugins:
|
||||
pluginmanager:
|
||||
# The URL of the repository index to use
|
||||
repository: http://plugins.octoprint.org/plugins.json
|
||||
|
||||
# Time to live for the repository cache
|
||||
repository_ttl: 1440
|
||||
|
||||
# Additional arguments to use with pip. Defaults to unset,
|
||||
# you normally shouldn't need to modify this
|
||||
pip_args: --some --additional --pip --arguments
|
||||
|
||||
# Whether to force the --user flag with pip. Defaults to
|
||||
# false, you normally shouldn't need to modify this
|
||||
pip_force_user: false
|
||||
|
||||
# Whether to have pip always follow dependency links.
|
||||
# Defaults to false, you normally shouldn't need to
|
||||
# modify this
|
||||
dependency_links: false
|
||||
|
||||
# List of plugin identifiers hidden from the plugin
|
||||
# manager. Defaults to an empty list. Not available
|
||||
# through the configuration dialog, only available
|
||||
# to allow for vendor customization
|
||||
hidden:
|
||||
- some
|
||||
- hidden
|
||||
- plugins
|
||||
|
||||
.. _sec-bundledplugins-pluginmanager-sourcecode:
|
||||
|
||||
Source Code
|
||||
-----------
|
||||
|
||||
The source of the Plugin Manager is bundled with OctoPrint and can be found in its source repository under ``src/octoprint/plugins/pluginmanager``.
|
||||
@@ -1,399 +0,0 @@
|
||||
.. _sec-bundledplugins-softwareupdate:
|
||||
|
||||
Software Update Plugin
|
||||
======================
|
||||
|
||||
The Software Update Plugin allows receiving notifications about new releases
|
||||
of OctoPrint or installed plugins which registered with it and -- if properly
|
||||
configured -- also applying the found updates.
|
||||
|
||||
.. _sec-bundledplugins-softwareupdate-firststeps:
|
||||
|
||||
First Steps
|
||||
-----------
|
||||
|
||||
Out of the box the Software Update Plugin will be able to notify you of any
|
||||
updates that might be available for your OctoPrint installation or any plugins
|
||||
that registered themselves with it. In order to also be able to update
|
||||
your OctoPrint installation, you'll need to configure
|
||||
at least OctoPrint's checkout folder, and you also should
|
||||
configure the restart commands for OctoPrint and the whole server.
|
||||
|
||||
For configuring the plugin you'll need to go into OctoPrint's Settings Dialog, navigate to the
|
||||
Software Upda.. _section therein and once you are there click on the little wrench icon in the
|
||||
upper right corner.
|
||||
|
||||
.. _fig-bundledplugins-softwareupdate-plugin-configuration:
|
||||
.. figure:: ../images/bundledplugins-softwareupdate-plugin-configuration.png
|
||||
:align: center
|
||||
:alt: Software Update plugin configuration dialog
|
||||
|
||||
The Software Update plugin configuration dialog
|
||||
|
||||
There you can adjust the following settings:
|
||||
|
||||
* **OctoPrint checkout folder**: This should be the path to OctoPrint's git checkout folder (``/home/pi/OctoPrint``
|
||||
for OctoPi or `manual installs following the Raspberry Pi setup guide <https://github.com/foosel/OctoPrint/wiki/Setup-on-a-Raspberry-Pi-running-Raspbian>`_).
|
||||
This must be set to allow updating from within OctoPrint
|
||||
|
||||
.. note::
|
||||
|
||||
OctoPi releases 0.12.0 and later ship with this already setup for you.
|
||||
|
||||
.. note::
|
||||
|
||||
**OctoPi 0.11.0 users**: Please also take a look at
|
||||
`the note at the very end of this FAQ entry <https://github.com/foosel/OctoPrint/wiki/FAQ#how-can-i-update-the-octoprint-installation-on-my-octopi-image>`_.
|
||||
Due to a little issue in that OctoPi release 0.11.0 you might have to fix
|
||||
the URL your OctoPrint checkout is using for updating. This can easily be
|
||||
done by SSHing into your OctoPi instance and doing this::
|
||||
|
||||
cd ~/OctoPrint
|
||||
git remote set-url origin https://github.com/foosel/OctoPrint.git
|
||||
|
||||
* **OctoPrint version tracking**: Whether you want to track OctoPrint *releases* or every *commit*. Usually you want to
|
||||
select "Release" here which is also the default, unless you are a developer.
|
||||
* **OctoPrint Release Channel**: The release channel of OctoPrint to track for updates. If you only want stable versions,
|
||||
select "Stable" here which is also the default. "Maintenance RCs" will also allow you to update to maintenance release
|
||||
candidates, "Devel RCs" will also allow you to update to development release candidates. If in doubt, leave it at
|
||||
"Stable". `Read more about Release Channels here <https://github.com/foosel/OctoPrint/wiki/Using-Release-Channels>`_.
|
||||
* **Version cache TTL**: The "time to live" of the cache OctoPrint will use to temporarily persist the version information
|
||||
for the various components registered with the plugin, so that they don't have to be queried from the internet every time
|
||||
you load the page. Defaults to 24h, you usually shouldn't need to change that value.
|
||||
|
||||
More settings are available by :ref:`editing the correspondi.. _section in config.yaml <sec-bundledplugins-softwareupdate-configuration>`.
|
||||
|
||||
That restart commands for OctoPrint and the whole server can be configured under Settings > Server.
|
||||
|
||||
.. _sec-bundledplugins-softwareupdate-cli:
|
||||
|
||||
Command line usage
|
||||
------------------
|
||||
|
||||
The functionality of the Software Update Plugin is also available on OctoPrint's command line interface under the
|
||||
``plugins`` sub command. It's is possible to check for updates via ``octoprint plugins softwareupdate:check``
|
||||
and to apply available updates via ``octoprint plugins softwareupdate:update``. Please the corresponding
|
||||
``--help`` pages on details:
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
$ octoprint plugins softwareupdate:check --help
|
||||
Usage: octoprint plugins softwareupdate:check [OPTIONS] [TARGETS]...
|
||||
|
||||
Check for updates.
|
||||
|
||||
If any TARGETs are provided, only those components will be checked.
|
||||
|
||||
Examples:
|
||||
- octoprint plugins softwareupdate:check
|
||||
This will check all components for available updates,
|
||||
utilizing cached version information.
|
||||
- octoprint plugins softwareupdate:check --force
|
||||
This will check all components for available updates,
|
||||
ignoring any cached version information even if it's
|
||||
still valid.
|
||||
- octoprint plugins softwareupdate:check octoprint
|
||||
This will only check OctoPrint itself for available
|
||||
updates.
|
||||
|
||||
Options:
|
||||
--force Ignore the cache for the update check
|
||||
--help Show this message and exit.
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
$ octoprint plugins softwareupdate:update --help
|
||||
Usage: octoprint plugins softwareupdate:update [OPTIONS] [TARGETS]...
|
||||
|
||||
Apply updates.
|
||||
|
||||
If any TARGETs are provided, only those components will be updated.
|
||||
|
||||
Examples:
|
||||
- octoprint plugins softwareupdate:update
|
||||
This will update all components with a pending update
|
||||
that can be updated.
|
||||
- octoprint plugins softwareupdate:update --force
|
||||
This will force an update of all registered components
|
||||
that can be updated, even if they don't have an updated
|
||||
pending.
|
||||
- octoprint plugins softwareupdate:update octoprint
|
||||
This will only update OctoPrint and leave any further
|
||||
components with pending updates at their current versions.
|
||||
|
||||
Options:
|
||||
--force Update even if already up to date
|
||||
--help Show this message and exit.
|
||||
|
||||
.. _sec-bundledplugins-softwareupdate-configuration:
|
||||
|
||||
Configuring the Plugin
|
||||
----------------------
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
plugins:
|
||||
softwareupdate:
|
||||
# the time-to-live of the version cache, in minutes
|
||||
cache_ttl: 60
|
||||
|
||||
# configured version check and update methods
|
||||
checks:
|
||||
# "octoprint" is reserved for OctoPrint
|
||||
octoprint:
|
||||
# this defines an version check that will check against releases
|
||||
# published on OctoPrint's Github repository and an update method
|
||||
# utilizing an (included) update script that will be run on
|
||||
# OctoPrint's checkout folder
|
||||
type: github_release
|
||||
user: foosel
|
||||
repo: OctoPrint
|
||||
update_script: '{python} "/path/to/octoprint-update.py" --python="{python}" "{folder}" "{target}"'
|
||||
update_folder: /path/to/octoprint/checkout/folder
|
||||
|
||||
# further checks may be define here
|
||||
|
||||
# pip command, if another one than the automatically detected one should be
|
||||
# used - should normally NOT be necessary and hence set
|
||||
pip_command: /path/to/pip
|
||||
|
||||
.. _sec-bundledplugins-softwareupdate-configuration-versionchecks:
|
||||
|
||||
Version checks
|
||||
++++++++++++++
|
||||
|
||||
* ``github_release``: Checks against releases published on Github. Additional
|
||||
config parameters:
|
||||
|
||||
* ``user``: (mandatory) Github user the repository to check belongs to
|
||||
* ``repo``: (mandatory) Github repository to check
|
||||
* ``prerelease``: ``True`` or ``False``, default ``False``, set to
|
||||
``True`` to also include releases on Github marked as prerelease.
|
||||
* ``release_branch``: Branch name to check against ``target_comittish``
|
||||
field in Github release data - release will only be included if the
|
||||
values match. Defaults to being unset, in which case no match will
|
||||
be performed.
|
||||
* ``release_compare``: Method to use to compare between current version
|
||||
information and release versions on Github. One of ``python`` (version
|
||||
comparison using ``pkg_resources.parse_version``, newer version detected
|
||||
if remote > current), ``semantic`` (version comparison using
|
||||
``semantic_version`` package, newer version detected if remote > current)
|
||||
and ``unequal`` (string comparison, newer version detected if
|
||||
remote != current).
|
||||
|
||||
* ``github_commit``: Checks against commits pushed to Github. Additional
|
||||
config parameters:
|
||||
|
||||
* ``user``: (mandatory) Github user the repository to check belongs to
|
||||
* ``repo``: (mandatory) Github repository to check
|
||||
* ``branch``: Branch of the Github repository to check, defaults to
|
||||
``master`` if not set.
|
||||
* ``current``: Current commit hash. Will be updated automatically.
|
||||
|
||||
* ``bitbucket_commit``: Checks against commits pushed to Bitbucket. Additional
|
||||
config parameters:
|
||||
|
||||
* ``user``: (mandatory) Bitbucket user the repository to check belongs to
|
||||
* ``repo``: (mandatory) Bitbucket repository to check
|
||||
* ``branch``: Branch of the Bitbucket repository to check, defaults to
|
||||
``master`` if not set.
|
||||
* ``current``: Current commit hash. Will be updated automatically.
|
||||
|
||||
* ``git_commit``: Checks a local git repository for new commits on its
|
||||
configured remote. Additional config parameters:
|
||||
|
||||
* ``checkout_folder``: (mandatory) The full path to the folder with a valid git
|
||||
repository to check.
|
||||
|
||||
* ``command_line``: Uses a provided script to determine whether an update
|
||||
is available. Additional config parameters:
|
||||
|
||||
* ``command``: (mandatory) The full path to the script to execute. The script is
|
||||
expected to return a ``0`` return code if an update is available and to
|
||||
return the display name of the available version as the final and
|
||||
optionally the display name of the current version as the next to final
|
||||
line on stdout.
|
||||
|
||||
* ``python_checker``: Can only be specified by plugins through the
|
||||
:ref:`hook <sec-bundledplugins-softwareupdate-hooks>`. Additional config
|
||||
parameters:
|
||||
|
||||
* ``python_checker``: (mandatory) A python callable which returns version
|
||||
information and whether the current version is up-to-date or not, see
|
||||
below for details.
|
||||
|
||||
.. _sec-bundledplugins-softwareupdate-configuration-updatemethods:
|
||||
|
||||
Update methods
|
||||
++++++++++++++
|
||||
|
||||
* ``pip``: An URL to provide to ``pip install`` in order to perform the
|
||||
update. May contain a placeholder ``{target}`` which will be the most
|
||||
recent version specifier as retrieved from the update check.
|
||||
* ``update_script``: A script to execute in order to perform the update. May
|
||||
contain placeholders ``{target}`` (for the most recent version specified
|
||||
as retrieved from the update check), ``{branch}`` for the branch to switch
|
||||
to to access the release, ``{folder}`` for the working directory
|
||||
of the script and ``{python}`` for the python executable OctoPrint is
|
||||
running under. The working directory must be specified either by an
|
||||
``update_folder`` setting or if the ``git_commit`` check is used its
|
||||
``checkout_folder`` setting.
|
||||
* ``python_updater``: Can only be specified by plugins through the
|
||||
:ref:`hook <sec-bundledplugins-softwareupdate-hooks>`. A python callable
|
||||
which performs the update, see below for details.
|
||||
|
||||
.. _sec-bundledplugins-softwareupdate-configuration-patterns:
|
||||
|
||||
Common configuration patterns
|
||||
+++++++++++++++++++++++++++++
|
||||
|
||||
Example for a setup that allows "bleeding edge" updates of OctoPrint under
|
||||
OctoPi (the ``update_script`` gets configured correctly automatically by the
|
||||
plugin itself):
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
plugins:
|
||||
softwareupdate:
|
||||
checks:
|
||||
octoprint:
|
||||
type: github_commit
|
||||
user: foosel
|
||||
repo: OctoPrint
|
||||
branch: devel
|
||||
update_folder: /home/pi/OctoPrint
|
||||
|
||||
Plugin installed via pip and hosted on Github under
|
||||
``https://github.com/someUser/OctoPrint-SomePlugin``, only releases should be
|
||||
tracked:
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
plugins:
|
||||
softwareupdate:
|
||||
checks:
|
||||
some_plugin:
|
||||
type: github_release
|
||||
user: someUser
|
||||
repo: OctoPrint-SomePlugin
|
||||
pip: 'https://github.com/someUser/OctoPrint-SomePlugin/archive/{target}.zip'
|
||||
|
||||
The same, but tracking all commits pushed to branch ``devel`` (thus allowing
|
||||
"bleeding edge" updates):
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
plugins:
|
||||
softwareupdate:
|
||||
checks:
|
||||
some_plugin:
|
||||
type: github_commit
|
||||
user: someUser
|
||||
repo: OctoPrint-SomePlugin
|
||||
branch: devel
|
||||
pip: 'https://github.com/someUser/OctoPrint-SomePlugin/archive/{target}.zip'
|
||||
|
||||
.. _sec-bundledplugins-softwareupdate-hooks:
|
||||
|
||||
Hooks
|
||||
-----
|
||||
|
||||
.. _sec-bundledplugins-softwareupdate-hooks-check_config:
|
||||
|
||||
octoprint.plugin.softwareupdate.check_config
|
||||
++++++++++++++++++++++++++++++++++++++++++++
|
||||
|
||||
.. py:function:: update_config_hook(*args, **kwargs)
|
||||
|
||||
Returns additional check configurations for the Software Update plugin.
|
||||
|
||||
Handlers should return a Python dict containing one entry per check. Usually
|
||||
this will probably only be the check configuration for the plugin providing
|
||||
the handler itself, using the plugin's identifier as key.
|
||||
|
||||
The check configuration must match the format expected in the configuration
|
||||
(see description above). Handlers may also utilize the ``python_checker``
|
||||
and ``python_updater`` properties to return Python callables that take care
|
||||
of performing the version check or the update.
|
||||
|
||||
``python_checker`` is expected to be a callable matching signature and return
|
||||
value of the ``get_latest`` methods found in the provided version checkers in
|
||||
``src/octoprint/plugins/softwareupdate/version_checks``. ``python_updater``
|
||||
is expected to be a callable matching signature and return value of the
|
||||
``perform_update`` methods found in the provided updaters in
|
||||
``src/octoprint/plugins/softwareupdate/updaters``.
|
||||
|
||||
**Example**
|
||||
|
||||
The example single-file-plugin updates itself from Github releases published
|
||||
at the (fictional) repository ``https://github.com/someUser/OctoPrint-UpdatePluginDemo``.
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
# coding=utf-8
|
||||
from __future__ import absolute_import
|
||||
|
||||
def get_update_information(*args, **kwargs):
|
||||
return dict(
|
||||
updateplugindemo=dict(
|
||||
displayName=self._plugin_name,
|
||||
displayVersion=self._plugin_version,
|
||||
|
||||
type="github_release",
|
||||
current=self._plugin_version,
|
||||
user="someUser",
|
||||
repo="OctoPrint-UpdatePluginDemo",
|
||||
|
||||
pip="https://github.com/someUser/OctoPrint-UpdatePluginDemo/archive/{target}.zip"
|
||||
)
|
||||
)
|
||||
|
||||
__plugin_hooks__ = {
|
||||
"octoprint.plugin.softwareupdate.check_config": get_update_information
|
||||
}
|
||||
|
||||
:return: A dictionary of check configurations as described above
|
||||
:rtype: dict
|
||||
|
||||
.. _sec-bundledplugins-softwareupdate-helpers:
|
||||
|
||||
Helpers
|
||||
-------
|
||||
|
||||
.. _sec-bundledplugins-softwareupdate-helpers-version_checks:
|
||||
|
||||
version_checks
|
||||
++++++++++++++
|
||||
|
||||
``version_checks`` module of the Software Update plugin, allows reusing the
|
||||
bundled version check variants from plugins (e.g. wrapped in a ``python_checker``).
|
||||
|
||||
.. _sec-bundledplugins-softwareupdate-helpers-updaters:
|
||||
|
||||
updaters
|
||||
++++++++
|
||||
|
||||
``updaters`` module of the Software Update plugin, allows reusing the bundled
|
||||
updater variants from plugins (e.g. wrapped in a ``python_updater``).
|
||||
|
||||
.. _sec-bundledplugins-softwareupdate-helpers-exceptions:
|
||||
|
||||
exceptions
|
||||
++++++++++
|
||||
|
||||
``exceptions`` module of the Software Update plugin.
|
||||
|
||||
.. _sec-bundledplugins-softwareupdate-helpers-util:
|
||||
|
||||
util
|
||||
++++
|
||||
|
||||
``util`` module of the Software Update plugin.
|
||||
|
||||
.. _sec-bundledplugins-softwareupdate-source:
|
||||
|
||||
Source Code
|
||||
-----------
|
||||
|
||||
The source of the Software Update plugin is bundled with OctoPrint and can be
|
||||
found in its source repository under ``src/octoprint/plugins/softwareupdate``.
|
||||
@@ -17,7 +17,6 @@ import sys, os
|
||||
# add these directories to sys.path here. If the directory is relative to the
|
||||
# documentation root, use os.path.abspath to make it absolute, like shown here.
|
||||
sys.path.insert(0, os.path.abspath('../src/'))
|
||||
sys.path.append(os.path.abspath('sphinxext'))
|
||||
|
||||
import octoprint._version
|
||||
from datetime import date
|
||||
@@ -28,12 +27,11 @@ year_current = date.today().year
|
||||
# -- General configuration -----------------------------------------------------
|
||||
|
||||
# If your documentation needs a minimal Sphinx version, state it here.
|
||||
needs_sphinx = '1.3'
|
||||
#needs_sphinx = '1.0'
|
||||
|
||||
# Add any Sphinx extension module names here, as strings. They can be extensions
|
||||
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
|
||||
extensions = ['codeblockext', 'onlineinclude', 'sphinx.ext.todo', 'sphinx.ext.autodoc', 'sphinxcontrib.httpdomain',
|
||||
'sphinx.ext.napoleon']
|
||||
extensions = ['sphinx.ext.todo', 'sphinx.ext.autodoc', 'sphinxcontrib.httpdomain']
|
||||
todo_include_todos = True
|
||||
|
||||
# Add any paths that contain templates here, relative to this directory.
|
||||
@@ -98,7 +96,6 @@ pygments_style = 'sphinx'
|
||||
# If true, keep warnings as "system message" paragraphs in the built documents.
|
||||
#keep_warnings = False
|
||||
|
||||
numfig = True
|
||||
|
||||
# -- Options for HTML output ---------------------------------------------------
|
||||
|
||||
@@ -106,12 +103,12 @@ numfig = True
|
||||
on_rtd = os.environ.get('READTHEDOCS', None) == 'True'
|
||||
|
||||
if not on_rtd: # only import and set the theme if we're building docs locally
|
||||
import sphinx_rtd_theme
|
||||
html_theme = 'sphinx_rtd_theme'
|
||||
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
|
||||
import sphinx_rtd_theme
|
||||
html_theme = 'sphinx_rtd_theme'
|
||||
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
|
||||
|
||||
# The theme to use for HTML and HTML Help pages. See the documentation for
|
||||
# a list of built-in themes.
|
||||
# a list of builtin themes.
|
||||
#html_theme = "sphinx_rtd_theme"
|
||||
|
||||
# Theme options are theme-specific and customize the look and feel of a theme
|
||||
@@ -139,13 +136,10 @@ if not on_rtd: # only import and set the theme if we're building docs locally
|
||||
#html_favicon = None
|
||||
|
||||
# Add any paths that contain custom static files (such as style sheets) here,
|
||||
# relative to this directory. They are copied after the built-in static files,
|
||||
# so a file named "default.css" will overwrite the built-in "default.css".
|
||||
# relative to this directory. They are copied after the builtin static files,
|
||||
# so a file named "default.css" will overwrite the builtin "default.css".
|
||||
html_static_path = ['_static']
|
||||
|
||||
def setup(app):
|
||||
app.add_stylesheet("theme_overrides.css")
|
||||
|
||||
# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
|
||||
# using the given strftime format.
|
||||
#html_last_updated_fmt = '%b %d, %Y'
|
||||
@@ -193,7 +187,7 @@ htmlhelp_basename = 'OctoPrintdoc'
|
||||
|
||||
# -- Options for LaTeX output --------------------------------------------------
|
||||
|
||||
#latex_elements = {
|
||||
latex_elements = {
|
||||
# The paper size ('letterpaper' or 'a4paper').
|
||||
#'papersize': 'letterpaper',
|
||||
|
||||
@@ -202,20 +196,20 @@ htmlhelp_basename = 'OctoPrintdoc'
|
||||
|
||||
# Additional stuff for the LaTeX preamble.
|
||||
#'preamble': '',
|
||||
#}
|
||||
}
|
||||
|
||||
# Grouping the document tree into LaTeX files. List of tuples
|
||||
# (source start file, target name, title, author, documentclass [howto/manual]).
|
||||
#latex_documents = [
|
||||
# ('index', 'OctoPrint.tex', u'OctoPrint Documentation',
|
||||
# u'Gina Häußge', 'manual'),
|
||||
#]
|
||||
latex_documents = [
|
||||
('index', 'OctoPrint.tex', u'OctoPrint Documentation',
|
||||
u'Gina Häußge', 'manual'),
|
||||
]
|
||||
|
||||
# The name of an image file (relative to this directory) to place at the top of
|
||||
# the title page.
|
||||
#latex_logo = None
|
||||
|
||||
# For "manual" documents, if this is true, then top-level headings are parts,
|
||||
# For "manual" documents, if this is true, then toplevel headings are parts,
|
||||
# not chapters.
|
||||
#latex_use_parts = False
|
||||
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
.. _sec-configuration:
|
||||
|
||||
#############
|
||||
Configuration
|
||||
#############
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 2
|
||||
|
||||
yaml.rst
|
||||
config_yaml.rst
|
||||
logging_yaml.rst
|
||||
@@ -1,100 +0,0 @@
|
||||
.. _sec-configuration-logging_yaml:
|
||||
|
||||
logging.yaml
|
||||
============
|
||||
|
||||
The logging configuration file ``logging.yaml`` for OctoPrint is expected in its settings folder, which unless defined
|
||||
differently on the command line is located at ``~/.octoprint`` on Linux, at ``%APPDATA%/OctoPrint`` on Windows and at
|
||||
``~/Library/Application Support/OctoPrint`` on MacOS.
|
||||
|
||||
You can use it to change the log levels of the individual components within OctoPrint, which might be necessary to help
|
||||
in debugging issues you are experiencing, or to change the configuration of the logging handlers themselves, e.g. in
|
||||
order to change size after which to rollover the ``serial.log``.
|
||||
|
||||
Changing log levels
|
||||
-------------------
|
||||
|
||||
If you need to change the default logging level within OctoPrint, create the file with a text editor of your choice
|
||||
(it's usually not there). The general format is this::
|
||||
|
||||
loggers:
|
||||
<component>:
|
||||
level: <loglevel>
|
||||
|
||||
with ``<component>`` being the internal OctoPrint component for which to change the loglevel, and ``<loglevel>`` being the
|
||||
new log level to set. An example for increasing the log level of the events and the file management components to
|
||||
``DEBUG`` (the highest amount of logging) would be this ``logging.yaml``:
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
loggers:
|
||||
octoprint.events:
|
||||
level: DEBUG
|
||||
octoprint.filemanager:
|
||||
level: DEBUG
|
||||
|
||||
A list of important components for which an increase in logging might be interesting follows:
|
||||
|
||||
* ``octoprint.events``: the event sub system
|
||||
* ``octoprint.filemanager``: the file management layer
|
||||
* ``octoprint.plugin``: the plugin sub system
|
||||
* ``octoprint.plugins.<plugin>``: the plugin ``<plugin>``, e.g. ``octoprint.plugins.discovery`` to change the log level of
|
||||
the `Discovery plugin <https://github.com/foosel/OctoPrint/wiki/Plugin:-Discovery>`_ or ``octoprint.plugins.cura``
|
||||
to change the log level of the `Cura plugin <https://github.com/foosel/OctoPrint/wiki/Plugin:-Cura>`_.
|
||||
* ``octoprint.slicing``: the slicing sub system
|
||||
|
||||
This list will be expanded when deemed necessary.
|
||||
|
||||
Changing logging handlers
|
||||
-------------------------
|
||||
|
||||
You can also change the configuration of the logging handlers themselves, e.g. in order to make the ``serial.log`` larger
|
||||
for debugging long running communications or to change the behaviour of the ``octoprint.log``.
|
||||
|
||||
You can find the default configurations of the ``file`` handler used for the ``octoprint.log``, the ``serialFile`` handler
|
||||
used for the ``serial.log`` and the ``console`` handler used for the output to stdout in YAML format below:
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
handlers:
|
||||
# stdout
|
||||
console:
|
||||
class: logging.StreamHandler
|
||||
level: DEBUG
|
||||
formatter: simple
|
||||
stream: ext://sys.stdout
|
||||
|
||||
# octoprint.log
|
||||
file:
|
||||
class: logging.handlers.TimedRotatingFileHandler
|
||||
level: DEBUG
|
||||
formatter: simple
|
||||
when: D
|
||||
backupCount: 1
|
||||
filename: /path/to/octoprints/logs/octoprint.log
|
||||
|
||||
# serial.log
|
||||
serialFile:
|
||||
class: logging.handlers.RotatingFileHandler
|
||||
level: DEBUG
|
||||
formatter: simple
|
||||
maxBytes: 2097152 # 2 * 1024 * 1024 = 2 MB in bytes
|
||||
filename: /path/to/octoprints/logs/serial.log
|
||||
|
||||
You can find more information on the used logging handlers in the
|
||||
`Python documentation on logging handlers <https://docs.python.org/2/library/logging.handlers.html>`_.
|
||||
|
||||
Changing logging formatters
|
||||
---------------------------
|
||||
|
||||
The logging formatters can be defined via ``logging.yaml`` as well. The ``simple`` formatter as referenced above is
|
||||
expressed in YAML as follows:
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
formatters:
|
||||
simple:
|
||||
format: "%(asctime)s - %(name)s - %(levelname)s - %(message)s"
|
||||
|
||||
The possible keys for the logging format can be found in the
|
||||
`Python documentation on LogRecord attributes <https://docs.python.org/2/library/logging.html#logrecord-attributes>`_.
|
||||
@@ -1,224 +0,0 @@
|
||||
.. _sec-configuration-yaml:
|
||||
|
||||
A YAML Primer
|
||||
=============
|
||||
|
||||
Most of OctoPrint's configuration is done under the hood through `YAML <https://en.wikipedia.org/wiki/YAML>`_ files,
|
||||
which is why it makes sense to shed some light on the basics of this data serialization format.
|
||||
|
||||
YAML is a text based format which excels at representing the most common of data structures in an easy and very human
|
||||
readable way, which is why it was chosen for OctoPrint's configuration files. A text editor is all you need in order
|
||||
to write YAML configuration files.
|
||||
|
||||
.. _sec-configuration-yaml-basic:
|
||||
|
||||
Basic Rules
|
||||
-----------
|
||||
|
||||
First of all some basic things to know about working with YAML files:
|
||||
|
||||
* Never use tabs outside of quoted strings, especially not for indentation. The tab character is illegal within
|
||||
YAML files.
|
||||
* Whitespace and indentation matters and plays an important part in structuring the data, so take special care
|
||||
to stay consistent here.
|
||||
* YAML's comments start with a ``#`` and go until the end of the line.
|
||||
|
||||
.. _sec-configuration-yaml-types:
|
||||
|
||||
Interesting data types
|
||||
----------------------
|
||||
|
||||
You will probably only come across the three most basic types of data within OctoPrint's YAML files: scalars
|
||||
(such as strings, integers, ...), lists and associated arrays (aka key-value-pairs, aka maps, aka dictionaries).
|
||||
|
||||
.. _sec-configuration-yaml-types-scalar:
|
||||
|
||||
Scalars
|
||||
.......
|
||||
|
||||
Scalars are the most basic of all data types and are simple string, integer, float or boolean values.
|
||||
|
||||
For most scalars you don't need any quotes at all, but if you need to define some piece of data which contains characters
|
||||
that could be mistaken with YAML syntax you need to quote it in either double ``"`` or single ``'`` quotes for the
|
||||
YAML file to stay valid. As simple rule of thumb, if your data contains any of these characters ``:-{}[]!#|>&%@`` better
|
||||
quote it. Also quote it if you want a string but it could be mistaken for a valid number (integer or float) or if
|
||||
it consists only of "Yes", "No", "yes", "no", "true" or "false", which would be converted to a boolean without quotes.
|
||||
|
||||
In double quoted strings if you need to include a literal double quote in your string you can escape it by prefixing
|
||||
it with a backslash ``\`` (which you can in turn escape by itself). In single quoted strings the single quote character
|
||||
can be escaped by prefixing it with another single quote, basically doubling it. Backslashes in single quoted strings
|
||||
do not need to be escaped.
|
||||
|
||||
Quoted strings can also span across multiple lines, just indent the following lines. Note that you'll need to add a
|
||||
completely empty line in order for force a line break, the data will not be actually wrapped across multiple lines
|
||||
just because you spread its representation across multiple lines.
|
||||
|
||||
.. _sec-configuration-yaml-types-scalar-int:
|
||||
|
||||
int
|
||||
'''
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
23
|
||||
|
||||
42
|
||||
|
||||
.. _sec-configuration-yaml-types-scalar-float:
|
||||
|
||||
float
|
||||
'''''
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
23.5
|
||||
|
||||
100.0
|
||||
|
||||
.. _sec-configuration-yaml-types-scalar-boolean:
|
||||
|
||||
boolean
|
||||
'''''''
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
true
|
||||
|
||||
false
|
||||
|
||||
Yes
|
||||
|
||||
No
|
||||
|
||||
yes
|
||||
|
||||
no
|
||||
|
||||
.. _sec-configuration-yaml-types-scalar-string:
|
||||
|
||||
string
|
||||
''''''
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
a string
|
||||
|
||||
"some quoted string with a : colon and a { bracket and a quote \" and a backslash \\ - phew"
|
||||
|
||||
'some single quoted string with a single quote '' and a backslash \ - yay'
|
||||
|
||||
"and a multiline string - just because we can we'll make it span
|
||||
across not two but four YAML lines!
|
||||
|
||||
Including this paragraph. But in fact it will only be two lines :)"
|
||||
|
||||
"23"
|
||||
|
||||
"42.3"
|
||||
|
||||
"Yes"
|
||||
|
||||
"No"
|
||||
|
||||
"true"
|
||||
|
||||
"false"
|
||||
|
||||
yes and no
|
||||
|
||||
true or false
|
||||
|
||||
.. _sec-configuration-yaml-types-lists:
|
||||
|
||||
Lists
|
||||
.....
|
||||
|
||||
Lists allow to "collect" a number of similar things into one data structure. They are created by prefixing one or more
|
||||
consecutive lines with a ``-``:
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
- item 1
|
||||
- 23.42
|
||||
- 57
|
||||
- true
|
||||
|
||||
Take special care to have all of your list items at the same indentation level!
|
||||
|
||||
.. _sec-configuration-yaml-types-dicts:
|
||||
|
||||
Dictionaries
|
||||
............
|
||||
|
||||
Dictionaries (aka associative arrays aka maps) allow organizing the data in key value pairs, with the key and the value
|
||||
being separated through a colon ``:``:
|
||||
|
||||
.. sourcecode:: yaml
|
||||
|
||||
key: value
|
||||
anotherkey: another value
|
||||
|
||||
.. _sec-configuration-yaml-examples:
|
||||
|
||||
Examples
|
||||
--------
|
||||
|
||||
Based on the three types explained above, quite complex data structures are possible (whitespace made visible to
|
||||
help track indentation):
|
||||
|
||||
.. code-block-ext:: yaml
|
||||
:whitespace:
|
||||
|
||||
general:
|
||||
some_setting: some_value
|
||||
a_list:
|
||||
- item 1
|
||||
- 23.42
|
||||
- 57
|
||||
- true
|
||||
some_flag: true
|
||||
quoted_string: "This string is quoted because {we have this here} and also > this and : that"
|
||||
specific:
|
||||
setting1: value1
|
||||
setting2:
|
||||
subsetting21: value11
|
||||
subsetting22:
|
||||
- subsubsetting221
|
||||
- subsubsetting222
|
||||
- subsubsetting223
|
||||
the_end: yes
|
||||
|
||||
In this example we have a dictionary on the top most "layer" which has three keys, ``general``, ``specific`` and
|
||||
``the_end``.
|
||||
|
||||
``general`` in turn is a dictionary with the keys ``some_setting`` (a string), ``a_list`` (a list with four items,
|
||||
a string, a float, an int and a boolean), ``some_flag`` (a boolean) and ``quoted_string`` (a -- you guessed it -- string).
|
||||
|
||||
``specific`` is also a dictionary, with keys ``setting1`` (a string) and ``setting2``, a dictionary with two keys, one
|
||||
a string and the other again a list.
|
||||
|
||||
Finally, ``the_end`` is just a boolean, since an unquoted ``yes`` evaluates as a boolean value as we saw in the
|
||||
:ref:`section about boolean scalars above <sec-configuration-yaml-types-scalar-boolean>`.
|
||||
|
||||
Don't get confused by the list "dividing" one part of the dictionary under ``general`` from the other -- your mind is
|
||||
just playing a trick on you due to the list's dashes ``-`` being on the same levels as the dictionary keys. You could
|
||||
also just add two more spaces to your indentation and write that part like this, which makes the structure a bit
|
||||
clearer (whitespace again made visible to help track indentation):
|
||||
|
||||
.. code-block-ext:: yaml
|
||||
:whitespace:
|
||||
|
||||
general:
|
||||
some_setting: some_value
|
||||
a_list:
|
||||
- item 1
|
||||
- 23.42
|
||||
- 57
|
||||
- true
|
||||
some_flag: true
|
||||
# ...
|
||||
|
||||
Just make sure you follow a consistent way of indenting your files -- YAML is not as strict as Python when it comes to
|
||||
differing indentation variants within the same file (as long as it's still valid), but consistency will help you as
|
||||
a lot as a human. Ideally you'll use a text editor which highlights white space characters for you (most editors can
|
||||
be configured this way), this will help tremendously when editing whitespace sensitive syntax such as YAML.
|
||||
@@ -1,186 +0,0 @@
|
||||
.. _sec-development:
|
||||
|
||||
###########
|
||||
Development
|
||||
###########
|
||||
|
||||
.. contents::
|
||||
:local:
|
||||
|
||||
.. _sec-development-environment:
|
||||
|
||||
Setting up a Development environment
|
||||
====================================
|
||||
|
||||
.. _sec-development-environment-source:
|
||||
|
||||
Obtaining, building and running the source
|
||||
------------------------------------------
|
||||
|
||||
This describes the general steps in obtaining, building and running. OS specific instructions can be found
|
||||
below.
|
||||
|
||||
* Prerequisites:
|
||||
|
||||
* `Python 2.7 <https://python.org>`_ including ``pip``, ``setuptools`` and ``virtualenv``
|
||||
* `Git <https://git-scm.com>`_
|
||||
|
||||
* Checkout the OctoPrint sources from their Git repository: ``git clone https://github.com/foosel/OctoPrint.git``
|
||||
* Create a virtual environment in the checkout folder to use for installing and running OctoPrint and its
|
||||
dependencies (this avoids potential versioning issues for the dependencies with system wide installed
|
||||
instances): ``virtualenv venv``
|
||||
* Activate the virtual environment: ``source venv/bin/activate`` (might differ per your platform/OS)
|
||||
* Update ``pip`` in the virtual environment: ``pip install --upgrade pip``
|
||||
* Install OctoPrint in `"editable" mode <https://pip.pypa.io/en/stable/reference/pip_install/#editable-installs>`_,
|
||||
including its regular *and* development dependencies: ``pip install -e .[develop]``
|
||||
|
||||
.. _sec-development-environment-source-linux:
|
||||
|
||||
Linux
|
||||
.....
|
||||
|
||||
This assumes you'll host your OctoPrint development checkout at ``~/devel/OctoPrint``. If you want to use a different
|
||||
location, please substitute accordingly.
|
||||
|
||||
First make sure you have python including its header files, pip, setuptools, virtualenv, git and some build requirements
|
||||
installed:
|
||||
|
||||
* On apt based distributions (e.g. Debian, Ubuntu, ...):
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
sudo apt-get install python python-pip python-dev python-setuptools python-virtualenv git libyaml-dev build-essential
|
||||
|
||||
.. todo::
|
||||
|
||||
Using a Linux distribution that doesn't use ``apt``? Please send a
|
||||
`Pull Request <https://github.com/foosel/OctoPrint/blob/master/CONTRIBUTING.md#pull-requests>`_ to get the necessary
|
||||
steps into this guide!
|
||||
|
||||
Then:
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
cd ~/devel
|
||||
git clone https://github.com/foosel/OctoPrint.git
|
||||
cd OctoPrint
|
||||
virtualenv venv
|
||||
source ./venv/bin/activate
|
||||
pip install --upgrade pip
|
||||
pip install -e .[develop]
|
||||
|
||||
You can then start OctoPrint via ``~/devel/OctoPrint/venv/bin/octoprint`` or just ``octoprint`` if you activated the virtual
|
||||
environment.
|
||||
|
||||
.. _sec-development-environment-windows:
|
||||
|
||||
Windows
|
||||
.......
|
||||
|
||||
This assumes you'll host your OctoPrint development checkout at ``C:\Devel\OctoPrint``. If you want to use a different
|
||||
location, please substitute accordingly.
|
||||
|
||||
First download & install:
|
||||
|
||||
* `Python 2.7.12 Windows x86 MSI installer <https://www.python.org/downloads/release/python-2712/>`_
|
||||
|
||||
* make sure to have the installer add Python to the ``PATH`` and have it install ``pip`` too
|
||||
|
||||
* `Microsoft Visual C++ Compiler for Python 2.7 <http://www.microsoft.com/en-us/download/details.aspx?id=44266>`_
|
||||
* `Git for Windows <https://git-for-windows.github.io/>`_
|
||||
|
||||
Open the Git Bash you just installed and in that:
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
pip install virtualenv
|
||||
cd /c/Devel
|
||||
git clone https://github.com/foosel/OctoPrint.git
|
||||
cd OctoPrint
|
||||
virtualenv venv
|
||||
source ./venv/bin/activate
|
||||
pip install --upgrade pip
|
||||
pip install -e .[develop]
|
||||
|
||||
You can then start OctoPrint via ``/c/Devel/OctoPrint/venv/bin/octoprint`` or just ``octoprint`` if you activated the virtual
|
||||
environment.
|
||||
|
||||
.. _sec-development-environment-mac:
|
||||
|
||||
Mac OS X
|
||||
........
|
||||
|
||||
.. note::
|
||||
|
||||
This guide is based on the `Setup Guide for Mac OS X on OctoPrint's wiki <https://github.com/foosel/OctoPrint/wiki/Setup-on-Mac/>`_.
|
||||
Please report back if it works for you, due to lack of access to a Mac I cannot test it myself. Thanks.
|
||||
|
||||
This assumes you'll host your OctoPrint development checkout at ``~/devel/OctoPrint``. If you want to use a different
|
||||
location, please substitute accordingly.
|
||||
|
||||
You'll need a user account with administrator privileges.
|
||||
|
||||
* Install the latest version of Xcode suitable for your OS. For example, OS X 10.11 (El Capitan) requires Xcode 7.
|
||||
* Install Xcode's command line tools:
|
||||
|
||||
* ``xcode-select --install``
|
||||
* ``sudo xcodebuild`` (ensure the license was accepted)
|
||||
* If you have more than one Xcode installed: ``sudo xcode-select -s /Applications/Xcode.app/Contents/Developer``
|
||||
|
||||
* Install Homebrew and use that to install Python:
|
||||
|
||||
* ``ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"``
|
||||
* ``brew install python``
|
||||
|
||||
* Install `virtualenv <https://virtualenv.pypa.io/>`_
|
||||
|
||||
* ``pip install virtualenv``
|
||||
|
||||
* Install OctoPrint
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
cd ~/devel
|
||||
git clone https://github.com/foosel/OctoPrint.git
|
||||
cd OctoPrint
|
||||
virtualenv venv
|
||||
source venv/bin/activate
|
||||
pip install -e .[develop]
|
||||
|
||||
You can then start OctoPrint via ``~/devel/OctoPrint/venv/bin/octoprint`` or just ``octoprint`` if you activated the virtual
|
||||
environment.
|
||||
|
||||
.. _sec-development-environment-ides:
|
||||
|
||||
IDE Setup
|
||||
---------
|
||||
|
||||
.. todo::
|
||||
|
||||
Using another IDE than the ones below? Please send a
|
||||
`Pull Request <https://github.com/foosel/OctoPrint/blob/master/CONTRIBUTING.md#pull-requests>`_ to get the necessary
|
||||
steps into this guide!
|
||||
|
||||
.. _sec-development-environment-ides-pycharm:
|
||||
|
||||
PyCharm
|
||||
.......
|
||||
|
||||
- "File" > "Open ...", select OctoPrint checkout folder (e.g. ``~/devel/OctoPrint`` or ``C:\Devel\OctoPrint``)
|
||||
- "File" > "Settings ..." > "Project: OctoPrint" > "Project Interpreter" > "Add local ...", select OctoPrint venv
|
||||
folder (e.g. ``~/devel/OctoPrint/venv`` or ``C:\Devel\OctoPrint\venv``)
|
||||
- Right click "src" in project tree, mark as source folder
|
||||
- Add Run/Debug Configuration, select "Python":
|
||||
|
||||
* Name: OctoPrint server
|
||||
* Script: path to ``run`` in the OctoPrint checkout folder (e.g. ``~/devel/OctoPrint/run`` or ``C:\Devel\OctoPrint\run``)
|
||||
* Script parameters: ``--debug``
|
||||
* Project: ``OctoPrint``
|
||||
* Python interpreter: the ``venv`` local virtual environment
|
||||
* Working directory: the OctoPrint checkout folder (e.g. ``~/devel/OctoPrint`` or ``C:\Devel\OctoPrint``)
|
||||
|
||||
.. note::
|
||||
|
||||
Make sure you are running a PyCharm version of 2016.1 or later, or manually fix
|
||||
`a debugger bug contained in earlier versions <https://youtrack.jetbrains.com/issue/PY-18365>`_ or plugin management
|
||||
will not work in your developer install when running OctoPrint from PyCharm in debug mode.
|
||||
@@ -1,19 +1,16 @@
|
||||
.. _sec-events:
|
||||
|
||||
######
|
||||
Events
|
||||
######
|
||||
####################
|
||||
Events Documentation
|
||||
####################
|
||||
|
||||
.. contents::
|
||||
|
||||
|
||||
.. note::
|
||||
|
||||
With release of OctoPrint 1.1.0, the payload data has been harmonized, it is now a key-value-map for all events.
|
||||
Additionally, the format of the placeholders in both system command and gcode command triggers has been changed to
|
||||
accommodate for this new format. Last but not least, the way of specifying event hooks has changed, OctoPrint no longer
|
||||
separates hooks into two sections (gcodeCommandTrigger and systemCommandTrigger) but instead event hooks are now typed
|
||||
to indicate what to do with the command contained.
|
||||
With release of OctoPrint 1.1.0, the payload data has been harmonized, it is now a key-value-map for all events.
|
||||
Additionally, the format of the placeholders in both system command and gcode command triggers has been changed to
|
||||
accommodate for this new format. Last but not least, the way of specifying event hooks has changed, OctoPrint no longer
|
||||
separates hooks into two sections (gcodeCommandTrigger and systemCommandTrigger) but instead event hooks are now typed
|
||||
to indicate what to do with the command contained.
|
||||
|
||||
.. _sec-events-configuration:
|
||||
|
||||
@@ -59,12 +56,10 @@ Example
|
||||
Placeholders
|
||||
============
|
||||
|
||||
You can use the following generic placeholders in your event hooks:
|
||||
You can use the following generic placeholders in your events:
|
||||
|
||||
* ``{__currentZ}``: the current Z position of the head if known, -1 if not available
|
||||
* ``{__filename}`` : name of currently selected file, or ``NO FILE`` if no file is selected
|
||||
* ``{__filepath}`` : path in origin location of currently selected file, or ``NO FILE`` if no file is selected
|
||||
* ``{__fileorigin}`` : origin of currently selected file, or ``NO FILE`` if no file is selected
|
||||
* ``{__filename}``: filename of the currently selected file, "NO FILE" if not available
|
||||
* ``{__progress}``: the progress of the print in percent, 0 if not available
|
||||
* ``{__data}``: a string representation of the payload
|
||||
* ``{__now}``: the date and time of the event in ISO 8601
|
||||
@@ -72,12 +67,10 @@ You can use the following generic placeholders in your event hooks:
|
||||
Additionally, all data from the payload can be accessed by its key. Example: If the payload happens to be defined
|
||||
something like this:
|
||||
|
||||
* ``name``: the file's name
|
||||
* ``path``: the file's path in its origin storage location
|
||||
* ``origin``: the origin storage location of the file, either ``local`` or ``sdcard``
|
||||
* ``file``: the file's name
|
||||
* ``origin``: the origin of the file, either ``local`` or ``sdcard``
|
||||
|
||||
then you'll be able to access the file's name via the placeholder ``{name}``, its path via the placeholder ``{path}``
|
||||
and its origin via the placeholder ``{origin}``.
|
||||
then you'll be able to access the filename via the placeholder ``{file}`` and the origin via the placeholder ``{origin}``.
|
||||
|
||||
|
||||
.. _sec-events-available_events:
|
||||
@@ -89,10 +82,7 @@ Server
|
||||
------
|
||||
|
||||
Startup
|
||||
The server has started.
|
||||
|
||||
Shutdown
|
||||
The server is shutting down.
|
||||
The server has started
|
||||
|
||||
ClientOpened
|
||||
A client has connected to the web server.
|
||||
@@ -106,16 +96,9 @@ ClientOpened
|
||||
ClientClosed
|
||||
A client has disconnected from the webserver
|
||||
|
||||
Payload:
|
||||
|
||||
* ``remoteAddress``: the remote address (IP) of the client that disconnected
|
||||
|
||||
Printer communication
|
||||
---------------------
|
||||
|
||||
Connecting
|
||||
The server is attempting to connect to the printer.
|
||||
|
||||
Connected
|
||||
The server has connected to the printer.
|
||||
|
||||
@@ -124,11 +107,6 @@ Connected
|
||||
* ``port``: the connected serial port
|
||||
* ``baudrate``: the baud rate
|
||||
|
||||
Disconnecting
|
||||
The server is going to disconnect from the printer. Note that this
|
||||
event might not always be sent when the server and printer get disconnected
|
||||
from each other. Do not depend on this for critical life cycle management.
|
||||
|
||||
Disconnected
|
||||
The server has disconnected from the printer
|
||||
|
||||
@@ -139,153 +117,58 @@ Error
|
||||
|
||||
* ``error``: the error string
|
||||
|
||||
PrinterStateChanged
|
||||
The state of the printer changed.
|
||||
|
||||
Payload:
|
||||
|
||||
* ``state_id``: Id of the new state. See
|
||||
:func:`~octoprint.printer.PrinterInterface.get_state_id` for possible values.
|
||||
* ``state_string``: Text representation of the new state.
|
||||
|
||||
File handling
|
||||
-------------
|
||||
|
||||
Upload
|
||||
A file has been uploaded through the web interface.
|
||||
A file has been uploaded.
|
||||
|
||||
Payload:
|
||||
* ``name``: the file's name
|
||||
* ``path``: the file's path within its storage location
|
||||
* ``target``: the target storage location to which the file was uploaded, either ``local`` or ``sdcard``
|
||||
|
||||
.. deprecated:: 1.3.0
|
||||
|
||||
* ``file``: the file's path within its storage location
|
||||
|
||||
Still available for reasons of backwards compatibility. Will be removed with 1.4.0.
|
||||
|
||||
FileAdded
|
||||
A file has been added to a storage.
|
||||
|
||||
Payload:
|
||||
* ``storage``: the storage's identifier
|
||||
* ``path``: the file's path within its storage location
|
||||
* ``name``: the file's name
|
||||
* ``type``: the file's type, a list of the path within the type hierarchy, e.g. ``["machinecode", "gcode"]`` or
|
||||
``["model", "stl"]``
|
||||
|
||||
.. note::
|
||||
|
||||
A copied file triggers this for its new path. A moved file first triggers ``FileRemoved`` for its original
|
||||
path and then ``FileAdded`` for the new one.
|
||||
|
||||
FileRemoved
|
||||
A file has been removed from a storage.
|
||||
|
||||
Payload:
|
||||
* ``storage``: the storage's identifier
|
||||
* ``path``: the file's path within its storage location
|
||||
* ``name``: the file's name
|
||||
* ``type``: the file's type, a list of the path within the type hierarchy, e.g. ``["machinecode", "gcode"]`` or
|
||||
``["model", "stl"]``
|
||||
|
||||
.. note::
|
||||
|
||||
A moved file first triggers ``FileRemoved`` for its original path and then ``FileAdded`` for the new one.
|
||||
|
||||
FolderAdded
|
||||
A folder has been added to a storage.
|
||||
|
||||
Payload:
|
||||
* ``storage``: the storage's identifier
|
||||
* ``path``: the folders's path within its storage location
|
||||
* ``name``: the folders's name
|
||||
|
||||
.. note::
|
||||
|
||||
A copied folder triggers this for its new path. A moved folder first triggers ``FolderRemoved`` for its original
|
||||
path and then ``FolderAdded`` for the new one.
|
||||
|
||||
FolderRemoved
|
||||
A folder has been removed from a storage.
|
||||
|
||||
Payload:
|
||||
* ``storage``: the storage's identifier
|
||||
* ``path``: the folders's path within its storage location
|
||||
* ``name``: the folders's name
|
||||
|
||||
.. note::
|
||||
|
||||
A moved folder first triggers ``FolderRemoved`` for its original path and then ``FolderAdded`` for the new one.
|
||||
* ``file``: the file's name
|
||||
* ``target``: the target to which the file was uploaded, either ``local`` or ``sdcard``
|
||||
|
||||
UpdatedFiles
|
||||
A file list was modified.
|
||||
|
||||
Payload:
|
||||
|
||||
* ``type``: the type of file list that was modified. Only ``printables`` is supported here. See the deprecation
|
||||
note below.
|
||||
* ``type``: the type of file list that was modified. Currently only ``printables`` and ``gcode`` (DEPRECATED) are supported here.
|
||||
|
||||
.. deprecated:: 1.2.0
|
||||
|
||||
The ``gcode`` modification type has been superceeded by ``printables``. It is currently still available for
|
||||
reasons of backwards compatibility and will also be sent on modification of ``printables``. It will however
|
||||
be removed with 1.4.0.
|
||||
.. note::
|
||||
|
||||
The type ``gcode`` has been renamed to ``printables`` with the introduction of a new file management layer that
|
||||
supports STL files as first class citizens as well. For reasons of backwards compatibility the ``UpdatedFiles``
|
||||
event for printable files will be fired twice, once with ``type`` set to ``gcode``, once set to ``printables``.
|
||||
Support for the ``gcode`` type will be removed in the next release after version 1.2.0.
|
||||
|
||||
MetadataAnalysisStarted
|
||||
The metadata analysis of a file has started.
|
||||
The metadata analysis of a GCODE file has started.
|
||||
|
||||
Payload:
|
||||
|
||||
* ``name``: the file's name
|
||||
* ``path``: the file's path within its storage location
|
||||
* ``origin``: the file's origin storage location
|
||||
* ``file``: the file's name
|
||||
|
||||
.. deprecated:: 1.3.0
|
||||
|
||||
* ``file``: the file's path within its storage location
|
||||
|
||||
Still available for reasons of backwards compatibility. Will be removed with 1.4.0.
|
||||
|
||||
MetadataAnalysisFinished
|
||||
The metadata analysis of a file has finished.
|
||||
MetadataAnalaysisFinished
|
||||
The metadata analysis of a GCODE file has finished.
|
||||
|
||||
Payload:
|
||||
|
||||
* ``name``: the file's name
|
||||
* ``path``: the file's path within its storage location
|
||||
* ``origin``: the file's origin storage location
|
||||
* ``file``: the file's name
|
||||
* ``result``: the analysis result -- this is a python object currently only available for internal use
|
||||
|
||||
.. deprecated:: 1.3.0
|
||||
|
||||
* ``file``: the file's path within its storage location
|
||||
|
||||
Still available for reasons of backwards compatibility. Will be removed with 1.4.0.
|
||||
|
||||
FileSelected
|
||||
A file has been selected for printing.
|
||||
A GCODE file has been selected for printing.
|
||||
|
||||
Payload:
|
||||
|
||||
* ``name``: the file's name
|
||||
* ``path``: the file's path within its storage location
|
||||
* ``origin``: the origin storage location of the file, either ``local`` or ``sdcard``
|
||||
|
||||
.. deprecated:: 1.3.0
|
||||
|
||||
* ``file``: the file's full path on disk (``local``) or within its storage (``sdcard``)
|
||||
* ``filename``: the file's name
|
||||
|
||||
Still available for reasons of backwards compatibility. Will be removed with 1.4.0.
|
||||
* ``file``: the file's name
|
||||
* ``origin``: the origin of the file, either ``local`` or ``sdcard``
|
||||
|
||||
FileDeselected
|
||||
No file is selected any more for printing.
|
||||
|
||||
TransferStarted
|
||||
A file transfer to the printer's SD has started.
|
||||
A GCODE file transfer to SD has started.
|
||||
|
||||
Payload:
|
||||
|
||||
@@ -295,7 +178,7 @@ TransferStarted
|
||||
**Note:** Name changed in version 1.1.0
|
||||
|
||||
TransferDone
|
||||
A file transfer to the printer's SD has finished.
|
||||
A GCODE file transfer to SD has finished.
|
||||
|
||||
Payload:
|
||||
|
||||
@@ -311,195 +194,102 @@ PrintStarted
|
||||
|
||||
Payload:
|
||||
|
||||
* ``name``: the file's name
|
||||
* ``path``: the file's path within its storage location
|
||||
* ``origin``: the origin storage location of the file, either ``local`` or ``sdcard``
|
||||
|
||||
.. deprecated:: 1.3.0
|
||||
|
||||
* ``file``: the file's full path on disk (``local``) or within its storage (``sdcard``)
|
||||
* ``filename``: the file's name
|
||||
|
||||
Still available for reasons of backwards compatibility. Will be removed with 1.4.0.
|
||||
* ``file``: the file's name
|
||||
* ``origin``: the origin of the file, either ``local`` or ``sdcard``
|
||||
|
||||
PrintFailed
|
||||
A print failed.
|
||||
|
||||
Payload:
|
||||
|
||||
* ``name``: the file's name
|
||||
* ``path``: the file's path within its storage location
|
||||
* ``origin``: the origin storage location of the file, either ``local`` or ``sdcard``
|
||||
|
||||
.. deprecated:: 1.3.0
|
||||
|
||||
* ``file``: the file's full path on disk (``local``) or within its storage (``sdcard``)
|
||||
* ``filename``: the file's name
|
||||
|
||||
Still available for reasons of backwards compatibility. Will be removed with 1.4.0.
|
||||
* ``file``: the file's name
|
||||
* ``origin``: the origin of the file, either ``local`` or ``sdcard``
|
||||
|
||||
PrintDone
|
||||
A print completed successfully.
|
||||
|
||||
Payload:
|
||||
|
||||
* ``name``: the file's name
|
||||
* ``path``: the file's path within its storage location
|
||||
* ``origin``: the origin storage location of the file, either ``local`` or ``sdcard``
|
||||
* ``file``: the file's name
|
||||
* ``origin``: the origin of the file, either ``local`` or ``sdcard``
|
||||
* ``time``: the time needed for the print, in seconds (float)
|
||||
|
||||
.. deprecated:: 1.3.0
|
||||
|
||||
* ``file``: the file's full path on disk (``local``) or within its storage (``sdcard``)
|
||||
* ``filename``: the file's name
|
||||
|
||||
Still available for reasons of backwards compatibility. Will be removed with 1.4.0.
|
||||
|
||||
PrintCancelled
|
||||
The print has been cancelled via the cancel button.
|
||||
|
||||
Payload:
|
||||
|
||||
* ``name``: the file's name
|
||||
* ``path``: the file's path within its storage location
|
||||
* ``origin``: the origin storage location of the file, either ``local`` or ``sdcard``
|
||||
* ``position``: the print head position at the time of cancelling, if available
|
||||
* ``position.x``: x coordinate, as reported back from the firmware through `M114`
|
||||
* ``position.y``: y coordinate, as reported back from the firmware through `M114`
|
||||
* ``position.z``: z coordinate, as reported back from the firmware through `M114`
|
||||
* ``position.e``: e coordinate (of currently selected extruder), as reported back from the firmware through `M114`
|
||||
* ``position.t``: last tool selected *through OctoPrint* (note that if you did change the printer's selected
|
||||
tool outside of OctoPrint, e.g. through the printer controller, or if you are printing from SD, this will NOT
|
||||
be accurate)
|
||||
* ``position.f``: last feedrate for move commands **sent through OctoPrint** (note that if you modified the
|
||||
feedrate outside of OctoPrint, e.g. through the printer controller, or if you are printing from SD, this will
|
||||
NOT be accurate)
|
||||
|
||||
.. deprecated:: 1.3.0
|
||||
|
||||
* ``file``: the file's full path on disk (``local``) or within its storage (``sdcard``)
|
||||
* ``filename``: the file's name
|
||||
|
||||
Still available for reasons of backwards compatibility. Will be removed with 1.4.0.
|
||||
* ``file``: the file's name
|
||||
* ``origin``: the origin of the file, either ``local`` or ``sdcard``
|
||||
|
||||
PrintPaused
|
||||
The print has been paused.
|
||||
|
||||
Payload:
|
||||
|
||||
* ``name``: the file's name
|
||||
* ``path``: the file's path within its storage location
|
||||
* ``origin``: the origin storage location of the file, either ``local`` or ``sdcard``
|
||||
* ``position``: the print head position at the time of pausing, if available
|
||||
* ``position.x``: x coordinate, as reported back from the firmware through `M114`
|
||||
* ``position.y``: y coordinate, as reported back from the firmware through `M114`
|
||||
* ``position.z``: z coordinate, as reported back from the firmware through `M114`
|
||||
* ``position.e``: e coordinate (of currently selected extruder), as reported back from the firmware through `M114`
|
||||
* ``position.t``: last tool selected *through OctoPrint* (note that if you did change the printer's selected
|
||||
tool outside of OctoPrint, e.g. through the printer controller, or if you are printing from SD, this will NOT
|
||||
be accurate)
|
||||
* ``position.f``: last feedrate for move commands **sent through OctoPrint** (note that if you modified the
|
||||
feedrate outside of OctoPrint, e.g. through the printer controller, or if you are printing from SD, this will
|
||||
NOT be accurate)
|
||||
|
||||
.. deprecated:: 1.3.0
|
||||
|
||||
* ``file``: the file's full path on disk (``local``) or within its storage (``sdcard``)
|
||||
* ``filename``: the file's name
|
||||
|
||||
Still available for reasons of backwards compatibility. Will be removed with 1.4.0.
|
||||
* ``file``: the file's name
|
||||
* ``origin``: the origin of the file, either ``local`` or ``sdcard``
|
||||
|
||||
PrintResumed
|
||||
The print has been resumed.
|
||||
|
||||
Payload:
|
||||
|
||||
* ``name``: the file's name
|
||||
* ``path``: the file's path within its storage location
|
||||
* ``origin``: the origin storage location of the file, either ``local`` or ``sdcard``
|
||||
|
||||
.. deprecated:: 1.3.0
|
||||
|
||||
* ``file``: the file's full path on disk (``local``) or within its storage (``sdcard``)
|
||||
* ``filename``: the file's name
|
||||
|
||||
Still available for reasons of backwards compatibility. Will be removed with 1.4.0.
|
||||
* ``file``: the file's name
|
||||
* ``origin``: the origin of the file, either ``local`` or ``sdcard``
|
||||
|
||||
GCODE processing
|
||||
----------------
|
||||
|
||||
PowerOn
|
||||
An ``M80`` was sent to the printer through OctoPrint (not triggered when printing from SD!)
|
||||
The GCode has turned on the printer power via M80
|
||||
|
||||
PowerOff
|
||||
An ``M81`` was sent to the printer through OctoPrint (not triggered when printing from SD!)
|
||||
The GCODE has turned on the printer power via M81
|
||||
|
||||
Home
|
||||
A ``G28`` was sent to the printer through OctoPrint (not triggered when printing from SD!)
|
||||
The head has gone home via G28
|
||||
|
||||
ZChange
|
||||
The printer's Z-Height has changed (new layer) through a ``G0`` or ``G1`` that was sent to the printer through OctoPrint
|
||||
(not triggered when printing from SD!)
|
||||
The printer's Z-Height has changed (new layer)
|
||||
|
||||
Dwell
|
||||
A ``G4`` was sent to the printer through OctoPrint (not triggered when printing from SD!)
|
||||
Paused
|
||||
The print has been paused
|
||||
|
||||
Waiting
|
||||
One of the following commands was sent to the printer through OctoPrint (not triggered when printing from SD!):
|
||||
``M0``, ``M1``, ``M226``
|
||||
The print is paused due to a gcode wait command
|
||||
|
||||
Cooling
|
||||
An ``M245`` was sent to the printer through OctoPrint (not triggered when printing from SD!)
|
||||
The GCODE has enabled the platform cooler via M245
|
||||
|
||||
Alert
|
||||
An ``M300`` was sent to the printer through OctoPrint (not triggered when printing from SD!)
|
||||
The GCODE has issued a user alert (beep) via M300
|
||||
|
||||
Conveyor
|
||||
An ``M240`` was sent to the printer through OctoPrint (not triggered when printing from SD!)
|
||||
The GCODE has enabled the conveyor belt via M240
|
||||
|
||||
Eject
|
||||
An ``M40`` was sent to the printer through OctoPrint (not triggered when printing from SD!)
|
||||
The GCODE has enabled the part ejector via M40
|
||||
|
||||
EStop
|
||||
An ``M112`` was sent to the printer through OctoPrint (not triggered when printing from SD!)
|
||||
|
||||
PositionUpdate
|
||||
The response to an ``M114`` was received by OctoPrint. The payload contains the current position information
|
||||
parsed from the response and (in the case of the selected tool ``t`` and the current feedrate ``f``) tracked
|
||||
by OctoPrint.
|
||||
|
||||
Payload:
|
||||
|
||||
* ``x``: x coordinate, parsed from response
|
||||
* ``y``: y coordinate, parsed from response
|
||||
* ``z``: z coordinate, parsed from response
|
||||
* ``e``: e coordinate, parsed from response
|
||||
* ``t``: last tool selected *through OctoPrint*
|
||||
* ``f``: last feedrate for move commands ``G0``, ``G1`` or ``G28`` sent *through OctoPrint*
|
||||
The GCODE has issued a panic stop via M112
|
||||
|
||||
Timelapses
|
||||
----------
|
||||
|
||||
CaptureStart
|
||||
A timelapse frame has started to be captured.
|
||||
A timelapse image has started to be captured.
|
||||
|
||||
Payload:
|
||||
|
||||
* ``file``: the name of the image file to be saved
|
||||
|
||||
CaptureDone
|
||||
A timelapse frame has completed being captured.
|
||||
A timelapse image has completed being captured.
|
||||
|
||||
Payload:
|
||||
* ``file``: the name of the image file that was saved
|
||||
|
||||
CaptureFailed
|
||||
A timelapse frame could not be captured.
|
||||
|
||||
Payload:
|
||||
* ``file``: the name of the image file that should have been saved
|
||||
* ``error``: the error that was caught
|
||||
|
||||
MovieRendering
|
||||
The timelapse movie has started rendering.
|
||||
|
||||
@@ -527,9 +317,6 @@ MovieFailed
|
||||
* ``movie``: the movie file that would have been created (full path)
|
||||
* ``movie_basename``: the movie file that would have been created (only the file name without the path)
|
||||
* ``returncode``: the return code of ``ffmpeg`` that indicates the error that occurred
|
||||
* ``reason``: additional machine processable reason string - can be ``returncode`` if ffmpeg
|
||||
returned a non-0 return code, ``no_frames`` if no frames were captured that could be rendered
|
||||
to a timelapse, or ``unknown`` for any other reason of failure to render.
|
||||
|
||||
Slicing
|
||||
-------
|
||||
@@ -540,9 +327,7 @@ SlicingStarted
|
||||
Payload:
|
||||
|
||||
* ``stl``: the STL's filename
|
||||
* ``stl_location``: the STL's location
|
||||
* ``gcode``: the sliced GCODE's filename
|
||||
* ``gcode_location``: the sliced GCODE's location
|
||||
* ``progressAvailable``: true if progress information via the ``slicingProgress`` push update will be available, false if not
|
||||
|
||||
SlicingDone
|
||||
@@ -551,9 +336,7 @@ SlicingDone
|
||||
Payload:
|
||||
|
||||
* ``stl``: the STL's filename
|
||||
* ``stl_location``: the STL's location
|
||||
* ``gcode``: the sliced GCODE's filename
|
||||
* ``gcode_location``: the sliced GCODE's location
|
||||
* ``time``: the time needed for slicing, in seconds (float)
|
||||
|
||||
SlicingCancelled
|
||||
@@ -563,9 +346,7 @@ SlicingCancelled
|
||||
Payload:
|
||||
|
||||
* ``stl``: the STL's filename
|
||||
* ``stl_location``: the STL's location
|
||||
* ``gcode``: the sliced GCODE's filename
|
||||
* ``gcode_location``: the sliced GCODE's location
|
||||
|
||||
SlicingFailed
|
||||
The slicing of a file has failed.
|
||||
@@ -573,35 +354,9 @@ SlicingFailed
|
||||
Payload:
|
||||
|
||||
* ``stl``: the STL's filename
|
||||
* ``stl_location``: the STL's location
|
||||
* ``gcode``: the sliced GCODE's filename
|
||||
* ``gcode_location``: the sliced GCODE's location
|
||||
* ``reason``: the reason for the slicing having failed
|
||||
|
||||
SlicingProfileAdded
|
||||
A new slicing profile was added.
|
||||
|
||||
Payload:
|
||||
|
||||
* ``slicer``: the slicer for which the profile was added
|
||||
* ``profile``: the profile that was added
|
||||
|
||||
SlicingProfileModified
|
||||
A new slicing profile was modified.
|
||||
|
||||
Payload:
|
||||
|
||||
* ``slicer``: the slicer for which the profile was modified
|
||||
* ``profile``: the profile that was modified
|
||||
|
||||
SlicingProfileDeleted
|
||||
A slicing profile was deleted.
|
||||
|
||||
Payload:
|
||||
|
||||
* ``slicer``: the slicer for which the profile was deleted
|
||||
* ``profile``: the profile that was deleted
|
||||
|
||||
Settings
|
||||
--------
|
||||
|
||||
|
||||
@@ -1,69 +0,0 @@
|
||||
.. _sec-features-access_control:
|
||||
|
||||
Access Control
|
||||
==============
|
||||
|
||||
When Access Control is enabled, anonymous users (not logged in) will only see
|
||||
the read-only parts of the UI which are the following:
|
||||
|
||||
* printer state
|
||||
* available gcode files and stats (upload is disabled)
|
||||
* temperature
|
||||
* webcam
|
||||
* gcode viewer
|
||||
* terminal output (sending commands is disabled)
|
||||
* available timelapse movies
|
||||
* any components provided through plugins which are enabled for anonymous
|
||||
users
|
||||
|
||||
Logged in users will get access to everything besides the Settings and System
|
||||
Commands, which are admin-only.
|
||||
|
||||
If Access Control is disabled, everything is directly accessible. **That also
|
||||
includes all administrative functionality as well as full control over the
|
||||
printer!**
|
||||
|
||||
Upon first start a configuration wizard is provided which allows configuration
|
||||
of the first administrator account or alternatively disabling Access Control
|
||||
(which is **NOT** recommended for systems that are directly accessible via the
|
||||
Internet!).
|
||||
|
||||
.. hint::
|
||||
|
||||
If you plan to have your OctoPrint instance accessible over the internet,
|
||||
**always enable Access Control**.
|
||||
|
||||
.. _sec-features-access_control-rerunning_wizard:
|
||||
|
||||
Rerunning the wizard
|
||||
--------------------
|
||||
|
||||
In case Access Control was disabled in the configuration wizard, it is
|
||||
possibly to re-run it by editing ``config.yaml`` [#f1]_ and setting ``firstRun``
|
||||
in the ``server`` section and ``enabled`` in the ``accessControl`` section to
|
||||
``true``:
|
||||
|
||||
.. code-block-ext:: yaml
|
||||
|
||||
accessControl:
|
||||
enabled: true
|
||||
# ...
|
||||
server:
|
||||
firstRun: true
|
||||
|
||||
Then restart the server and connect to the web interface - the wizard should
|
||||
be shown again.
|
||||
|
||||
.. note::
|
||||
|
||||
If user accounts were created prior to disabling Access Control and those
|
||||
user accounts are not to be used any more, remove ``.octoprint/users.yaml``.
|
||||
If you don't remove this file, the above changes won't lead to the
|
||||
configuration being shown again, instead Access Control will just be
|
||||
enabled using the already existing login data. This is to prevent you from
|
||||
resetting access control by accident.
|
||||
|
||||
.. rubric:: Footnotes
|
||||
|
||||
.. [#f1] For Linux that will be ``~/.octoprint/config.yaml``, for Windows it will be ``%APPDATA%/OctoPrint/config.yaml`` and for
|
||||
Mac ``~/Library/Application Support/OctoPrint/config.yaml``
|
||||
@@ -1,36 +0,0 @@
|
||||
.. _sec-features-action_commands:
|
||||
|
||||
Action Commands
|
||||
===============
|
||||
|
||||
Action commands are a feature defined for the GCODE based RepRap communication protocol. To quote from the
|
||||
`GCODE node of the RepRap wiki <http://reprap.org/wiki/Gcode#Replies_from_the_RepRap_machine_to_the_host_computer>`_:
|
||||
|
||||
The RepRap machine may also send lines that look like this:
|
||||
|
||||
**// This is some debugging or other information on a line on its own. It may be sent at any time.**
|
||||
|
||||
Such lines will always be preceded by //.
|
||||
|
||||
On the latest version of Pronterface and [...] OctoPrint a special comment of the form:
|
||||
|
||||
**// action:command**
|
||||
|
||||
is allowed to be sent from the firmware[. T]he command can currently be pause, resume or disconnect which will
|
||||
execute those commands on the host. As this is also a comment other hosts will just ignored these commands.
|
||||
|
||||
OctoPrint out of the box supports handling of the above mentioned commands:
|
||||
|
||||
pause
|
||||
When this command is received from the printer, OctoPrint will pause streaming of a current print job just like if the
|
||||
"Pause" button had been clicked.
|
||||
|
||||
resume
|
||||
When this command is received from the printer, OctoPrint will resume streaming of a current print job just like if
|
||||
the "Resume" button had been clicked.
|
||||
|
||||
disconnect
|
||||
When this command is Received from the printer, OctoPrint will immediately disconnect from it.
|
||||
|
||||
Support for additional commands may be added by plugins by implementing a handler for the
|
||||
:ref:`octoprint.comm.protocol.action <sec-plugins-hook-comm-protocol-action>` hook.
|
||||
@@ -1,293 +0,0 @@
|
||||
.. _sec-features-custom_controls:
|
||||
|
||||
Custom Controls
|
||||
===============
|
||||
|
||||
.. contents::
|
||||
|
||||
OctoPrint allows you to add custom controls to the "Control" tab of its interface. Control types reach from simple
|
||||
buttons which trigger sending of one or more lines of GCODE to the printer over more complex controls allowing
|
||||
parameterization of these commands with values entered by the user to full blown GCODE script templates backed by
|
||||
`Jinja2 <http://jinja.pocoo.org/>`_.
|
||||
|
||||
Custom controls are configured within :ref:`config.yaml <sec-configuration-config_yaml>` [#f1]_ in a ``controls`` section which
|
||||
basically represents a hierarchical structure of all configured custom controls of various types.
|
||||
|
||||
.. note::
|
||||
|
||||
To make sure that your ``config.yaml`` stays valid when adding custom controls, don't hesitate to take a look at the
|
||||
:ref:`YAML Primer <sec-configuration-yaml>`.
|
||||
|
||||
The following example defines a control for enabling the cooling fan with a variable speed defined by the user
|
||||
(default 255 and selectable through a slider UI element) and a control for disabling the fan, all within a section named
|
||||
"Fan", two example controls with multiple commands in a section "Example for multiple commands", a command with printer
|
||||
feedback evaluation for the result of the M114 "Get Position" gcode inside a section named "Reporting" and finally
|
||||
a GCODE script including user input.
|
||||
|
||||
.. code-block-ext:: yaml
|
||||
|
||||
controls:
|
||||
- name: Fan
|
||||
layout: horizontal
|
||||
children:
|
||||
- name: Enable Fan
|
||||
command: M106 S%(speed)s
|
||||
input:
|
||||
- name: Speed (0-255)
|
||||
parameter: speed
|
||||
default: 255
|
||||
slider:
|
||||
min: 0
|
||||
max: 255
|
||||
- name: Disable Fan
|
||||
command: M107
|
||||
- name: Example for multiple commands
|
||||
children:
|
||||
- name: Move X (static)
|
||||
confirm: You are about to move the X axis right by 10mm with 3000mm/s.
|
||||
commands:
|
||||
- G91
|
||||
- G1 X10 F3000
|
||||
- G90
|
||||
- name: Move X (parametric)
|
||||
commands:
|
||||
- G91
|
||||
- G1 X%(distance)s F%(speed)s
|
||||
- G90
|
||||
input:
|
||||
- default: 10
|
||||
name: Distance
|
||||
parameter: distance
|
||||
- default: 3000
|
||||
name: Speed
|
||||
parameter: speed
|
||||
- name: Reporting
|
||||
children:
|
||||
- name: Get Position
|
||||
command: M114
|
||||
regex: "X:([-+]?[0-9.]+) Y:([-+]?[0-9.]+) Z:([-+]?[0-9.]+) E:([-+]?[0-9.]+)"
|
||||
template: "Position: X={0}, Y={1}, Z={2}, E={3}"
|
||||
- name: Fun stuff
|
||||
children:
|
||||
- name: Dance
|
||||
script: custom/dance.gco
|
||||
input:
|
||||
- name: Go arounds
|
||||
parameter: repetitions
|
||||
slider:
|
||||
max: 10
|
||||
min: 1
|
||||
step: 1
|
||||
|
||||
Adding this to ``config.yaml``, restarting the OctoPrint server and switching to the "Control" tab within its
|
||||
interface yields the visual representation in :numref:`fig-configuration-customcontrols-example`.
|
||||
|
||||
.. _fig-configuration-customcontrols-example:
|
||||
.. figure:: ../images/features-custom_controls-example.png
|
||||
:align: center
|
||||
:alt: The rendered output created through the example configuration
|
||||
|
||||
The rendered output created through the example configuration
|
||||
|
||||
As you can see you have two basic types of control definitions here: controls that actually do something (providing a
|
||||
button that sends one or more commands to the printer when clicked, displaying output received from the printer) and
|
||||
controls that just serve as *container* for other controls, the latter being identified by having a ``children``
|
||||
attribute wrapping more controls.
|
||||
|
||||
.. hint::
|
||||
|
||||
Take a look at the `Custom Control Editor plugin <http://plugins.octoprint.org/plugins/customControl/>`_
|
||||
which allows you configuring your Custom Controls through OctoPrint's
|
||||
settings interface without the need to manually edit the configuration
|
||||
file.
|
||||
|
||||
.. _sec-features-custom_controls-types:
|
||||
|
||||
Types
|
||||
-----
|
||||
|
||||
Let's take a closer look at the possible attributes that are available for both basic types.
|
||||
|
||||
.. _sec-features-custom_controls-types-containers:
|
||||
|
||||
Containers
|
||||
..........
|
||||
|
||||
.. list-table::
|
||||
:widths: 25 75
|
||||
|
||||
* - **Attribute**
|
||||
- **Description**
|
||||
* - ``children``
|
||||
- A list of children controls or containers contained within this container
|
||||
* - ``name``
|
||||
- (Optional) A name to display above the container, basically a section header
|
||||
* - ``layout``
|
||||
- (Optional) The layout to use for laying out the contained children, either from top to bottom (``vertical``) or
|
||||
from left to right (``horizontal``). Defaults to a ``vertical`` layout.
|
||||
|
||||
.. _sec-features-custom_controls-types-controls:
|
||||
|
||||
Controls
|
||||
........
|
||||
|
||||
.. list-table::
|
||||
:widths: 25 75
|
||||
|
||||
* - **Attribute**
|
||||
- **Description**
|
||||
* - ``name``
|
||||
- The name of the control, will be displayed either on the button if it's a control sending a command or as a label
|
||||
for controls which only display output.
|
||||
* - ``command``
|
||||
- (Optional) A single GCODE command to send to the printer. Will be rendered as a button which sends the command to
|
||||
the printer upon click. The button text will be the value of the ``name`` attribute. Mutually exclusive with
|
||||
``commands`` and ``script``. The rendered button be disabled if the printer is currently offline or printing or
|
||||
alternatively if the requirements defined via the ``enabled`` attribute are not met.
|
||||
* - ``commands``
|
||||
- (Optional) A list of GCODE commands to send to the printer. Will be rendered as a button which sends the commands
|
||||
to the printer upon click. The button text will be the value of the ``name`` attribute. Mutually exclusive with
|
||||
``command`` and ``script``. The rendered button will be disabled if the printer is currently offline or printing
|
||||
or alternatively if the requirements defined via the ``enabled`` attribute are not met.
|
||||
* - ``script``
|
||||
- (Optional) The name of a full blown :ref:`GCODE script <sec-features-gcode_scripts>` to send to the printer.
|
||||
Will be rendered as a button which sends the script to the printer upon click. The button text will be the value
|
||||
of the ``name`` attribute. Mutually exclusive with ``command`` and ``commands``. The rendered button will be
|
||||
disabled if the printer is currently offline or printing or alternatively if the requirements defined via the
|
||||
``enabled`` attribute are not met.
|
||||
|
||||
Values of input parameters will be available in the template context under the ``parameter`` variable (e.g.
|
||||
an input parameter ``speed`` will be available in the script template as ``parameter.speed``). On top of that all
|
||||
other variables defined in the :ref:`GCODE template context <sec-features-gcode_scripts-context>` will be available.
|
||||
|
||||
:ref:`See below for an example <sec-features-custom_controls-examples-gcode_script>`.
|
||||
* - ``javascript``
|
||||
- (Optional) A JavaScript snippet to be executed when the button rendered for ``command`` or ``commands`` is
|
||||
clicked. This allows to override the direct sending of the command or commands to the printer with more
|
||||
sophisticated behaviour. The JavaScript snippet is ``eval``'d and processed in a context where the control
|
||||
it is part of is provided as local variable ``data`` and the ``ControlViewModel`` is available as ``self``.
|
||||
* - ``enabled``
|
||||
- (Optional) A JavaScript snippet returning either ``true`` or ``false`` determining whether the control
|
||||
should be enabled or not. This allow to override the default logic for this (disabled if printer is offline
|
||||
or currently printing). The JavaScript snippet is ``eval``'d and processed in a context where the control
|
||||
it is part of is provided as local variable ``data`` and the ``ControlViewModel`` is available as ``self``.
|
||||
* - ``input``
|
||||
- (Optional) A list of definitions of input parameters for a ``command`` or ``commands``, to be rendered as
|
||||
additional input fields. ``command``/``commands`` may contain placeholders to be replaced by the values obtained
|
||||
from the user for the defined input fields:
|
||||
|
||||
.. code-block-ext:: yaml
|
||||
|
||||
name: Enable Fan
|
||||
command: M106 S%(speed)s
|
||||
input:
|
||||
- name: Speed (0-255)
|
||||
parameter: speed
|
||||
default: 255
|
||||
slider:
|
||||
min: 0
|
||||
max: 255
|
||||
|
||||
In OctoPrint's default UI input fields are always rendered left to right (inline).
|
||||
* - ``input.name``
|
||||
- Name to display for the input field.
|
||||
* - ``input.parameter``
|
||||
- Internal parameter name for the input field, used as a placeholder in ``command``/``commands``.
|
||||
* - ``input.default``
|
||||
- Default value for the input field.
|
||||
* - ``input.slider``
|
||||
- (Optional) If this attribute is included, instead of an input field a slider control will
|
||||
be rendered. If you don't want to define any of ``min``, ``max`` or ``step``, write ``slider: {}`` to render
|
||||
a slider based on default values.
|
||||
* - ``input.slider.min``
|
||||
- (Optional) Minimum value of the slider, defaults to 0.
|
||||
* - ``input.slider.max``
|
||||
- (Optional) Maximum value of the slider, defaults to 255.
|
||||
* - ``input.slider.step``
|
||||
- (Optional) Step size per slider "tick", defaults to 1.
|
||||
* - ``regex``
|
||||
- (Optional) A `regular expression <https://docs.python.org/2/library/re.html#regular-expression-syntax>`_ to
|
||||
match against lines received from the printer to retrieve information from it (e.g. specific output). Together
|
||||
with ``template`` this allows rendition of received data from the printer within the UI.
|
||||
* - ``template``
|
||||
- (Optional) A template to use for rendering the match of ``regex``. May contain placeholders in
|
||||
`Python Format String Syntax <https://docs.python.org/2/library/string.html#format-string-syntax>`_ for either named
|
||||
groups within the regex (e.g. ``Temperature: {temperature}`` for a regex ``T:\s*(?P<temperature>\d+(\.\d*)``)
|
||||
or positional groups within the regex (e.g. ``Position: X={0}, Y={1}, Z={2}, E={3}`` for a regex
|
||||
``X:([0-9.]+) Y:([0-9.]+) Z:([0-9.]+) E:([0-9.]+)``).
|
||||
* - ``confirm``
|
||||
- (Optional) A text to display to the user to confirm his button press. Can be used with sensitive custom controls
|
||||
like changing EEPROM values in order to prevent accidental clicks. The text will be displayed in a confirmation
|
||||
dialog like in :numref:`fig-configuration-customcontrols-confirm`.
|
||||
|
||||
.. _fig-configuration-customcontrols-confirm:
|
||||
.. figure:: ../images/features-custom_controls-confirm.png
|
||||
:align: center
|
||||
:alt: An example confirmation dialog
|
||||
|
||||
An example confirmation dialog
|
||||
|
||||
.. _sec-features-custom_controls-examples:
|
||||
|
||||
Examples
|
||||
--------
|
||||
|
||||
.. _sec-features-custom_controls-examples-gcode_script:
|
||||
|
||||
Parameterized GCODE Script
|
||||
..........................
|
||||
|
||||
.. code-block-ext:: yaml
|
||||
:caption: Control definition in ~/.octoprint/config.yaml
|
||||
:name: code-features-custom_controls-example-gcode_script-config_yaml
|
||||
|
||||
name: Dance
|
||||
script: custom/dance.gco
|
||||
input:
|
||||
- default: 5
|
||||
name: Go arounds
|
||||
parameter: repetitions
|
||||
slider:
|
||||
max: 10
|
||||
min: 1
|
||||
step: 1
|
||||
|
||||
.. code-block-ext:: jinja
|
||||
:caption: ~/.octoprint/scripts/gcode/custom/dance.gco
|
||||
:name: code-features-custom_controls-example-gcode_script-dance_gco
|
||||
|
||||
{% set center_x = printer_profile.volume.width / 2 %}
|
||||
{% set center_y = printer_profile.volume.depth / 2 %}
|
||||
{% set speed_x = printer_profile.axes.x.speed %}
|
||||
{% set speed_y = printer_profile.axes.y.speed %}
|
||||
{% set speed_z = printer_profile.axes.z.speed %}
|
||||
M117 run {{ script.name }}
|
||||
G4 P500
|
||||
G1 Z10
|
||||
G1 X{{ center_x }} Y{{ center_y }} F{{ speed_x }}
|
||||
M117 let's dance!
|
||||
G91
|
||||
G1 X-1 Y-1 F{{ speed_x }}
|
||||
{% for n in range(parameters.repetitions) %}
|
||||
M117 and {{ n + 1 }}
|
||||
{% if n % 2 == 0 %}
|
||||
G1 Z1 F{{ speed_z }}
|
||||
G1 Z-2 F{{ speed_z }}
|
||||
G1 Z1 F{{ speed_z }}
|
||||
{% endif %}
|
||||
G1 X2 F{{ speed_x }}
|
||||
G1 Y2 F{{ speed_y }}
|
||||
G1 X-2 F{{ speed_x }}
|
||||
G1 Y-2 F{{ speed_y }}
|
||||
{% endfor %}
|
||||
G90
|
||||
G1 X{{ center_x }} Y{{ center_y }} F{{ speed_x }}
|
||||
G28 X0 Y0
|
||||
|
||||
Note the usage of the ``parameters.repetitions`` template variable in the GCODE script template, which will contain
|
||||
the value selected by the user for the "Go arounds" slider.
|
||||
|
||||
.. rubric:: Footnotes
|
||||
|
||||
.. [#f1] For Linux that will be ``~/.octoprint/config.yaml``, for Windows it will be ``%APPDATA%/OctoPrint/config.yaml`` and for
|
||||
Mac ``~/Library/Application Support/OctoPrint/config.yaml``
|
||||
@@ -1,166 +0,0 @@
|
||||
.. _sec-features-gcode_scripts:
|
||||
|
||||
GCODE Scripts
|
||||
=============
|
||||
|
||||
.. contents::
|
||||
|
||||
OctoPrint allows you to define custom GCODE scripts to be executed on specified occasions, e.g. when a print
|
||||
starts, when OctoPrint connects to a printer, or when a :ref:`button defined as a custom control <sec-features-custom_controls>`
|
||||
is clicked.
|
||||
|
||||
Unless :ref:`configured otherwise <sec-configuration-config_yaml-folder>`, OctoPrint expects scripts to be located in
|
||||
the ``scripts/gcode`` folder in OctoPrint configuration directory (per default ``~/.octoprint`` on Linux, ``%APPDATA%\OctoPrint``
|
||||
on Windows and ``~/Library/Application Support/OctoPrint`` on MacOS).
|
||||
|
||||
These GCODE scripts are backed by the templating engine Jinja2, allowing more than just
|
||||
simple "send-as-is" scripts but making use of a full blown templating language in order to create your scripts. To
|
||||
this end, OctoPrint injects some variables into the :ref:`template rendering context <sec-features-gcode_scripts-context>`
|
||||
as described below.
|
||||
|
||||
You can find the docs on the Jinja templating engine as used in OctoPrint at `jinja.octoprint.org <http://jinja.octoprint.org/templates.html>`_.
|
||||
|
||||
.. note::
|
||||
|
||||
Due to backwards compatibility issues with Jinja versions 2.9+, OctoPrint currently only supports Jinja 2.8. For this
|
||||
reason use the template documentation at `jinja.octoprint.org <http://jinja.octoprint.org/templates.html>`_ instead of the
|
||||
documentation of current stable Jinja versions.
|
||||
|
||||
.. _sec-features-gcode_scripts-predefined:
|
||||
|
||||
Predefined Scripts
|
||||
------------------
|
||||
|
||||
The following GCODE scripts are sent by OctoPrint automatically:
|
||||
|
||||
* ``afterPrinterConnected``: Sent after OctoPrint successfully connected to a printer. Defaults to an empty script.
|
||||
* ``beforePrinterDisconnected``: Sent just before OctoPrint (actively) closes the connection to the printer. Defaults
|
||||
to an empty script. Note that this will *not* be sent for unexpected connection cut offs, e.g. in case of errors
|
||||
on the serial line, only when the user clicks the "Disconnect" button or the printer requests a disconnect via an
|
||||
:ref:`action command <sec-features-action_commands>` .
|
||||
* ``beforePrintStarted``: Sent just before a print job is started. Defaults to an empty script.
|
||||
* ``afterPrintCancelled``: Sent just after a print job was cancelled. Defaults to the
|
||||
:ref:`bundled script listed below <sec-features-gcode_scripts-bundled>`.
|
||||
* ``afterPrintDone``: Sent just after a print job finished. Defaults to an empty script.
|
||||
* ``afterPrintPaused``: Sent just after a print job was paused. Defaults to an empty script.
|
||||
* ``beforePrintResumed``: Sent just before a print job is resumed. Defaults to an empty script.
|
||||
|
||||
.. note::
|
||||
|
||||
Plugins may extend these scripts through :ref:`a hook <sec-plugins-hook-comm-protocol-scripts>`.
|
||||
|
||||
.. _sec-features-gcode_scripts-snippets:
|
||||
|
||||
Snippets
|
||||
--------
|
||||
|
||||
For making small GCODE snippets reusable in a template (e.g. for :ref:`disabling all hotends <sec-features-gcode_scripts-bundled>`)
|
||||
there's an additional Jinja template command ``{% snippet '<snippet name>' %}`` available which allows including
|
||||
snippets stored under ``scripts/gcode/snippets`` in OctoPrint's configuration directory. They fully support
|
||||
the whole spectrum of the Jinja2 templating language (that includes including other snippets).
|
||||
|
||||
.. _sec-features-gcode_scripts-context:
|
||||
|
||||
Context
|
||||
-------
|
||||
|
||||
All GCODE scripts have access to the following template variables through the template context:
|
||||
|
||||
* ``printer_profile``: The currently selected Printer Profile, including
|
||||
information such as the extruder count, the build volume size, the filament diameter etc.
|
||||
* ``last_position``: Last position reported by the printer via `M114` (might be unset if no `M114` was sent so far!)
|
||||
* ``script``: An object wrapping the script's type (``gcode``) and name (e.g. ``afterPrintCancelled``) as ``script.type``
|
||||
and ``script.name`` respectively.
|
||||
|
||||
There are a few additional template variables available for the following specific scripts:
|
||||
|
||||
* ``afterPrintPaused`` and ``beforePrintResumed``
|
||||
|
||||
* ``pause_position``: Position reported by the printer via ``M114`` immediately before the print was paused. Consists
|
||||
of ``x``, ``y``, ``z`` and ``e`` coordinates as received by the printer and tracked values for ``f`` and current tool
|
||||
``t`` taken from commands sent through OctoPrint. All of these coordinates might be ``None`` if no position could be
|
||||
retrieved from the printer or the values could not be tracked (in case of ``f`` and ``t``)!
|
||||
|
||||
* ``afterPrintCancelled``
|
||||
|
||||
* ``cancel_position``: Position reported by the printer via ``M114`` immediately before the print was cancelled.
|
||||
Consists of ``x``, ``y``, ``z`` and ``e`` coordinates as received by the printer and tracked values for ``f`` and
|
||||
current tool ``t`` taken from commands sent through OctoPrint. All of these coordinates might be ``None`` if no
|
||||
position could be retrieved from the printer or the values could not be tracked (in case of ``f`` and ``t``)!
|
||||
|
||||
.. warning::
|
||||
|
||||
Note that current firmware implementations only report back one ``E`` value, the current extrusion value for the current
|
||||
extruder. Retrieving all ``E`` values by cycling through all extruders on pause and cancel is something OctoPrint
|
||||
currently does NOT do since it would simply take too long. That means that if you want to write a ``beforePrintResumed``
|
||||
script that basically resets everything back to the point when the printer was paused *and* you are running with
|
||||
multiple extruders, you'll have to find some other way to have your ``E`` values set correctly for all your available
|
||||
extruders - the data available in ``pause_position`` will *not* suffice. Additionally, most firmwares don't report
|
||||
the currently selected tool in the ``M114`` response, meaning that the only way OctoPrint can keep track of that is
|
||||
by tracking it itself. Same goes for the current feed rate ``F``. So if you are printing from SD, this data will be
|
||||
*wrong*. This is also the reason why OctoPrint currently doesn't bundle a more sophisticated pause and resume script
|
||||
that would actually move the print head out of the way and pause and back to the original position on resume - it
|
||||
might cause issues for the multitude of users out there with multi-extruder setups or for people printing from the
|
||||
printer's SD, thanks to the lack of information the firmware provides.
|
||||
|
||||
The :ref:`predefined GCODE scripts <sec-features-gcode_scripts-predefined>` are also called with the following additional
|
||||
template variables:
|
||||
|
||||
* ``event``: The payload of the ``Connected``, ``PrintStarted``, ``PrintCancelled``, ``PrintDone``, ``PrintPaused`` or
|
||||
``PrintResumed`` event. See :ref:`the documentation of events <sec-events-available_events>` for the contained values.
|
||||
|
||||
GCODE scripts attached to :ref:`custom controls <sec-features-custom_controls>` are called with the following
|
||||
additional template variables:
|
||||
|
||||
* ``parameters``: The parameters as defined for the custom control, if it has any inputs.
|
||||
* ``context``: Additional ``context`` included in the definition of the custom control.
|
||||
|
||||
.. _sec-features-gcode_scripts-bundled:
|
||||
|
||||
Bundled Scripts
|
||||
---------------
|
||||
|
||||
Out of the box, OctoPrint defaults to the following script setup for ``afterPrintCancelled``:
|
||||
|
||||
.. code-block:: jinja
|
||||
:caption: Default ``afterPrintCancelled`` script
|
||||
|
||||
; disable motors
|
||||
M84
|
||||
|
||||
;disable all heaters
|
||||
{% snippet 'disable_hotends' %}
|
||||
[% snippet 'disable_bed' %}
|
||||
|
||||
;disable fan
|
||||
M106 S0
|
||||
|
||||
The ``disable_hotends`` snippet is defined as follows:
|
||||
|
||||
.. code-block:: jinja
|
||||
:caption: Default ``disable_hotends`` snippet
|
||||
|
||||
{% for tool in range(printer_profile.extruder.count) %}
|
||||
M104 T{{ tool }} S0
|
||||
{% endfor %}
|
||||
|
||||
The ``disable_bed`` snippet is defined as follows:
|
||||
|
||||
.. code-block:: jinja
|
||||
:caption: Default ``disable_bed`` snippet
|
||||
|
||||
{% if printer_profile.heatedBed %}
|
||||
M140 S0
|
||||
{% endif %}
|
||||
|
||||
As you can see, the ``disable_hotends`` and ``disable_bed`` snippets utilize the
|
||||
``printer_profile`` context variable in order to iterate through all available
|
||||
extruders and set their temperature to 0, and to also set the bed temperature
|
||||
to 0 if a heated bed is configured.
|
||||
|
||||
.. seealso::
|
||||
|
||||
`Jinja Template Designer Documentation <http://jinja.octoprint.org/templates.html>`_
|
||||
Jinja's Template Designer Documentation describes the syntax and semantics of the template language used
|
||||
also by OctoPrint's GCODE scripts. Linked here are the docs for Jinja 2.8.1, which OctoPrint still
|
||||
relies on for backwards compatibility reasons.
|
||||
@@ -1,19 +0,0 @@
|
||||
.. _section-features:
|
||||
|
||||
********
|
||||
Features
|
||||
********
|
||||
|
||||
.. note::
|
||||
|
||||
This feature list is not exhaustive. This part of OctoPrint's documentation is sadly far from finished still.
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 2
|
||||
|
||||
accesscontrol.rst
|
||||
custom_controls.rst
|
||||
gcode_scripts.rst
|
||||
action_commands.rst
|
||||
plugins.rst
|
||||
safemode.rst
|
||||
@@ -1,80 +0,0 @@
|
||||
.. _sec-features-plugins:
|
||||
|
||||
*******
|
||||
Plugins
|
||||
*******
|
||||
|
||||
Starting with OctoPrint 1.2.0, there's now a plugin system in place which allows to individually
|
||||
extend OctoPrint's functionality.
|
||||
|
||||
Right now plugins can be used to extend OctoPrint's web interface, to execute specific tasks on server startup and
|
||||
shutdown, to provide custom (API) endpoints or whole user interfaces with special functionality, to react to system
|
||||
events or progress reports or to add support for additional slicers. More plugin types are planned for the future.
|
||||
|
||||
.. note::
|
||||
|
||||
Since a plugin might not function properly and cause issues that are hard to diagnose or outright disrupt server
|
||||
functionality, you might want to be able to start OctoPrint without any third party plugins enabled. This is also
|
||||
very important when reporting bugs in OctoPrint, to ensure that what you are observing is actually a bug in
|
||||
OctoPrint and not in any of your installed third party plugins.
|
||||
|
||||
To do that, OctoPrint has a built-in safe mode that disables all plugins not shipped as part of OctoPrint. You can
|
||||
read more on how to enable that :ref:`here <sec-features-safemode>`.
|
||||
|
||||
.. _sec-features-plugins-available:
|
||||
|
||||
Finding Plugins
|
||||
===============
|
||||
|
||||
The official OctoPrint Plugin Repository can be found at `plugins.octoprint.org <http://plugins.octoprint.org>`_.
|
||||
|
||||
Some plugins may also be found in the list provided in `the OctoPrint wiki <https://github.com/foosel/OctoPrint/wiki#plugins>`_
|
||||
and on the `OctoPrint organization Github page <https://github.com/OctoPrint>`_.
|
||||
|
||||
.. _sec-features-plugins-installing:
|
||||
|
||||
Installing Plugins
|
||||
==================
|
||||
|
||||
Plugins can be installed through the bundled Plugin Manager, which allows installing plugins available in the
|
||||
`OctoPrint Plugin Repository <http://plugins.octoprint.org>`_, from a web address or from an uploaded file archive.
|
||||
|
||||
Please refer to the documentation of the plugin for additional installations instructions.
|
||||
|
||||
Manual Installation
|
||||
-------------------
|
||||
|
||||
If you don't want or can't use the Plugin Manager, plugins may also be installed manually either by copying and
|
||||
unpacking them into one of the configured plugin folders (regularly those are ``<octoprint source root>/plugins`` and
|
||||
``<octoprint config folder>/plugins`` [#f1]_ or by installing them as regular python modules via ``pip`` [#f2]_.
|
||||
|
||||
For a plugin available on the Python Package Index (PyPi), the process is as simple as issuing a
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
pip install <plugin_name>
|
||||
|
||||
For plugins not available on PyPi, you'll have to give ``pip`` an URL from which to install the package (e.g. the URL to
|
||||
a ZIP file of the current master branch of a Github repository hosting a plugin, or even a ``git+https`` URL), example:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
pip install https://github.com/OctoPrint/OctoPrint-Growl/archive/master.zip
|
||||
|
||||
See `the pip install documentation <http://pip.readthedocs.org/en/latest/reference/pip_install.html>`_ for what URL
|
||||
types are possible.
|
||||
|
||||
.. _sec-features-plugins-developing:
|
||||
|
||||
Developing Plugins
|
||||
==================
|
||||
|
||||
See :ref:`Developing Plugins <sec-plugins>`.
|
||||
|
||||
.. rubric:: Footnotes
|
||||
|
||||
.. [#f1] For Linux that will be ``~/.octoprint/plugins``, for Windows it will be ``%APPDATA%/OctoPrint/plugins`` and for
|
||||
Mac ``~/Library/Application Support/OctoPrint/plugins``
|
||||
.. [#f2] Make sure to use the exact same Python installation for installing the plugin that you also used for
|
||||
installing & running OctoPrint. For OctoPi this means using ``~/oprint/bin/pip`` for installing plugins
|
||||
instead of just ``pip``.
|
||||
@@ -1,64 +0,0 @@
|
||||
.. _sec-features-safemode:
|
||||
|
||||
*********
|
||||
Safe mode
|
||||
*********
|
||||
|
||||
With the advent of support for plugins in OctoPrint, it quickly became apparent that some of the bugs
|
||||
reported on OctoPrint's bug tracker were actually bugs with installed third party plugins instead of
|
||||
OctoPrint itself.
|
||||
|
||||
To allow an easier identification of these cases, OctoPrint 1.3.0 introduced safe mode. Starting
|
||||
OctoPrint in safe mode disables all plugins that are not bundled with OctoPrint, allowing to easier
|
||||
identify most cases where a third party plugin is the culprit of an observed issue.
|
||||
|
||||
Additionally, OctoPrint allows uninstalling plugins in this mode, allowing recovery from cases where
|
||||
a third party plugin causes the server to not start up or the web interface to not render or function
|
||||
correctly anymore.
|
||||
|
||||
.. _sec-features-safemode-how:
|
||||
|
||||
How to start OctoPrint in safe mode
|
||||
===================================
|
||||
|
||||
There exist three ways to start OctoPrint in safe mode:
|
||||
|
||||
* since OctoPrint 1.3.2: by selecting "Restart OctoPrint in safe mode" from the "System" menu,
|
||||
if the "Restart OctoPrint" server command has been correctly configured (see :numref:`fig-features-safemode-systemmenu`).
|
||||
* by starting OctoPrint with the command line parameter ``--safe``, e.g. ``octoprint serve --safe``
|
||||
* by setting the option ``server.startOnceInSafeMode`` in :ref:`config.yaml <sec-configuration-config_yaml>`
|
||||
to ``true`` and restarting
|
||||
|
||||
The last two options will have OctoPrint enable safe mode only for the next server start - once you
|
||||
restart OctoPrint again, safe mode will be disabled again.
|
||||
|
||||
.. _fig-features-safemode-systemmenu:
|
||||
.. figure:: ../images/features-safemode-systemmenu.png
|
||||
:align: center
|
||||
:alt: "Restart OctoPrint in safe mode" in the "System" menu
|
||||
|
||||
"Restart OctoPrint in safe mode" in the "System" menu
|
||||
|
||||
.. _sec-features-safemode-differences:
|
||||
|
||||
Differences of safe mode vs normal operation mode
|
||||
=================================================
|
||||
|
||||
When OctoPrint is running in safe mode the following changes to its normal operation mode apply:
|
||||
|
||||
* OctoPrint will not enable any of the installed third party plugins. OctoPrint considers all plugins third
|
||||
party plugins that do not ship with OctoPrint's sources, so any plugins installed either via `pip` or
|
||||
into OctoPrint's plugin folder at ``~/.octoprint/plugins`` (Linux), ``%APPDATA%/OctoPrint`` (Windows) and
|
||||
``~/Library/Application Support/OctoPrint`` (MacOS).
|
||||
* OctoPrint will still allow to uninstall third party plugins through the built-in Plugin Manager.
|
||||
* OctoPrint will still allow to disable (bundled) plugins that are still enabled.
|
||||
* OctoPrint will not allow to enable third party plugins.
|
||||
* OctoPrint's web interface will display a notification to remind you that it is running in
|
||||
safe mode.
|
||||
|
||||
.. _fig-features-safemode-notification:
|
||||
.. figure:: ../images/features-safemode-notification.png
|
||||
:align: center
|
||||
:alt: Safe mode notification
|
||||
|
||||
Safe mode notification
|
||||
|
Before Width: | Height: | Size: 64 KiB |
|
Before Width: | Height: | Size: 49 KiB |
|
Before Width: | Height: | Size: 76 KiB |
|
Before Width: | Height: | Size: 52 KiB |
|
Before Width: | Height: | Size: 28 KiB |
|
Before Width: | Height: | Size: 10 KiB |
|
Before Width: | Height: | Size: 28 KiB |
|
Before Width: | Height: | Size: 38 KiB |
|
Before Width: | Height: | Size: 33 KiB |
|
Before Width: | Height: | Size: 26 KiB |
|
Before Width: | Height: | Size: 32 KiB |
|
Before Width: | Height: | Size: 81 KiB |
|
Before Width: | Height: | Size: 36 KiB |
|
Before Width: | Height: | Size: 2.9 KiB |
|
Before Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 100 KiB |
|
Before Width: | Height: | Size: 47 KiB |
@@ -1,309 +0,0 @@
|
||||
<?xml version="1.0"?>
|
||||
<Document xmlns="http://www.evolus.vn/Namespace/Pencil"><Properties/><Pages><Page><Properties><Property name="name">sidebar</Property><Property name="id">1421408377849_1407</Property><Property name="width">1531</Property><Property name="height">847</Property><Property name="dimBackground"/><Property name="transparentBackground">true</Property><Property name="backgroundColor">#FFFFFFFF</Property><Property name="background">transparent</Property></Properties><Content><g xmlns="http://www.w3.org/2000/svg" p:type="Group" xmlns:p="http://www.evolus.vn/Namespace/Pencil" transform="translate(200,211.5)" id="9c37daabc3ba46d8a8d9392db9c5bfec" p:sizing-gow="533.5" p:sizing-goh="366.5"><g p:type="Shape" p:def="Evolus.Common:RoundedRect" id="db0858b72c864467b215dbf33d56f344" transform="matrix(1,0,0,1,57,-0.5)" p:sizing-ox="58" p:sizing-oy="0.5" p:sizing-ow="264" p:sizing-oh="368"><p:metadata><p:property name="box"><![CDATA[264,368]]></p:property><p:property name="withBlur"><![CDATA[false]]></p:property><p:property name="radius"><![CDATA[0,0]]></p:property><p:property name="textPadding"><![CDATA[0,46]]></p:property><p:property name="fillColor"><![CDATA[#CCCCCCFF]]></p:property><p:property name="strokeColor"><![CDATA[#000000FF]]></p:property><p:property name="strokeStyle"><![CDATA[2|]]></p:property><p:property name="textContent"><![CDATA[
|
||||
]]></p:property><p:property name="textFont"><![CDATA["Liberation Sans",Arial,sans-serif|normal|normal|13px|none]]></p:property><p:property name="textColor"><![CDATA[#000000FF]]></p:property><p:property name="textAlign"><![CDATA[1,1]]></p:property></p:metadata>
|
||||
|
||||
<defs>
|
||||
<rect width="262" height="366" rx="0" ry="0" x="0" y="0" style="stroke-width: 2; fill: rgb(204, 204, 204); fill-opacity: 1; stroke: rgb(0, 0, 0); stroke-opacity: 1;" p:name="rrRect" id="6a0c5dd8bb904291948a061be156b69a" transform="translate(1,1)"/>
|
||||
<filter height="1.2558399" y="-0.12792" width="1.06396" x="-0.03198" p:name="shadingFilter" id="47e2c5b978d04acdae01fb06a59a4447">
|
||||
<feGaussianBlur stdDeviation="1" in="SourceAlpha"/>
|
||||
</filter>
|
||||
</defs>
|
||||
<use xlink:href="#6a0c5dd8bb904291948a061be156b69a" xmlns:xlink="http://www.w3.org/1999/xlink" transform="translate(2, 2)" p:filter="url(#47e2c5b978d04acdae01fb06a59a4447)" style="opacity: 0.5; visibility: hidden; display: none;" p:heavy="true" p:name="bgCopy" id="1bb1baaca7cc44c1b02cd9b42c705cc4"/>
|
||||
<use xlink:href="#6a0c5dd8bb904291948a061be156b69a" xmlns:xlink="http://www.w3.org/1999/xlink"/>
|
||||
<foreignObject x="46" y="184" width="172" height="0" p:name="text" id="85bd2e4e256b4cb7842522f2f03f3c81" style="font-family: "Liberation Sans",Arial,sans-serif; font-size: 13px; font-weight: normal; font-style: normal; text-decoration: none; fill: rgb(0, 0, 0); fill-opacity: 1; color: rgb(0, 0, 0); opacity: 1; text-align: center;"><div xmlns="http://www.w3.org/1999/xhtml">
|
||||
</div></foreignObject>
|
||||
</g><g p:type="Shape" p:def="Evolus.Common:RoundedRect" id="76483818cd584af4995434fb28810ce8" transform="matrix(1,0,0,1,73,15.5)" p:sizing-ox="74" p:sizing-oy="16.5" p:sizing-ow="232" p:sizing-oh="112"><p:metadata><p:property name="box"><![CDATA[232,112]]></p:property><p:property name="withBlur"><![CDATA[false]]></p:property><p:property name="radius"><![CDATA[0,0]]></p:property><p:property name="textPadding"><![CDATA[0,14]]></p:property><p:property name="fillColor"><![CDATA[#CCCCCCFF]]></p:property><p:property name="strokeColor"><![CDATA[#000000FF]]></p:property><p:property name="strokeStyle"><![CDATA[2|]]></p:property><p:property name="textContent"><![CDATA[
|
||||
]]></p:property><p:property name="textFont"><![CDATA["Liberation Sans",Arial,sans-serif|normal|normal|13px|none]]></p:property><p:property name="textColor"><![CDATA[#000000FF]]></p:property><p:property name="textAlign"><![CDATA[1,1]]></p:property></p:metadata>
|
||||
|
||||
<defs>
|
||||
<rect width="230" height="110" rx="0" ry="0" x="0" y="0" style="stroke-width: 2; fill: rgb(204, 204, 204); fill-opacity: 1; stroke: rgb(0, 0, 0); stroke-opacity: 1;" p:name="rrRect" id="3013ddbcc4fa492995a68798edd29384" transform="translate(1,1)"/>
|
||||
<filter height="1.2558399" y="-0.12792" width="1.06396" x="-0.03198" p:name="shadingFilter" id="d1e4f71d5d584c4791ec9a7c9e5be830">
|
||||
<feGaussianBlur stdDeviation="1" in="SourceAlpha"/>
|
||||
</filter>
|
||||
</defs>
|
||||
<use xlink:href="#3013ddbcc4fa492995a68798edd29384" xmlns:xlink="http://www.w3.org/1999/xlink" transform="translate(2, 2)" p:filter="url(#d1e4f71d5d584c4791ec9a7c9e5be830)" style="opacity: 0.5; visibility: hidden; display: none;" p:heavy="true" p:name="bgCopy" id="99bedd6f63d44a4a98c846ef4bec10a1"/>
|
||||
<use xlink:href="#3013ddbcc4fa492995a68798edd29384" xmlns:xlink="http://www.w3.org/1999/xlink"/>
|
||||
<foreignObject x="14" y="56" width="204" height="0" p:name="text" id="628f108cd2324e66b43059a0f6820ee6" style="font-family: "Liberation Sans",Arial,sans-serif; font-size: 13px; font-weight: normal; font-style: normal; text-decoration: none; fill: rgb(0, 0, 0); fill-opacity: 1; color: rgb(0, 0, 0); opacity: 1; text-align: center;"><div xmlns="http://www.w3.org/1999/xhtml">
|
||||
</div></foreignObject>
|
||||
</g><g p:type="Shape" p:def="Evolus.Common:RoundedRect" id="cab18e5323344976a22116d09ed7f8d9" transform="matrix(1,0,0,1,73,143.5)" p:sizing-ox="74" p:sizing-oy="144.5" p:sizing-ow="232" p:sizing-oh="208"><p:metadata><p:property name="box"><![CDATA[232,208]]></p:property><p:property name="withBlur"><![CDATA[false]]></p:property><p:property name="radius"><![CDATA[0,0]]></p:property><p:property name="textPadding"><![CDATA[0,25.999999999999993]]></p:property><p:property name="fillColor"><![CDATA[#FFFFFFFF]]></p:property><p:property name="strokeColor"><![CDATA[#000000FF]]></p:property><p:property name="strokeStyle"><![CDATA[2|]]></p:property><p:property name="textContent"><![CDATA[
|
||||
]]></p:property><p:property name="textFont"><![CDATA["Liberation Sans",Arial,sans-serif|normal|normal|13px|none]]></p:property><p:property name="textColor"><![CDATA[#000000FF]]></p:property><p:property name="textAlign"><![CDATA[1,1]]></p:property></p:metadata>
|
||||
|
||||
<defs>
|
||||
<rect width="230" height="206" rx="0" ry="0" x="0" y="0" style="stroke-width: 2; fill: rgb(255, 255, 255); fill-opacity: 1; stroke: rgb(0, 0, 0); stroke-opacity: 1;" p:name="rrRect" id="81f28baf72ac469cbdebdcaeb5aeb243" transform="translate(1,1)"/>
|
||||
<filter height="1.2558399" y="-0.12792" width="1.06396" x="-0.03198" p:name="shadingFilter" id="d7c2713036ee43909c0c1edc167e270b">
|
||||
<feGaussianBlur stdDeviation="1" in="SourceAlpha"/>
|
||||
</filter>
|
||||
</defs>
|
||||
<use xlink:href="#81f28baf72ac469cbdebdcaeb5aeb243" xmlns:xlink="http://www.w3.org/1999/xlink" transform="translate(2, 2)" p:filter="url(#d7c2713036ee43909c0c1edc167e270b)" style="opacity: 0.5; visibility: hidden; display: none;" p:heavy="true" p:name="bgCopy" id="825e8e4a336247cba2f89994b72de93e"/>
|
||||
<use xlink:href="#81f28baf72ac469cbdebdcaeb5aeb243" xmlns:xlink="http://www.w3.org/1999/xlink"/>
|
||||
<foreignObject x="26" y="104" width="180" height="0" p:name="text" id="5da32f0eb5b64ebc8ed60f5ad52e1693" style="font-family: "Liberation Sans",Arial,sans-serif; font-size: 13px; font-weight: normal; font-style: normal; text-decoration: none; fill: rgb(0, 0, 0); fill-opacity: 1; color: rgb(0, 0, 0); opacity: 1; text-align: center;"><div xmlns="http://www.w3.org/1999/xhtml">
|
||||
</div></foreignObject>
|
||||
</g><g p:type="Shape" p:def="Evolus.Common:RoundedRect" id="5bb69b63f17c4b90bab26e055b40809d" transform="matrix(1,0,0,1,88,52.5)" p:sizing-ox="89" p:sizing-oy="53.5" p:sizing-ow="200" p:sizing-oh="56"><p:metadata><p:property name="box"><![CDATA[200,56]]></p:property><p:property name="withBlur"><![CDATA[false]]></p:property><p:property name="radius"><![CDATA[0,0]]></p:property><p:property name="textPadding"><![CDATA[0,7]]></p:property><p:property name="fillColor"><![CDATA[#FFFFFFFF]]></p:property><p:property name="strokeColor"><![CDATA[#000000FF]]></p:property><p:property name="strokeStyle"><![CDATA[2|5,5]]></p:property><p:property name="textContent"><![CDATA[
|
||||
]]></p:property><p:property name="textFont"><![CDATA["Liberation Sans",Arial,sans-serif|normal|normal|13px|none]]></p:property><p:property name="textColor"><![CDATA[#000000FF]]></p:property><p:property name="textAlign"><![CDATA[1,1]]></p:property></p:metadata>
|
||||
|
||||
<defs>
|
||||
<rect width="198" height="54" rx="0" ry="0" x="0" y="0" style="stroke-width: 2; fill: rgb(255, 255, 255); fill-opacity: 1; stroke: rgb(0, 0, 0); stroke-opacity: 1; stroke-dasharray: 5, 5;" p:name="rrRect" id="50d1edd378e8475a976ee62cc51e187a" transform="translate(1,1)"/>
|
||||
<filter height="1.2558399" y="-0.12792" width="1.06396" x="-0.03198" p:name="shadingFilter" id="646abf607f094b84b088ebb2615c88cd">
|
||||
<feGaussianBlur stdDeviation="1" in="SourceAlpha"/>
|
||||
</filter>
|
||||
</defs>
|
||||
<use xlink:href="#50d1edd378e8475a976ee62cc51e187a" xmlns:xlink="http://www.w3.org/1999/xlink" transform="translate(2, 2)" p:filter="url(#646abf607f094b84b088ebb2615c88cd)" style="opacity: 0.5; visibility: hidden; display: none;" p:heavy="true" p:name="bgCopy" id="ebb65993472448b0827d87c3a3b09450"/>
|
||||
<use xlink:href="#50d1edd378e8475a976ee62cc51e187a" xmlns:xlink="http://www.w3.org/1999/xlink"/>
|
||||
<foreignObject x="7" y="28" width="186" height="0" p:name="text" id="1ebe6438f1de49eaab62aa0ac42a63dd" style="font-family: "Liberation Sans",Arial,sans-serif; font-size: 13px; font-weight: normal; font-style: normal; text-decoration: none; fill: rgb(0, 0, 0); fill-opacity: 1; color: rgb(0, 0, 0); opacity: 1; text-align: center;"><div xmlns="http://www.w3.org/1999/xhtml">
|
||||
</div></foreignObject>
|
||||
</g><g p:type="Shape" p:def="Evolus.Common:PlainTextV2" id="253be0b8bade43249b1d0373589b4bde" transform="matrix(1,0,0,1,118,43.5)" p:sizing-ox="117.859375" p:sizing-oy="21.5" p:sizing-ow="79.7890625" p:sizing-oh="28"><p:metadata><p:property name="disabled"><![CDATA[false]]></p:property><p:property name="width"><![CDATA[100,0]]></p:property><p:property name="fixedWidth"><![CDATA[false]]></p:property><p:property name="label"><![CDATA[<name>]]></p:property><p:property name="textColor"><![CDATA[#000000FF]]></p:property><p:property name="textFont"><![CDATA[Open Sans|bold|normal|20px|none]]></p:property><p:property name="textAlign"><![CDATA[0,0]]></p:property></p:metadata>
|
||||
<rect x="0" y="0" style="fill: none; stroke: none; visibility: hidden; display: none;" p:name="bgRect" id="a00b6941683d4803957395e5c0b93fc5" width="0" height="0"/>
|
||||
<text xml:space="preserve" p:name="text" id="907a2badd36140fa9e10760dbe67b52d" style="fill: rgb(0, 0, 0); fill-opacity: 1; font-family: Open Sans; font-size: 20px; font-weight: bold; font-style: normal; text-decoration: none;"><tspan x="0" y="0"><name></tspan></text>
|
||||
</g><g p:type="Shape" p:def="Evolus.Common:Balloon" id="a7b1d219b2e04f00946f8ad6fb892a70" transform="matrix(1,0,0,1,333,186.5)" p:sizing-ox="305.5" p:sizing-oy="187" p:sizing-ow="200" p:sizing-oh="80"><p:metadata><p:property name="box"><![CDATA[200,80]]></p:property><p:property name="withBlur"><![CDATA[false]]></p:property><p:property name="radius"><![CDATA[8,0]]></p:property><p:property name="leftStart"><![CDATA[0,12]]></p:property><p:property name="leftEnd"><![CDATA[0,33]]></p:property><p:property name="rightStart"><![CDATA[200,12]]></p:property><p:property name="rightEnd"><![CDATA[200,33]]></p:property><p:property name="topStart"><![CDATA[12,0]]></p:property><p:property name="topEnd"><![CDATA[33,0]]></p:property><p:property name="bottomStart"><![CDATA[12,80]]></p:property><p:property name="bottomEnd"><![CDATA[33,80]]></p:property><p:property name="pin"><![CDATA[-28,23]]></p:property><p:property name="fillColor"><![CDATA[#FFFFFFFF]]></p:property><p:property name="strokeColor"><![CDATA[#1B3280FF]]></p:property><p:property name="strokeStyle"><![CDATA[2|]]></p:property><p:property name="textContent"><![CDATA[<span style="font-family: Consolas;">styles_content / styles<br />classes_content / classes</span><br />]]></p:property><p:property name="textFont"><![CDATA["Liberation Sans",Arial,sans-serif|normal|normal|13px|none]]></p:property><p:property name="textColor"><![CDATA[#000000FF]]></p:property><p:property name="textAlign"><![CDATA[1,1]]></p:property></p:metadata>
|
||||
|
||||
<defs>
|
||||
<filter height="1.2558399" y="-0.12792" width="1.06396" x="-0.03198" p:name="imageShading" id="d1b2e26143ba4dc9b5011127eaf859fa">
|
||||
<feGaussianBlur stdDeviation="1.3325" in="SourceAlpha"/>
|
||||
</filter>
|
||||
<g p:name="container" id="1d983e33baff4b5db9814e8bc44d5ff2">
|
||||
<path transform="translate(0.5 0.5)" style="stroke-width: 2; fill: rgb(255, 255, 255); fill-opacity: 1; stroke: rgb(27, 50, 128); stroke-opacity: 1;" p:name="rect" id="9d05a5c681eb4e8690d7092cfde36dd4" d="M 8 0 L 192 0 C 197.33333333333334 0 200 2.6666666666666665 200 8 L 200 72 C 200 77.33333333333333 197.33333333333334 80 192 80 L 8 80 C 2.6666666666666665 80 0 77.33333333333333 0 72 L 0 33 L -28 23 L 0 12 L 0 8 C 0 2.6666666666666665 2.6666666666666665 0 8 0"/>
|
||||
</g>
|
||||
</defs>
|
||||
<use xlink:href="#1d983e33baff4b5db9814e8bc44d5ff2" xmlns:xlink="http://www.w3.org/1999/xlink" transform="translate(1, 1)" p:filter="url(#d1b2e26143ba4dc9b5011127eaf859fa)" style="opacity: 0.6; visibility: hidden; display: none;" p:heavy="true" p:name="bgCopy" id="0a8c818f34d64855927948dca5fdd21e"/>
|
||||
<use xlink:href="#1d983e33baff4b5db9814e8bc44d5ff2" xmlns:xlink="http://www.w3.org/1999/xlink"/>
|
||||
<foreignObject x="8" y="24" width="184" height="33" p:name="text" id="4edecb8e11ca486cad7e10fecaff8778" style="font-family: "Liberation Sans",Arial,sans-serif; font-size: 13px; font-weight: normal; font-style: normal; text-decoration: none; fill: rgb(0, 0, 0); fill-opacity: 1; color: rgb(0, 0, 0); opacity: 1; text-align: center;"><div xmlns="http://www.w3.org/1999/xhtml"><span style="font-family: Consolas;">styles_content / styles<br />classes_content / classes</span><br /></div></foreignObject>
|
||||
</g><g p:type="Shape" p:def="Evolus.Common:Balloon" id="c736be040cc84947b5eb28896b2f18b0" transform="matrix(1,0,0,1,333,-0.5)" p:sizing-ox="321.5" p:sizing-oy="0" p:sizing-ow="200" p:sizing-oh="94"><p:metadata><p:property name="box"><![CDATA[200,94]]></p:property><p:property name="withBlur"><![CDATA[false]]></p:property><p:property name="radius"><![CDATA[8,0]]></p:property><p:property name="leftStart"><![CDATA[0,14.100000000000001]]></p:property><p:property name="leftEnd"><![CDATA[0,38.775]]></p:property><p:property name="rightStart"><![CDATA[200,14.100000000000001]]></p:property><p:property name="rightEnd"><![CDATA[200,38.775]]></p:property><p:property name="topStart"><![CDATA[12,0]]></p:property><p:property name="topEnd"><![CDATA[33,0]]></p:property><p:property name="bottomStart"><![CDATA[12,94]]></p:property><p:property name="bottomEnd"><![CDATA[33,94]]></p:property><p:property name="pin"><![CDATA[-12,27.025000000000002]]></p:property><p:property name="fillColor"><![CDATA[#FFFFFFFF]]></p:property><p:property name="strokeColor"><![CDATA[#1B3280FF]]></p:property><p:property name="strokeStyle"><![CDATA[2|]]></p:property><p:property name="textContent"><![CDATA[<span style="font-family: Consolas;">data_bind<br />styles_wrapper / styles<br />classes_wrapper / classes<br /></span>]]></p:property><p:property name="textFont"><![CDATA["Liberation Sans",Arial,sans-serif|normal|normal|13px|none]]></p:property><p:property name="textColor"><![CDATA[#000000FF]]></p:property><p:property name="textAlign"><![CDATA[1,1]]></p:property></p:metadata>
|
||||
|
||||
<defs>
|
||||
<filter height="1.2558399" y="-0.12792" width="1.06396" x="-0.03198" p:name="imageShading" id="da71a006d4af4ce6b8f0dc6b1763b086">
|
||||
<feGaussianBlur stdDeviation="1.3325" in="SourceAlpha"/>
|
||||
</filter>
|
||||
<g p:name="container" id="9352a73150934cfd986e88ce1ab4a93e">
|
||||
<path transform="translate(0.5 0.5)" style="stroke-width: 2; fill: rgb(255, 255, 255); fill-opacity: 1; stroke: rgb(27, 50, 128); stroke-opacity: 1;" p:name="rect" id="1d692ff756b24c2aafa9c15372494c5d" d="M 8 0 L 192 0 C 197.33333333333334 0 200 2.6666666666666665 200 8 L 200 86 C 200 91.33333333333333 197.33333333333334 94 192 94 L 8 94 C 2.6666666666666665 94 0 91.33333333333333 0 86 L 0 38.775 L -12 27.025000000000002 L 0 14.100000000000001 L 0 8 C 0 2.6666666666666665 2.6666666666666665 0 8 0"/>
|
||||
</g>
|
||||
</defs>
|
||||
<use xlink:href="#9352a73150934cfd986e88ce1ab4a93e" xmlns:xlink="http://www.w3.org/1999/xlink" transform="translate(1, 1)" p:filter="url(#da71a006d4af4ce6b8f0dc6b1763b086)" style="opacity: 0.6; visibility: hidden; display: none;" p:heavy="true" p:name="bgCopy" id="2186895b427e4e0bac628bdbf5b65fe6"/>
|
||||
<use xlink:href="#9352a73150934cfd986e88ce1ab4a93e" xmlns:xlink="http://www.w3.org/1999/xlink"/>
|
||||
<foreignObject x="8" y="22" width="184" height="50" p:name="text" id="b02113fca2d14fa783c537fba5d391e6" style="font-family: "Liberation Sans",Arial,sans-serif; font-size: 13px; font-weight: normal; font-style: normal; text-decoration: none; fill: rgb(0, 0, 0); fill-opacity: 1; color: rgb(0, 0, 0); opacity: 1; text-align: center;"><div xmlns="http://www.w3.org/1999/xhtml"><span style="font-family: Consolas;">data_bind<br />styles_wrapper / styles<br />classes_wrapper / classes<br /></span></div></foreignObject>
|
||||
</g><g p:type="Shape" p:def="Evolus.Common:PlainTextV2" id="61991a849e7f4c72a857ddebed80da33" transform="matrix(1,0,0,1,89,166.5)" p:sizing-ox="87.3984375" p:sizing-oy="154.5" p:sizing-ow="60" p:sizing-oh="16"><p:metadata><p:property name="disabled"><![CDATA[false]]></p:property><p:property name="width"><![CDATA[100,0]]></p:property><p:property name="fixedWidth"><![CDATA[false]]></p:property><p:property name="label"><![CDATA[template]]></p:property><p:property name="textColor"><![CDATA[#000000FF]]></p:property><p:property name="textFont"><![CDATA[Consolas|normal|normal|13px|none]]></p:property><p:property name="textAlign"><![CDATA[0,0]]></p:property></p:metadata>
|
||||
<rect x="0" y="0" style="fill: none; stroke: none; visibility: hidden; display: none;" p:name="bgRect" id="6d064b059239458684409f224ccbb316" width="0" height="0"/>
|
||||
<text xml:space="preserve" p:name="text" id="dadbe69e489042ce8e4eb9fc489ea745" style="fill: rgb(0, 0, 0); fill-opacity: 1; font-family: Consolas; font-size: 13px; font-weight: normal; font-style: normal; text-decoration: none;"><tspan x="0" y="0">template</tspan></text>
|
||||
</g><g p:type="Shape" p:def="Evolus.Common:PlainTextV2" id="39a78451571e4e14b57426ec83d5c92a" transform="matrix(1,0,0,1,100,75.5)" p:sizing-ox="98.3984375" p:sizing-oy="63.5" p:sizing-ow="109.1640625" p:sizing-oh="16"><p:metadata><p:property name="disabled"><![CDATA[false]]></p:property><p:property name="width"><![CDATA[100,0]]></p:property><p:property name="fixedWidth"><![CDATA[false]]></p:property><p:property name="label"><![CDATA[template_header]]></p:property><p:property name="textColor"><![CDATA[#000000FF]]></p:property><p:property name="textFont"><![CDATA[Consolas|normal|normal|13px|none]]></p:property><p:property name="textAlign"><![CDATA[0,0]]></p:property></p:metadata>
|
||||
<rect x="0" y="0" style="fill: none; stroke: none; visibility: hidden; display: none;" p:name="bgRect" id="538be6af592e49a686d10f714de79255" width="0" height="0"/>
|
||||
<text xml:space="preserve" p:name="text" id="bb1be320b027418592c6edf7f319411d" style="fill: rgb(0, 0, 0); fill-opacity: 1; font-family: Consolas; font-size: 13px; font-weight: normal; font-style: normal; text-decoration: none;"><tspan x="0" y="0">template_header</tspan></text>
|
||||
</g><g p:type="Shape" p:def="Evolus.Common:RoundedRect" id="2f7cafb48e32492193fc2507d4a77a41" transform="matrix(1,0,0,1,88,24.5)" p:sizing-ox="89" p:sizing-oy="25.5" p:sizing-ow="24" p:sizing-oh="24"><p:metadata><p:property name="box"><![CDATA[24,24]]></p:property><p:property name="withBlur"><![CDATA[false]]></p:property><p:property name="radius"><![CDATA[0,0]]></p:property><p:property name="textPadding"><![CDATA[0,3]]></p:property><p:property name="fillColor"><![CDATA[#CCCCCCFF]]></p:property><p:property name="strokeColor"><![CDATA[#FFFFFFFF]]></p:property><p:property name="strokeStyle"><![CDATA[2|]]></p:property><p:property name="textContent"><![CDATA[
|
||||
]]></p:property><p:property name="textFont"><![CDATA["Liberation Sans",Arial,sans-serif|normal|normal|13px|none]]></p:property><p:property name="textColor"><![CDATA[#000000FF]]></p:property><p:property name="textAlign"><![CDATA[1,1]]></p:property></p:metadata>
|
||||
|
||||
<defs>
|
||||
<rect width="22" height="22" rx="0" ry="0" x="0" y="0" style="stroke-width: 2; fill: rgb(204, 204, 204); fill-opacity: 1; stroke: rgb(255, 255, 255); stroke-opacity: 1;" p:name="rrRect" id="226ab97c12354c4c824fbf94a11a98b0" transform="translate(1,1)"/>
|
||||
<filter height="1.2558399" y="-0.12792" width="1.06396" x="-0.03198" p:name="shadingFilter" id="8ae0aa26919c481db673739e49601e78">
|
||||
<feGaussianBlur stdDeviation="1" in="SourceAlpha"/>
|
||||
</filter>
|
||||
</defs>
|
||||
<use xlink:href="#226ab97c12354c4c824fbf94a11a98b0" xmlns:xlink="http://www.w3.org/1999/xlink" transform="translate(2, 2)" p:filter="url(#8ae0aa26919c481db673739e49601e78)" style="opacity: 0.5; visibility: hidden; display: none;" p:heavy="true" p:name="bgCopy" id="13e998ab0f984d15b0b4f7c8f136ac21"/>
|
||||
<use xlink:href="#226ab97c12354c4c824fbf94a11a98b0" xmlns:xlink="http://www.w3.org/1999/xlink"/>
|
||||
<foreignObject x="3" y="12" width="18" height="0" p:name="text" id="998c2f0c678e447fa46f5424e9b8a698" style="font-family: "Liberation Sans",Arial,sans-serif; font-size: 13px; font-weight: normal; font-style: normal; text-decoration: none; fill: rgb(0, 0, 0); fill-opacity: 1; color: rgb(0, 0, 0); opacity: 1; text-align: center;"><div xmlns="http://www.w3.org/1999/xhtml">
|
||||
</div></foreignObject>
|
||||
</g><g p:type="Shape" p:def="Evolus.Common:arrow" id="f983474041574164a9ed540858755610" transform="matrix(1,0,0,1,-144,61.5)" p:sizing-ox="16" p:sizing-oy="30.5" p:sizing-ow="72" p:sizing-oh="63"><p:metadata><p:property name="startPin"><![CDATA[160,32]]></p:property><p:property name="endPin" p:connectedShapeId="2f7cafb48e32492193fc2507d4a77a41" p:connectedOutletId="middle-left" p:viax="222" p:viay="-25"><![CDATA[232,-25]]></p:property><p:property name="withStartArrow"><![CDATA[false]]></p:property><p:property name="withEndArrow"><![CDATA[true]]></p:property><p:property name="mode"><![CDATA[curvy]]></p:property><p:property name="detached"><![CDATA[false]]></p:property><p:property name="strokeColor"><![CDATA[#1B3280FF]]></p:property><p:property name="strokeStyle"><![CDATA[2|]]></p:property><p:property name="textContent"><![CDATA[]]></p:property><p:property name="textFont"><![CDATA["Liberation Sans",Arial,sans-serif|normal|normal|13px|none]]></p:property><p:property name="textColor"><![CDATA[#000000FF]]></p:property><p:property name="textAlign"><![CDATA[1,1]]></p:property></p:metadata>
|
||||
<defs>
|
||||
<path style="stroke-linejoin: round; fill: none;" p:name="path" id="d96ef38bf8c04e81aec043fef0b2d21c" d="M 160 32 C 160 -14 186 -25 232 -25 M 226 -31 L 232 -25 L 226 -19"/>
|
||||
</defs>
|
||||
<use xlink:href="#d96ef38bf8c04e81aec043fef0b2d21c" xmlns:xlink="http://www.w3.org/1999/xlink" stroke-width="10" stroke-opacity="0" stroke="#FF0000"/>
|
||||
<use xlink:href="#d96ef38bf8c04e81aec043fef0b2d21c" xmlns:xlink="http://www.w3.org/1999/xlink" p:name="outArrow1" id="66e4484f068b49a09813e21c39d8994e" style="stroke: rgb(27, 50, 128); stroke-opacity: 1; stroke-width: 2;"/>
|
||||
<text p:name="text" id="b0d40ebba7664c20a9a4f1452c86a07d" style="fill: rgb(0, 0, 0); fill-opacity: 1; font-family: "Liberation Sans",Arial,sans-serif; font-size: 13px; font-weight: normal; font-style: normal; text-decoration: none;">
|
||||
<textPath xlink:href="#d96ef38bf8c04e81aec043fef0b2d21c" xmlns:xlink="http://www.w3.org/1999/xlink" startOffset="50%" text-anchor="middle" alignment-baseline="middle">
|
||||
<tspan dy="-4.333333333333333" p:name="textSpan" id="73255d7945434ce9bc661341349735e1" dx="-16"></tspan>
|
||||
</textPath>
|
||||
</text>
|
||||
|
||||
</g><g p:type="Shape" p:def="Evolus.Common:PlainTextV2" id="86ed3ea65aee42199bac08824c3826a6" transform="matrix(1,0,0,1,1,104.5)" p:sizing-ox="0" p:sizing-oy="92.5" p:sizing-ow="31.140625" p:sizing-oh="16"><p:metadata><p:property name="disabled"><![CDATA[false]]></p:property><p:property name="width"><![CDATA[100,0]]></p:property><p:property name="fixedWidth"><![CDATA[false]]></p:property><p:property name="label"><![CDATA[icon]]></p:property><p:property name="textColor"><![CDATA[#000000FF]]></p:property><p:property name="textFont"><![CDATA[Consolas|normal|normal|13px|none]]></p:property><p:property name="textAlign"><![CDATA[0,0]]></p:property></p:metadata>
|
||||
<rect x="0" y="0" style="fill: none; stroke: none; visibility: hidden; display: none;" p:name="bgRect" id="a9ecdbb9c77b4ce4928e46b7cfe54dcf" width="0" height="0"/>
|
||||
<text xml:space="preserve" p:name="text" id="02a5711e99924fc4b34e5730e2a78fa8" style="fill: rgb(0, 0, 0); fill-opacity: 1; font-family: Consolas; font-size: 13px; font-weight: normal; font-style: normal; text-decoration: none;"><tspan x="0" y="0">icon</tspan></text>
|
||||
</g></g></Content></Page><Page><Properties><Property name="name">tab</Property><Property name="id">1421409530685_8513</Property><Property name="width">1531</Property><Property name="height">847</Property><Property name="dimBackground"/><Property name="transparentBackground">true</Property><Property name="backgroundColor">#FFFFFFFF</Property><Property name="background">transparent</Property></Properties><Content><g xmlns="http://www.w3.org/2000/svg" p:type="Group" xmlns:p="http://www.evolus.vn/Namespace/Pencil" transform="translate(201,144)" id="d8e8f6e0f752428680f67384aa52208f" p:sizing-gow="598.5" p:sizing-goh="310"><g p:type="Shape" p:def="Evolus.Common:RoundedRect" id="9e881048fedf43d6a67dfad7f06548e9" transform="matrix(1,0,0,1,0,47)" p:sizing-ox="1" p:sizing-oy="48" p:sizing-ow="384" p:sizing-oh="264"><p:metadata><p:property name="box"><![CDATA[384,264]]></p:property><p:property name="withBlur"><![CDATA[false]]></p:property><p:property name="radius"><![CDATA[0,0]]></p:property><p:property name="textPadding"><![CDATA[0,33]]></p:property><p:property name="fillColor"><![CDATA[#CCCCCCFF]]></p:property><p:property name="strokeColor"><![CDATA[#000000FF]]></p:property><p:property name="strokeStyle"><![CDATA[2|]]></p:property><p:property name="textContent"><![CDATA[
|
||||
]]></p:property><p:property name="textFont"><![CDATA["Liberation Sans",Arial,sans-serif|normal|normal|13px|none]]></p:property><p:property name="textColor"><![CDATA[#000000FF]]></p:property><p:property name="textAlign"><![CDATA[1,1]]></p:property></p:metadata>
|
||||
|
||||
<defs>
|
||||
<rect width="382" height="262" rx="0" ry="0" x="0" y="0" style="stroke-width: 2; fill: rgb(204, 204, 204); fill-opacity: 1; stroke: rgb(0, 0, 0); stroke-opacity: 1;" p:name="rrRect" id="12a9d962fb7b4cabbe2795c5e396d6ec" transform="translate(1,1)"/>
|
||||
<filter height="1.2558399" y="-0.12792" width="1.06396" x="-0.03198" p:name="shadingFilter" id="76b2ce77019f45daad45b48817f65325">
|
||||
<feGaussianBlur stdDeviation="1" in="SourceAlpha"/>
|
||||
</filter>
|
||||
</defs>
|
||||
<use xlink:href="#12a9d962fb7b4cabbe2795c5e396d6ec" xmlns:xlink="http://www.w3.org/1999/xlink" transform="translate(2, 2)" p:filter="url(#76b2ce77019f45daad45b48817f65325)" style="opacity: 0.5; visibility: hidden; display: none;" p:heavy="true" p:name="bgCopy" id="6ed5bd1e00f648a792981e16e260963e"/>
|
||||
<use xlink:href="#12a9d962fb7b4cabbe2795c5e396d6ec" xmlns:xlink="http://www.w3.org/1999/xlink"/>
|
||||
<foreignObject x="33" y="132" width="318" height="0" p:name="text" id="14b2622dcb514c21a19fcf064f8abe55" style="font-family: "Liberation Sans",Arial,sans-serif; font-size: 13px; font-weight: normal; font-style: normal; text-decoration: none; fill: rgb(0, 0, 0); fill-opacity: 1; color: rgb(0, 0, 0); opacity: 1; text-align: center;"><div xmlns="http://www.w3.org/1999/xhtml">
|
||||
</div></foreignObject>
|
||||
</g><g p:type="Shape" p:def="Evolus.Common:RoundedRect" id="fb37074399fd40dc8078a398f9299f3e" transform="matrix(1,0,0,1,16,63)" p:sizing-ox="17" p:sizing-oy="64" p:sizing-ow="352" p:sizing-oh="232"><p:metadata><p:property name="box"><![CDATA[352,232]]></p:property><p:property name="withBlur"><![CDATA[false]]></p:property><p:property name="radius"><![CDATA[0,0]]></p:property><p:property name="textPadding"><![CDATA[0,29]]></p:property><p:property name="fillColor"><![CDATA[#FFFFFFFF]]></p:property><p:property name="strokeColor"><![CDATA[#000000FF]]></p:property><p:property name="strokeStyle"><![CDATA[2|]]></p:property><p:property name="textContent"><![CDATA[
|
||||
]]></p:property><p:property name="textFont"><![CDATA["Liberation Sans",Arial,sans-serif|normal|normal|13px|none]]></p:property><p:property name="textColor"><![CDATA[#000000FF]]></p:property><p:property name="textAlign"><![CDATA[1,1]]></p:property></p:metadata>
|
||||
|
||||
<defs>
|
||||
<rect width="350" height="230" rx="0" ry="0" x="0" y="0" style="stroke-width: 2; fill: rgb(255, 255, 255); fill-opacity: 1; stroke: rgb(0, 0, 0); stroke-opacity: 1;" p:name="rrRect" id="d8debccd7e4f482b8c04420ef54ffa70" transform="translate(1,1)"/>
|
||||
<filter height="1.2558399" y="-0.12792" width="1.06396" x="-0.03198" p:name="shadingFilter" id="1eb07f64e796487984ddffea498f79b9">
|
||||
<feGaussianBlur stdDeviation="1" in="SourceAlpha"/>
|
||||
</filter>
|
||||
</defs>
|
||||
<use xlink:href="#d8debccd7e4f482b8c04420ef54ffa70" xmlns:xlink="http://www.w3.org/1999/xlink" transform="translate(2, 2)" p:filter="url(#1eb07f64e796487984ddffea498f79b9)" style="opacity: 0.5; visibility: hidden; display: none;" p:heavy="true" p:name="bgCopy" id="9b45931ea5e84b15a01479b46dc76b83"/>
|
||||
<use xlink:href="#d8debccd7e4f482b8c04420ef54ffa70" xmlns:xlink="http://www.w3.org/1999/xlink"/>
|
||||
<foreignObject x="29" y="116" width="294" height="0" p:name="text" id="6d8d3f3cce8b4da0b0f97ed8a5fce058" style="font-family: "Liberation Sans",Arial,sans-serif; font-size: 13px; font-weight: normal; font-style: normal; text-decoration: none; fill: rgb(0, 0, 0); fill-opacity: 1; color: rgb(0, 0, 0); opacity: 1; text-align: center;"><div xmlns="http://www.w3.org/1999/xhtml">
|
||||
</div></foreignObject>
|
||||
</g><g p:type="Shape" p:def="Evolus.Common:PlainTextV2" id="407ebd46fa5f48f395a7d5a0b8d46d2a" transform="matrix(1,0,0,1,26,83)" p:sizing-ox="24.3984375" p:sizing-oy="71" p:sizing-ow="60" p:sizing-oh="16"><p:metadata><p:property name="disabled"><![CDATA[false]]></p:property><p:property name="width"><![CDATA[100,0]]></p:property><p:property name="fixedWidth"><![CDATA[false]]></p:property><p:property name="label"><![CDATA[template]]></p:property><p:property name="textColor"><![CDATA[#000000FF]]></p:property><p:property name="textFont"><![CDATA[Consolas|normal|normal|13px|none]]></p:property><p:property name="textAlign"><![CDATA[0,0]]></p:property></p:metadata>
|
||||
<rect x="0" y="0" style="fill: none; stroke: none; visibility: hidden; display: none;" p:name="bgRect" id="efd58ec8f2eb45dcbeea7bb13c573cc5" width="0" height="0"/>
|
||||
<text xml:space="preserve" p:name="text" id="ba9f30328268467ba17566dbd14ae998" style="fill: rgb(0, 0, 0); fill-opacity: 1; font-family: Consolas; font-size: 13px; font-weight: normal; font-style: normal; text-decoration: none;"><tspan x="0" y="0">template</tspan></text>
|
||||
</g><g p:type="Shape" p:def="Evolus.Common:trapezoid" id="cb49850d258c4367abbee3628aa93512" transform="matrix(1,0,0,1,0,0)" p:sizing-ox="0" p:sizing-oy="0" p:sizing-ow="119" p:sizing-oh="48"><p:metadata><p:property name="box"><![CDATA[119,48]]></p:property><p:property name="a"><![CDATA[29.750000000000004,0]]></p:property><p:property name="fillColor"><![CDATA[#CCCCCCFF]]></p:property><p:property name="strokeColor"><![CDATA[#000000FF]]></p:property><p:property name="strokeStyle"><![CDATA[2|]]></p:property></p:metadata>
|
||||
<path style="stroke-linejoin: round; stroke: rgb(0, 0, 0); stroke-opacity: 1; stroke-width: 2; fill: rgb(204, 204, 204); fill-opacity: 1;" p:name="path" id="ac794f7d717045878f0fdebc737e9adc" transform="translate(0,0)" d="M 29.750000000000004 0 L 89.25 0 L 119 48 L 0 48 z"/>
|
||||
</g><g xmlns="http://www.w3.org/2000/svg" p:type="Shape" xmlns:p="http://www.evolus.vn/Namespace/Pencil" p:def="Evolus.Common:trapezoid" id="b0b14e6d505d4af7a04a05a8cc7fe672" transform="matrix(1,0,0,1,87,0)" p:sizing-ox="87" p:sizing-oy="0" p:sizing-ow="120" p:sizing-oh="48"><p:metadata><p:property name="box"><![CDATA[120,48]]></p:property><p:property name="a"><![CDATA[30,0]]></p:property><p:property name="fillColor"><![CDATA[#CCCCCCFF]]></p:property><p:property name="strokeColor"><![CDATA[#000000FF]]></p:property><p:property name="strokeStyle"><![CDATA[2|]]></p:property></p:metadata>
|
||||
<path style="stroke-linejoin: round; stroke: rgb(0, 0, 0); stroke-opacity: 1; stroke-width: 2; fill: rgb(204, 204, 204); fill-opacity: 1;" p:name="path" id="5c4e128120224a0f87c3c6f9e98f9183" transform="translate(0,0)" d="M 30 0 L 90 0 L 120 48 L 0 48 z"/>
|
||||
</g><g xmlns="http://www.w3.org/2000/svg" p:type="Shape" xmlns:p="http://www.evolus.vn/Namespace/Pencil" p:def="Evolus.Common:trapezoid" id="b95ce307dbc04cb297e1d019f1c31d0d" transform="matrix(1,0,0,1,263,0)" p:sizing-ox="263" p:sizing-oy="0" p:sizing-ow="120" p:sizing-oh="48"><p:metadata><p:property name="box"><![CDATA[120,48]]></p:property><p:property name="a"><![CDATA[30,0]]></p:property><p:property name="fillColor"><![CDATA[#CCCCCCFF]]></p:property><p:property name="strokeColor"><![CDATA[#000000FF]]></p:property><p:property name="strokeStyle"><![CDATA[2|]]></p:property></p:metadata>
|
||||
<path style="stroke-linejoin: round; stroke: rgb(0, 0, 0); stroke-opacity: 1; stroke-width: 2; fill: rgb(204, 204, 204); fill-opacity: 1;" p:name="path" id="58f26895549a4afe87215738aad60c7f" transform="translate(0,0)" d="M 30 0 L 90 0 L 120 48 L 0 48 z"/>
|
||||
</g><g xmlns="http://www.w3.org/2000/svg" p:type="Shape" xmlns:p="http://www.evolus.vn/Namespace/Pencil" p:def="Evolus.Common:trapezoid" id="dd08c65002d54b4d963c0fc1ddd8da56" transform="matrix(1,0,0,1,175,0)" p:sizing-ox="175" p:sizing-oy="0" p:sizing-ow="120" p:sizing-oh="48"><p:metadata><p:property name="box"><![CDATA[120,48]]></p:property><p:property name="a"><![CDATA[30,0]]></p:property><p:property name="fillColor"><![CDATA[#CCCCCCFF]]></p:property><p:property name="strokeColor"><![CDATA[#000000FF]]></p:property><p:property name="strokeStyle"><![CDATA[2|]]></p:property></p:metadata>
|
||||
<path style="stroke-linejoin: round; stroke: rgb(0, 0, 0); stroke-opacity: 1; stroke-width: 2; fill: rgb(204, 204, 204); fill-opacity: 1;" p:name="path" id="2ff5fd3ed1174b1ca120e0521506dfdb" transform="translate(0,0)" d="M 30 0 L 90 0 L 120 48 L 0 48 z"/>
|
||||
</g><g xmlns="http://www.w3.org/2000/svg" p:type="Shape" xmlns:p="http://www.evolus.vn/Namespace/Pencil" p:def="Evolus.Common:PlainTextV2" id="c821784d3f6f4c54a482c9b800303096" transform="matrix(1,0,0,1,196,38)" p:sizing-ox="195.859375" p:sizing-oy="16" p:sizing-ow="79.7890625" p:sizing-oh="28"><p:metadata><p:property name="disabled"><![CDATA[false]]></p:property><p:property name="width"><![CDATA[100,0]]></p:property><p:property name="fixedWidth"><![CDATA[false]]></p:property><p:property name="label"><![CDATA[<name>]]></p:property><p:property name="textColor"><![CDATA[#000000FF]]></p:property><p:property name="textFont"><![CDATA[Open Sans|bold|normal|20px|none]]></p:property><p:property name="textAlign"><![CDATA[0,0]]></p:property></p:metadata>
|
||||
<rect x="0" y="0" style="fill: none; stroke: none; visibility: hidden; display: none;" p:name="bgRect" id="45c9bc72749f4114b754dd78d39294d9" width="0" height="0"/>
|
||||
<text xml:space="preserve" p:name="text" id="510af970bf6e4a3299e10d5726dc506b" style="fill: rgb(0, 0, 0); fill-opacity: 1; font-family: Open Sans; font-size: 20px; font-weight: bold; font-style: normal; text-decoration: none;"><tspan x="0" y="0"><name></tspan></text>
|
||||
</g><g p:type="Shape" p:def="Evolus.Common:Balloon" id="28819f317c9a44f487d89358bc01d35e" transform="matrix(1,0,0,1,398,0)" p:sizing-ox="284.5" p:sizing-oy="0.5" p:sizing-ow="200" p:sizing-oh="80"><p:metadata><p:property name="box"><![CDATA[200,80]]></p:property><p:property name="withBlur"><![CDATA[false]]></p:property><p:property name="radius"><![CDATA[8,0]]></p:property><p:property name="leftStart"><![CDATA[0,12]]></p:property><p:property name="leftEnd"><![CDATA[0,33]]></p:property><p:property name="rightStart"><![CDATA[200,12]]></p:property><p:property name="rightEnd"><![CDATA[200,33]]></p:property><p:property name="topStart"><![CDATA[12,0]]></p:property><p:property name="topEnd"><![CDATA[33,0]]></p:property><p:property name="bottomStart"><![CDATA[12,80]]></p:property><p:property name="bottomEnd"><![CDATA[33,80]]></p:property><p:property name="pin"><![CDATA[-114,22]]></p:property><p:property name="fillColor"><![CDATA[#FFFFFFFF]]></p:property><p:property name="strokeColor"><![CDATA[#1B3280FF]]></p:property><p:property name="strokeStyle"><![CDATA[2|]]></p:property><p:property name="textContent"><![CDATA[<span style="font-family: Consolas;">data_bind<br />styles_link / styles<br />classes_link / classes</span><br />]]></p:property><p:property name="textFont"><![CDATA["Liberation Sans",Arial,sans-serif|normal|normal|13px|none]]></p:property><p:property name="textColor"><![CDATA[#000000FF]]></p:property><p:property name="textAlign"><![CDATA[1,1]]></p:property></p:metadata>
|
||||
|
||||
<defs>
|
||||
<filter height="1.2558399" y="-0.12792" width="1.06396" x="-0.03198" p:name="imageShading" id="f46117a9847b442a848d6dc6d0f1ca02">
|
||||
<feGaussianBlur stdDeviation="1.3325" in="SourceAlpha"/>
|
||||
</filter>
|
||||
<g p:name="container" id="7e565a2554874c8693bee8c3b1fb4a96">
|
||||
<path transform="translate(0.5 0.5)" style="stroke-width: 2; fill: rgb(255, 255, 255); fill-opacity: 1; stroke: rgb(27, 50, 128); stroke-opacity: 1;" p:name="rect" id="35606f3a84d34cfabef6fd7995e162c9" d="M 8 0 L 192 0 C 197.33333333333334 0 200 2.6666666666666665 200 8 L 200 72 C 200 77.33333333333333 197.33333333333334 80 192 80 L 8 80 C 2.6666666666666665 80 0 77.33333333333333 0 72 L 0 33 L -114 22 L 0 12 L 0 8 C 0 2.6666666666666665 2.6666666666666665 0 8 0"/>
|
||||
</g>
|
||||
</defs>
|
||||
<use xlink:href="#7e565a2554874c8693bee8c3b1fb4a96" xmlns:xlink="http://www.w3.org/1999/xlink" transform="translate(1, 1)" p:filter="url(#f46117a9847b442a848d6dc6d0f1ca02)" style="opacity: 0.6; visibility: hidden; display: none;" p:heavy="true" p:name="bgCopy" id="fba23d0e302047588af7e9e586dfb238"/>
|
||||
<use xlink:href="#7e565a2554874c8693bee8c3b1fb4a96" xmlns:xlink="http://www.w3.org/1999/xlink"/>
|
||||
<foreignObject x="8" y="15" width="184" height="50" p:name="text" id="d94b77112885453db437a00ff25500ca" style="font-family: "Liberation Sans",Arial,sans-serif; font-size: 13px; font-weight: normal; font-style: normal; text-decoration: none; fill: rgb(0, 0, 0); fill-opacity: 1; color: rgb(0, 0, 0); opacity: 1; text-align: center;"><div xmlns="http://www.w3.org/1999/xhtml"><span style="font-family: Consolas;">data_bind<br />styles_link / styles<br />classes_link / classes</span><br /></div></foreignObject>
|
||||
</g><g p:type="Shape" p:def="Evolus.Common:Balloon" id="6f1c4f61a1fb4f14a28d1793b958ba0a" transform="matrix(1,0,0,1,397,120)" p:sizing-ox="369.5" p:sizing-oy="120.5" p:sizing-ow="200" p:sizing-oh="80"><p:metadata><p:property name="box"><![CDATA[200,80]]></p:property><p:property name="withBlur"><![CDATA[false]]></p:property><p:property name="radius"><![CDATA[8,0]]></p:property><p:property name="leftStart"><![CDATA[0,12]]></p:property><p:property name="leftEnd"><![CDATA[0,33]]></p:property><p:property name="rightStart"><![CDATA[200,12]]></p:property><p:property name="rightEnd"><![CDATA[200,33]]></p:property><p:property name="topStart"><![CDATA[12,0]]></p:property><p:property name="topEnd"><![CDATA[33,0]]></p:property><p:property name="bottomStart"><![CDATA[12,80]]></p:property><p:property name="bottomEnd"><![CDATA[33,80]]></p:property><p:property name="pin"><![CDATA[-28,23]]></p:property><p:property name="fillColor"><![CDATA[#FFFFFFFF]]></p:property><p:property name="strokeColor"><![CDATA[#1B3280FF]]></p:property><p:property name="strokeStyle"><![CDATA[2|]]></p:property><p:property name="textContent"><![CDATA[<span style="font-family: Consolas;">data_bind<br />styles_content / styles<br />classes_content / classes</span><br />]]></p:property><p:property name="textFont"><![CDATA["Liberation Sans",Arial,sans-serif|normal|normal|13px|none]]></p:property><p:property name="textColor"><![CDATA[#000000FF]]></p:property><p:property name="textAlign"><![CDATA[1,1]]></p:property></p:metadata>
|
||||
|
||||
<defs>
|
||||
<filter height="1.2558399" y="-0.12792" width="1.06396" x="-0.03198" p:name="imageShading" id="acf275ea0a954d79ae41107f58d208ae">
|
||||
<feGaussianBlur stdDeviation="1.3325" in="SourceAlpha"/>
|
||||
</filter>
|
||||
<g p:name="container" id="a75b69e48d5e40f4b6150b1ec2953af3">
|
||||
<path transform="translate(0.5 0.5)" style="stroke-width: 2; fill: rgb(255, 255, 255); fill-opacity: 1; stroke: rgb(27, 50, 128); stroke-opacity: 1;" p:name="rect" id="eb3218f33a0b49fb8ec0ad9f86d2872a" d="M 8 0 L 192 0 C 197.33333333333334 0 200 2.6666666666666665 200 8 L 200 72 C 200 77.33333333333333 197.33333333333334 80 192 80 L 8 80 C 2.6666666666666665 80 0 77.33333333333333 0 72 L 0 33 L -28 23 L 0 12 L 0 8 C 0 2.6666666666666665 2.6666666666666665 0 8 0"/>
|
||||
</g>
|
||||
</defs>
|
||||
<use xlink:href="#a75b69e48d5e40f4b6150b1ec2953af3" xmlns:xlink="http://www.w3.org/1999/xlink" transform="translate(1, 1)" p:filter="url(#acf275ea0a954d79ae41107f58d208ae)" style="opacity: 0.6; visibility: hidden; display: none;" p:heavy="true" p:name="bgCopy" id="809f63827dbe473db68c768a9299d7be"/>
|
||||
<use xlink:href="#a75b69e48d5e40f4b6150b1ec2953af3" xmlns:xlink="http://www.w3.org/1999/xlink"/>
|
||||
<foreignObject x="8" y="15" width="184" height="50" p:name="text" id="31d16c095ee849c791565b6c88b93fad" style="font-family: "Liberation Sans",Arial,sans-serif; font-size: 13px; font-weight: normal; font-style: normal; text-decoration: none; fill: rgb(0, 0, 0); fill-opacity: 1; color: rgb(0, 0, 0); opacity: 1; text-align: center;"><div xmlns="http://www.w3.org/1999/xhtml"><span style="font-family: Consolas;">data_bind<br />styles_content / styles<br />classes_content / classes</span><br /></div></foreignObject>
|
||||
</g></g></Content></Page><Page><Properties><Property name="name">settings</Property><Property name="id">1421410253180_3579</Property><Property name="width">1531</Property><Property name="height">847</Property><Property name="dimBackground"/><Property name="transparentBackground">true</Property><Property name="backgroundColor">#FFFFFFFF</Property><Property name="background">transparent</Property></Properties><Content><g xmlns="http://www.w3.org/2000/svg" p:type="Group" xmlns:p="http://www.evolus.vn/Namespace/Pencil" transform="translate(323,143)" id="7395842d34de4079b3029fbb8f377213" p:sizing-gow="769.5" p:sizing-goh="390"><g p:type="Shape" p:def="Evolus.Common:RoundedRect" id="5267d389e1714536a6262df513ff7665" transform="matrix(1,0,0,1,-1,-1)" p:sizing-ox="0" p:sizing-oy="0" p:sizing-ow="144" p:sizing-oh="392"><p:metadata><p:property name="box"><![CDATA[144,392]]></p:property><p:property name="withBlur"><![CDATA[false]]></p:property><p:property name="radius"><![CDATA[0,0]]></p:property><p:property name="textPadding"><![CDATA[0,49]]></p:property><p:property name="fillColor"><![CDATA[#CCCCCCFF]]></p:property><p:property name="strokeColor"><![CDATA[#000000FF]]></p:property><p:property name="strokeStyle"><![CDATA[2|]]></p:property><p:property name="textContent"><![CDATA[
|
||||
]]></p:property><p:property name="textFont"><![CDATA["Liberation Sans",Arial,sans-serif|normal|normal|13px|none]]></p:property><p:property name="textColor"><![CDATA[#000000FF]]></p:property><p:property name="textAlign"><![CDATA[1,1]]></p:property></p:metadata>
|
||||
|
||||
<defs>
|
||||
<rect width="142" height="390" rx="0" ry="0" x="0" y="0" style="stroke-width: 2; fill: rgb(204, 204, 204); fill-opacity: 1; stroke: rgb(0, 0, 0); stroke-opacity: 1;" p:name="rrRect" id="cb16e9a309e341f1ba7f6440a0483dc7" transform="translate(1,1)"/>
|
||||
<filter height="1.2558399" y="-0.12792" width="1.06396" x="-0.03198" p:name="shadingFilter" id="54e55b5fad5d4a3995c3806b790f2d05">
|
||||
<feGaussianBlur stdDeviation="1" in="SourceAlpha"/>
|
||||
</filter>
|
||||
</defs>
|
||||
<use xlink:href="#cb16e9a309e341f1ba7f6440a0483dc7" xmlns:xlink="http://www.w3.org/1999/xlink" transform="translate(2, 2)" p:filter="url(#54e55b5fad5d4a3995c3806b790f2d05)" style="opacity: 0.5; visibility: hidden; display: none;" p:heavy="true" p:name="bgCopy" id="904bde4e72cb4b5aa6cb5b963c339bdf"/>
|
||||
<use xlink:href="#cb16e9a309e341f1ba7f6440a0483dc7" xmlns:xlink="http://www.w3.org/1999/xlink"/>
|
||||
<foreignObject x="49" y="196" width="46" height="0" p:name="text" id="e13fe7a85e1a4ca081470478b747bc8c" style="font-family: "Liberation Sans",Arial,sans-serif; font-size: 13px; font-weight: normal; font-style: normal; text-decoration: none; fill: rgb(0, 0, 0); fill-opacity: 1; color: rgb(0, 0, 0); opacity: 1; text-align: center;"><div xmlns="http://www.w3.org/1999/xhtml">
|
||||
</div></foreignObject>
|
||||
</g><g p:type="Shape" p:def="Evolus.Common:RoundedRect" id="00107838b5c846ac87f4bbc67a235524" transform="matrix(1,0,0,1,143,-1)" p:sizing-ox="144" p:sizing-oy="0" p:sizing-ow="416" p:sizing-oh="392"><p:metadata><p:property name="box"><![CDATA[416,392]]></p:property><p:property name="withBlur"><![CDATA[false]]></p:property><p:property name="radius"><![CDATA[0,0]]></p:property><p:property name="textPadding"><![CDATA[0,49]]></p:property><p:property name="fillColor"><![CDATA[#CCCCCCFF]]></p:property><p:property name="strokeColor"><![CDATA[#000000FF]]></p:property><p:property name="strokeStyle"><![CDATA[2|]]></p:property><p:property name="textContent"><![CDATA[
|
||||
]]></p:property><p:property name="textFont"><![CDATA["Liberation Sans",Arial,sans-serif|normal|normal|13px|none]]></p:property><p:property name="textColor"><![CDATA[#000000FF]]></p:property><p:property name="textAlign"><![CDATA[1,1]]></p:property></p:metadata>
|
||||
|
||||
<defs>
|
||||
<rect width="414" height="390" rx="0" ry="0" x="0" y="0" style="stroke-width: 2; fill: rgb(204, 204, 204); fill-opacity: 1; stroke: rgb(0, 0, 0); stroke-opacity: 1;" p:name="rrRect" id="cbe5e6469a9647b9a54b064a30ee0c35" transform="translate(1,1)"/>
|
||||
<filter height="1.2558399" y="-0.12792" width="1.06396" x="-0.03198" p:name="shadingFilter" id="8d5eca961f8d499abcbcdb90c9f38da8">
|
||||
<feGaussianBlur stdDeviation="1" in="SourceAlpha"/>
|
||||
</filter>
|
||||
</defs>
|
||||
<use xlink:href="#cbe5e6469a9647b9a54b064a30ee0c35" xmlns:xlink="http://www.w3.org/1999/xlink" transform="translate(2, 2)" p:filter="url(#8d5eca961f8d499abcbcdb90c9f38da8)" style="opacity: 0.5; visibility: hidden; display: none;" p:heavy="true" p:name="bgCopy" id="34141c77145742d3810b0e7474f6e012"/>
|
||||
<use xlink:href="#cbe5e6469a9647b9a54b064a30ee0c35" xmlns:xlink="http://www.w3.org/1999/xlink"/>
|
||||
<foreignObject x="49" y="196" width="318" height="0" p:name="text" id="41ef32306e1e4d9da9165746657a5965" style="font-family: "Liberation Sans",Arial,sans-serif; font-size: 13px; font-weight: normal; font-style: normal; text-decoration: none; fill: rgb(0, 0, 0); fill-opacity: 1; color: rgb(0, 0, 0); opacity: 1; text-align: center;"><div xmlns="http://www.w3.org/1999/xhtml">
|
||||
</div></foreignObject>
|
||||
</g><g p:type="Shape" p:def="Evolus.Common:RoundedRect" id="dfc036f4a3394f48abfd564cd42b2b0e" transform="matrix(1,0,0,1,159,15)" p:sizing-ox="160" p:sizing-oy="16" p:sizing-ow="384" p:sizing-oh="360"><p:metadata><p:property name="box"><![CDATA[384,360]]></p:property><p:property name="withBlur"><![CDATA[false]]></p:property><p:property name="radius"><![CDATA[0,0]]></p:property><p:property name="textPadding"><![CDATA[0,45]]></p:property><p:property name="fillColor"><![CDATA[#FFFFFFFF]]></p:property><p:property name="strokeColor"><![CDATA[#000000FF]]></p:property><p:property name="strokeStyle"><![CDATA[2|]]></p:property><p:property name="textContent"><![CDATA[
|
||||
]]></p:property><p:property name="textFont"><![CDATA["Liberation Sans",Arial,sans-serif|normal|normal|13px|none]]></p:property><p:property name="textColor"><![CDATA[#000000FF]]></p:property><p:property name="textAlign"><![CDATA[1,1]]></p:property></p:metadata>
|
||||
|
||||
<defs>
|
||||
<rect width="382" height="358" rx="0" ry="0" x="0" y="0" style="stroke-width: 2; fill: rgb(255, 255, 255); fill-opacity: 1; stroke: rgb(0, 0, 0); stroke-opacity: 1;" p:name="rrRect" id="29dc0c2600da465fb63911073183eafe" transform="translate(1,1)"/>
|
||||
<filter height="1.2558399" y="-0.12792" width="1.06396" x="-0.03198" p:name="shadingFilter" id="451d197a117c48f7a68d1c1be41304e5">
|
||||
<feGaussianBlur stdDeviation="1" in="SourceAlpha"/>
|
||||
</filter>
|
||||
</defs>
|
||||
<use xlink:href="#29dc0c2600da465fb63911073183eafe" xmlns:xlink="http://www.w3.org/1999/xlink" transform="translate(2, 2)" p:filter="url(#451d197a117c48f7a68d1c1be41304e5)" style="opacity: 0.5; visibility: hidden; display: none;" p:heavy="true" p:name="bgCopy" id="6c260c83376042eda5122f600dac0784"/>
|
||||
<use xlink:href="#29dc0c2600da465fb63911073183eafe" xmlns:xlink="http://www.w3.org/1999/xlink"/>
|
||||
<foreignObject x="45" y="180" width="294" height="0" p:name="text" id="cb978529c3144a3085a502964a33bfa4" style="font-family: "Liberation Sans",Arial,sans-serif; font-size: 13px; font-weight: normal; font-style: normal; text-decoration: none; fill: rgb(0, 0, 0); fill-opacity: 1; color: rgb(0, 0, 0); opacity: 1; text-align: center;"><div xmlns="http://www.w3.org/1999/xhtml">
|
||||
</div></foreignObject>
|
||||
</g><g p:type="Shape" p:def="Evolus.Common:RoundedRect" id="f2e9506fa0ed4466890d1042d5ac901e" transform="matrix(1,0,0,1,15,175)" p:sizing-ox="16" p:sizing-oy="176" p:sizing-ow="112" p:sizing-oh="40"><p:metadata><p:property name="box"><![CDATA[112,40]]></p:property><p:property name="withBlur"><![CDATA[false]]></p:property><p:property name="radius"><![CDATA[0,0]]></p:property><p:property name="textPadding"><![CDATA[0,5]]></p:property><p:property name="fillColor"><![CDATA[#CCCCCCFF]]></p:property><p:property name="strokeColor"><![CDATA[#000000FF]]></p:property><p:property name="strokeStyle"><![CDATA[2|]]></p:property><p:property name="textContent"><![CDATA[
|
||||
]]></p:property><p:property name="textFont"><![CDATA["Liberation Sans",Arial,sans-serif|normal|normal|13px|none]]></p:property><p:property name="textColor"><![CDATA[#000000FF]]></p:property><p:property name="textAlign"><![CDATA[1,1]]></p:property></p:metadata>
|
||||
|
||||
<defs>
|
||||
<rect width="110" height="38" rx="0" ry="0" x="0" y="0" style="stroke-width: 2; fill: rgb(204, 204, 204); fill-opacity: 1; stroke: rgb(0, 0, 0); stroke-opacity: 1;" p:name="rrRect" id="76d805dced5640149e7d9b75b58e9479" transform="translate(1,1)"/>
|
||||
<filter height="1.2558399" y="-0.12792" width="1.06396" x="-0.03198" p:name="shadingFilter" id="4fc6940222be4d1bb3d1bba581209b59">
|
||||
<feGaussianBlur stdDeviation="1" in="SourceAlpha"/>
|
||||
</filter>
|
||||
</defs>
|
||||
<use xlink:href="#76d805dced5640149e7d9b75b58e9479" xmlns:xlink="http://www.w3.org/1999/xlink" transform="translate(2, 2)" p:filter="url(#4fc6940222be4d1bb3d1bba581209b59)" style="opacity: 0.5; visibility: hidden; display: none;" p:heavy="true" p:name="bgCopy" id="60a990d0eb9e4ea69c10c41791e58323"/>
|
||||
<use xlink:href="#76d805dced5640149e7d9b75b58e9479" xmlns:xlink="http://www.w3.org/1999/xlink"/>
|
||||
<foreignObject x="5" y="20" width="102" height="0" p:name="text" id="54e8a52460b84409b8c52e713918e527" style="font-family: "Liberation Sans",Arial,sans-serif; font-size: 13px; font-weight: normal; font-style: normal; text-decoration: none; fill: rgb(0, 0, 0); fill-opacity: 1; color: rgb(0, 0, 0); opacity: 1; text-align: center;"><div xmlns="http://www.w3.org/1999/xhtml">
|
||||
</div></foreignObject>
|
||||
</g><g xmlns="http://www.w3.org/2000/svg" p:type="Shape" xmlns:p="http://www.evolus.vn/Namespace/Pencil" p:def="Evolus.Common:PlainTextV2" id="3a5c9441f4dd450489ef6c32b84277bb" transform="matrix(1,0,0,1,22,202)" p:sizing-ox="21.859375" p:sizing-oy="180" p:sizing-ow="79.7890625" p:sizing-oh="28"><p:metadata><p:property name="disabled"><![CDATA[false]]></p:property><p:property name="width"><![CDATA[100,0]]></p:property><p:property name="fixedWidth"><![CDATA[false]]></p:property><p:property name="label"><![CDATA[<name>]]></p:property><p:property name="textColor"><![CDATA[#000000FF]]></p:property><p:property name="textFont"><![CDATA[Open Sans|bold|normal|20px|none]]></p:property><p:property name="textAlign"><![CDATA[0,0]]></p:property></p:metadata>
|
||||
<rect x="0" y="0" style="fill: none; stroke: none; visibility: hidden; display: none;" p:name="bgRect" id="49590ece8832421093f480572615621e" width="0" height="0"/>
|
||||
<text xml:space="preserve" p:name="text" id="638c493afd75474bba33ba6ed7f6b418" style="fill: rgb(0, 0, 0); fill-opacity: 1; font-family: Open Sans; font-size: 20px; font-weight: bold; font-style: normal; text-decoration: none;"><tspan x="0" y="0"><name></tspan></text>
|
||||
</g><g xmlns="http://www.w3.org/2000/svg" p:type="Shape" xmlns:p="http://www.evolus.vn/Namespace/Pencil" p:def="Evolus.Common:PlainTextV2" id="ebd3473021234611aefc9fa212dcc943" transform="matrix(1,0,0,1,175,37)" p:sizing-ox="173.3984375" p:sizing-oy="25" p:sizing-ow="60" p:sizing-oh="16"><p:metadata><p:property name="disabled"><![CDATA[false]]></p:property><p:property name="width"><![CDATA[100,0]]></p:property><p:property name="fixedWidth"><![CDATA[false]]></p:property><p:property name="label"><![CDATA[template]]></p:property><p:property name="textColor"><![CDATA[#000000FF]]></p:property><p:property name="textFont"><![CDATA[Consolas|normal|normal|13px|none]]></p:property><p:property name="textAlign"><![CDATA[0,0]]></p:property></p:metadata>
|
||||
<rect x="0" y="0" style="fill: none; stroke: none; visibility: hidden; display: none;" p:name="bgRect" id="a7f7b8da20384df091964756d22bd5df" width="0" height="0"/>
|
||||
<text xml:space="preserve" p:name="text" id="85ffc835cc2f4e8ea41c1857b55af53e" style="fill: rgb(0, 0, 0); fill-opacity: 1; font-family: Consolas; font-size: 13px; font-weight: normal; font-style: normal; text-decoration: none;"><tspan x="0" y="0">template</tspan></text>
|
||||
</g><g p:type="Shape" p:def="Evolus.Common:Balloon" id="a0d9b8a91b8d4913bc11cca99c86a459" transform="matrix(1,0,0,1,569,15)" p:sizing-ox="541.5" p:sizing-oy="15.5" p:sizing-ow="200" p:sizing-oh="80"><p:metadata><p:property name="box"><![CDATA[200,80]]></p:property><p:property name="withBlur"><![CDATA[false]]></p:property><p:property name="radius"><![CDATA[8,0]]></p:property><p:property name="leftStart"><![CDATA[0,12]]></p:property><p:property name="leftEnd"><![CDATA[0,33]]></p:property><p:property name="rightStart"><![CDATA[200,12]]></p:property><p:property name="rightEnd"><![CDATA[200,33]]></p:property><p:property name="topStart"><![CDATA[12,0]]></p:property><p:property name="topEnd"><![CDATA[33,0]]></p:property><p:property name="bottomStart"><![CDATA[12,80]]></p:property><p:property name="bottomEnd"><![CDATA[33,80]]></p:property><p:property name="pin"><![CDATA[-28,23]]></p:property><p:property name="fillColor"><![CDATA[#FFFFFFFF]]></p:property><p:property name="strokeColor"><![CDATA[#1B3280FF]]></p:property><p:property name="strokeStyle"><![CDATA[2|]]></p:property><p:property name="textContent"><![CDATA[<span style="font-family: Consolas;">data_bind<br />styles_content / styles<br />classes_content / classes<br /></span>]]></p:property><p:property name="textFont"><![CDATA["Liberation Sans",Arial,sans-serif|normal|normal|13px|none]]></p:property><p:property name="textColor"><![CDATA[#000000FF]]></p:property><p:property name="textAlign"><![CDATA[1,1]]></p:property></p:metadata>
|
||||
|
||||
<defs>
|
||||
<filter height="1.2558399" y="-0.12792" width="1.06396" x="-0.03198" p:name="imageShading" id="2f5319b357c84839b3986162a515c00e">
|
||||
<feGaussianBlur stdDeviation="1.3325" in="SourceAlpha"/>
|
||||
</filter>
|
||||
<g p:name="container" id="9c15a0a8bd764d0187e813cd78f906d4">
|
||||
<path transform="translate(0.5 0.5)" style="stroke-width: 2; fill: rgb(255, 255, 255); fill-opacity: 1; stroke: rgb(27, 50, 128); stroke-opacity: 1;" p:name="rect" id="0f6d812601a94e60b7f5e3f1d859d630" d="M 8 0 L 192 0 C 197.33333333333334 0 200 2.6666666666666665 200 8 L 200 72 C 200 77.33333333333333 197.33333333333334 80 192 80 L 8 80 C 2.6666666666666665 80 0 77.33333333333333 0 72 L 0 33 L -28 23 L 0 12 L 0 8 C 0 2.6666666666666665 2.6666666666666665 0 8 0"/>
|
||||
</g>
|
||||
</defs>
|
||||
<use xlink:href="#9c15a0a8bd764d0187e813cd78f906d4" xmlns:xlink="http://www.w3.org/1999/xlink" transform="translate(1, 1)" p:filter="url(#2f5319b357c84839b3986162a515c00e)" style="opacity: 0.6; visibility: hidden; display: none;" p:heavy="true" p:name="bgCopy" id="4a90c69f97384e74ae968cff348b2ed9"/>
|
||||
<use xlink:href="#9c15a0a8bd764d0187e813cd78f906d4" xmlns:xlink="http://www.w3.org/1999/xlink"/>
|
||||
<foreignObject x="8" y="15" width="184" height="50" p:name="text" id="eac648dfa87d4f719c8d271b82f1c930" style="font-family: "Liberation Sans",Arial,sans-serif; font-size: 13px; font-weight: normal; font-style: normal; text-decoration: none; fill: rgb(0, 0, 0); fill-opacity: 1; color: rgb(0, 0, 0); opacity: 1; text-align: center;"><div xmlns="http://www.w3.org/1999/xhtml"><span style="font-family: Consolas;">data_bind<br />styles_content / styles<br />classes_content / classes<br /></span></div></foreignObject>
|
||||
</g><g p:type="Shape" p:def="Evolus.Common:Balloon" id="bda1534d936b4b1a8851bd7316333963" transform="matrix(1,0,0,1,137,175)" p:sizing-ox="125.5" p:sizing-oy="175.5" p:sizing-ow="200" p:sizing-oh="80"><p:metadata><p:property name="box"><![CDATA[200,80]]></p:property><p:property name="withBlur"><![CDATA[false]]></p:property><p:property name="radius"><![CDATA[8,0]]></p:property><p:property name="leftStart"><![CDATA[0,12]]></p:property><p:property name="leftEnd"><![CDATA[0,33]]></p:property><p:property name="rightStart"><![CDATA[200,12]]></p:property><p:property name="rightEnd"><![CDATA[200,33]]></p:property><p:property name="topStart"><![CDATA[12,0]]></p:property><p:property name="topEnd"><![CDATA[33,0]]></p:property><p:property name="bottomStart"><![CDATA[12,80]]></p:property><p:property name="bottomEnd"><![CDATA[33,80]]></p:property><p:property name="pin"><![CDATA[-12,23]]></p:property><p:property name="fillColor"><![CDATA[#FFFFFFFF]]></p:property><p:property name="strokeColor"><![CDATA[#1B3280FF]]></p:property><p:property name="strokeStyle"><![CDATA[2|]]></p:property><p:property name="textContent"><![CDATA[<span style="font-family: Consolas;">data_bind<br />styles_link / styles<br />classes_link / classes</span><br />]]></p:property><p:property name="textFont"><![CDATA["Liberation Sans",Arial,sans-serif|normal|normal|13px|none]]></p:property><p:property name="textColor"><![CDATA[#000000FF]]></p:property><p:property name="textAlign"><![CDATA[1,1]]></p:property></p:metadata>
|
||||
|
||||
<defs>
|
||||
<filter height="1.2558399" y="-0.12792" width="1.06396" x="-0.03198" p:name="imageShading" id="7190c91fd5a0498faee46f6a07e4ee36">
|
||||
<feGaussianBlur stdDeviation="1.3325" in="SourceAlpha"/>
|
||||
</filter>
|
||||
<g p:name="container" id="e38975d273874cd7ac31fa1c63716ec1">
|
||||
<path transform="translate(0.5 0.5)" style="stroke-width: 2; fill: rgb(255, 255, 255); fill-opacity: 1; stroke: rgb(27, 50, 128); stroke-opacity: 1;" p:name="rect" id="72ab543eb28a48e6bedf116266c72fbb" d="M 8 0 L 192 0 C 197.33333333333334 0 200 2.6666666666666665 200 8 L 200 72 C 200 77.33333333333333 197.33333333333334 80 192 80 L 8 80 C 2.6666666666666665 80 0 77.33333333333333 0 72 L 0 33 L -12 23 L 0 12 L 0 8 C 0 2.6666666666666665 2.6666666666666665 0 8 0"/>
|
||||
</g>
|
||||
</defs>
|
||||
<use xlink:href="#e38975d273874cd7ac31fa1c63716ec1" xmlns:xlink="http://www.w3.org/1999/xlink" transform="translate(1, 1)" p:filter="url(#7190c91fd5a0498faee46f6a07e4ee36)" style="opacity: 0.6; visibility: hidden; display: none;" p:heavy="true" p:name="bgCopy" id="f143de029bc146c7a3a7bca494562509"/>
|
||||
<use xlink:href="#e38975d273874cd7ac31fa1c63716ec1" xmlns:xlink="http://www.w3.org/1999/xlink"/>
|
||||
<foreignObject x="8" y="15" width="184" height="50" p:name="text" id="9ba09cfb0e0643c69291c6942df8c8c9" style="font-family: "Liberation Sans",Arial,sans-serif; font-size: 13px; font-weight: normal; font-style: normal; text-decoration: none; fill: rgb(0, 0, 0); fill-opacity: 1; color: rgb(0, 0, 0); opacity: 1; text-align: center;"><div xmlns="http://www.w3.org/1999/xhtml"><span style="font-family: Consolas;">data_bind<br />styles_link / styles<br />classes_link / classes</span><br /></div></foreignObject>
|
||||
</g></g></Content></Page><Page><Properties><Property name="name">navbar</Property><Property name="id">1421410510071_9693</Property><Property name="width">1531</Property><Property name="height">847</Property><Property name="dimBackground"/><Property name="transparentBackground">true</Property><Property name="backgroundColor">#FFFFFFFF</Property><Property name="background">transparent</Property></Properties><Content><g xmlns="http://www.w3.org/2000/svg" p:type="Group" xmlns:p="http://www.evolus.vn/Namespace/Pencil" transform="translate(126,121)" id="31a617e276fe4161a5e3b70380bb0e34" p:sizing-gow="490.5" p:sizing-goh="78"><g p:type="Shape" p:def="Evolus.Common:RoundedRect" id="fa8da9aed28744f5af9f11285080496c" transform="matrix(1,0,0,1,-1,-1)" p:sizing-ox="0" p:sizing-oy="0" p:sizing-ow="283" p:sizing-oh="80"><p:metadata><p:property name="box"><![CDATA[283,80]]></p:property><p:property name="withBlur"><![CDATA[false]]></p:property><p:property name="radius"><![CDATA[0,0]]></p:property><p:property name="textPadding"><![CDATA[0,10]]></p:property><p:property name="fillColor"><![CDATA[#CCCCCCFF]]></p:property><p:property name="strokeColor"><![CDATA[#000000FF]]></p:property><p:property name="strokeStyle"><![CDATA[2|]]></p:property><p:property name="textContent"><![CDATA[
|
||||
]]></p:property><p:property name="textFont"><![CDATA["Liberation Sans",Arial,sans-serif|normal|normal|13px|none]]></p:property><p:property name="textColor"><![CDATA[#000000FF]]></p:property><p:property name="textAlign"><![CDATA[1,1]]></p:property></p:metadata>
|
||||
|
||||
<defs>
|
||||
<rect width="281" height="78" rx="0" ry="0" x="0" y="0" style="stroke-width: 2; fill: rgb(204, 204, 204); fill-opacity: 1; stroke: rgb(0, 0, 0); stroke-opacity: 1;" p:name="rrRect" id="ea12bfd96e974a0f8f92afced67bdd6f" transform="translate(1,1)"/>
|
||||
<filter height="1.2558399" y="-0.12792" width="1.06396" x="-0.03198" p:name="shadingFilter" id="d5043318357b49a1bb219a00f76eddd9">
|
||||
<feGaussianBlur stdDeviation="1" in="SourceAlpha"/>
|
||||
</filter>
|
||||
</defs>
|
||||
<use xlink:href="#ea12bfd96e974a0f8f92afced67bdd6f" xmlns:xlink="http://www.w3.org/1999/xlink" transform="translate(2, 2)" p:filter="url(#d5043318357b49a1bb219a00f76eddd9)" style="opacity: 0.5; visibility: hidden; display: none;" p:heavy="true" p:name="bgCopy" id="0d42ff0970ff472aa4c006ef85d8e87a"/>
|
||||
<use xlink:href="#ea12bfd96e974a0f8f92afced67bdd6f" xmlns:xlink="http://www.w3.org/1999/xlink"/>
|
||||
<foreignObject x="10" y="40" width="263" height="0" p:name="text" id="40018080392b490da490d8b286b95c41" style="font-family: "Liberation Sans",Arial,sans-serif; font-size: 13px; font-weight: normal; font-style: normal; text-decoration: none; fill: rgb(0, 0, 0); fill-opacity: 1; color: rgb(0, 0, 0); opacity: 1; text-align: center;"><div xmlns="http://www.w3.org/1999/xhtml">
|
||||
</div></foreignObject>
|
||||
</g><g p:type="Shape" p:def="Evolus.Common:RoundedRect" id="5b845ca54039496591b80db2010a32bc" transform="matrix(1,0,0,1,122,15)" p:sizing-ox="123" p:sizing-oy="16" p:sizing-ow="144" p:sizing-oh="48"><p:metadata><p:property name="box"><![CDATA[144,48]]></p:property><p:property name="withBlur"><![CDATA[false]]></p:property><p:property name="radius"><![CDATA[0,0]]></p:property><p:property name="textPadding"><![CDATA[0,6]]></p:property><p:property name="fillColor"><![CDATA[#FFFFFFFF]]></p:property><p:property name="strokeColor"><![CDATA[#000000FF]]></p:property><p:property name="strokeStyle"><![CDATA[2|]]></p:property><p:property name="textContent"><![CDATA[
|
||||
]]></p:property><p:property name="textFont"><![CDATA["Liberation Sans",Arial,sans-serif|normal|normal|13px|none]]></p:property><p:property name="textColor"><![CDATA[#000000FF]]></p:property><p:property name="textAlign"><![CDATA[1,1]]></p:property></p:metadata>
|
||||
|
||||
<defs>
|
||||
<rect width="142" height="46" rx="0" ry="0" x="0" y="0" style="stroke-width: 2; fill: rgb(255, 255, 255); fill-opacity: 1; stroke: rgb(0, 0, 0); stroke-opacity: 1;" p:name="rrRect" id="480225b90d8842139e20649d22caa757" transform="translate(1,1)"/>
|
||||
<filter height="1.2558399" y="-0.12792" width="1.06396" x="-0.03198" p:name="shadingFilter" id="db76ffd36668492aa45c3dacb4ed2d52">
|
||||
<feGaussianBlur stdDeviation="1" in="SourceAlpha"/>
|
||||
</filter>
|
||||
</defs>
|
||||
<use xlink:href="#480225b90d8842139e20649d22caa757" xmlns:xlink="http://www.w3.org/1999/xlink" transform="translate(2, 2)" p:filter="url(#db76ffd36668492aa45c3dacb4ed2d52)" style="opacity: 0.5; visibility: hidden; display: none;" p:heavy="true" p:name="bgCopy" id="125928c2b681488ba446768b095a76a5"/>
|
||||
<use xlink:href="#480225b90d8842139e20649d22caa757" xmlns:xlink="http://www.w3.org/1999/xlink"/>
|
||||
<foreignObject x="6" y="24" width="132" height="0" p:name="text" id="de5cbf018c224ba3adf8aed52ebc5f77" style="font-family: "Liberation Sans",Arial,sans-serif; font-size: 13px; font-weight: normal; font-style: normal; text-decoration: none; fill: rgb(0, 0, 0); fill-opacity: 1; color: rgb(0, 0, 0); opacity: 1; text-align: center;"><div xmlns="http://www.w3.org/1999/xhtml">
|
||||
</div></foreignObject>
|
||||
</g><g xmlns="http://www.w3.org/2000/svg" p:type="Shape" xmlns:p="http://www.evolus.vn/Namespace/Pencil" p:def="Evolus.Common:PlainTextV2" id="3637818ac51540849a753285e83d950d" transform="matrix(1,0,0,1,132,35)" p:sizing-ox="130.3984375" p:sizing-oy="23" p:sizing-ow="60" p:sizing-oh="16"><p:metadata><p:property name="disabled"><![CDATA[false]]></p:property><p:property name="width"><![CDATA[100,0]]></p:property><p:property name="fixedWidth"><![CDATA[false]]></p:property><p:property name="label"><![CDATA[template]]></p:property><p:property name="textColor"><![CDATA[#000000FF]]></p:property><p:property name="textFont"><![CDATA[Consolas|normal|normal|13px|none]]></p:property><p:property name="textAlign"><![CDATA[0,0]]></p:property></p:metadata>
|
||||
<rect x="0" y="0" style="fill: none; stroke: none; visibility: hidden; display: none;" p:name="bgRect" id="6f91157aa1354619ab2b7960baeb8cba" width="0" height="0"/>
|
||||
<text xml:space="preserve" p:name="text" id="638334d0a39b4b39a7e4806254e2e418" style="fill: rgb(0, 0, 0); fill-opacity: 1; font-family: Consolas; font-size: 13px; font-weight: normal; font-style: normal; text-decoration: none;"><tspan x="0" y="0">template</tspan></text>
|
||||
</g><g p:type="Shape" p:def="Evolus.Common:Balloon" id="c0be16ae150d4dc68b7bffdc19d19262" transform="matrix(1,0,0,1,294,7)" p:sizing-ox="266.5" p:sizing-oy="7.5" p:sizing-ow="196" p:sizing-oh="64"><p:metadata><p:property name="box"><![CDATA[196,64]]></p:property><p:property name="withBlur"><![CDATA[false]]></p:property><p:property name="radius"><![CDATA[7.84,0]]></p:property><p:property name="leftStart"><![CDATA[0,9.84]]></p:property><p:property name="leftEnd"><![CDATA[0,26.400000000000002]]></p:property><p:property name="rightStart"><![CDATA[196,9.84]]></p:property><p:property name="rightEnd"><![CDATA[196,26.400000000000002]]></p:property><p:property name="topStart"><![CDATA[11.76,0]]></p:property><p:property name="topEnd"><![CDATA[32.339999999999996,0]]></p:property><p:property name="bottomStart"><![CDATA[11.76,64]]></p:property><p:property name="bottomEnd"><![CDATA[32.339999999999996,64]]></p:property><p:property name="pin"><![CDATA[-28,18]]></p:property><p:property name="fillColor"><![CDATA[#FFFFFFFF]]></p:property><p:property name="strokeColor"><![CDATA[#1B3280FF]]></p:property><p:property name="strokeStyle"><![CDATA[2|]]></p:property><p:property name="textContent"><![CDATA[<span style="font-family: Consolas;">data_bind<br />styles<br />classes</span><br />]]></p:property><p:property name="textFont"><![CDATA["Liberation Sans",Arial,sans-serif|normal|normal|13px|none]]></p:property><p:property name="textColor"><![CDATA[#000000FF]]></p:property><p:property name="textAlign"><![CDATA[1,1]]></p:property></p:metadata>
|
||||
|
||||
<defs>
|
||||
<filter height="1.2558399" y="-0.12792" width="1.06396" x="-0.03198" p:name="imageShading" id="f3a0f53acfa3492abf13b69eb2bf8e75">
|
||||
<feGaussianBlur stdDeviation="1.3325" in="SourceAlpha"/>
|
||||
</filter>
|
||||
<g p:name="container" id="8eaa88f76ee748fdbb66142e124db376">
|
||||
<path transform="translate(0.5 0.5)" style="stroke-width: 2; fill: rgb(255, 255, 255); fill-opacity: 1; stroke: rgb(27, 50, 128); stroke-opacity: 1;" p:name="rect" id="e5ed7702279b485f83a84e170232b245" d="M 7.84 0 L 188.16 0 C 193.38666666666666 0 196 2.6133333333333333 196 7.84 L 196 56.16 C 196 61.38666666666667 193.38666666666666 64 188.16 64 L 7.84 64 C 2.6133333333333333 64 0 61.38666666666667 0 56.16 L 0 26.400000000000002 L -28 18 L 0 9.84 L 0 7.84 C 0 2.6133333333333333 2.6133333333333333 0 7.84 0"/>
|
||||
</g>
|
||||
</defs>
|
||||
<use xlink:href="#8eaa88f76ee748fdbb66142e124db376" xmlns:xlink="http://www.w3.org/1999/xlink" transform="translate(1, 1)" p:filter="url(#f3a0f53acfa3492abf13b69eb2bf8e75)" style="opacity: 0.6; visibility: hidden; display: none;" p:heavy="true" p:name="bgCopy" id="e7a7687af8d14f2888d588636e0cd333"/>
|
||||
<use xlink:href="#8eaa88f76ee748fdbb66142e124db376" xmlns:xlink="http://www.w3.org/1999/xlink"/>
|
||||
<foreignObject x="7.84" y="7" width="180.32" height="50" p:name="text" id="cdcded6607b7463ea18aa393da7520bc" style="font-family: "Liberation Sans",Arial,sans-serif; font-size: 13px; font-weight: normal; font-style: normal; text-decoration: none; fill: rgb(0, 0, 0); fill-opacity: 1; color: rgb(0, 0, 0); opacity: 1; text-align: center;"><div xmlns="http://www.w3.org/1999/xhtml"><span style="font-family: Consolas;">data_bind<br />styles<br />classes</span><br /></div></foreignObject>
|
||||
</g></g></Content></Page></Pages></Document>
|
||||
@@ -6,9 +6,9 @@ Welcome to OctoPrint's documentation!
|
||||
:alt: The OctoPrint Logo
|
||||
:align: right
|
||||
|
||||
This documentation is still in the process of being migrated from
|
||||
`OctoPrint's wiki <https://github.com/foosel/OctoPrint/wiki>`_, so also take
|
||||
a look there!
|
||||
This is a work in progress. The goal is to document OctoPrint's REST API, event system, configuration etc in a way that
|
||||
allows different documentation per development branch in Git, which so far did not scale well with the Github-Wiki-based
|
||||
approach.
|
||||
|
||||
Contents
|
||||
========
|
||||
@@ -16,13 +16,7 @@ Contents
|
||||
.. toctree::
|
||||
:maxdepth: 2
|
||||
|
||||
features/index.rst
|
||||
bundledplugins/index.rst
|
||||
configuration/index.rst
|
||||
api/index.rst
|
||||
events/index.rst
|
||||
development/index.rst
|
||||
plugins/index.rst
|
||||
modules/index.rst
|
||||
jsclientlib/index.rst
|
||||
|
||||
@@ -1,463 +0,0 @@
|
||||
.. _sec-jsclientlib-base:
|
||||
|
||||
:mod:`OctoPrintClient`
|
||||
----------------------
|
||||
|
||||
.. js:class:: OctoPrintClient([options])
|
||||
|
||||
Instantiates a new instance of the client library. Note that by default there's always an instance registered
|
||||
globally called ``OctoPrint``.
|
||||
|
||||
:param object options: An optional object of options to set :js:attr:`OctoPrintClient.options` to.
|
||||
|
||||
.. js:attribute:: OctoPrintClient.options
|
||||
|
||||
The client library instance's options. The following keys are currently supported:
|
||||
|
||||
``apikey``
|
||||
The API Key to use for requests against the OctoPrint API. Should usually be
|
||||
the anonymous UI API Key provided on the socket.
|
||||
|
||||
``baseurl``
|
||||
The base URL of the OctoPrint API
|
||||
|
||||
``locale``
|
||||
The locale to set in ``X-Locale`` headers on API requests. Useful for API
|
||||
endpoints that might return localized content.
|
||||
|
||||
.. js:attribute:: OctoPrintClient.plugins
|
||||
|
||||
Registration of client library components provided by plugins.
|
||||
|
||||
OctoPrint plugins should always register their client classes here using their plugin identifier as key via
|
||||
:js:func:`OctoPrintClient.registerPluginComponent`.
|
||||
|
||||
.. note::
|
||||
|
||||
The registration mechanism has changed slightly with OctoPrint 1.3.2 due to an otherwise unsolvable issue with
|
||||
allowing multiple clients to exist concurrently and still keeping the existing architecture intact.
|
||||
|
||||
The old mechanism works fine as long as you are only planning to offer your plugin client implementation on the
|
||||
default client instance ``OctoPrint``, however if you also want to support additional clients you'll need to
|
||||
use the implementation and registration approach as described below.
|
||||
|
||||
**Example:**
|
||||
|
||||
.. code-block:: javascript
|
||||
|
||||
(function (global, factory) {
|
||||
if (typeof define === "function" && define.amd) {
|
||||
define(["OctoPrintClient"], factory);
|
||||
} else {
|
||||
factory(window.OctoPrintClient);
|
||||
}
|
||||
})(window || this, function(OctoPrintClient) {
|
||||
var MyPluginClient = function(base) {
|
||||
this.base = base;
|
||||
};
|
||||
|
||||
MyPluginClient.prototype.someFunction = function() {
|
||||
// do something
|
||||
};
|
||||
|
||||
// further define API
|
||||
|
||||
OctoPrintClient.registerPluginComponent("myplugin", MyPluginClient);
|
||||
return MyPluginClient;
|
||||
});
|
||||
|
||||
.. js:function:: OctoPrintClient.getBaseUrl()
|
||||
|
||||
Returns the canonical base URL to use for OctoPrint's API. Uses the current value of
|
||||
:js:data:`OctoPrint.options.baseurl <OctoPrint.options>`. If that doesn't end in a ``/``,
|
||||
a trailing ``/`` will be appended to the URL before the result is returned.
|
||||
|
||||
:returns string: The base url to use to access OctoPrint's API.
|
||||
|
||||
.. js:function:: OctoPrintClient.getRequestHeaders(additional)
|
||||
|
||||
Generates a dictionary of HTTP headers to use for API requests against OctoPrint with all
|
||||
necessary headers and any additionally provided ones.
|
||||
|
||||
At the moment this entails setting the ``X-Api-Key`` header based on the current value of
|
||||
``OctoPrint.options.apikey`` at a minimum.
|
||||
|
||||
:param object additional: Additional headers to add to the request.
|
||||
:returns object: HTTP headers to use for requests.
|
||||
|
||||
.. js:function:: OctoPrintClient.ajax(method, url, opts)
|
||||
|
||||
Performs an AJAX request against the OctoPrint API, utilizing `jQuery's own ajax function <http://api.jquery.com/jquery.ajax/>`_.
|
||||
|
||||
The HTTP method to use may be defined through ``opts.method`` or - if that is not provided -- through the
|
||||
``method`` parameter. If neither is available, ``GET`` will be used.
|
||||
|
||||
The URL to perform the request against may be defined through ``opts.url`` or -- if that is not provided --
|
||||
through the ``url`` parameter. If neither is available, an empty string will be used (plain base URL). If the
|
||||
URL starts with ``http://`` or ``https://`` it will be used directly. Otherwise the return value of :js:func:`OctoPrint.getBaseUrl`
|
||||
will be prepended.
|
||||
|
||||
As headers everything returned by :js:func:`OctoPrint.getRequestHeaders` will be used. Additional headers to set
|
||||
may be defined by providing them through ``opts.headers``.
|
||||
|
||||
If ``opts.dataType`` is set, it will be used for setting the corresponding option on the jQuery ``ajax`` call, otherwise
|
||||
``json`` will be used.
|
||||
|
||||
Anything provided in the ``opts`` parameter will also be passed on to the jQuery ``ajax`` call.
|
||||
|
||||
:param string method: The HTTP method to use for the request (optional)
|
||||
:param string url: The URL to perform the request against (optional)
|
||||
:param object opts: Additional options to use for the request, see above for details (optional)
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. js:function:: OctoPrintClient.ajaxWithData(method, url, data, opts)
|
||||
|
||||
Performs an AJAX request against the OctoPrint API, including the provided ``data`` in the body of the request.
|
||||
|
||||
Utilizes :js:func:`OctoPrint.ajax`, see that for more details.
|
||||
|
||||
:param string method: The HTTP method to use for the request (optional)
|
||||
:param string url: The URL to perform the request against (optional)
|
||||
:param object data: The data to send in the request body (optional)
|
||||
:param object opts: Additonal options to use for the request (optional)
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. js:function:: OctoPrintClient.get(url, opts)
|
||||
|
||||
Performs a ``GET`` request against ``url``.
|
||||
|
||||
**Example:**
|
||||
|
||||
.. code-block:: javascript
|
||||
|
||||
OctoPrint.get("api/version")
|
||||
.done(function(response) {
|
||||
console.log("API:", response.api, "Server:", response.server);
|
||||
});
|
||||
|
||||
:param string url: URL against which to make the request, relative to base url or absolute
|
||||
:param object opts: Additional options for the request
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. js:function:: OctoPrintClient.getWithQuery(url, data, opts)
|
||||
|
||||
Performs a ``GET`` request against ``url`` using the provided ``data`` as URL query.
|
||||
|
||||
**Example:**
|
||||
|
||||
.. code-block:: javascript
|
||||
|
||||
// this should perform a GET of "api/timelapse?unrendered=true"
|
||||
OctoPrint.getWithQuery("api/timelapse", {"unrendered": true});
|
||||
|
||||
:param string url: URL against which to make the request, relative to base url or absolute
|
||||
:param object data: An object containing the key/value pairs of the query data OR a string representation of the query
|
||||
:param object opts: Additional options for the request
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. js:function:: OctoPrintClient.post(url, data, opts)
|
||||
|
||||
Performs a ``POST`` request against ``url`` using the provided ``data`` as request body.
|
||||
|
||||
**Example:**
|
||||
|
||||
.. code-block:: javascript
|
||||
|
||||
var url = OctoPrint.getBlueprintUrl("myplugin") + "endpoint";
|
||||
OctoPrint.post(url, "a whole lot of data", {"contentType": "application/octet-stream"})
|
||||
.done(function(response) {
|
||||
// do something with the response
|
||||
});
|
||||
|
||||
:param string url: URL against which to make the request, relative to base url or absolute
|
||||
:param string data: Data to post as request body
|
||||
:param object opts: Additional options for the request
|
||||
:param object opts: Additional options for the request
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. js:function:: OctoPrintClient.postJson(url, data, opts)
|
||||
|
||||
Performs a ``POST`` request against ``url`` using the provided ``data`` object as request body
|
||||
after serializing it to JSON.
|
||||
|
||||
**Example:**
|
||||
|
||||
.. code-block:: javascript
|
||||
|
||||
var url = OctoPrint.getBlueprintUrl("myplugin") + "endpoint";
|
||||
OctoPrint.postJson(url, {"someKey": "someValue"})
|
||||
.done(function(response) {
|
||||
// do something with the response
|
||||
});
|
||||
|
||||
:param string url: URL against which to make the request, relative to base url or absolute
|
||||
:param object data: Data to post as request body after serialization to JSON
|
||||
:param object opts: Additional options for the request
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. js:function:: OctoPrintClient.put(url, data, opts)
|
||||
|
||||
Performs ``PUT`` request against ``url`` using the provided ``data`` as request body.
|
||||
|
||||
See :js:func:`OctoPrint.post` for details.
|
||||
|
||||
.. js:function:: OctoPrintClient.putJson(url, data, opts)
|
||||
|
||||
Performs ``PUT`` request against ``url`` using the provided ``data`` as request body after
|
||||
serializing it to JSON.
|
||||
|
||||
See :js:func:`OctoPrint.postJson` for details.
|
||||
|
||||
.. js:function:: OctoPrintClient.patch(url, data, opts)
|
||||
|
||||
Performs ``PATCH`` request against ``url`` using the provided ``data`` as request body.
|
||||
|
||||
See :js:func:`OctoPrint.post` for details.
|
||||
|
||||
.. js:function:: OctoPrintClient.patchJson(url, data, opts)
|
||||
|
||||
Performs ``PATCH`` request against ``url`` using the provided ``data`` as request body after
|
||||
serializing it to JSON.
|
||||
|
||||
See :js:func:`OctoPrint.postJson` for details.
|
||||
|
||||
.. js:function:: OctoPrintClient.delete(url, opts)
|
||||
|
||||
Performs a ``DELETE`` request against ``url``.
|
||||
|
||||
:param string url: URL against which to make the request, relative to base url or absolute
|
||||
:param object opts: Additional options for the request
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. js:function:: OctoPrintClient.download(url, opts)
|
||||
|
||||
Downloads a file from ``url``, returning the response body as data type ``text``.
|
||||
|
||||
Use this if you need to download a file from the server in order to process it further in the client. The
|
||||
response body returned on successful completion of the returned `jQuery Promise <http://api.jquery.com/Types/#Promise>`_
|
||||
will contain the requested file as raw string/binary.
|
||||
|
||||
:param string url: URL to download
|
||||
:param object opts: Additional options for the request
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. js:function:: OctoPrintClient.upload(url, file, filename, additional)
|
||||
|
||||
Uploads a ``file`` to ``url`` using a ``multipart/form-data`` ``POST`` request.
|
||||
|
||||
``file`` should be either of
|
||||
|
||||
* a jQuery element pointing at a file input of the page of which the first
|
||||
`File instance <https://developer.mozilla.org/en-US/docs/Web/API/File>`_ will be used,
|
||||
* a string usable as selector to address a file input of the page of which the first
|
||||
`File instance <https://developer.mozilla.org/en-US/docs/Web/API/File>`_ will be used or
|
||||
* a `File instance <https://developer.mozilla.org/en-US/docs/Web/API/File>`_
|
||||
|
||||
If ``filename`` is provided, the file upload data will contain its value as file name for the
|
||||
upload, otherwise the ``name`` property from the `File instance <https://developer.mozilla.org/en-US/docs/Web/API/File>`_.
|
||||
|
||||
The function will return a `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ which will also be
|
||||
notified on the upload progress with an object containing the following properties:
|
||||
|
||||
loaded
|
||||
The number of bytes already uploaded
|
||||
total
|
||||
The total number of bytes to upload
|
||||
|
||||
This can be used to populate progress bars or other types of progress visualization.
|
||||
|
||||
It is important to note that contrary to all the other request methods in this module, ``OctoPrint.upload``
|
||||
is implemented using ``XMLHttpRequest`` directly instead of relying on jQuery's ``ajax`` function. It still
|
||||
tries to replicate its behaviour on the returned `jQuery Promise <http://api.jquery.com/Types/#Promise>`_
|
||||
however, meaning that the ``resolve`` and ``reject`` methods will be called with ``(data, textStatus, request)``
|
||||
and ``(request, textStatus, error)`` parameters respectively.
|
||||
|
||||
Additional form elements for the POSTed form can be supplied through the ``additional`` parameters.
|
||||
This should be an object of key/value pairs that are set as field name and value on the `FormData <https://developer.mozilla.org/en/docs/Web/API/FormData>`_
|
||||
object that will be used in the request.
|
||||
|
||||
**Example:**
|
||||
|
||||
Uploading a file to ``some/path`` on the blueprint of plugin ``myplugin``, from a file input element,
|
||||
updating a label with the current upload progress.
|
||||
|
||||
.. code-block:: javascript
|
||||
|
||||
var fileInput = $("#my-file-input");
|
||||
var progressOutput = $("#progress-output");
|
||||
|
||||
OctoPrint.upload(OctoPrint.getBlueprintUrl("myplugin") + "some/path",
|
||||
fileInput,
|
||||
"myfilename.dat",
|
||||
{"somekey": "somevalue"})
|
||||
.progress(function(data) {
|
||||
if (data.total) {
|
||||
var percentage = Math.round(data.loaded * 100 / data.total);
|
||||
if (percentage || percentage == 0) {
|
||||
progressOutput.text(percentage + "%");
|
||||
return;
|
||||
}
|
||||
}
|
||||
progressOutput.text("");
|
||||
})
|
||||
.done(function(response, textStatus, request) {
|
||||
progressOutput.text("Uploaded!");
|
||||
});
|
||||
|
||||
:param string url: URL to which to POST the upload, relative to base url or absolute
|
||||
:param object file: The file to object, see description for details
|
||||
:param string filename: An optional file name to use for the upload
|
||||
:param object additional: An optional object of additional key/value pairs to set on the uploaded form data
|
||||
|
||||
.. js:function:: OctoPrintClient.issueCommand(url, command, payload, opts)
|
||||
|
||||
Issues a command against an OctoPrint command API endpoint.
|
||||
|
||||
OctoPrint contains various API endpoints which follow a specific pattern: The payload of the request body is
|
||||
a JSON object which contains at least one property ``command`` and depending on the provided command additional
|
||||
parameters as further properties for the command. See the :ref:`Issue a file command <sec-api-fileops-filecommand>`
|
||||
for an example of an API endpoint following this pattern.
|
||||
|
||||
Using this function sending commands to such API endpoints becomes a trivial task. The function expects
|
||||
the ``url`` of the endpoint, the ``command`` to send, and optional ``payload`` and additional ``opts``.
|
||||
|
||||
The function will take care of wrapping the ``command`` and the ``payload`` into one JSON object and
|
||||
POSTing that to the endpoint with the correct JSON content type.
|
||||
|
||||
**Example:**
|
||||
|
||||
.. code-block:: javascript
|
||||
|
||||
var url = OctoPrint.getBlueprintUrl("myplugin") + "myendpoint";
|
||||
OctoPrint.issueCommand(url, "mycommand", {"someParameter": "someValue",
|
||||
"someOtherParameter": "someOtherValue"})
|
||||
.done(function(response) {
|
||||
// do something with the response
|
||||
});
|
||||
|
||||
:param string url: The URL to ``POST`` the command to
|
||||
:param string command: The command to issue
|
||||
:param object payload: Additional payload data for the command
|
||||
:param object opts: Additional options for the request
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. js:function:: OctoPrintClient.getSimpleApiUrl(plugin)
|
||||
|
||||
Returns the proper URL for the endpoint of a :class:`~octoprint.plugin.SimpleApiPlugin`, based on the
|
||||
plugin identifier.
|
||||
|
||||
**Example:**
|
||||
|
||||
.. code-block:: javascript
|
||||
|
||||
// prints "api/plugin/myplugin"
|
||||
console.log(OctoPrint.getSimpleApiUrl("myplugin")
|
||||
|
||||
:param string plugin: The identifier of the plugin for which to return the URL
|
||||
:returns string: The URL to use as endpoint
|
||||
|
||||
.. js:function:: OctoPrintClient.simpleApiGet(plugin, opts)
|
||||
|
||||
Performs a ``GET`` request against the endpoint of a :class:`~octoprint.plugin.SimpleApiPlugin` with
|
||||
identifier ``plugin``.
|
||||
|
||||
.. code-block:: javascript
|
||||
|
||||
OctoPrint.simpleApiGet("myplugin")
|
||||
.done(function(response) {
|
||||
// do something with the response
|
||||
});
|
||||
|
||||
:param string plugin: The identifier of the plugin
|
||||
:param object opts: Additional options for the request
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. js:function:: OctoPrintClient.simpleApiCommand(plugin, command, payload, opts)
|
||||
|
||||
Performs the API command ``command`` against the endpoint of a :class:`~octoprint.plugin.SimpleApiPlugin` with
|
||||
identifier ``plugin``, including the optional ``payload``.
|
||||
|
||||
**Example:**
|
||||
|
||||
.. code-block:: javascript
|
||||
|
||||
OctoPrint.simpleApiCommand("myplugin", "mycommand", {"someParameter": "someValue",
|
||||
"otherParameter": "otherValue"})
|
||||
.done(function(response) {
|
||||
// do something with the response
|
||||
});
|
||||
|
||||
:param string plugin: The identifier of the plugin
|
||||
:param string command: The command to issue
|
||||
:param object payload: Additional payload data for the command
|
||||
:param object opts: Additional options for the request
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. js:function:: OctoPrintClient.getBlueprintUrl(plugin)
|
||||
|
||||
Returns the proper base URL for blueprint endpoints of a :class:`~octoprint.plugin.BlueprintPlugin` with
|
||||
identifier ``plugin``.
|
||||
|
||||
**Example:**
|
||||
|
||||
.. code-block:: javascript
|
||||
|
||||
// prints "plugin/myplugin/"
|
||||
console.log(OctoPrint.getBlueprintUrl("myplugin"));
|
||||
|
||||
.. js:function:: OctoPrintClient.createRejectedDeferred()
|
||||
|
||||
Static method.
|
||||
|
||||
Shortcut for creating a rejected `jQuery Deferred <http://api.jquery.com/category/deferred-object/>`_.
|
||||
|
||||
.. js:function:: OctoPrintClient.createCustomException(name)
|
||||
|
||||
Static method.
|
||||
|
||||
Creates a custom exception class. ``name`` may be either a function in which case it will be used
|
||||
as constructor for the new exception class, or a string, in which case a constructor with proper
|
||||
``name``, ``message`` and ``stack`` attributes will be created. The class hierarchy will be propery
|
||||
setup to subclass ``Error``.
|
||||
|
||||
**Example:**
|
||||
|
||||
.. code-block:: javascript
|
||||
|
||||
MyCustomException = OctoPrintClient.createCustomException("MyCustomException");
|
||||
throw new MyCustomException("Something went horribly wrong!");
|
||||
|
||||
.. js:function:: OctoPrintClient.registerPluginComponent(identifier, clientClass)
|
||||
|
||||
Static method.
|
||||
|
||||
Registers the plugin client component ``clientClass`` under the name ``identifier`` on the
|
||||
:js:attr:`OctoPrintClient.plugins` registry.
|
||||
|
||||
``clientClass`` must have a constructor that follows the signature ``ClientClass(base)`` and in which it sets
|
||||
the attribute ``base`` on the instance to:
|
||||
|
||||
.. code-block:: javascript
|
||||
|
||||
var MyPluginClient = function(base) {
|
||||
this.base = base;
|
||||
}
|
||||
|
||||
Each :js:class:`OctoPrintClient` will create its own instance of registered plugin classes and make them available
|
||||
under :js:attr:`OctoPrintClient.plugins`. It will inject itself into those instances in order to allow plugin
|
||||
clients to access its functionality via ``this.base``:
|
||||
|
||||
.. code-block:: javascript
|
||||
|
||||
MyPluginClient.prototype.doSomething = function(data, opts) {
|
||||
return this.base.simpleApiCommand("myplugin", "doSomething", data, opts);
|
||||
};
|
||||
|
||||
:param string identifier: The identifier of the plugin for which ``clientClass`` is the client
|
||||
:param class clientClass: The client class to register. Constructor must follow the signature ``ClientClass(base)``
|
||||
where ``base`` will be assigned to the instance as ``this.base`` and be the :js:class:`OctoPrintClient`
|
||||
instance to use for API calls etc via ``this.base``.
|
||||
|
||||
.. js:class:: OctoPrintClient.InvalidArgumentError
|
||||
|
||||
Exception to use when functions are called with invalid arguments.
|
||||
@@ -1,40 +0,0 @@
|
||||
.. _sec-jsclientlib-browser:
|
||||
|
||||
:mod:`OctoPrintClient.browser`
|
||||
------------------------------
|
||||
|
||||
.. js:function:: OctoPrintClient.browser.login(username, password, remember, opts)
|
||||
|
||||
Logs the browser into OctoPrint, using the provided ``username`` and
|
||||
``password`` as credentials. If ``remember`` is set to ``true``, the session
|
||||
will also persist across browser restarts.
|
||||
|
||||
**Example:**
|
||||
|
||||
.. code-block:: javascript
|
||||
|
||||
OctoPrint.browser.login("myusername", "mypassword", true)
|
||||
.done(function(response) {
|
||||
// do something with the response
|
||||
});
|
||||
|
||||
:param string username: Username to log in with
|
||||
:param string password: Password to log in with
|
||||
:param bool remember: "Remember me"
|
||||
:param object opts: Additional request options
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. js:function:: OctoPrintClient.browser.passiveLogin(opts)
|
||||
|
||||
Tries to perform a passive login into OctoPrint, using existing session data
|
||||
stored in the browser's cookies.
|
||||
|
||||
:param object opts: Additional request options
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. js:function:: OctoPrintClient.browser.logout(opts)
|
||||
|
||||
Logs the browser out of OctoPrint.
|
||||
|
||||
:param object opts: Additional request options
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
@@ -1,49 +0,0 @@
|
||||
.. _sec-jsclientlib-connection:
|
||||
|
||||
:mod:`OctoPrintClient.connection`
|
||||
---------------------------------
|
||||
|
||||
.. js:function:: OctoPrintClient.connection.getSettings(opts)
|
||||
|
||||
Retrieves the available connection options for connection to a printer.
|
||||
|
||||
See :ref:`Get connection settings <sec-api-connection-current>` for the response format.
|
||||
|
||||
:param object opts: Additional options for the request
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. js:function:: OctoPrintClient.connection.connect(data, opts)
|
||||
|
||||
Connects to the printer, optionally using the provided connection ``data`` as parameters.
|
||||
|
||||
If ``data`` is provided it's expected to be an object specifying one or more of
|
||||
|
||||
* ``port``
|
||||
* ``baudrate``
|
||||
* ``printerProfile``
|
||||
* ``save``
|
||||
* ``autoconnect``
|
||||
|
||||
See :ref:`Issue a connection command <sec-api-connection-command>` for more details.
|
||||
|
||||
:param object data: Connection data to use
|
||||
:param object opts: Additional options for the request
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. js:function:: OctoPrintClient.connection.disconnect(opts)
|
||||
|
||||
Disconnects from the printer.
|
||||
|
||||
See :ref:`Issue a connection command <sec-api-connection-command>` for more details.
|
||||
|
||||
:param object opts: Additional options for the request
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. js:function:: OctoPrintClient.connection.fakeAck(opts)
|
||||
|
||||
Triggers a fake acknowledgement (``ok``) on the printer.
|
||||
|
||||
See :ref:`Issue a connection command <sec-api-connection-command>` for more details.
|
||||
|
||||
:param object opts: Additional options for the request
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
@@ -1,57 +0,0 @@
|
||||
.. _sec-jsclientlib-control:
|
||||
|
||||
:mod:`OctoPrintClient.control`
|
||||
------------------------------
|
||||
|
||||
.. js:function:: OctoPrintClient.control.getCustomControls(opts)
|
||||
|
||||
Retrieves the defined custom controls from the server.
|
||||
|
||||
:param object opts: Additional options for the request
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. js:function:: OctoPrintClient.control.sendGcode(commands, opts)
|
||||
|
||||
Sends the provided ``commands`` to the printer.
|
||||
|
||||
Corresponds to the :ref:`Send an arbitrary command to the printer <sec-api-printer-arbcommand>` API,
|
||||
see there for details.
|
||||
|
||||
:param list or string commands: One or more commands to send to the printer.
|
||||
:param object opts: Additional options for the request
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. js:function:: OctoPrintClient.control.sendGcodeWithParameters(commands, parameters, opts)
|
||||
|
||||
Sends the provided ``commands`` to the printer, replacing contained placeholders with
|
||||
the provided ``parameters`` first.
|
||||
|
||||
Corresponds to the :ref:`Send an arbitrary command to the printer <sec-api-printer-arbcommand>` API,
|
||||
see there for details.
|
||||
|
||||
:param list or string commands: One or more commands to send to the printer
|
||||
:param object parameters: Parameters (key-value-pairs) to replace placeholders in ``commands`` with
|
||||
:param object opts: Additional options for the request
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. js:function:: OctoPrintClient.control.sendGcodeScript(script, context, opts)
|
||||
|
||||
Sends the provided ``script`` to the printer, enhancing the template with the
|
||||
specified ``context``.
|
||||
|
||||
:param string script: Name of the script to send to the printer
|
||||
:param object context: Template context
|
||||
:param object opts: Additional options for the request
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. js:function:: OctoPrintClient.control.sendGcodeScriptWithParameters(script, context, parameters, opts)
|
||||
|
||||
Sends the provided ``script`` to the printer, enhancing the template with the
|
||||
specified ``context`` and ``parameters``.
|
||||
|
||||
:param string script: Name of the script to send to the printer
|
||||
:param object context: Template context
|
||||
:param object parameters: Template parameters
|
||||
:param object opts: Additional options for the request
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
@@ -1,273 +0,0 @@
|
||||
.. _sec-jsclientlib-files:
|
||||
|
||||
:mod:`OctoPrintClient.files`
|
||||
----------------------------
|
||||
|
||||
.. js:function:: OctoPrintClient.files.get(location, filename, opts)
|
||||
|
||||
Retrieves information about the file ``filename`` at ``location``.
|
||||
|
||||
See :ref:`Retrieve a specific file's information <sec-api-fileops-retrievefileinfo>` for more details.
|
||||
|
||||
:param string location: The location of the file
|
||||
:param string filename: The name of the file
|
||||
:param object opts: Additional options for the request
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. js:function:: OctoPrintClient.files.list(recursively, opts)
|
||||
|
||||
Retrieves a list of all files from the server.
|
||||
|
||||
The response from the server will be preprocessed such that all contained entries (recursively)
|
||||
will be guaranteed to have a ``parent``, ``size`` and ``date`` property set at least with a value
|
||||
of ``undefined``.
|
||||
|
||||
For folders, all children will have their ``parent`` property set to the folder entry.
|
||||
|
||||
**Example:**
|
||||
|
||||
.. code-block:: javascript
|
||||
|
||||
var recursivelyPrintNames = function(entry, depth) {
|
||||
depth = depth || 0;
|
||||
|
||||
var isFolder = entry.type == "folder";
|
||||
var name = (isFolder ? "+ " + entry.name : entry.name);
|
||||
console.log(_.repeat("| ", depth - 1) + (depth ? "|-" : "") + name);
|
||||
|
||||
if (isFolder) {
|
||||
_.each(entry.children, function(child) {
|
||||
recursivelyPrintNames(child, depth + 1);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
OctoPrint.files.list(true)
|
||||
.done(function(response) {
|
||||
console.log("### Files:");
|
||||
_.each(response.files, function(entry) {
|
||||
recursivelyPrintNames(entry);
|
||||
});
|
||||
});
|
||||
|
||||
See :ref:`Retrieve all files <sec-api-fileops-retrieveall>` for more details.
|
||||
|
||||
:param boolean recursively: Whether to list the files recursively (including all sub folders, true) or not (false, default)
|
||||
:param object opts: Additional options for the request
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. js:function:: OctoPrintClient.files.listForLocation(location, recursively, opts)
|
||||
|
||||
Retrieves a list of all files stored at the specified ``location`` from the server.
|
||||
|
||||
The response from the server will be preprocessed such that all contained entries (recursively)
|
||||
will be guaranteed to have a ``parent``, ``size`` and ``date`` property set at least with a value
|
||||
of ``undefined``.
|
||||
|
||||
For folders, all children will have their ``parent`` property set to the folder entry.
|
||||
|
||||
See :ref:`Retrieve files from specific location <sec-api-fileops-retrievelocation>` for more details.
|
||||
|
||||
:param string location: The location for which to retrieve the list
|
||||
:param boolean recursively: Whether to list the files recursively (including all sub folders, true) or not (false, default)
|
||||
:param object opts: Additional options for the request
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. js:function:: OctoPrintClient.files.select(location, path, print, opts)
|
||||
|
||||
Selects a file at ``location`` named ``filename`` for printing. If ``print`` is supplied and
|
||||
truthy, also starts printing the file immediately.
|
||||
|
||||
See the ``select`` command in :ref:`Issue a file command <sec-api-fileops-filecommand>` for more details.
|
||||
|
||||
:param string location: The location of the file to select
|
||||
:param string path: The name of the file to select
|
||||
:param boolean print: Whether to print the file after selection (true) or not (false, default)
|
||||
:param object opts: Additional options for the request
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. js:function:: OctoPrintClient.files.slice(location, path, parameters, opts)
|
||||
|
||||
Slices a file at ``location`` called ``filename``, using the supplied slice command ``parameters``.
|
||||
|
||||
See the ``slice`` command in :ref:`Issue a file command <sec-api-fileops-filecommand>` for more details.
|
||||
|
||||
:param string location: The location of the file to slice
|
||||
:param string path: The path of the file to slice
|
||||
:param object parameters: Additional parameters for the ``slice`` command
|
||||
:param object opts: Additional options for the request
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. js:function:: OctoPrintClient.files.delete(location, path, opts)
|
||||
|
||||
Deletes the file or folder at ``location`` and ``path``.
|
||||
|
||||
See :ref:`Delete file <sec-api-fileops-delete>` for more details.
|
||||
|
||||
:param string location: The location of the file to delete
|
||||
:param string path: The path of the file to delete
|
||||
:param object opts: Additional options for the request
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. js:function:: OctoPrintClient.files.copy(location, path, destination, opts)
|
||||
|
||||
Copies file or folder ``path`` on ``location`` to new parent folder ``destination`` on ``location``.
|
||||
|
||||
``destination`` must already exist.
|
||||
|
||||
**Example:**
|
||||
|
||||
.. code-block:: javascript
|
||||
|
||||
OctoPrint.files.copy("local", "some/file.gco", "other/folder");
|
||||
|
||||
See :ref:`Issue a file command <sec-api-fileops-filecommand>` for more details.
|
||||
|
||||
:param string location: The location of the file to copy, currently only "local" is supported
|
||||
:param string path: The path of the file or folder to copy
|
||||
:param string destination: The path of the parent to which to copy the file or folder
|
||||
:param object opts: Additional options for the request
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. js:function:: OctoPrintClient.files.move(location, filename, destination, opts)
|
||||
|
||||
Moves file or folder ``path`` on ``location`` to new parent folder ``destination`` on ``location``.
|
||||
|
||||
``destination`` must already exist.
|
||||
|
||||
**Example:**
|
||||
|
||||
.. code-block:: javascript
|
||||
|
||||
OctoPrint.files.move("local", "some/file.gco", "other/folder");
|
||||
|
||||
See :ref:`Issue a file command <sec-api-fileops-filecommand>` for more details.
|
||||
|
||||
:param string location: The location of the file to move, currently only "local" is supported
|
||||
:param string path: The path of the file or folder to move
|
||||
:param string destination: The path of the parent to which to copy the file or folder
|
||||
:param object opts: Additional options for the request
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. js:function:: OctoPrintClient.files.createFolder(location, name, path, opts)
|
||||
|
||||
Creates a new folder ``name`` on ``location``. If ``path`` is provided and not empty the folder
|
||||
will be created as a new child of it.
|
||||
|
||||
**Example:**
|
||||
|
||||
.. code-block:: javascript
|
||||
|
||||
// creates new folder "folder" in the root of "local"
|
||||
OctoPrint.files.createFolder("local", "folder");
|
||||
|
||||
// creates new folder "subfolder" in parent "some/existing/folder" on "local"
|
||||
OctoPrint.files.createFolder("local", "subfolder", "some/existing/folder");
|
||||
|
||||
See :ref:`Upload file or create folder <sec-api-fileops-uploadfile>` for more details on the folder creation API.
|
||||
|
||||
:param string location: The location to create the folder on (currently only "local" is supported)
|
||||
:param string name: The name of the new folder
|
||||
:param string path: The path to the parent folder in which to create the new folder. May be left unset in which
|
||||
case the folder will be created in the root directory of ``location``.
|
||||
:param object opts: Additional options for the request
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. js:function:: OctoPrintClient.files.upload(location, file, data)
|
||||
|
||||
Uploads a ``file`` to the specified ``location``.
|
||||
|
||||
Additional command ``data`` may be provided. Supported properties are:
|
||||
|
||||
filename
|
||||
A string value, the filename to assign to the uploaded file. Optional, if not provided the filename
|
||||
will be taken from the provided ``file`` object's ``name`` property.
|
||||
select
|
||||
A boolean value, specifies whether to immediately select the uploaded file for printing once
|
||||
the upload completes (true) or not (false, default)
|
||||
print
|
||||
A boolean value, specifies whether to immediately start printing the file after the upload
|
||||
completes (true) or not (false, default)
|
||||
userdata
|
||||
An optional object or a serialized JSON string of additional user supplised data to associate with
|
||||
the uploaded file.
|
||||
|
||||
See :ref:`Upload file or create folder <sec-api-fileops-uploadfile>` for more details on the file upload API and
|
||||
:js:func:`OctoPrint.upload` for more details on the underlying library upload mechanism, including
|
||||
what values are accepted for the ``file`` parameter.
|
||||
|
||||
:param string location: The location to upload the file to
|
||||
:param object or string file: The file to upload, see :js:func:`OctoPrint.upload` for more details
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. js:function:: OctoPrintClient.files.download(location, path, opts)
|
||||
|
||||
Downloads the file at ``path`` in ``location``.
|
||||
|
||||
The downloaded file will be returned as response body in the completed `Promise <http://api.jquery.com/Types/#Promise>`_.
|
||||
Note that not all locations support downloading of files (``sdcard`` for example doesn't).
|
||||
|
||||
**Example:**
|
||||
|
||||
.. code-block:: javascript
|
||||
|
||||
OctoPrint.files.download("local", "somefile.gco")
|
||||
.done(function(response) {
|
||||
var contents = response;
|
||||
// do something with the file contents
|
||||
});
|
||||
|
||||
:param string location: The location of the file to download
|
||||
:param string path: The path of the file to download
|
||||
:param object opts: Additional options for the request
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. js:function:: OctoPrintClient.files.pathForEntry(entry)
|
||||
|
||||
Utility function to retrieve the path within its location for a given ``entry``.
|
||||
|
||||
Use this if you already have a full list of entries and need the path to one.
|
||||
|
||||
**Example**
|
||||
|
||||
.. code-block:: javascript
|
||||
|
||||
OctoPrint.files.listForLocation("local", True)
|
||||
.done(function(entries) {
|
||||
var entry = OctoPrint.files.entryForPath("some/funny/entry", entries.files);
|
||||
var path = OctoPrint.files.pathForEntry(entry);
|
||||
console.log(path); // will log some/funny/entry
|
||||
});
|
||||
|
||||
:param object entry: The entry object for which to retrieve the path
|
||||
:returns string: The path of the entry within its location
|
||||
|
||||
.. js:function:: OctoPrintClient.files.entryForPath(path, root)
|
||||
|
||||
Utility function to retrieve an entry by its ``path`` based on an entry tree provided by its
|
||||
``root``.
|
||||
|
||||
Use this if you already have a full list of entries and are looking for a specified entry
|
||||
within.
|
||||
|
||||
**Example**
|
||||
|
||||
.. code-block:: javascript
|
||||
|
||||
var somePathsToFind = ["some/funny/entry",
|
||||
"another/entry",
|
||||
"this/does/not/exist"];
|
||||
|
||||
OctoPrint.files.listForLocation("local", True)
|
||||
.done(function(entries) {
|
||||
// will log two entries and one undefined
|
||||
_.each(somePathsToFind, function(path) {
|
||||
console.log(OctoPrint.files.entryForPath(path, entries.files));
|
||||
});
|
||||
});
|
||||
|
||||
:param string path: The path of the entry to retrieve
|
||||
:param object root: The root of the tree in which to resolve the entry by its path, either a list of entries or an entry
|
||||
element with ``children``
|
||||
:returns object or undefined: The retrieved entry, or ``undefined`` if the ``path`` could
|
||||
not be resolved
|
||||
@@ -1,107 +0,0 @@
|
||||
.. _sec-jsclientlib:
|
||||
|
||||
#########################
|
||||
JavaScript Client Library
|
||||
#########################
|
||||
|
||||
The JS Client Library provides an interface to all of OctoPrint's API, including the SockJS based socket to send
|
||||
push messages from the server to connected clients. It is available as packed web
|
||||
asset file at ``/static/webassets/packed_client.js`` or as individual
|
||||
component files at ``/static/js/app/client/<component>.js`` relative to your
|
||||
OctoPrint instance's base URL (e.g. ``http://octopi.local/static/webassets/packed_client.js``).
|
||||
|
||||
If you are using it from a web page hosted on OctoPrint as a Jinja2 template, you should use one of the following
|
||||
methods to embed it instead of manually entering the URL, in order to have OctoPrint take care of setting the
|
||||
correct URL prefix:
|
||||
|
||||
.. code-block:: html
|
||||
|
||||
<!--
|
||||
full client library or all individual files, depending
|
||||
on the server mode - should be the preferred variant
|
||||
-->
|
||||
{% assets "js_client" %}<script type="text/javascript" src="{{ ASSET_URL }}"></script>{% endassets %}
|
||||
|
||||
<!--
|
||||
full client library
|
||||
-->
|
||||
<script type="text/javascript" src="{{ url_for("static", filename="webassets/packed_client.js") }}"></script>
|
||||
|
||||
<!--
|
||||
individual components (do not forget base!)
|
||||
-->
|
||||
<script type="text/javascript" src="{{ url_for("static", filename="js/app/client/<component>.js") }}"></script>
|
||||
|
||||
Regardless of which way you use to include the library, you'll also need to make sure you included JQuery and lodash,
|
||||
because the library depends on those to be available (as ``$`` and ``_``). You can embed those like this:
|
||||
|
||||
.. code-block:: html
|
||||
|
||||
<script src="{{ url_for("static", filename="js/lib/jquery/jquery.min.js") }}"></script>
|
||||
<script src="{{ url_for("static", filename="js/lib/lodash.min.js") }}"></script>
|
||||
|
||||
Note that all components depend on the ``base`` component to be present, so if you are only including a select
|
||||
number of components, make sure to at the very least include that one to be able to utilize the client.
|
||||
|
||||
When you import the client library as described above, a global variable ``OctoPrint`` will become available, which is
|
||||
a prepared instance of the ``OctoPrintClient`` class the library assembles from registered components. You can directly
|
||||
used that singular ``OctoPrint`` instance if you only need to talk to one OctoPrint server:
|
||||
|
||||
.. code-block:: javascript
|
||||
|
||||
OctoPrint.options.baseurl = "http://example.com/octoprint/"
|
||||
OctoPrint.options.apikey = "apikey";
|
||||
|
||||
OctoPrint.files.list()
|
||||
.done(function(response) {
|
||||
// do something with the response
|
||||
});
|
||||
|
||||
If you want to access multiple servers, you should however instead instantiate your own clients. You can provide the
|
||||
connection options (``baseurl`` and ``apikey``) directly in the constructor or set them later:
|
||||
|
||||
.. code-block:: javascript
|
||||
|
||||
var client1 = new OctoPrintClient({baseurl: "http://example.com/octoprint1/", apikey: "apikey1"});
|
||||
|
||||
var client2 = new OctoPrintClient();
|
||||
client2.options.baseurl = "http://example.com/octoprint2/";
|
||||
client2.options.apikey = "apikey2";
|
||||
|
||||
client1.files.list()
|
||||
.done(function(response) {
|
||||
// do something with the response for server 1
|
||||
});
|
||||
|
||||
client2.files.list()
|
||||
.done(function(response) {
|
||||
// do something with the response for server 2
|
||||
});
|
||||
|
||||
.. seealso::
|
||||
|
||||
`OctoPrint-ForceLogin <https://github.com/OctoPrint/OctoPrint-ForceLogin>`_
|
||||
A plugin that disables anonymous access to the regular OctoPrint UI by implementing a custom UI. Utilizes the
|
||||
client library's :ref:`browser component <sec-jsclientlib-browser>` to login the user.
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 3
|
||||
|
||||
base.rst
|
||||
browser.rst
|
||||
connection.rst
|
||||
control.rst
|
||||
files.rst
|
||||
job.rst
|
||||
languages.rst
|
||||
logs.rst
|
||||
printer.rst
|
||||
printerprofiles.rst
|
||||
settings.rst
|
||||
slicing.rst
|
||||
socket.rst
|
||||
system.rst
|
||||
timelapse.rst
|
||||
users.rst
|
||||
util.rst
|
||||
wizard.rst
|
||||
@@ -1,82 +0,0 @@
|
||||
.. _sec-jsclientlib-job:
|
||||
|
||||
:mod:`OctoPrintClient.job`
|
||||
--------------------------
|
||||
|
||||
.. js:function:: OctoPrintClient.job.get(opts)
|
||||
|
||||
Retrieves information about the current job.
|
||||
|
||||
See :ref:`Retrieve information about the current job <sec-api-job-information>` for details.
|
||||
|
||||
:param object opts: Additional options for the request
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. js:function:: OctoPrintClient.job.start(opts)
|
||||
|
||||
Starts the current job.
|
||||
|
||||
See :ref:`Issue a job command <sec-api-jobs-command>` for details.
|
||||
|
||||
:param object opts: Additional options for the request
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. js:function:: OctoPrintClient.job.cancel(opts)
|
||||
|
||||
Cancels the current job.
|
||||
|
||||
See :ref:`Issue a job command <sec-api-jobs-command>` for details.
|
||||
|
||||
:param object opts: Additional options for the request
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. js:function:: OctoPrintClient.job.restart(opts)
|
||||
|
||||
Restarts the current job. This is equivalent to cancelling and immediately restarting
|
||||
the job.
|
||||
|
||||
**Example:**
|
||||
|
||||
.. code-block:: javascript
|
||||
|
||||
OctoPrint.job.restart();
|
||||
|
||||
// the above is a shorthand for:
|
||||
|
||||
OctoPrint.job.cancel()
|
||||
.done(function(response) {
|
||||
OctoPrint.job.start();
|
||||
});
|
||||
|
||||
See :ref:`Issue a job command <sec-api-jobs-command>` for details.
|
||||
|
||||
:param object opts: Additional options for the request
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. js:function:: OctoPrintClient.job.pause(opts)
|
||||
|
||||
Pauses the current job if it's running, does nothing if it's already paused.
|
||||
|
||||
See :ref:`Issue a job command <sec-api-jobs-command>` for details.
|
||||
|
||||
:param object opts: Additional options for the request
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. js:function:: OctoPrintClient.job.resume(opts)
|
||||
|
||||
Resumes the current job if it's currently pause, does nothing if it's running.
|
||||
|
||||
See :ref:`Issue a job command <sec-api-jobs-command>` for details.
|
||||
|
||||
:param object opts: Additional options for the request
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. js:function:: OctoPrintClient.job.togglePause(opts)
|
||||
|
||||
Resumes a paused and pauses a running job.
|
||||
|
||||
See :ref:`Issue a job command <sec-api-jobs-command>` for details.
|
||||
|
||||
:param object opts: Additional options for the request
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
@@ -1,37 +0,0 @@
|
||||
.. _sec-jsclientlib-languages:
|
||||
|
||||
:mod:`OctoPrintClient.languages`
|
||||
--------------------------------
|
||||
|
||||
.. note::
|
||||
|
||||
All methods here require that the used API token or a the existing browser session
|
||||
has admin rights.
|
||||
|
||||
.. js:function:: OctoPrintClient.languages.list(opts)
|
||||
|
||||
Retrieves a list of available language packs.
|
||||
|
||||
:param object opts: Additional options for the request
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. js:function:: OctoPrintClient.languages.upload(file)
|
||||
|
||||
Uploads a language pack.
|
||||
|
||||
:param object or string file: The file to upload, see :js:func:`OctoPrint.upload` for more details
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. js:function:: OctoPrintClient.languages.delete(locale, pack, opts)
|
||||
|
||||
Deletes the language pack ``pack`` for the specified locale ``locale``.
|
||||
|
||||
:param string locale: The locale for which to delete the language pack
|
||||
:param string pack: The identifier of the pack to delete
|
||||
:param object opts: Additional options for the request
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. seealso::
|
||||
|
||||
:ref:`Languages API <sec-api-languages>`
|
||||
The documentation of the underlying languages API.
|
||||
@@ -1,39 +0,0 @@
|
||||
.. _sec-jsclientlib-logs:
|
||||
|
||||
:mod:`OctoPrintClient.logs`
|
||||
---------------------------
|
||||
|
||||
.. note::
|
||||
|
||||
All methods here require that the used API token or a the existing browser session
|
||||
has admin rights.
|
||||
|
||||
.. js:function:: OctoPrintClient.logs.list(opts)
|
||||
|
||||
Retrieves a list of log files.
|
||||
|
||||
See :ref:`Retrieve a list of available log files <sec-api-logs-list>` for details.
|
||||
|
||||
:param object opts: Additional options for the request
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. js:function:: OctoPrintClient.logs.delete(path, opts)
|
||||
|
||||
Deletes the specified log ``path``.
|
||||
|
||||
See :ref:`Delete a specific log file <sec-api-logs-delete>` for details.
|
||||
|
||||
:param string path: The path to the log file to delete
|
||||
:param object opts: Additional options for the request
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. js:function:: OctoPrintClient.logs.download(path, opts)
|
||||
|
||||
Downloads the specified log ``file``.
|
||||
|
||||
See :js:func:`OctoPrint.download` for more details on the underlying library download mechanism.
|
||||
|
||||
:param string path: The path to the log file to download
|
||||
:param object opts: Additional options for the request
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
@@ -1,317 +0,0 @@
|
||||
.. _sec-jsclientlib-printer:
|
||||
|
||||
:mod:`OctoPrintClient.printer`
|
||||
------------------------------
|
||||
|
||||
.. note::
|
||||
|
||||
All commands here that interact with the printer (anything that sends a command) will
|
||||
resolve the returned `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ when the
|
||||
request to the server enqueuing the command has been processed, *not* when the command
|
||||
was actually sent to or processed by the printer.
|
||||
|
||||
See :ref:`the note here <sec-api-printer>` for an explanation why that is the case.
|
||||
|
||||
.. contents::
|
||||
:local:
|
||||
|
||||
.. js:function:: OctoPrintClient.printer.getFullState(flags, opts)
|
||||
|
||||
Retrieves the full printer state, including temperature information, sd state and general
|
||||
printer state.
|
||||
|
||||
The ``flags`` object can be used to specify the data to retrieve further via the following
|
||||
properties:
|
||||
|
||||
* ``history``: a boolean value to specify whether the temperature history should be included (``true``)
|
||||
or not (``false``), defaults to it not being included
|
||||
* ``limit``: an integer value to specify how many history entries to include
|
||||
* ``exclude``: a string value of comma-separated fields to exclude from the returned result.
|
||||
|
||||
See :ref:`Retrieve the current printer state <sec-api-printer-state>` for more details.
|
||||
|
||||
:param object flags: Flags that further specify which data to retrieve, see above for details
|
||||
:param object opts: Additional options for the request
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. js:function:: OctoPrintClient.printer.getToolState(flags, opts)
|
||||
|
||||
Retrieves the current printer extruder state/temperature information, and optionally also the temperature
|
||||
history.
|
||||
|
||||
The ``flags`` object can be used to specify the data to retrieve further via the following
|
||||
properties:
|
||||
|
||||
* ``history``: a boolean value to specify whether the temperature history should be included (``true``)
|
||||
or not (``false``), defaults to it not being included
|
||||
* ``limit``: an integer value to specify how many history entries to include
|
||||
|
||||
See :ref:`Retrieve the current tool state <sec-api-printer-toolstate>` for more details.
|
||||
|
||||
:param object flags: Flags that further specify which data to retrieve, see above for details
|
||||
:param object opts: Additional options for the request
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. js:function:: OctoPrintClient.printer.setToolTargetTemperatures(targets, opts)
|
||||
|
||||
Sets the given temperatures on the printer's extruders.
|
||||
|
||||
``targets`` is expected to be an object mapping tool identifier to target temperature to set.
|
||||
|
||||
**Example:**
|
||||
|
||||
Set first hotend to 220°C and second to 205°C.
|
||||
|
||||
.. code-block:: javascript
|
||||
|
||||
OctoPrint.printer.setToolTargetTemperatures({"tool0": 220, "tool1": 205});
|
||||
|
||||
See the ``target`` command in :ref:`Issue a tool command <sec-api-printer-toolcommand>` for more details.
|
||||
|
||||
:param object targets: The targets to set
|
||||
:param object opts: Additional options for the request
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. js:function:: OctoPrintClient.printer.setToolTemperatureOffsets(offsets, opts)
|
||||
|
||||
Sets the given temperature offsets for the printer's extruders.
|
||||
|
||||
``offsets`` is expected to be an object mapping tool identifier to offset to set.
|
||||
|
||||
**Example:**
|
||||
|
||||
Set the offset for the first hotend's temperature to +10°C and the offset for the second hotend's
|
||||
temperature to -5°C.
|
||||
|
||||
.. code-block:: javascript
|
||||
|
||||
OctoPrint.printer.setToolTemperatureOffsets({"tool0": 10, "tool1": -5});
|
||||
|
||||
See the ``offset`` command in :ref:`Issue a tool command <sec-api-printer-toolcommand>` for more details.
|
||||
|
||||
:param object offsets: The offsets to set
|
||||
:param object opts: Additional options for the request
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. js:function:: OctoPrintClient.printer.selectTool(tool, opts)
|
||||
|
||||
Selects the printer's current extruder.
|
||||
|
||||
``tool`` is the identifier of the extruder to select.
|
||||
|
||||
**Example:**
|
||||
|
||||
Select the second tool, extrude 5mm of filament, then select the first tool.
|
||||
|
||||
.. code-block:: javascript
|
||||
|
||||
OctoPrint.printer.selectTool("tool1")
|
||||
.done(function(response) {
|
||||
OctoPrint.printer.extrude(5.0)
|
||||
.done(function(response) {
|
||||
OctoPrint.printer.selectTool("tool0");
|
||||
});
|
||||
});
|
||||
|
||||
See the ``select`` command in :ref:`Issue a tool command <sec-api-printer-toolcommand>` for more details.
|
||||
|
||||
:param string tool: The tool identifier of the extruder to select
|
||||
:param object opts: Additional options for the request
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. js:function:: OctoPrintClient.printer.extrude(amount, opts)
|
||||
|
||||
Extrudes or retracts ``amount`` mm of filament on the currently selected extruder.
|
||||
|
||||
**Example:**
|
||||
|
||||
Extrude 5mm of filament on the current extruder, then retract 2mm.
|
||||
|
||||
.. code-block:: javascript
|
||||
|
||||
OctoPrint.printer.extrude(5.0)
|
||||
.done(function(response) {
|
||||
OctoPrint.printer.extrude(-2.0);
|
||||
});
|
||||
|
||||
See the ``extrude`` command in :ref:`Issue a tool command <sec-api-printer-toolcommand>` for more details.
|
||||
|
||||
:param float amount: The amount of filament to extrude/retract.
|
||||
:param object opts: Additional options for the request
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. js:function:: OctoPrintClient.printer.setFlowrate(factor, opts)
|
||||
|
||||
Sets the current flowrate multiplier.
|
||||
|
||||
``factor`` is expected to be a integer value between 75 and 125 representing the new flowrate percentage.
|
||||
|
||||
See the ``flowrate`` command in :ref:`Issue a tool command <sec-api-printer-toolcommand>` for more details.
|
||||
|
||||
:param integer factor: The flowrate as percentage
|
||||
:param object opts: Additional options for the request
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. js:function:: OctoPrintClient.printer.getBedState(data, opts)
|
||||
|
||||
Retrieves the current printer bed state/temperature information, and optionally also the temperature
|
||||
history.
|
||||
|
||||
The ``flags`` object can be used to specify the data to retrieve further via the following
|
||||
properties:
|
||||
|
||||
* ``history``: a boolean value to specify whether the temperature history should be included (``true``)
|
||||
or not (``false``), defaults to it not being included
|
||||
* ``limit``: an integer value to specify how many history entries to include
|
||||
|
||||
See :ref:`Retrieve the current bed state <sec-api-printer-bedstate>` for more details.
|
||||
|
||||
:param object flags: Flags that further specify which data to retrieve, see above for details
|
||||
:param object opts: Additional options for the request
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. js:function:: OctoPrintClient.printer.setBedTargetTemperature(target, opts)
|
||||
|
||||
Sets the given temperature on the printer's heated bed (if available).
|
||||
|
||||
``target`` is expected to be a the target temperature as a float value.
|
||||
|
||||
**Example:**
|
||||
|
||||
Set the bed to 90°C.
|
||||
|
||||
.. code-block:: javascript
|
||||
|
||||
OctoPrint.printer.setBedTargetTemperature(90.0);
|
||||
|
||||
See the ``target`` command in :ref:`Issue a bed command <sec-api-printer-bedcommand>` for more details.
|
||||
|
||||
:param float target: The target to set
|
||||
:param object opts: Additional options for the request
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. js:function:: OctoPrintClient.printer.setBedTemperatureOffset(offset, opts)
|
||||
|
||||
Sets the given temperature offset for the printer's heated bed (if available).
|
||||
|
||||
``offset`` is expected to be the temperature offset to set.
|
||||
|
||||
**Example:**
|
||||
|
||||
Set the offset for the bed to -5°C.
|
||||
|
||||
.. code-block:: javascript
|
||||
|
||||
OctoPrint.printer.setBedTemperatureOffset(-5);
|
||||
|
||||
See the ``offset`` command in :ref:`Issue a bed command <sec-api-printer-bedcommand>` for more details.
|
||||
|
||||
:param object offsets: The offsets to set
|
||||
:param object opts: Additional options for the request
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. js:function:: OctoPrintClient.printer.jog(amounts, opts)
|
||||
|
||||
Jogs the specified axes by the specified ``amounts``.
|
||||
|
||||
``amounts`` is expected to be an object with properties reflecting the axes to be jogged by the specified
|
||||
amount given as value.
|
||||
|
||||
**Example:**
|
||||
|
||||
Jog X by 10mm.
|
||||
|
||||
.. code-block:: javascript
|
||||
|
||||
OctoPrint.printer.jog({"x", 10.0});
|
||||
|
||||
Jog Y by -5mm and Z by 0.2mm.
|
||||
|
||||
.. code-block:: javascript
|
||||
|
||||
OctoPrint.printer.jog({"y": -5.0, "z": 0.2});
|
||||
|
||||
See the ``jog`` command in :ref:`Issue a print head command <sec-api-printer-printheadcommand>` for more details.
|
||||
|
||||
:param object amounts: Key-value-pairs of axes to jog and amount to jog it.
|
||||
:param object opts: Additional options for the request
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. js:function:: OctoPrintClient.printer.home(axes, opts)
|
||||
|
||||
Homes the specified ``axes``.
|
||||
|
||||
``axes`` is expected to be an array of strings specifying the axes to home.
|
||||
|
||||
**Example:**
|
||||
|
||||
Home the X and Y axis.
|
||||
|
||||
.. code-block:: javascript
|
||||
|
||||
OctoPrint.printer.home(["x", "y"]);
|
||||
|
||||
Home the Z axis.
|
||||
|
||||
.. code-block:: javascript
|
||||
|
||||
OctoPrint.printer.home(["z"]);
|
||||
|
||||
See the ``home`` command in :ref:`Issue a print head command <sec-api-printer-printheadcommand>` for more details.
|
||||
|
||||
:param array axes: List of axes to home
|
||||
:param object opts: Additional options for the request
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. js:function:: OctoPrintClient.printer.setFeedrate(factor, opts)
|
||||
|
||||
Sets the feedrate multiplier to use.
|
||||
|
||||
``factor`` is expected to be a integer value between 0 and 200 representing the new feedrate percentage.
|
||||
|
||||
See the ``feedrate`` command in :ref:`Issue a print head command <sec-api-printer-printheadcommand>` for more details.
|
||||
|
||||
:param integer factor: The feedrate multiplier as percentage
|
||||
:param object opts: Additional options for the request
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. js:function:: OctoPrintClient.printer.getSdState(opts)
|
||||
|
||||
Retrieves the current ready state of the printer's SD card.
|
||||
|
||||
See :ref:`Retrieve the current SD state <sec-api-printer-sdstate>` for more details.
|
||||
|
||||
:param object opts: Additional options for the request
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. js:function:: OctoPrintClient.printer.initSd(opts)
|
||||
|
||||
Instructs the printer to initialize its SD card (if present).
|
||||
|
||||
See the ``init`` command in :ref:`Issue an SD command <sec-api-printer-sdcommand>` for more details.
|
||||
|
||||
:param object opts: Additional options for the request
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. js:function:: OctoPrintClient.printer.refreshSd(opts)
|
||||
|
||||
Instructs the printer to refresh the list of files on the SD card (if present).
|
||||
|
||||
See the ``refresh`` command in :ref:`Issue an SD command <sec-api-printer-sdcommand>` for more details.
|
||||
|
||||
:param object opts: Additional options for the request
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. js:function:: OctoPrintClient.printer.releaseSd(opts)
|
||||
|
||||
Instructs the printer to release its SD card (if present).
|
||||
|
||||
See the ``release`` command in :ref:`Issue an SD command <sec-api-printer-sdcommand>` for more details.
|
||||
|
||||
:param object opts: Additional options for the request
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. seealso::
|
||||
|
||||
:ref:`REST API: Printer operations <sec-api-printer>`
|
||||
Documentation of the API functionality covered with this client library module.
|
||||
@@ -1,48 +0,0 @@
|
||||
.. _sec-jsclientlib-printerprofiles:
|
||||
|
||||
:mod:`OctoPrintClient.printerprofiles`
|
||||
--------------------------------------
|
||||
|
||||
.. js:function:: OctoPrintClient.printerprofiles.list(opts)
|
||||
|
||||
Retrieves a list of all configured printer profiles.
|
||||
|
||||
:param object opts: Additional options for the request
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. js:function:: OctoPrintClient.printerprofiles.get(id, opts)
|
||||
|
||||
:param string id: The identifier of the profile to retrieve
|
||||
:param object opts: Additional options for the request
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. js:function:: OctoPrintClient.printerprofiles.add(profile, additional, opts)
|
||||
|
||||
Adds a new profile to OctoPrint.
|
||||
|
||||
:param string profile: The data of the profile to add
|
||||
:param string basedOn: The identifier of the profile to base this profile on (optional)
|
||||
:param object opts: Additional options for the request
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. js:function:: OctoPrintClient.printerprofiles.update(id, profile, opts)
|
||||
|
||||
Updates an existing profile in OctoPrint.
|
||||
|
||||
:param string id: The identifier of the profile to update
|
||||
:param string profile: The data of the profile to update
|
||||
:param object opts: Additional options for the request
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. js:function:: OctoPrintClient.printerprofiles.delete(id, opts)
|
||||
|
||||
Deletes a profile in OctoPrint.
|
||||
|
||||
:param string id: The identifier of the profile to delete
|
||||
:param object opts: Additional options for the request
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. seealso::
|
||||
|
||||
:ref:`Printer profile operations <sec-api-printerprofiles>`
|
||||
The documentation of the underlying printer profile API.
|
||||
@@ -1,48 +0,0 @@
|
||||
.. _sec-jsclientlib-settings:
|
||||
|
||||
:mod:`OctoPrintClient.settings`
|
||||
-------------------------------
|
||||
|
||||
.. js:function:: OctoPrintClient.settings.get(opts)
|
||||
|
||||
Retrieves the current settings.
|
||||
|
||||
:param object opts: Additional options for the request
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. js:function:: OctoPrintClient.settings.save(settings, opts)
|
||||
|
||||
Saves the provided ``settings``.
|
||||
|
||||
:param object settings: The settings to save
|
||||
:param object opts: Additional options for the request
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. js:function:: OctoPrintClient.settings.getPluginSettings(plugin, opts)
|
||||
|
||||
Retrieves the settings of the specified ``plugin``.
|
||||
|
||||
:param string plugin: The plugin for which to retrieve the settings
|
||||
:param object opts: Additional options for the request
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. js:function:: OctoPrintClient.settings.savePluginSettings(plugin, settings, opts)
|
||||
|
||||
Saves the ``settings`` for the specified ``plugin``.
|
||||
|
||||
:param string plugin: The plugin for which to save settings
|
||||
:param object settings: The settings to save
|
||||
:param object opts: Additional options for the request
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. js:function:: OctoPrintClient.settings.generateApiKey(opts)
|
||||
|
||||
Generate a new system wide API key.
|
||||
|
||||
:param object opts: Additional options for the request
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. seealso::
|
||||
|
||||
:ref:`Settings API <sec-api-settings>`
|
||||
The documentation of the underlying settings API.
|
||||
@@ -1,60 +0,0 @@
|
||||
.. _sec-jsclientlib-slicing:
|
||||
|
||||
:mod:`OctoPrintClient.slicing`
|
||||
------------------------------
|
||||
|
||||
.. js:function:: OctoPrintClient.slicing.listAllSlicersAndProfiles(opts)
|
||||
|
||||
Retrieves a list of all slicers and their available slicing profiles.
|
||||
|
||||
:param object opts: Additional options for the request
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. js:function:: OctoPrintClient.slicing.listProfilesForSlicer(slicer, opts)
|
||||
|
||||
Retrieves of all slicing profiles for the specified ``slicer``.
|
||||
|
||||
:param string slicer: The identifier of the slicer for which to retrieve the profiles
|
||||
:param object opts: Additional options for the request
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. js:function:: OctoPrintClient.slicing.getProfileForSlicer(slicer, profileId, opts)
|
||||
|
||||
Retrieves the slicing profile with ``profileId`` for the specified ``slicer``.
|
||||
|
||||
:param string slicer: The slicer for which to retrieve the profile
|
||||
:param string profileId: The identifier of the profile to retrieve
|
||||
:param object opts: Additional options for the request
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. js:function:: OctoPrintClient.slicing.addProfileForSlicer(slicer, profileId, profile, opts)
|
||||
|
||||
Adds the profile with identifier ``profileId`` to the specified ``slicer``, using the provided ``profile`` data.
|
||||
|
||||
:param string slicer: The slicer for which to add the profile
|
||||
:param string profileId: The identifier for the profile to add
|
||||
:param object profile: The data of the profile to add
|
||||
:param object opts: Additional options for the request
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. js:function:: OctoPrintClient.slicing.updateProfileForSlicer(slicer, profileId, profile, opts)
|
||||
|
||||
Updates the profile ``profileId`` for ``slicer`` with the provided ``profile`` data.
|
||||
|
||||
:param string slicer: The slicer for which to update the profile
|
||||
:param string profileId: The identifier for the profile to update
|
||||
:param object profile: The updated data of the profile
|
||||
:param object opts: Additional options for the request
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. js:function:: OctoPrintClient.slicing.deleteProfileForSlicer(slicer, profileId, opts)
|
||||
|
||||
Deletes the profile ``profileId`` for ``slicer``.
|
||||
|
||||
:param object opts: Additional options for the request
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. seealso::
|
||||
|
||||
:ref:`Slicing API <sec-api-slicing>`
|
||||
The documentation of the underlying slicing API.
|
||||
@@ -1,114 +0,0 @@
|
||||
.. _sec-jsclientlib-socket:
|
||||
|
||||
:mod:`OctoPrintClient.socket`
|
||||
-----------------------------
|
||||
|
||||
.. js:attribute:: OctoPrintClient.socket.options
|
||||
|
||||
The socket client's options.
|
||||
|
||||
``OctoPrintClient.socket.options.timeouts``
|
||||
A list of consecutive timeouts after which to attempt reconnecting to a
|
||||
disconnected sockets, in seconds. Defaults to ``[1, 1, 2, 3, 5, 8, 13, 20, 40, 100]``.
|
||||
The default setting here makes the client slowly back off after the first couple of very
|
||||
fast connection attempts don't succeed, and give up after 10 tries.
|
||||
|
||||
``OctoPrintClient.socket.options.rateSlidingWindowSize``
|
||||
Number of last rate measurements to take into account for timing analysis and
|
||||
communication throttling. See :ref:`Communication Throttling <sec-jsclient-socket-throttling>`
|
||||
below.
|
||||
|
||||
.. js:function:: OctoPrintClient.socket.connect(opts)
|
||||
|
||||
Connects the socket client to OctoPrint's `SockJS <http://sockjs.org/>`_ socket.
|
||||
|
||||
The optional parameter ``opts`` may be used to provide additional configuration options
|
||||
to the SockJS constructor. See the `SockJS documentation <https://github.com/sockjs/sockjs-client#sockjs-class>`_ on potential options.
|
||||
|
||||
:param object opts: Additional options for the SockJS constructor.
|
||||
|
||||
.. js:function:: OctoPrintClient.socket.reconnect()
|
||||
|
||||
Reconnects the socket client. If the socket is currently connected it will be disconnected first.
|
||||
|
||||
.. js:function:: OctoPrintClient.socket.disconnect()
|
||||
|
||||
Disconnects the socket client.
|
||||
|
||||
.. js:function:: OctoPrintClient.socket.onMessage(message, handler)
|
||||
|
||||
Registers the ``handler`` for messages of type ``message``.
|
||||
|
||||
To register for all message types, provide ``*`` as the type to register for.
|
||||
|
||||
``handler`` is expected to be a function accepting one object parameter ``eventObj``, consisting
|
||||
of the received message as property ``key`` and the received payload (if any) as property ``data``.
|
||||
|
||||
.. code-block:: javascript
|
||||
|
||||
OctoPrint.socket.onMessage("*", function(message) {
|
||||
// do something with the message object
|
||||
});
|
||||
|
||||
The socket client will measure how long message processing over all handlers will take and utilize
|
||||
that measurement to determine if the :ref:`communication throttling <sec-jsclient-socket-throttling>`
|
||||
needs to be adjusted or not.
|
||||
|
||||
Please refer to the :ref:`Push API documentation <sec-api-push>`
|
||||
for details on the possible message types and their payloads.
|
||||
|
||||
:param string message: The type of message for which to register
|
||||
:param function handler: The handler function
|
||||
|
||||
.. js:function:: OctoPrintClient.socket.sendMessage(type, payload)
|
||||
|
||||
Sends a message of type ``type`` with the provided ``payload`` to the server.
|
||||
|
||||
Note that at the time of writing, OctoPrint only supports the ``throttle`` message. See
|
||||
also the :ref:`Push API documentation <sec-api-push>`.
|
||||
|
||||
:param string type: Type of message to send
|
||||
:param object payload: Payload to send
|
||||
|
||||
.. js:function:: OctoPrintClient.socket.onRateTooLow(measured, minimum)
|
||||
|
||||
Called by the socket client when the measured message round trip times have been lower than
|
||||
the current lower processing limit over the full sliding window, indicating that messages
|
||||
are now processed faster than the current rate and a faster rate might be possible.
|
||||
|
||||
Can be overwritten with custom handler methods. The default implementation will call
|
||||
:js:func:`OctoPrint.socket.increaseRate`.
|
||||
|
||||
:param Number measured: Maximal measured message round trip time
|
||||
:param Number minimum: Lower round trip time limit for keeping the rate
|
||||
|
||||
.. js:function:: OctoPrintClient.socket.onRateTooHigh(measured, maximum)
|
||||
|
||||
Called by the socket client when the last measured round trip time was higher than the
|
||||
current upper procesisng limit, indicating that the messages are now processed slower than
|
||||
the current rate requires and a slower rate might be necessary.
|
||||
|
||||
Can be overwritten with custom handler methods. The default implementation will call
|
||||
:js:func:`OctoPrint.socket.decreaseRate`.
|
||||
|
||||
:param Number measured: Measured message round trip time
|
||||
:param Number minimum: Upper round trip time limit for keeping the rate
|
||||
|
||||
.. js:function:: OctoPrintClient.socket.increaseRate()
|
||||
|
||||
Instructs the server to increase the message rate by 500ms.
|
||||
|
||||
.. js:function:: OctoPrintClient.socket.decreaseRate()
|
||||
|
||||
Instructs the server to decrease the message rate by 500ms.
|
||||
|
||||
.. _sec-jsclient-socket-throttling:
|
||||
|
||||
Communication Throttling
|
||||
========================
|
||||
|
||||
The socket client supports communication throttling. It will measure how long each incoming message takes
|
||||
to be processed by all registered handlers. If the processing times in a sliding window are longer than
|
||||
the current rate limit configured on the socket (default: 500ms between messages), the socket client will
|
||||
instruct the server to send slower. If the messages are handled faster than half the current rate limit,
|
||||
the socket client will instruct the server to send faster.
|
||||
@@ -1,38 +0,0 @@
|
||||
.. sec-jsclientlib-system:
|
||||
|
||||
:mod:`OctoPrintClient.system`
|
||||
-----------------------------
|
||||
|
||||
.. note::
|
||||
|
||||
All methods here require that the used API token or a the existing browser session
|
||||
has admin rights.
|
||||
|
||||
.. js:function:: OctoPrintClient.system.getCommands(opts)
|
||||
|
||||
Retrieves a list of configured system commands for both ``core`` and ``custom`` sources.
|
||||
|
||||
:param object opts: Additional options for the request
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. js:function:: OctoPrintClient.system.getCommandsForSource(source, opts)
|
||||
|
||||
Retrieves a list of system commands, limiting it to the specified ``source``, which might be
|
||||
either ``core`` or ``custom``.
|
||||
|
||||
:param object opts: Additional options for the request
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. js:function:: OctoPrintClient.system.executeCommand(source, action, opts)
|
||||
|
||||
Executes command ``action`` on ``source``.
|
||||
|
||||
:param string source: The source of the command to execute
|
||||
:param string action: The action identifier of the command to execute
|
||||
:param object opts: Additional options for the request
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. seealso::
|
||||
|
||||
:ref:`System API <sec-api-system>`
|
||||
Documentation of the underlying system API
|
||||
@@ -1,90 +0,0 @@
|
||||
.. _sec-jsclientlib-timelapse:
|
||||
|
||||
:mod:`OctoPrintClient.timelapse`
|
||||
--------------------------------
|
||||
|
||||
.. js:function:: OctoPrintClient.timelapse.get(unrendered, opts)
|
||||
|
||||
Get a list of all timelapses and the current timelapse config.
|
||||
|
||||
If ``unrendered`` is true, also retrieve the list of unrendered
|
||||
timelapses.
|
||||
|
||||
:param object opts: Additional options for the request
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. js:function:: OctoPrintClient.timelapse.list(opts)
|
||||
|
||||
Get the lists of rendered and unrendered timelapses. The returned promis
|
||||
will be resolved with an object containing the properties ``rendered``
|
||||
which will have the list of rendered timelapses, and ``unrendered`` which
|
||||
will have the list of unrendered timelapses.
|
||||
|
||||
:param object opts: Additional options for the request
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. js:function:: OctoPrintClient.timelapse.listRendered(opts)
|
||||
|
||||
Get the list of rendered timelapses.
|
||||
|
||||
:param object opts: Additional options for the request
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. js:function:: OctoPrintClient.timelapse.listUnrendered(opts)
|
||||
|
||||
Get the list of unrendered timelapses.
|
||||
|
||||
:param object opts: Additional options for the request
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. js:function:: OctoPrintClient.timelapse.download(filename, opts)
|
||||
|
||||
Download the rendered timelapse ``filename``.
|
||||
|
||||
:param string filename: The name of the rendered timelapse to download
|
||||
:param object opts: Additional options for the request
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. js:function:: OctoPrintClient.timelapse.delete(filename, opts)
|
||||
|
||||
Delete the rendered timelapse ``filename``.
|
||||
|
||||
:param string filename: The name of the rendered timelapse to delete
|
||||
:param object opts: Additional options for the request
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. js:function:: OctoPrintClient.timelapse.deleteUnrendered(name, opts)
|
||||
|
||||
Delete the unrendered timelapse ``name``.
|
||||
|
||||
:param string name: The name of the unrendered timelapse to delete
|
||||
:param object opts: Additional options for the request
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. js:function:: OctoPrintClient.timelapse.renderUnrendered(name, opts)
|
||||
|
||||
Render the unrendered timelapse ``name``.
|
||||
|
||||
:param string name: The name of the unrendered timelapse to render
|
||||
:param object opts: Additional options for the request
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. js:function:: OctoPrintClient.timelapse.getConfig(opts)
|
||||
|
||||
Get the current timelapse configuration.
|
||||
|
||||
:param object opts: Additional options for the request
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. js:function:: OctoPrintClient.timelapse.saveConfig(config, opts)
|
||||
|
||||
Save the timelapse configuration.
|
||||
|
||||
:param object config: The config to save
|
||||
:param object opts: Additional options for the request
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. seealso::
|
||||
|
||||
:ref:`Timelapse API <sec-api-timelapse>`
|
||||
The documentation of the underlying timelapse API.
|
||||
@@ -1,106 +0,0 @@
|
||||
.. _sec-jsclientlib-users:
|
||||
|
||||
:mod:`OctoPrintClient.users`
|
||||
----------------------------
|
||||
|
||||
.. note::
|
||||
|
||||
Most methods here require that the used API token or a the existing browser session
|
||||
has admin rights *or* corresponds to the user to be modified. Some methods
|
||||
definitely require admin rights.
|
||||
|
||||
.. js:function:: OctoPrintClient.users.list(opts)
|
||||
|
||||
Get a list of all registered users.
|
||||
|
||||
Requires admin rights.
|
||||
|
||||
:param object opts: Additional options for the request
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. js:function:: OctoPrintClient.users.get(name, opts)
|
||||
|
||||
Get information about a specific user.
|
||||
|
||||
:param string name: The user's name
|
||||
:param object opts: Additional options for the request
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. js:function:: OctoPrintClient.users.add(user, opts)
|
||||
|
||||
Add a new user.
|
||||
|
||||
Requires admin rights.
|
||||
|
||||
:param object user: The new user
|
||||
:param object opts: Additional options for the request
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. js:function:: OctoPrintClient.users.update(name, active, admin, opts)
|
||||
|
||||
Update an existing user.
|
||||
|
||||
Requires admin rights.
|
||||
|
||||
:param string name: The user's name
|
||||
:param bool active: The new ``active`` state of the user
|
||||
:param bool admin: The new ``admin`` state of the user
|
||||
:param object opts: Additional options for the request
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. js:function:: OctoPrintClient.users.delete(name, opts)
|
||||
|
||||
Delete an existing user.
|
||||
|
||||
Requires admin rights.
|
||||
|
||||
:param string name: The user's name
|
||||
:param object opts: Additional options for the request
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. js:function:: OctoPrintClient.users.changePassword(name, password, opts)
|
||||
|
||||
Change the password for a user.
|
||||
|
||||
:param string name: The user's name
|
||||
:param string password: The new password
|
||||
:param object opts: Additional options for the request
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. js:function:: OctoPrintClient.users.generateApiKey(name, opts)
|
||||
|
||||
Generate a new API key for a user.
|
||||
|
||||
:param string name: The user's name
|
||||
:param object opts: Additional options for the request
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. js:function:: OctoPrintClient.users.resetApiKey(name, opts)
|
||||
|
||||
Reset the API key for a user to being unset.
|
||||
|
||||
:param string name: The user's name
|
||||
:param object opts: Additional options for the request
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. js:function:: OctoPrintClient.users.getSettings(name, opts)
|
||||
|
||||
Get the settings for a user.
|
||||
|
||||
:param string name: The user's name
|
||||
:param object opts: Additional options for the request
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. js:function:: OctoPrintClient.users.saveSettings(name, settings, opts)
|
||||
|
||||
Save the settings for a user.
|
||||
|
||||
:param string name: The user's name
|
||||
:param object settings: The new settings, may be a partial set of settings which will be merged unto the current ones
|
||||
:param object opts: Additional options for the request
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. seealso::
|
||||
|
||||
:ref:`User API <sec-api-user>`
|
||||
The documentation of the underlying user API.
|
||||
@@ -1,159 +0,0 @@
|
||||
.. _sec-jsclientlib-util:
|
||||
|
||||
:mod:`OctoPrintClient.util`
|
||||
---------------------------
|
||||
|
||||
.. note::
|
||||
|
||||
All methods here require that the used API token or a the existing browser session
|
||||
has admin rights.
|
||||
|
||||
.. js:function:: OctoPrintClient.util.test(command, parameters, opts)
|
||||
|
||||
Execute a :ref:`test command <sec-api-util-test>`.
|
||||
|
||||
See below for the more specialized versions of this.
|
||||
|
||||
:param string command: The command to execute (currently either ``path`` or ``url``)
|
||||
:param object parameters: The parameters for the command
|
||||
:param object opts: Additional options for the request
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. js:function:: OctoPrintClient.util.testPath(path, additional, opts)
|
||||
|
||||
Test the provided ``path`` for existance. More test criteria supported by the :ref:`path test command <sec-api-util-test-path>`
|
||||
can be provided via the ``additional`` object.
|
||||
|
||||
**Example 1**
|
||||
|
||||
Test if ``/some/path/to/a/file`` exists.
|
||||
|
||||
.. code-block:: javascript
|
||||
|
||||
OctoPrint.util.testPath("/som/path/to/a/file")
|
||||
.done(function(response) {
|
||||
if (response.result) {
|
||||
// check passed
|
||||
} else {
|
||||
// check failed
|
||||
}
|
||||
});
|
||||
|
||||
**Example 2**
|
||||
|
||||
Test if ``/some/path/to/a/file`` exists, is a file and OctoPrint has read and executable rights on it.
|
||||
|
||||
.. code-block:: javascript
|
||||
|
||||
OctoPrint.util.testPath("/som/path/to/a/file", {"check_type": "file", "check_access": ["r", "x"]})
|
||||
.done(function(response) {
|
||||
if (response.result) {
|
||||
// check passed
|
||||
} else {
|
||||
// check failed
|
||||
}
|
||||
});
|
||||
|
||||
:param string path: Path to test
|
||||
:param object additional: Additional parameters for the test command
|
||||
:param object opts: Additional options for the request
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. js:function:: OctoPrintClient.util.testExecutable(path, opts)
|
||||
|
||||
Shortcut to test if a provided ``path`` exists and is executable by OctoPrint.
|
||||
|
||||
**Example**
|
||||
|
||||
Test if ``/some/path/to/a/file`` exists and can be executed by OctoPrint.
|
||||
|
||||
.. code-block:: javascript
|
||||
|
||||
OctoPrint.util.testExecutable("/some/path/to/a/file")
|
||||
.done(function(response) {
|
||||
if (response.result) {
|
||||
// check passed
|
||||
} else {
|
||||
// check failed
|
||||
}
|
||||
});
|
||||
|
||||
This is equivalent to calling :js:func:`OctoPrint.util.testPath` like this:
|
||||
|
||||
.. code-block:: javascript
|
||||
|
||||
OctoPrint.util.testPath("/some/path/to/a/file", {"access": "x"})
|
||||
.done(function(response) {
|
||||
if (response.result) {
|
||||
// check passed
|
||||
} else {
|
||||
// check failed
|
||||
}
|
||||
});
|
||||
|
||||
:param string path: Path to test
|
||||
:param object opts: Additional options for the request
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. js:function:: OctoPrintClient.util.testUrl(url, additional, opts)
|
||||
|
||||
Test if a URL can be accessed. More test criteria supported by the :ref:`URL test command <sec-api-util-test-url>`
|
||||
can be provided via the ``additional`` object.
|
||||
|
||||
**Example 1**
|
||||
|
||||
Test if ``http://octopi.local/online.gif`` can be accessed and returns a non-error status code within the default timeout.
|
||||
|
||||
.. code-block:: javascript
|
||||
|
||||
OctoPrint.util.testUrl("http://octopi.local/online.gif")
|
||||
.done(function(response) {
|
||||
if (response.result) {
|
||||
// check passed
|
||||
} else {
|
||||
// check failed
|
||||
}
|
||||
});
|
||||
|
||||
**Example 2**
|
||||
|
||||
Test if ``http://octopi.local/webcam/?action=snapshot`` can be accessed and returns a non-error status code. Return the
|
||||
raw response data and headers from the check as well.
|
||||
|
||||
.. code-block:: javascript
|
||||
|
||||
OctoPrint.util.testUrl("http://octopi.local/webcam/?action=snapshot", {"response": "bytes", "method": "GET"})
|
||||
.done(function(response) {
|
||||
if (response.result) {
|
||||
// check passed
|
||||
var image = $("#someimage");
|
||||
image.
|
||||
} else {
|
||||
// check failed
|
||||
}
|
||||
});
|
||||
|
||||
**Example 3**
|
||||
|
||||
Test if a "GET" request against ``http://example.com/idonotexist`` returns either a :http:statuscode:`404` or a :http:statuscode:`400`.
|
||||
|
||||
.. code-block:: javascript
|
||||
|
||||
OctoPrint.util.testUrl("http://example.com/idonotexist", {"status": [400, 404], "method": "GET"})
|
||||
.done(function(response) {
|
||||
if (response.result) {
|
||||
// check passed
|
||||
} else {
|
||||
// check failed
|
||||
}
|
||||
});
|
||||
|
||||
:param string url: URL to test
|
||||
:param object additional: Additional parameters for the test command
|
||||
:param object opts: Additional options for the request
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. seealso::
|
||||
|
||||
:ref:`Util API <sec-api-util>`
|
||||
Documentation of the underlying util API
|
||||
@@ -1,29 +0,0 @@
|
||||
.. _sec-jsclientlib-wizard:
|
||||
|
||||
:mod:`OctoPrintClient.wizard`
|
||||
-----------------------------
|
||||
|
||||
.. note::
|
||||
|
||||
All methods here require that the used API token or a the existing browser session
|
||||
has admin rights.
|
||||
|
||||
.. js:function:: OctoPrintClient.wizard.get(opts)
|
||||
|
||||
Retrieve additional data about registered wizards.
|
||||
|
||||
:param object opts: Additional options for the request
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. js:function:: OctoPrintClient.wizard.finish(handled, opts)
|
||||
|
||||
Inform wizards that the wizard dialog has been finished.
|
||||
|
||||
:param list handled: List of identifiers of handled wizards
|
||||
:param object opts: Additional options for the request
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. seealso::
|
||||
|
||||
:ref:`Wizard API <sec-api-wizard>`
|
||||
The documentation of the underlying wizard API.
|
||||
@@ -1,31 +0,0 @@
|
||||
.. _sec-modules-cli:
|
||||
|
||||
octoprint.cli
|
||||
-------------
|
||||
|
||||
.. automodule:: octoprint.cli
|
||||
:members:
|
||||
|
||||
.. _sec-modules-cli-dev:
|
||||
|
||||
octoprint.cli.dev
|
||||
-----------------
|
||||
|
||||
.. automodule:: octoprint.cli.dev
|
||||
:members:
|
||||
|
||||
.. _sec-modules-cli-plugins:
|
||||
|
||||
octoprint.cli.plugins
|
||||
---------------------
|
||||
|
||||
.. automodule:: octoprint.cli.plugins
|
||||
:members:
|
||||
|
||||
.. _sec-modules-cli-server:
|
||||
|
||||
octoprint.cli.server
|
||||
--------------------
|
||||
|
||||
.. automodule:: octoprint.cli.server
|
||||
:members:
|
||||
@@ -1,39 +0,0 @@
|
||||
.. _sec-modules-filemanager:
|
||||
|
||||
octoprint.filemanager
|
||||
---------------------
|
||||
|
||||
.. automodule:: octoprint.filemanager
|
||||
:members:
|
||||
|
||||
.. _sec-modules-filemanager-analysis:
|
||||
|
||||
octoprint.filemanager.analysis
|
||||
------------------------------
|
||||
|
||||
.. automodule:: octoprint.filemanager.analysis
|
||||
:members:
|
||||
|
||||
.. _sec-modules-filemanager-destinations:
|
||||
|
||||
octoprint.filemanager.destinations
|
||||
----------------------------------
|
||||
|
||||
.. automodule:: octoprint.filemanager.destinations
|
||||
:members:
|
||||
|
||||
.. _sec-modules-filemanager-storage:
|
||||
|
||||
octoprint.filemanager.storage
|
||||
-----------------------------
|
||||
|
||||
.. automodule:: octoprint.filemanager.storage
|
||||
:members: StorageInterface, LocalFileStorage
|
||||
|
||||
.. _sec-modules-filemanager-util:
|
||||
|
||||
octoprint.filemanager.util
|
||||
--------------------------
|
||||
|
||||
.. automodule:: octoprint.filemanager.util
|
||||
:members:
|
||||
@@ -1,17 +0,0 @@
|
||||
.. _sec-modules:
|
||||
|
||||
################
|
||||
Internal Modules
|
||||
################
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 3
|
||||
|
||||
cli.rst
|
||||
filemanager.rst
|
||||
plugin.rst
|
||||
printer.rst
|
||||
server.rst
|
||||
settings.rst
|
||||
slicing.rst
|
||||
util.rst
|
||||
@@ -1,20 +0,0 @@
|
||||
.. _sec-modules-plugin:
|
||||
|
||||
octoprint.plugin
|
||||
----------------
|
||||
|
||||
.. automodule:: octoprint.plugin
|
||||
|
||||
.. _sec-modules-plugin-core:
|
||||
|
||||
octoprint.plugin.core
|
||||
---------------------
|
||||
|
||||
.. automodule:: octoprint.plugin.core
|
||||
|
||||
.. _sec-modules-plugin-types:
|
||||
|
||||
octoprint.plugin.types
|
||||
----------------------
|
||||
|
||||
.. automodule:: octoprint.plugin.types
|
||||
@@ -1,6 +0,0 @@
|
||||
.. _sec-modules-printer:
|
||||
|
||||
octoprint.printer
|
||||
-----------------
|
||||
|
||||
.. automodule:: octoprint.printer
|
||||
@@ -1,42 +0,0 @@
|
||||
.. _sec-modules-server:
|
||||
|
||||
octoprint.server
|
||||
----------------
|
||||
|
||||
.. automodule:: octoprint.server
|
||||
:members:
|
||||
|
||||
.. _sec-modules-server-util:
|
||||
|
||||
octoprint.server.util
|
||||
---------------------
|
||||
|
||||
.. automodule:: octoprint.server.util
|
||||
:members:
|
||||
|
||||
.. _sec-modules-server-util-flask:
|
||||
|
||||
octoprint.server.util.flask
|
||||
---------------------------
|
||||
|
||||
.. automodule:: octoprint.server.util.flask
|
||||
:members:
|
||||
|
||||
.. _sec-modules-server-util-sockjs:
|
||||
|
||||
octoprint.server.util.sockjs
|
||||
----------------------------
|
||||
|
||||
.. automodule:: octoprint.server.util.sockjs
|
||||
:members:
|
||||
|
||||
.. _sec-modules-server-util-tornado:
|
||||
|
||||
octoprint.server.util.tornado
|
||||
-----------------------------
|
||||
|
||||
.. automodule:: octoprint.server.util.tornado
|
||||
:members:
|
||||
|
||||
|
||||
|
||||