Skip to main content

ConnectorRegistry

This is the registry for all connectors. The connector service will look up the connector registry based on the task type and version.

Methods


register()

@classmethod
def register(
connector: [AsyncConnector](asyncconnector.md?sid=flyte_connectors__connector_asyncconnector),
override: bool = False
) - > null

Registers a new connector in the global registry and updates its associated metadata. Raises a ValueError if a connector for the same task type and version already exists, unless override is set to True.

Parameters

NameTypeDescription
connector[AsyncConnector](asyncconnector.md?sid=flyte_connectors__connector_asyncconnector)The asynchronous connector instance to be registered, containing task type and version information.
overridebool = FalseA flag indicating whether to overwrite an existing registration for the same task type and version.

Returns

TypeDescription
null

get_connector()

@classmethod
def get_connector(
task_type_name: str,
task_type_version: int = 0
) - > [AsyncConnector](asyncconnector.md?sid=flyte_connectors__connector_asyncconnector)

Retrieves a registered connector based on its task type name and version. Throws a FlyteConnectorNotFound exception if no matching connector is found in the registry.

Parameters

NameTypeDescription
task_type_namestrThe unique identifier for the type of task the connector handles.
task_type_versionint = 0The specific version of the task type to retrieve.

Returns

TypeDescription
[AsyncConnector](asyncconnector.md?sid=flyte_connectors__connector_asyncconnector)The connector instance associated with the specified task type and version.