fatmcgav/fatmcgav-netapp — pull request #33 by stschulte (2013-06-27 22:46:43+00:00)
Title: Add api helper methods

Hi Gavin,

I noticed that you often check the result of the issued api call and raise exceptions on failures. I tried to write a helper method similar to the `commands` method of the `Puppet::Provider` class.

The `netapp_commands` method lets you define helper methods for each api call you want to use, so in your `qtree` provider you can write

netapp_commands :qadd => 'qtree-create', :qdel => 'qtree-delete'

and then use `qadd 'qtree', 'q1', 'volume', 'v1'` instead of `transport.invoke('qtree-create', 'qtree', 'q1', 'volume', 'v1')`. The helper method will also check the result and raise an error on failures.

Please note that I have not modified any provider to actually use the new helper methods yet