Whenever the commission shall be of the opinion that any person or utility is failing or omitting or about to fail or omit to do anything required of it by this act or by any order of the commission, or is doing anything or about to do anything, or permitting anything or about to permit anything to be done, contrary to or in violation of this act or of any order of the commission, it may direct the attorney general of New Mexico to commence an action or proceeding in the district court in and for the county of Santa Fe, or in the district court of the county in which the complaint or controversy arose, in the name of the state of New Mexico for the purpose of having such violations or threatened violations stopped and prevented either by mandamus or injunction. The attorney general of New Mexico shall thereupon begin such action or proceeding by petition to such court, alleging the violation or threatened violation complained of, and praying for appropriate relief by way of mandamus or injunction. It shall thereupon be the duty of the court to specify a time, not exceeding thirty days after the service of the copy of the petition, within which the public utility or person complained of must plead, and in the meantime said public utility or person may for good cause shown be restrained. In case of default, the court shall immediately inquire into the facts and circumstances of the case. Such corporations or persons as the court may deem necessary or proper to be joined as parties, in order to make its judgment, order or writ effective, may be joined as parties. The final judgment in any such action or proceeding shall either dismiss the action or proceeding or direct that the writ of mandamus or injunction issue or be made permanent as prayed for in the petition, or in such modified or other form as will afford appropriate relief. An appeal may be taken as in other civil actions.
NMS § 62-12-1