Skip to content

Add and remove tags from a server#61

Open
stefants wants to merge 1 commit into
fog:masterfrom
stefants:fog/feature/add_remove_tags
Open

Add and remove tags from a server#61
stefants wants to merge 1 commit into
fog:masterfrom
stefants:fog/feature/add_remove_tags

Conversation

@stefants
Copy link
Copy Markdown

@stefants stefants commented Sep 7, 2016

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
Copy link
Copy Markdown
Member

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
Copy link
Copy Markdown
Author

stefants commented Sep 7, 2016

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

Thx!

@fernandes
Copy link
Copy Markdown
Member

@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
Copy link
Copy Markdown
Author

stefants commented Oct 6, 2016

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

I've got some new stuff coming soon!

@fernandes
Copy link
Copy Markdown
Member

@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
Copy link
Copy Markdown
Author

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 😄

@plribeiro3000
Copy link
Copy Markdown
Member

@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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants