]> git.llucax.com Git - software/pymin.git/blob - services/dns/host.py
Add GPL v3 license to the project
[software/pymin.git] / services / dns / host.py
1 # vim: set encoding=utf-8 et sw=4 sts=4 :
2
3 # TODO documentation
4
5 from pymin.validation import Item, Field, HostName, IPAddress
6 from pymin.service.util import DictComposedSubHandler
7
8 __all__ = ('HostHandler',)
9
10
11 class Host(Item):
12     name = Field(HostName(not_empty=True))
13     ip = Field(IPAddress(not_empty=True))
14
15 class HostHandler(DictComposedSubHandler):
16     handler_help = u"Manage DNS hosts"
17     _comp_subhandler_cont = 'zones'
18     _comp_subhandler_attr = 'hosts'
19     _comp_subhandler_class = Host
20