code: def upload(self, filename=None, json=None, as_type='zip'):
          
          headers = {'content-type': 'multipart/form-data'}
          params = None
          files = None
          if filename:
              files = {'ip_addresses': open(filename, 'rb')}
          if as_type == 'json':
              headers = {'accept': 'application/json',
                         'content-type': 'application/json'}
          elif as_type == 'txt':
              params = {'format': 'txt'}
  
          self.make_request(
              CreateElementFailed,
              method='create',
              resource='ip_address_list',
              headers=headers, files=files, json=json,
              params=params)
docs: Upload an IPList to the SMC. The contents of the upload
          are not incremental to what is in the existing IPList.
          So if the intent is to add new entries, you should first retrieve
          the existing and append to the content, then upload.
          The only upload type that can be done without loading a file as
          the source is as_type='json'.
  
          :param str filename: required for zip/txt uploads
          :param str json: required for json uploads
          :param str as_type: type of format to upload in: txt|json|zip (default)
          :raises IOError: filename specified cannot be loaded
          :raises CreateElementFailed: element creation failed with reason
          :return: None