'Drain action, sets the server to DRAIN mode.
In this mode mode, the server will not accept any new connections
other than those that are accepted via persistence.'

def drain(self, host, backend):

    haproxy_version = self.discover_version()
    if (haproxy_version and ((1, 5) <= haproxy_version)):
        cmd = 'set    server    $pxname/$svname    state    drain'
        self.execute_for_backends(cmd, backend, host, 'DRAIN')
