Forum Discussion

Kelemvor's avatar
Icon for Expert rankExpert
3 months ago

Any easy way to delete a Step from a website check?


I have a couple hundred websites where I need to delete the 2nd Step.  ("name": "__step1",).  There doesn’t seem to be a built-in way to mess with Steps directly from the API.  I’d have to read in the site, then figure out how to remove the info for the 2nd Step, then write it back in or something like that.

Does anyone know how hard this might be to do?  I’m using Powershell and can pull the data in just fine.  It’s the editing and rewriting it back up that I’m not sure how to do.  If it was just a couple sites I would even worry about the API.  But since it’s 250+, I thought it might help.  But if it’s going to be really complicated, it might be faster to just brute force through them manually.


3 Replies

  • I don’t know how to do it in powershell, but in Python, you’d just pull the websites in, loop through each one removing the step, then do a PUT to get it back in LM. Doing a PUT replaces whatever is there with your payload, so if you leave something out, it gets deleted.

  • Other than syntax, I’m sure they work the same.  I’d just have to figure out how to read through the info and figure out how to remove just the chunk that I don’t want any more.  Hmm.

  • Yep, that’s what i mean. I’m sure posh can do it, i just don’t know how myself. The strategy is the same.