So i want to add custom connection types to our instance, but I am having trouble getting it to work. I am looking at this as a reference.
I added these lines to my custom hook:
Which should have been enough to populate the custom connection type right? Is it because we have not built our custom plugins into a provider, just stored them in the plugins folder?
Commenting to hopefully get this some visibility.
I have some time to dig into this more and i have created a hook that will be inherited by other hooks. Eventually i want the child hooks to be able to modify and create their own connection types using the parent connection type as a minimum requirements. First gotta get this working in the parent hook though:
class IntegrationsHook(HttpHook):
conn_type = 'integrations'
hook_name = 'Integrations Hook'
@staticmethod
def get_connection_form_widgets():
from flask_appbuilder.fieldwidgets import BS3TextFieldWidget
from flask_babel import lazy_gettext
from wtforms import StringField
return {
"extra__vault": StringField(lazy_gettext('Vault'), widget=BS3TextFieldWidget()),
"extra__connection_prefix": StringField(lazy_gettext('Connection Prefix'), widget=BS3TextFieldWidget()),
}
@staticmethod
def get_ui_field_behaviour():
"""
Returns custom field behaviour
:return: a dictionary containing two keys:
'hidden_fields': a set of fields to hide from the UI
'relabeling': a dictionary of {old_name: new_name} to rename fields
"""
return {
'hidden_fields': {'port', 'schema', 'login', 'password'},
'relabeling': {'host': 'Base URL'}
}
I feel like the code is correct but i still don’t see the expected integrations connection type when i go to create a connection. Any help would be appreciated!