summaryrefslogtreecommitdiff
path: root/src/mailman/rest/docs
diff options
context:
space:
mode:
authorBarry Warsaw2014-12-26 22:59:02 -0500
committerBarry Warsaw2014-12-26 22:59:02 -0500
commit37ee257a8b0ccdcab41703b04d68e3f939017988 (patch)
tree54f5a586f2c8a1f09ccd5ba7826b3646f0e49624 /src/mailman/rest/docs
parentee2fdc578b5e0209a9e661cc1455aaff5dc8443a (diff)
downloadmailman-37ee257a8b0ccdcab41703b04d68e3f939017988.tar.gz
mailman-37ee257a8b0ccdcab41703b04d68e3f939017988.tar.zst
mailman-37ee257a8b0ccdcab41703b04d68e3f939017988.zip
* You can access the system configuration via the resource path
``/3.0/system/configuration/<section>``. This returns a dictionary with the keys being the section's variables and the values being their value from ``mailman.cfg`` as verbatim strings. You can get a list of all section names via ``/3.0/system/configuration`` which returns a dictionary containing the ``http_etag`` and the section names as a sorted list under the ``sections`` key. The system configuration resource is read-only.
Diffstat (limited to 'src/mailman/rest/docs')
-rw-r--r--src/mailman/rest/docs/listconf.rst (renamed from src/mailman/rest/docs/configuration.rst)0
-rw-r--r--src/mailman/rest/docs/systemconf.rst34
2 files changed, 34 insertions, 0 deletions
diff --git a/src/mailman/rest/docs/configuration.rst b/src/mailman/rest/docs/listconf.rst
index 841ab3c27..841ab3c27 100644
--- a/src/mailman/rest/docs/configuration.rst
+++ b/src/mailman/rest/docs/listconf.rst
diff --git a/src/mailman/rest/docs/systemconf.rst b/src/mailman/rest/docs/systemconf.rst
new file mode 100644
index 000000000..66953f4ba
--- /dev/null
+++ b/src/mailman/rest/docs/systemconf.rst
@@ -0,0 +1,34 @@
+====================
+System configuration
+====================
+
+The entire system configuration is available through the REST API. You can
+get a list of all defined sections.
+
+ >>> dump_json('http://localhost:9001/3.0/system/configuration')
+ http_etag: ...
+ sections: ['antispam', 'archiver.mail_archive', 'archiver.master', ...
+
+You can also get all the values for a particular section.
+
+ >>> dump_json('http://localhost:9001/3.0/system/configuration/mailman')
+ default_language: en
+ email_commands_max_lines: 10
+ filtered_messages_are_preservable: no
+ http_etag: ...
+ layout: testing
+ noreply_address: noreply
+ pending_request_life: 3d
+ post_hook:
+ pre_hook:
+ sender_headers: from from_ reply-to sender
+ site_owner: noreply@example.com
+
+Dotted section names work too, for example, to get the French language
+settings section.
+
+ >>> dump_json('http://localhost:9001/3.0/system/configuration/language.fr')
+ charset: iso-8859-1
+ description: French
+ enabled: yes
+ http_etag: ...