Connector API
api_create_connector_from_endpoint(ep_id)
Creates a connector based on the provided endpoint ID.
This function retrieves the endpoint arguments using the provided endpoint ID and then creates a connector based on those arguments. It utilizes the ConnectorManager's read_endpoint method to fetch the endpoint arguments and then calls the create_connector method to initialize and return the connector.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
ep_id |
str
|
The ID of the endpoint for which to create a connector. |
required |
Returns:
Name | Type | Description |
---|---|---|
Connector |
Connector
|
An initialized Connector object. |
Source code in moonshot/src/api/api_connector.py
api_create_connectors_from_endpoints(ep_ids)
Creates connectors for multiple endpoints based on their IDs.
This function takes a list of endpoint IDs, retrieves the corresponding endpoint arguments for each ID, and then creates a connector for each set of arguments. It utilizes the ConnectorEndpoint's read method to fetch the endpoint arguments and then calls the Connector's create method to initialize the connectors.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
ep_ids |
conlist(str, min_length=1
|
A list of endpoint IDs for which to create connectors. |
required |
Returns:
Type | Description |
---|---|
list[Connector]
|
list[Connector]: A list of initialized Connector objects. |
Source code in moonshot/src/api/api_connector.py
api_get_all_connector_type()
Retrieves a list of all available connector types.
This function calls the ConnectorManager's get_available_connector_types method to retrieve a list of all available connector types. It returns the list of connector types.
Returns:
Type | Description |
---|---|
list[str]
|
list[str]: A list of connector types. |