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

consistent private/public ip accessors (thanks abecc) #60

Closed
geemus opened this issue Nov 4, 2010 · 4 comments
Closed

consistent private/public ip accessors (thanks abecc) #60

geemus opened this issue Nov 4, 2010 · 4 comments
Labels

Comments

@geemus
Copy link
Member

geemus commented Nov 4, 2010

for instance AWS servers have private_ip_address and ip_address

but Rackspace servers have addresses['public'] and addresses['private'](which are arrays)

array vs single value may need to be reconciled and naming should be unified

private_ip_address and public_ip_address would probably be good as the accessors

So other stuff will need to be updated and/or deprecated as appropriate to allow for this

You may want to talk to geemus before tackling this, because it could be a bit hairy. Otherwise I'll get to it eventually.

@geemus
Copy link
Member Author

geemus commented Feb 8, 2011

This shouldn't be too crazy I don't think.

For each server model we just want to have #public_ip_address and #private_ip_address.

If there happens to be more than one just return the primary one, or the first one if there is no clear primary one. If for some reason there is no ip address for one option or the other this call should simply return nil.

Shared server tests should also be updated to ensure that the model responds_to both of the previously mentioned methods.

@joakimk
Copy link

joakimk commented Feb 9, 2011

I'd like to see this, but I also want it to allocate IP's when needed.

For Brightbox there is no public IP by default, so you have to create or reuse an existing cloud_ip with a few additional API calls.

What I would want is essentially this:
compute = Fog::Compute.new({ ... any provider conf ...})
server = compute.servers.create({ .. })
ssh(server.public_ip, ...)

(How I do this now: https://github.com/joakimk/testbot_cloud/blob/master/lib/server/brightbox.rb).

@geemus
Copy link
Member Author

geemus commented Feb 9, 2011

I can definitely see how that would be useful. But I think it is outside of scope for this particular ticket. It would make sense to have this functionality as a part of the 'bootstrap' command though, I think.

@geemus
Copy link
Member Author

geemus commented Feb 23, 2011

[compute] consolidate ip accessors

closed by 9a40a17

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

No branches or pull requests

2 participants