Was the arrest of Nicolás Maduro legal?

The U.S. strikes in Venezuela are sure to reignite a centuries-old debate about when the president can deploy the military.