Closed omkaringale closed 3 years ago
It is expecting you to pass in the Controller Service definition as an object, not just the name of the class. You can find the one you want by filtering the canvas.list_all_controller_types method by name, I could add a convenience function for this if you think it'd be helpful?
Created a separate function to filter the name from the list
def get_controller_custom(identifier,identifier_type='name'):
controller_list = nipyapi.canvas.list_all_controller_types()
return nipyapi.utils.filter_obj(controller_list, identifier, identifier_type)
Thanks for your help!!!
Added this for the next release, should do the job similar to get_processor_type
def get_controller_type(identifier, identifier_type='name', greedy=True):
"""
Gets the abstract object describing a controller, or list thereof
Args:
identifier (str): the string to filter the list for
identifier_type (str): the field to filter on, set in config.py
greedy (bool): False for exact match, True for greedy match
Returns:
None for no matches, Single Object for unique match,
list(Objects) for multiple matches
"""
with nipyapi.utils.rest_exceptions():
obj = list_all_controller_types
if obj:
return nipyapi.utils.filter_obj(
obj, identifier, identifier_type, greedy=greedy
)
return obj
Description
Trying to setup a ssl service to get data from a site in a secure way using getHTTP processor
What I Did
canvas.create_controller(pg_1,'org.apache.nifi.ssl.StandardSSLContextService',name=None)
Error : __AssertionError Traceback (most recent call last)