summaryrefslogtreecommitdiff
path: root/src/mailman/rest/root.py
diff options
context:
space:
mode:
authorBarry Warsaw2014-12-26 18:32:30 -0500
committerBarry Warsaw2014-12-26 18:32:30 -0500
commitee2fdc578b5e0209a9e661cc1455aaff5dc8443a (patch)
tree8187b97ef08764aab3bc642e56e6242d7f555354 /src/mailman/rest/root.py
parentcfdc3d9f6a358b76135ea42dbd03f8ed782af9a9 (diff)
downloadmailman-ee2fdc578b5e0209a9e661cc1455aaff5dc8443a.tar.gz
mailman-ee2fdc578b5e0209a9e661cc1455aaff5dc8443a.tar.zst
mailman-ee2fdc578b5e0209a9e661cc1455aaff5dc8443a.zip
Diffstat (limited to 'src/mailman/rest/root.py')
-rw-r--r--src/mailman/rest/root.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/mailman/rest/root.py b/src/mailman/rest/root.py
index 654b230a3..8cbe4061a 100644
--- a/src/mailman/rest/root.py
+++ b/src/mailman/rest/root.py
@@ -77,13 +77,13 @@ class Root:
return TopLevel()
-class System:
+class Versions:
def on_get(self, request, response):
- """/<api>/system"""
+ """/<api>/system/versions"""
resource = dict(
mailman_version=system.mailman_version,
python_version=system.python_version,
- self_link=path_to('system'),
+ self_link=path_to('system/versions'),
)
okay(response, etag(resource))
@@ -95,11 +95,14 @@ class TopLevel:
def system(self, request, segments):
"""/<api>/system"""
if len(segments) == 0:
- return System()
+ # This provides backward compatibility; see /system/versions.
+ return Versions()
elif len(segments) > 1:
return BadRequest(), []
elif segments[0] == 'preferences':
return ReadOnlyPreferences(system_preferences, 'system'), []
+ elif segments[0] == 'versions':
+ return Versions(), []
else:
return NotFound(), []