Skip to main content

Plugin

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

NameTypeDescription
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

TypeDescription
webapi.PluginConfigThe 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 given context.

Parameters

NameTypeDescription
_context.ContextThe context for the operation, typically used for cancellation and deadlines.
_webapi.TaskExecutionContextReaderA reader for the task execution context, providing information about the task being executed.

Returns

TypeDescription
(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 a new resource based on the provided context and task execution details.

Parameters

NameTypeDescription
ctxcontext.ContextThe context for the operation, typically used for cancellation and deadlines.
taskCtxwebapi.TaskExecutionContextReaderA reader for the task execution context, providing details necessary for resource creation.

Returns

TypeDescription
(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 status and details of a specific resource.

Parameters

NameTypeDescription
ctxcontext.ContextThe context for the operation, typically used for cancellation and deadlines.
taskCtxwebapi.GetContextThe context for the get operation, containing identifiers for the resource to be retrieved.

Returns

TypeDescription
(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 resource. This method is used to remove a specified resource from the system.

Parameters

NameTypeDescription
ctxcontext.ContextThe context for the operation, typically used for cancellation and deadlines.
taskCtxwebapi.DeleteContextThe context for the delete operation, containing identifiers for the resource to be deleted.

Returns

TypeDescription
errorAn 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, error

Retrieves event information for a connector application. This method is used internally to gather task logs related to a specific connector application and resource.

Parameters

NameTypeDescription
taskCtxwebapi.StatusContextThe status context providing information about the task's current state.
resource[ResourceWrapper](resourcewrapper.md?sid=flyteplugins_go_tasks_plugins_webapi_connector_resourcewrapper)The wrapper around the resource for which event information is needed.

Returns

TypeDescription
[]*flyteIdl.TaskLog, errorA slice of task logs associated with the connector application and an error if retrieval failed.

Status()

@classmethod
def Status(
ctx: context.Context,
taskCtx: webapi.StatusContext
) - > (phase core.PhaseInfo, err error)

Retrieves the current status of a task. Callers use this method to monitor the progress and state of an ongoing task.

Parameters

NameTypeDescription
ctxcontext.ContextThe context for the operation, typically used for cancellation and deadlines.
taskCtxwebapi.StatusContextThe status context providing information about the task whose status is being queried.

Returns

TypeDescription
(phase core.PhaseInfo, err error)A tuple containing the current phase information of the task and an error if status retrieval failed.

getAsyncConnectorClient()

@classmethod
def getAsyncConnectorClient(
ctx: context.Context,
connector: *Deployment
) - > connectorPb.AsyncConnectorServiceClient, error

Obtains an asynchronous client for a connector. This method is used internally to establish a connection to a connector service for asynchronous operations.

Parameters

NameTypeDescription
ctxcontext.ContextThe context for the operation, typically used for cancellation and deadlines.
connector*DeploymentThe deployment configuration for the connector.

Returns

TypeDescription
connectorPb.AsyncConnectorServiceClient, errorAn asynchronous connector service client and an error if client creation failed.

watchConnectors()

@classmethod
def watchConnectors(
ctx: context.Context,
connectorService: *ConnectorService
)

Initiates watching for changes in connectors. This method sets up a mechanism to observe and react to updates or events related to connector services.

Parameters

NameTypeDescription
ctxcontext.ContextThe context for the operation, typically used for cancellation and deadlines.
connectorService*ConnectorServiceThe connector service instance to be watched for changes.

getFinalConnector()

@classmethod
def getFinalConnector(
taskCategory: *connectorPb.TaskCategory,
cfg: *Config,
project: string,
domain: string
) - > *Connector, error

Determines the final connector based on task category, configuration, project, and domain. This method is used to resolve and retrieve the appropriate connector instance for a given set of parameters.

Parameters

NameTypeDescription
taskCategory*connectorPb.TaskCategoryThe category of the task, used to identify the type of connector needed.
cfg*ConfigThe plugin configuration, providing general settings.
projectstringThe project identifier associated with the task.
domainstringThe domain identifier associated with the task.

Returns

TypeDescription
*Connector, errorThe resolved connector instance and an error if the connector could not be determined.