Infoblox-PS / ibx-sdk

Basic Tools and Functions used by other Integrations.
Apache License 2.0
4 stars 0 forks source link

Potential refactor for the WAPI class #41

Closed yeti9990 closed 9 months ago

yeti9990 commented 9 months ago

Consider refactoring the WAPI class to make life for the programmer EVEN easier!

instead of requiring the user to build up the URL of a WAPI call, like this:

res = wapi.get(f'{wapi.url}/networkcontainer', params={'network': '172.16.0.0/16'})

Why not refactor the WAPI class to do that for you?!

res = wapi.get('networkcontainer', params={'network': '172.16.0.0/16'})

It works with _ref GET requests where you fetch an individual record by reference id.

It would be possible to have a get() method to get one or more and a get_one() method which would always and ONLY return one object. Things that make you go hmmm....

yeti9990 commented 9 months ago

@mjsmithkc WOW - this is really cool - WARNING - this WILL be breaking change when i merge with main

i'm fixing another pesky issue as well - none of the wapi.put, get, delete, post methods handled the verify arg. Now i do it automatically. So it shortens the syntax a great deal! WAY cool

mjsmithkc commented 9 months ago

goforit

yeti9990 commented 9 months ago

closing this as a result of merge #43