2016-08-26 15:47:38 +00:00
|
|
|
.. sec-jsclientlib-system:
|
|
|
|
|
|
|
|
|
|
:mod:`OctoPrint.system`
|
|
|
|
|
-----------------------
|
|
|
|
|
|
2016-09-22 14:27:06 +00:00
|
|
|
.. note::
|
2016-08-26 15:47:38 +00:00
|
|
|
|
2016-09-22 14:27:06 +00:00
|
|
|
All methods here require that the used API token or a the existing browser session
|
|
|
|
|
has admin rights.
|
2016-08-26 15:47:38 +00:00
|
|
|
|
|
|
|
|
.. js:function:: OctoPrint.system.getCommands(opts)
|
|
|
|
|
|
2016-09-22 14:27:06 +00:00
|
|
|
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
|
|
|
|
|
|
2016-08-26 15:47:38 +00:00
|
|
|
.. js:function:: OctoPrint.system.getCommandsForSource(source, opts)
|
|
|
|
|
|
2016-09-22 14:27:06 +00:00
|
|
|
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
|
|
|
|
|
|
2016-08-26 15:47:38 +00:00
|
|
|
.. js:function:: OctoPrint.system.executeCommand(source, action, opts)
|
2016-09-22 14:27:06 +00:00
|
|
|
|
|
|
|
|
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
|