No overview available.
Methods
setRegistry()
@classmethod
def setRegistry(
r: [Registry](registry.md?sid=flyteplugins_go_tasks_plugins_webapi_connector_registry)
)
Sets the registry for the plugin. This method is used to provide the plugin with access to the registry, which manages various components and services.
Parameters
| Name | Type | Description |
|---|
| r | [Registry](registry.md?sid=flyteplugins_go_tasks_plugins_webapi_connector_registry) | The Registry instance to be set for the plugin. |
GetConfig()
@classmethod
def GetConfig() - > webapi.PluginConfig
Retrieves the configuration for the plugin. Callers use this to access the current operational settings of the plugin.
Returns
| Type | Description |
|---|
webapi.PluginConfig | The configuration object for the plugin. |
ResourceRequirements()
@classmethod
def ResourceRequirements(
_: context.Context,
_: webapi.TaskExecutionContextReader
) - > (namespace core.ResourceNamespace, constraints core.ResourceConstraintsSpec, err error)
Determines the resource requirements for a task. This method is used to specify the necessary resources (e.g., CPU, memory) for executing a task within the plugin's context.
Parameters
| Name | Type | Description |
|---|
| _ | context.Context | The context for the operation, typically used for cancellation and deadlines. |
| _ | webapi.TaskExecutionContextReader | A reader for the task execution context, providing information about the task being executed. |
Returns
| Type | Description |
|---|
(namespace core.ResourceNamespace, constraints core.ResourceConstraintsSpec, err error) | A tuple containing the resource namespace, resource constraints specification, and an error if any occurred. |
Create()
@classmethod
def Create(
ctx: context.Context,
taskCtx: webapi.TaskExecutionContextReader
) - > (webapi.ResourceMeta, webapi.Resource, error)
Creates a new resource. This method is invoked to provision and initialize a resource managed by the plugin.
Parameters
| Name | Type | Description |
|---|
| ctx | context.Context | The context for the operation, typically used for cancellation and deadlines. |
| taskCtx | webapi.TaskExecutionContextReader | A reader for the task execution context, providing information about the task requesting resource creation. |
Returns
| Type | Description |
|---|
(webapi.ResourceMeta, webapi.Resource, error) | A tuple containing the resource metadata, the created resource, and an error if the creation failed. |
Get()
@classmethod
def Get(
ctx: context.Context,
taskCtx: webapi.GetContext
) - > (latest webapi.Resource, err error)
Retrieves the latest state of a resource. Callers use this method to fetch the current details and status of a specific resource.
Parameters
| Name | Type | Description |
|---|
| ctx | context.Context | The context for the operation, typically used for cancellation and deadlines. |
| taskCtx | webapi.GetContext | The context for the get operation, including identifiers for the resource to retrieve. |
Returns
| Type | Description |
|---|
(latest webapi.Resource, err error) | A tuple containing the latest version of the resource and an error if the retrieval failed. |
Delete()
@classmethod
def Delete(
ctx: context.Context,
taskCtx: webapi.DeleteContext
) - > error
Deletes a specified resource. This method is used to remove a resource managed by the plugin.
Parameters
| Name | Type | Description |
|---|
| ctx | context.Context | The context for the operation, typically used for cancellation and deadlines. |
| taskCtx | webapi.DeleteContext | The context for the delete operation, including identifiers for the resource to delete. |
Returns
| Type | Description |
|---|
error | An error if the deletion failed, otherwise nil. |
getEventInfoForConnectorApp()
@classmethod
def getEventInfoForConnectorApp(
taskCtx: webapi.StatusContext,
resource: [ResourceWrapper](resourcewrapper.md?sid=flyteplugins_go_tasks_plugins_webapi_connector_resourcewrapper)
) - > []*flyteIdl.TaskLog
Retrieves event information for a connector application. This method is used to gather logs or event details related to a specific connector application's execution.
Parameters
| Name | Type | Description |
|---|
| taskCtx | webapi.StatusContext | The context for retrieving status, including information about the task. |
| resource | [ResourceWrapper](resourcewrapper.md?sid=flyteplugins_go_tasks_plugins_webapi_connector_resourcewrapper) | The wrapper around the resource for which event information is needed. |
Returns
| Type | Description |
|---|
[]*flyteIdl.TaskLog | A slice of task logs associated with the connector application, or an error if retrieval fails. |
Status()
@classmethod
def Status(
ctx: context.Context,
taskCtx: webapi.StatusContext
) - > (phase core.PhaseInfo, err error)
Retrieves the current status of a resource. Callers use this method to check the progress and state of a resource managed by the plugin.
Parameters
| Name | Type | Description |
|---|
| ctx | context.Context | The context for the operation, typically used for cancellation and deadlines. |
| taskCtx | webapi.StatusContext | The context for retrieving status, including information about the task. |
Returns
| Type | Description |
|---|
(phase core.PhaseInfo, err error) | A tuple containing the current phase information of the resource and an error if status retrieval failed. |
getAsyncConnectorClient()
@classmethod
def getAsyncConnectorClient(
ctx: context.Context,
connector: *Deployment
) - > connectorPb.AsyncConnectorServiceClient
Obtains an asynchronous client for a connector. This method is used to establish a connection and interact with a specific connector service asynchronously.
Parameters
| Name | Type | Description |
|---|
| ctx | context.Context | The context for the operation, typically used for cancellation and deadlines. |
| connector | *Deployment | A pointer to the Deployment object representing the connector configuration. |
Returns
| Type | Description |
|---|
connectorPb.AsyncConnectorServiceClient | An asynchronous client for the connector service, or an error if client creation fails. |
watchConnectors()
@classmethod
def watchConnectors(
ctx: context.Context,
connectorService: *ConnectorService
)
Monitors connectors for changes or events. This method sets up a watch mechanism to observe the state and activity of connector services.
Parameters
| Name | Type | Description |
|---|
| ctx | context.Context | The context for the operation, typically used for cancellation and deadlines. |
| connectorService | *ConnectorService | A pointer to the ConnectorService instance to be watched. |
getFinalConnector()
@classmethod
def getFinalConnector(
taskCategory: *connectorPb.TaskCategory,
cfg: *Config,
project: string,
domain: string
) - > *Connector
Determines the final connector configuration based on task category, plugin configuration, project, and domain. This method resolves and returns the appropriate connector to be used for a given task.
Parameters
| Name | Type | Description |
|---|
| taskCategory | *connectorPb.TaskCategory | A pointer to the task category, which helps in identifying the type of connector needed. |
| cfg | *Config | A pointer to the plugin's configuration, providing global settings. |
| project | string | The project identifier associated with the task. |
| domain | string | The domain identifier associated with the task. |
Returns
| Type | Description |
|---|
*Connector | A pointer to the resolved Connector object, or an error if the connector cannot be determined. |