Skip to content

Instantly share code, notes, and snippets.

@dwelch2344
Created March 23, 2016 16:46
Show Gist options
  • Save dwelch2344/ada7c0761d876e20418d to your computer and use it in GitHub Desktop.
Save dwelch2344/ada7c0761d876e20418d to your computer and use it in GitHub Desktop.
When looking at the Consul ui / services tab, run this to get rid of everything (assuming you're tunneled into the right box -- since the Agent API only relates to the node executed on)
$('.name small')
.map( (i,e) => e.innerText.trim() )
.filter( (i,e) => e.indexOf("service:") == 0)
.map( (i,e) => e.replace("service:", '') )
.each( (i,e) => {
var url = "http://localhost:8500/v1/agent/service/deregister/" + e
console.log('Trying', url)
$.ajax({
type: "GET",
url: url,
async: true,
success: function () {
console.log('Success', e)
}
})
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment