The plaintiff at the time of commencing an action, or at any time afterward before judgment, may have the property of the defendant, or that of any one or more of several defendants, attached in the manner prescribed in this chapter, as security for the satisfaction of such judgment as the plaintiff may recover.