summaryrefslogtreecommitdiff
path: root/src/mailman/interfaces/domain.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/mailman/interfaces/domain.py')
-rw-r--r--src/mailman/interfaces/domain.py26
1 files changed, 25 insertions, 1 deletions
diff --git a/src/mailman/interfaces/domain.py b/src/mailman/interfaces/domain.py
index f9476fc3d..96ec1568d 100644
--- a/src/mailman/interfaces/domain.py
+++ b/src/mailman/interfaces/domain.py
@@ -29,7 +29,7 @@ __all__ = [
from lazr.restful.declarations import (
collection_default_content, export_as_webservice_collection,
- export_as_webservice_entry, exported)
+ export_as_webservice_entry, export_factory_operation, exported)
from zope.interface import Interface, Attribute
from zope.schema import TextLine
@@ -174,3 +174,27 @@ class IDomainCollection(Interface):
:return: The list of all known domains.
:rtype: list of `IDomain`
"""
+
+ @export_factory_operation(
+ IDomain,
+ ('email_host', 'description', 'base_url', 'contact_address'))
+ def new(email_host, description=None, base_url=None, contact_address=None):
+ """Add a new domain.
+
+ :param email_host: The email host name for the domain.
+ :type email_host: string
+ :param description: The description of the domain.
+ :type description: string
+ :param base_url: The base url, including the scheme for the web
+ interface of the domain. If not given, it defaults to
+ http://`email_host`/
+ :type base_url: string
+ :param contact_address: The email contact address for the human
+ managing the domain. If not given, defaults to
+ postmaster@`email_host`
+ :type contact_address: string
+ :return: The new domain object
+ :rtype: `IDomain`
+ :raises `BadDomainSpecificationError`: when the `email_host` is
+ already registered.
+ """