Skip to content

Instantly share code, notes, and snippets.

@jlsherrill
Last active July 26, 2021 22:54
Show Gist options
  • Save jlsherrill/e089682dcd1402c27142debe7c4468d4 to your computer and use it in GitHub Desktop.
Save jlsherrill/e089682dcd1402c27142debe7c4468d4 to your computer and use it in GitHub Desktop.
cancel all running and wiating pulp3 tasks
yum install jq  # should be in epel
for href in `curl "https://$(hostname)/pulp/api/v3/tasks/?state=running&state=waiting"  --cert /etc/pki/katello/certs/pulp-client.crt --key /etc/pki/katello/private/pulp-client.key | jq '.results[].pulp_href' | awk -F '"' '{print $2}'`; do echo "https://$(hostname)$href" ;   curl "https://$(hostname)$href" -X PATCH -d '{"state": "canceled"}'  -H "Content-Type: application/json"  --cert /etc/pki/katello/certs/pulp-client.crt --key /etc/pki/katello/private/pulp-client.key ; done 






Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment