def set_state(name, backend, state, socket='/var/run/haproxy.sock'):
 class setServerState(haproxy.cmds.Cmd, ):
  'Set server state command.'
  cmdTxt = 'set server %(backend)s/%(server)s state %(value)s\r\n'
  p_args = ['backend', 'server', 'value']
  helpTxt = "Force a server's administrative state to a new state."
 ha_conn = _get_conn(socket)
 ha_cmd = setServerState(server=name, backend=backend, value=state)
 return ha_conn.sendCmd(ha_cmd)

def set_state ( name , backend , state , socket = '/var/run/haproxy.sock' ) : class setServerState ( haproxy . cmds . Cmd , ) : cmdTxt = 'set server %(backend)s/%(server)s state %(value)s\r\n' p_args = [ 'backend' , 'server' , 'value' ] helpTxt = "Force a server's administrative state to a new state." ha_conn = _get_conn ( socket ) ha_cmd = setServerState ( server = name , backend = backend , value = state ) return ha_conn . sendCmd ( ha_cmd )
force a servers administrative state to a new state .