Version resource on API with API and software version
This commit is contained in:
parent
76a9e94aed
commit
907f5051e1
1 changed files with 11 additions and 0 deletions
|
|
@ -32,6 +32,9 @@ from . import users as api_users
|
||||||
from . import log as api_logs
|
from . import log as api_logs
|
||||||
|
|
||||||
|
|
||||||
|
VERSION = "1.0"
|
||||||
|
|
||||||
|
|
||||||
def optionsAllowOrigin(request):
|
def optionsAllowOrigin(request):
|
||||||
""" Always reply 200 on OPTIONS request """
|
""" Always reply 200 on OPTIONS request """
|
||||||
|
|
||||||
|
|
@ -135,6 +138,14 @@ def apiPrinterState():
|
||||||
return make_response(("/api/state has been deprecated, use /api/printer instead", 405, []))
|
return make_response(("/api/state has been deprecated, use /api/printer instead", 405, []))
|
||||||
|
|
||||||
|
|
||||||
|
@api.route("/version", methods=["GET"])
|
||||||
|
@restricted_access
|
||||||
|
def apiVersion():
|
||||||
|
return jsonify({
|
||||||
|
"server": octoprint.server.VERSION,
|
||||||
|
"api": octoprint.server.api.VERSION
|
||||||
|
})
|
||||||
|
|
||||||
#~~ system control
|
#~~ system control
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue