fog / fog-xenserver

Module for the 'fog' gem to support XENSERVER
MIT License
16 stars 22 forks source link

Unplug vif #44

Closed fmbiete closed 9 years ago

fmbiete commented 9 years ago

This is more a question, so sorry beforehand:

How can I plug/unplug a VIF? There is a plug_vif and unplug_vif but I don't know what object has it.

Thanks

plribeiro3000 commented 9 years ago

So the main intention here is to make everything feel more encapsulated. So instead of calling the requests directly from the connections object you can call them directly on the objects.

Since its a vif method you can call it directly on the vif object.

# handle connection
@connection = 'bla bla bla'

# load the vif
@vif = @connections.vifs.first

# plug the vif
@vif.plug

# unplug the vif
@vif.unplug
plribeiro3000 commented 9 years ago

Let me know if you have more questions. Thanks!