Reference · the tools · environments
protect_environment
Safe to repeatProtect an environment, or unprotect it
What it does
Mark an environment protected, or take that back. A protected environment is left out of cleanups -- never offer it for removal -- and it cannot be destroyed until it is unprotected: destroy_environment always refuses it. Protection never stops, restarts or hides anything. Protect one only when the user asks. Unprotect one only when the user has asked, in their own words, to unprotect that environment: pass their message, quoted exactly, as their_words. Never from a yes to a list you offered, never from a request to destroy it, and never on your own to get a destroy through. A clone, a saved environment or a template of a protected environment starts unprotected. The dashboard's Protect and Unprotect buttons do the same.
What it needs to know
- environment_id
- The environment.
- protected
- true: protect it. false: unprotect it, which needs their_words.
- their_words · optional
- To unprotect: the user's own message asking to unprotect this environment, quoted exactly. It must name the environment and ask to unprotect it. Kept in the box's audit log.
- box · optional
- Which box: its name and account, "home.frank" or "jordan.northwind", or just "home" when only one of your boxes is called that. Omit it for your current box (switch_box changes it; list_boxes says which it is).
- session_box · optional
- The box this session runs on, if it runs on one of yours: its name, as the on-box instructions give it ("frankh90.hemlane"). With it, a call that names no box is checked against your current box.
Where it lands
On one of your boxes: the one named in box, or your default box when none is named.