martindstone / pagerduty-cli

A command line interface for PagerDuty
MIT License
91 stars 13 forks source link

Can we add pipe ability to rest:delete? #16

Closed ajohnson-pdt closed 2 years ago

ajohnson-pdt commented 2 years ago

Not able to pass a piped list of services to rest:delete. This would be very helpful in cleaning up large swaths of unused services with similar names.

tried: pd service:list --filter name={query string} -p | pd rest:delete -e /services -p

martindstone commented 2 years ago

So the reason I have not done this (as well as the reason there are no other *:delete commands) is because I am terrified of the consequences of making a mistake. I am open to ideas here, but a -p flag to a delete command gives me some serious anxiety...

ajohnson-pdt commented 2 years ago

Possible to have a preview of the delete (or summary) and "ARE YOU ABSOLUTELY SURE?"

martindstone commented 2 years ago

Hmm... I could see doing that in a service:delete command... I am still a little scared to do it... maybe if you have to type something more than just y...

ajohnson-pdt commented 2 years ago

Full admission of wrongdoing, please provide your Venmo account for all liability damages. 😛

martindstone commented 2 years ago

Hey @ajohnson-pdt i put in a user:delete command... can you play around with it and let me know if that meets your needs? And if so, what other objects you would be interested in deleting like this?

martindstone commented 2 years ago

@ajohnson-pdt check out the new util:deleteresource command in 0.0.83 and let me know if that works for you?

martindstone commented 2 years ago

Closing this as I believe it’s resolved as noted above