Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add call to purge disconnected agents #40

Merged
merged 4 commits into from
Dec 21, 2017
Merged

Conversation

vikman90
Copy link
Member

@vikman90 vikman90 commented Dec 1, 2017

This new call will allow removing unused keys from the manager, purging agents that have not connected in a defined timeframe.

curl -u foo:bar -k -X POST -H "Content-Type:application/json" -d '{"timeframe":10800}' "http://127.0.0.1:55000/agents/purge?pretty"
{
   "error": 0,
   "data": {
      "totalItems": 1
   }
}

@mgmacias95
Copy link
Contributor

mgmacias95 commented Dec 1, 2017

Hello @vikman90,

This PR looks amazing. I think the following suggestions would make it even better 😉 👍

  • Add a time unit for the timeframe. For example: 2m, 1d, 4h, 30s...
  • Add a debug parameter to return removed IDs or not.
  • Add another API call: GET/agents/purgeable with limit and offset parameters.
  • Add a backup parameter.

Also, don't forget to update the CHANGELOG.md file.

Best regards,
Marta

@Lifka Lifka self-assigned this Dec 13, 2017
@mgmacias95
Copy link
Contributor

Amazing! Thank you so much @vikman90 and @Lifka 😄 !

@mgmacias95 mgmacias95 merged commit 82a3115 into master Dec 21, 2017
@mgmacias95 mgmacias95 deleted the dev-purge-agents branch December 21, 2017 00:45
@sonfrau
Copy link

sonfrau commented Feb 6, 2018

Sorry for my ignorance but I'd like to use this new feature but I'm not able to find out any example on your documentation.

Would you mind to supply any related link?

Thanks and kind regards

@sonfrau
Copy link

sonfrau commented Feb 6, 2018

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

Successfully merging this pull request may close these issues.

4 participants