Hello, Is there anyway to delete all subscriptions in one shot from a queue using Legacy SEMP and SEMP V2?
@nram @Aaron
Thank you
Hello, Is there anyway to delete all subscriptions in one shot from a queue using Legacy SEMP and SEMP V2?
@nram @Aaron
Thank you
Hey @Manikanta ! Looking at the SEMPv2 API documentation, you can get the list of all subscriptions /msgVpns/{msgVpnName}/queues/{queueName}/subscriptions
and loop trough deleting the subscriptions /msgVpns/{msgVpnName}/queues/{queueName}/subscriptions/{subscriptionTopic}
. I know you mentioned one shot tho I’ll see if anyone else has another input
Hello @Manikanta , there is no “single command” to delete all subscriptions. As @Tamimi mentioned, you need to get the list of subscriptions first and iterate over them to delete. You can ofcourse build a wrapper around it … something like:
AUTH="user:pass"
SEMP_CFG_URL="http://localhost:8080/SEMP/v2/config"
VPN="test-vpn"
QUEUE="test-queue"
curl -X GET -u ${AUTH} -H content-type:application/json "${SEMP_CFG_URL}/msgVpns/${VPN}/queues/${QUEUE}/subscriptions" | \
grep subscriptionTopic |cut -f2 -d:|sed 's/\//\%2F/g' | sed 's/"//g' | \
while read TOPIC; do
echo Deleting ${TOPIC}
curl -X DELETE -u ${AUTH} -H content-type:application/json "${SEMP_CFG_URL}/msgVpns/${VPN}/queues/${QUEUE}/subscriptions/${TOPIC}"
done