summaryrefslogtreecommitdiff
path: root/ick2/versionapi.py
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2017-11-18 20:28:55 +0100
committerLars Wirzenius <liw@liw.fi>2017-11-18 20:28:55 +0100
commit10edd83909027a647e256afb76dc6a09a55b553b (patch)
tree0bd4c7fa856ceab0513d6c81999daddd0b83a085 /ick2/versionapi.py
parentceae946c47b4ce34d9d66652b94df66d82fe8c69 (diff)
downloadick2-10edd83909027a647e256afb76dc6a09a55b553b.tar.gz
Refactor: move VersionAPI into its own module
Diffstat (limited to 'ick2/versionapi.py')
-rw-r--r--ick2/versionapi.py49
1 files changed, 49 insertions, 0 deletions
diff --git a/ick2/versionapi.py b/ick2/versionapi.py
new file mode 100644
index 0000000..f17c333
--- /dev/null
+++ b/ick2/versionapi.py
@@ -0,0 +1,49 @@
+# Copyright (C) 2017 Lars Wirzenius
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+
+import ick2
+
+
+class VersionAPI(ick2.APIbase):
+
+ def __init__(self, state):
+ super().__init__(state)
+
+ def get_routes(self, path): # pragma: no cover
+ return [
+ {
+ 'method': 'GET',
+ 'path': path,
+ 'callback': self.GET(self.get_version),
+ }
+ ]
+
+ def get_version(self):
+ return {'version': ick2.__version__}
+
+ def create(self, *args): # pragma: no cover
+ pass
+
+ def update(self, *args): # pragma: no cover
+ pass
+
+ def delete(self, *args): # pragma: no cover
+ pass
+
+ def list(self): # pragma: no cover
+ pass
+
+ def show(self, *args): # pragma: no cover
+ pass