axxyhtrx / pysphere

Automatically exported from code.google.com/p/pysphere
0 stars 0 forks source link

Add a __getitem__ method to VIVirtualMachine class #39

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
This is an enhancement proposal. It would be fantastic if we could add a 
__getitem__ method to VIVirtualMachine classes so that one might be able to 
index a VIVirtualMachine instance—like so: vm['memory_mb']—and get the 
pertinent information. This would essentially be a shorthand for the following:
``
vm.get_properties()['memory_mb']
``

Original issue reported on code.google.com by ad...@vbridges.com on 30 Aug 2013 at 3:53

GoogleCodeExporter commented 9 years ago
Note that there's an optional parameter in properties from_cache which makes it 
impossible to be *replaced* by something like this. Imo it's not a good thing 
to have two obvious ways to get exactly the same information.

Original comment by seppo.yl...@gmail.com on 4 Dec 2013 at 2:22