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