from parallels.plesk.utils.xml_rpc.plesk import Client


class PleskMultiServerClient(Client):
    def send_multi_server(self, operation, node_ip=None, ipv4=None, ipv6=None, **request_settings):
        if node_ip is not None:
            request_settings['ext-plesk-multi-server:node-ip'] = node_ip
        if ipv4 is not None:
            request_settings['ext-plesk-multi-server:ipv4'] = ipv4
        if ipv6 is not None:
            request_settings['ext-plesk-multi-server:ipv6'] = ipv6

        return self.send(operation, plesk_rpc_forwarding_to_ext='plesk-multi-server', **request_settings)
