Sureties are entitled to judgment by motion against their principals:

(1) Whenever judgment has been rendered against them as such sureties;
(2) Whenever such judgment, or any part thereof, has been paid by the surety.