Version resource on API with API and software version
This commit is contained in:
1 parent
76a9e94aed
commit
907f5051e1
1 file changed
+11
@@ -32,6 +32,9 @@ from . import users as api_users
|
||||
from . import log as api_logs
|
||||
|
||||
|
||||
VERSION = "1.0"
|
||||
|
||||
|
||||
def optionsAllowOrigin(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, []))
|
||||
|
||||
|
||||
@api.route("/version", methods=["GET"])
|
||||
@restricted_access
|
||||
def apiVersion():
|
||||
return jsonify({
|
||||
"server": octoprint.server.VERSION,
|
||||
"api": octoprint.server.api.VERSION
|
||||
})
|
||||
|
||||
#~~ system control
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user