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

Adding Hetzner compute api #1247

Closed
ahmeij opened this issue Nov 4, 2012 · 7 comments
Closed

Adding Hetzner compute api #1247

ahmeij opened this issue Nov 4, 2012 · 7 comments

Comments

@ahmeij
Copy link
Contributor

ahmeij commented Nov 4, 2012

Hi,

I am adding the Hetzner (www.hetzner.de) compute api. They rent out dedicated hardware which can be configured and rebooted via an api.

I have the basic setup working, I can see my servers, reboot them, get the available images. I could really use a couple of hints on how to proceed to get this more in line with the fog standards (although I tried following them) the current changes: https://github.com/ahmeij/fog/compare/hetzner

Also a question, in a lot of implementations there is a method 'setup' on the server model, which seems to be a duplicate for most of them, should this method be moved to the core/server model? (I can make the change in another feature branch if needed)

Thanks, Andre

@geemus
Copy link
Member

geemus commented Nov 5, 2012

@ahmeij - Seems like a good start, though we will want to flesh out some tests before we get this merged in. Nothing jumped out at me as being too far off, but there may be some subtle differences. Did you have particular questions?

Moving setup to core/server could make a lot of sense, but we should be careful as I think there may be some small/subtle differences from one provider to another in this realm.

@ahmeij
Copy link
Contributor Author

ahmeij commented Nov 5, 2012

Thanks @geemus, I planned to add some specific questions but other work took my attention. My questions:

  • I do not understand the test setup really, it seems the tests are testing the mocks, I probably misunderstand;
  • in the compute.rb the mocks do stuff with self.data, is there some documentation about how this should be implemented, it currently is a copy from the linode implementation, but I don not understand the function;
  • the setup methods (server model) saves attributes and metadata as json on the instance, I see multiple implementations do this however I don't see where this information is retrieved / used, neither do I know what the metadata contains.

Any pointers to good reference implementations or some documentation would be helpful, currently a lack of understanding is blocking my progress :)

@geemus
Copy link
Member

geemus commented Nov 6, 2012

@ahmeij - sure thing, hopefully I can clear things up.

  • This document might help some: http://fog.io/1.7.0/about/contributing.html
  • The tests are of the mock by default, but there is an expectation that setting FOG_MOCK=false would run real tests (and that they would also all pass).
  • self.data is setup in the mock class as a hash, generally with a few basic values that a brand new account would have. There are many examples here but maybe not great docs, happy to clarify any questions that grow around that, but starting from an existing one should probably get you headed in the right direction.
  • The setup methods save that data so that the bootstrap method can use it, if I remember correctly. Also part of the idea is that this data is added there consistently so that regardless of what service or whatever you are using you know where you can find that data if/when you need it.

@vcastellm
Copy link

Would be great to see this released!

@ahmeij
Copy link
Contributor Author

ahmeij commented Dec 4, 2012

I have taken all my hetzner instances into production, limiting my options of testing this code. I'll see if I can add the required tests anyway, testing based on the mocks should give a good start.

I hope to get this done this week

@geemus
Copy link
Member

geemus commented Dec 5, 2012

@ahmeij - thanks for the update, just let me know if you have any questions along the way.

@geemus
Copy link
Member

geemus commented Dec 18, 2013

Closing as this hasn't been touched in a year. If this was closed in error or is still an issue, please re-open. Thanks!

@geemus geemus closed this as completed Dec 18, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants