Implement instance restarts with reason

A new api for instance restarts, which includes a reason and count.