Esempio n. 1
0
 def add_port_forward(self, config):
     settings = xmlobjects.VirtualServerCollection()
     settings.parseXML(self.port_forwards)
     if not isinstance(config, list):
         config = [config]
     for cfg in config:
         settings.add_service(cfg)
     return self.api('security/virtual-servers', settings)
Esempio n. 2
0
 def remove_port_forward(self, config):
     settings = xmlobjects.VirtualServerCollection()
     settings.parseXML(self.port_forwards)
     if not isinstance(config, list):
         config = [config]
     for cfg in config:
         name = self._get_param(cfg, 'name')
         settings.remove_service(name)
     return self.api('security/virtual-servers', settings)