dnaeon / pyinfoblox

Infoblox WAPI module for Python
16 stars 11 forks source link

return_fields parameter for get request #14

Closed z3rohour closed 5 years ago

z3rohour commented 5 years ago

Allows to pass 'return_fields' parameter to get() method to get additional parameters of an object.

Simple example how to use to get extensible attributes for the object record:host

iblox = InfobloxWAPI(username='admin', password='p@ssw0rd,', wapi='https://ipam.local/wapi/v2.7.3/')
iblox.record_host.get(ipv4addr='192.168.1.1', return_fields='extattrs')
dnaeon commented 5 years ago

Thanks for the PR.

Isn't this something that can be done as described in #6 ?

Thanks, Marin

z3rohour commented 5 years ago

Hey,

Actually you're right, it can be done like:

params = {'ipv4addr': '192.168.1.1', '_return_fields+': 'extattrs'}
iblox.record_host.get(**params)

Didn't think of that :) Sorry for disturbance

Cheers, Eugene

dnaeon commented 5 years ago

No problem :)

Maybe it would be better to have this mentioned in the readme.

Would you mind documenting this for others to know as well?

Thanks, Marin

z3rohour commented 5 years ago

Hey,

Sure, why not :) Committed

Cheers, Eugene

dnaeon commented 5 years ago

Hey @z3rohour ,

Before I merge this can you make sure that the PR touches only the README file? Currently it also changes permissions of __init__.py as well.

Thanks!

z3rohour commented 5 years ago

Hey,

My bad, I'm using windows and didn't keep track of permissions change. Fixed now

dnaeon commented 5 years ago

Thanks!