fog / fog-xenserver

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

Add and remove tags from a server #61

Open stefants opened 8 years ago

stefants commented 8 years ago

Hello!

I'd like to add support to adding and removing tags from a VM. Please let me know if you have any questions!

fernandes commented 8 years ago

Hi @stefants thanks for the PR... could you please point to the documentation where's this method? I tried to find and couldn't.

Thank you

stefants commented 8 years ago

Hi @fernandes, I am following these docs: https://xapi-project.github.io/xen-api/classes/vm.html

Thx!

fernandes commented 7 years ago

@stefants hey! 28 days... shame on me! sorry about taking so long on this! after the review we are good to merge 😎

thank you! 🙇

stefants commented 7 years ago

Hey @fernandes, thanks for your time, I'm glad to contribute! :smile:

I've got some new stuff coming soon!

fernandes commented 7 years ago

@stefants great!

  1. are you going to make the changes on review?
  2. would you like to open an issue to discuss new stuff? heheh
stefants commented 7 years ago

Hi @fernandes ,

I'm not sure I follow... what changes on review?

I've also added some other methods to the VM class, but they're not related to this PR. If you prefer, I can surely open an issue to discuss them :smile:

plribeiro3000 commented 7 years ago

@stefants Sorry for missing this out.

Can i suggest one change?

If you take a look here you will find out that we are using meta programming to make some methods call out of the box. When calling a method on an instance, if that instance does not have that method, it will automatically look for a request with that name appended with underscore and the object class name, in this case _vm.

This means that if you call this request add_tag_vm and remove_tag_vm it will be possible to call add_tag and remove_tag on a server object without even passing the reference like so:

@server.add_tag(tag)
@server.remove_tag(tag)

All current requests follow this pattern. See: image