You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I noticed nipyapi.nifi.ProcessGroupsApi.upload_process_group_with_http_info() (seems to have been removed in Nipyapi 0.19.0) had no argument for the JSON flow definition path. By taking a deeper dive I also discovered that arguments body, body2, body3, body4 and body5 are never actually included or used in the function in addition to the file argument missing.
What I Did
I fixed it myself! An argument that will contain the JSON file path obviously needs to be added;
Once all of these things are fixed, the function should look something like this:
defupload_process_group_with_http_info(self, id, body, body2, body3, body4, **kwargs):
""" Uploads a versioned flow definition and creates a process group This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please define a `callback` function to be invoked when receiving the response. >>> def callback_function(response): >>> pprint(response) >>> >>> thread = api.upload_process_group_with_http_info(id, body, body2, body3, body4, callback=callback_function) :param callback function: The callback function for asynchronous request. (optional) :param str id: The process group id. (required) :param str body: The process group name. (required) :param float body2: The process group X position. (required) :param float body3: The process group Y position. (required) :param str body4: The client id. (required) :param bool body5: Acknowledges that this node is disconnected to allow for mutable requests to proceed. :param str file: Path to JSON flow definition. :return: ProcessGroupEntity If the method is called asynchronously, returns the request thread. """all_params= ['id', 'body', 'body2', 'body3', 'body4', 'body5', 'file']
all_params.append('callback')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
params=locals()
forkey, valiniteritems(params['kwargs']):
ifkeynotinall_params:
raiseTypeError(
"Got an unexpected keyword argument '%s'"" to method upload_process_group"%key
)
params[key] =valdelparams['kwargs']
# verify the required parameter 'id' is setif ('id'notinparams) or (params['id'] isNone):
raiseValueError("Missing the required parameter `id` when calling `upload_process_group`")
# verify the required parameter 'body' is setif ('body'notinparams) or (params['body'] isNone):
raiseValueError("Missing the required parameter `body` when calling `upload_process_group`")
# verify the required parameter 'body2' is setif ('body2'notinparams) or (params['body2'] isNone):
raiseValueError("Missing the required parameter `body2` when calling `upload_process_group`")
# verify the required parameter 'body3' is setif ('body3'notinparams) or (params['body3'] isNone):
raiseValueError("Missing the required parameter `body3` when calling `upload_process_group`")
# verify the required parameter 'body4' is setif ('body4'notinparams) or (params['body4'] isNone):
raiseValueError("Missing the required parameter `body4` when calling `upload_process_group`")
collection_formats= {}
path_params= {}
if'id'inparams:
path_params['id'] =params['id']
query_params= []
header_params= {}
form_params= []
if'body'inparams:
form_params.append(tuple(["groupName", params['body']]))
if'body2'inparams:
form_params.append(tuple(["positionX", int(params['body2'])]))
if'body3'inparams:
form_params.append(tuple(["positionY", int(params['body3'])]))
if'body4'inparams:
form_params.append(tuple(["clientId", params['body4']]))
if'body5'inparams:
form_params.append(tuple(["disconnectedNodeAcknowledged",params['body5']]))
local_var_files= {}
if'file'inparams:
local_var_files['file'] =params['file']
body_params=None# HTTP header `Accept`header_params['Accept'] =self.api_client.\
select_header_accept(['application/json'])
# HTTP header `Content-Type`header_params['Content-Type'] =self.api_client.\
select_header_content_type(['multipart/form-data'])
# Authentication settingauth_settings= ['tokenAuth']
returnself.api_client.call_api('/process-groups/{id}/process-groups/upload', 'POST',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='ProcessGroupEntity',
auth_settings=auth_settings,
callback=params.get('callback'),
_return_http_data_only=params.get('_return_http_data_only'),
_preload_content=params.get('_preload_content', True),
_request_timeout=params.get('_request_timeout'),
collection_formats=collection_formats)
Urgency
As evident above, I resolved this myself but it would be nice to patch up for others at some point.
The text was updated successfully, but these errors were encountered:
Description
I noticed
nipyapi.nifi.ProcessGroupsApi.upload_process_group_with_http_info()
(seems to have been removed in Nipyapi 0.19.0) had no argument for the JSON flow definition path. By taking a deeper dive I also discovered that argumentsbody
,body2
,body3
,body4
andbody5
are never actually included or used in the function in addition to the file argument missing.What I Did
I fixed it myself! An argument that will contain the JSON file path obviously needs to be added;
Furthermore, all body arguments need to be appended to the
form_params
list as tuples like so;The JSON flow definiton path also needs to be added to the
local_var_files
dictionary;Once all of these things are fixed, the function should look something like this:
Urgency
As evident above, I resolved this myself but it would be nice to patch up for others at some point.
The text was updated successfully, but these errors were encountered: