-
Notifications
You must be signed in to change notification settings - Fork 46
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
Allow add-system CLI call to update systems as well #21
base: master
Are you sure you want to change the base?
Conversation
Would you mind making a pull request that doesn't include the changes to the .gemspec or Rakefile to make it simpler to merge? |
Do you think it makes more sense to make |
Well I would argue add/update is the same thing, that's effectively how the API works. As it currently stands, if you call add and the system exists, no update is made and no notification is made either. My preference would be to either have add-system do both, or have a new method add-update-system which does both and leave add-system as is. But I don't think update-system is a realistic call as you won't often know if the system exists in the first place. Once you confirm what you think is best, then I will make another pull request |
Any further thoughts on this? |
Can you give me an idea what the use case is for needing to do an add-or-update? Maybe it'll help figure out the right name of it... |
I have an EC2 image for a machine which is used to deploy new machines in an auto-scaling group. On startup, they register themselves so that Papertrail allows logs from that IP, hence they call |
Sorry for the long delay here. I believe I've come up with an even better solution to this problem. I've added a This means you should be able to call:
as part of server boot and it'll ensure that that system name is registered. IP changes will be detected automatically. This has been released as version 0.9.6. Please give it a spin and see if it solves the problem for you. |
I'm not sure I understand what this does to be honest (although admittedly I've only just skimmed the code on my mobile). If in my user case, where I need to register a server on start up, how would I actually use this? Surely I would first need to know if that system name / host had been registered first? That is what I was hoping to avoid, I want a system where you fire and forget knowing that your server has been registered correctly. |
My thinking was, if you use this new way (of registering a hostname to send to a destination port), you won't need to specify the source IP, which means you can call |
I expect you won't want to incorporate the Rakefile update as this is just my personal preference to use Bundler for Gem creation, however the previous commit allows
papertrail-add-system
to update systems as well as add systems when the name already exists.