mirror of
https://git.selfprivacy.org/SelfPrivacy/selfprivacy-rest-api.git
synced 2024-12-01 10:56:39 +00:00
Add API version endpoint
This commit is contained in:
parent
dc56b6f4ad
commit
ec76484857
|
@ -48,7 +48,7 @@ def create_app():
|
||||||
def spec():
|
def spec():
|
||||||
if app.config["ENABLE_SWAGGER"] == "1":
|
if app.config["ENABLE_SWAGGER"] == "1":
|
||||||
swag = swagger(app)
|
swag = swagger(app)
|
||||||
swag["info"]["version"] = "1.0"
|
swag["info"]["version"] = "1.0.0"
|
||||||
swag["info"]["title"] = "SelfPrivacy API"
|
swag["info"]["title"] = "SelfPrivacy API"
|
||||||
swag["info"]["description"] = "SelfPrivacy API"
|
swag["info"]["description"] = "SelfPrivacy API"
|
||||||
swag["securityDefinitions"] = {
|
swag["securityDefinitions"] = {
|
||||||
|
|
|
@ -4,6 +4,31 @@ import subprocess
|
||||||
from flask_restful import Resource, reqparse
|
from flask_restful import Resource, reqparse
|
||||||
|
|
||||||
|
|
||||||
|
class ApiVersion(Resource):
|
||||||
|
"""SelfPrivacy API version"""
|
||||||
|
|
||||||
|
def get(self):
|
||||||
|
"""Get API version
|
||||||
|
---
|
||||||
|
tags:
|
||||||
|
- System
|
||||||
|
security:
|
||||||
|
- bearerAuth: []
|
||||||
|
responses:
|
||||||
|
200:
|
||||||
|
description: API version
|
||||||
|
schema:
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
version:
|
||||||
|
type: string
|
||||||
|
description: API version
|
||||||
|
401:
|
||||||
|
description: Unauthorized
|
||||||
|
"""
|
||||||
|
return {"version": "1.0.0"}
|
||||||
|
|
||||||
|
|
||||||
class DecryptDisk(Resource):
|
class DecryptDisk(Resource):
|
||||||
"""Decrypt disk"""
|
"""Decrypt disk"""
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue