infobloxopen/infoblox-client

Missing required support for file upload and download on the fileop object

Closed this issue · 0 comments

  • OS - Mac OS X 11.2.1 (big sur)
  • Python 3.9.2
  • infoblox-client 0.5.0 (master)

There is currently no support for uploading files or downloading files when using the fileop object. For example, when calling uploadinit function on the Connector as part of a CSV import, there is no mechanism for performing a POST w/ files=<files_object> to the fully-qualified URL provided in the uploadinit response. The flow of performing a CSV import is as follows:

  1. call function on the connector uploadinit - the repose contains TOKEN and URL (a fully-qualified URL upload path)
  2. perform a POST to the fully-qualified URL provided in step 1 w/ a files= as the payload
  3. call function on the connector csv_import using the TOKEN provided in step 1

There are two (2) items of functionality that are not handled in the infoblox-client:

  1. there is no method on the Connector class that allows you to pass a fully-qualified URL to a POST or GET
  2. there is no support for handling multipart-form/data support for handling files when uploading - there is only data= support, not files=<file_payload>

One option to fix this is to add two (2) generic methods on the Connector class a simple POST and GET method call with the required params in the method signature.

Another option is to examine the Connector class and see if it can be incorporated into the call_func() method. Not sure this is the right spot since call_func() is likely to call WAPI functions on supported objects.