ActionsClientInterface
This class defines the interface for actions operations, combining the responsibilities of queue and state clients. It provides methods for enqueuing, updating the status of, and aborting actions, as well as listing child actions. The class also supports subscribing to and unsubscribing from action updates, and managing the watching of TaskAction resources.
Methods
Enqueue()
@classmethod
def Enqueue(
ctx: context.Context,
action: *actions.Action,
runSpec: *task.RunSpec
) - > error
Creates a TaskAction CR in Kubernetes.
Parameters
| Name | Type | Description |
|---|---|---|
| ctx | context.Context | The context for the operation, allowing cancellation and timeouts. |
| action | *actions.Action | The action to be enqueued, containing details about the task to be performed. |
| runSpec | *task.RunSpec | The run specification for the action, defining how and where the action should be executed. |
Returns
| Type | Description |
|---|---|
error | An error if the TaskAction could not be created. |
PutStatus()
@classmethod
def PutStatus(
ctx: context.Context,
actionID: *common.ActionIdentifier,
attempt: uint32,
status: *workflow.ActionStatus
) - > error
Updates the status of a TaskAction.
Parameters
| Name | Type | Description |
|---|---|---|
| ctx | context.Context | The context for the operation, allowing cancellation and timeouts. |
| actionID | *common.ActionIdentifier | The identifier of the action whose status is being updated. |
| attempt | uint32 | The attempt number for the action, used to track retries or multiple executions. |
| status | *workflow.ActionStatus | The new status to set for the action, reflecting its current state (e.g., running, completed, failed). |
Returns
| Type | Description |
|---|---|
error | An error if the status update failed. |
AbortAction()
@classmethod
def AbortAction(
ctx: context.Context,
actionID: *common.ActionIdentifier,
reason: *string
) - > error
Aborts a queued or running action, cascading to descendants.
Parameters
| Name | Type | Description |
|---|---|---|
| ctx | context.Context | The context for the operation, allowing cancellation and timeouts. |
| actionID | *common.ActionIdentifier | The identifier of the action to be aborted. |
| reason | *string | The reason for aborting the action, providing context for the cancellation. |
Returns
| Type | Description |
|---|---|
error | An error if the action could not be aborted. |
ListChildActions()
@classmethod
def ListChildActions(
ctx: context.Context,
parentActionID: *common.ActionIdentifier
) - > []*executorv1.TaskAction, error
Lists all TaskActions that are children of the given parent action.
Parameters
| Name | Type | Description |
|---|---|---|
| ctx | context.Context | The context for the operation, allowing cancellation and timeouts. |
| parentActionID | *common.ActionIdentifier | The identifier of the parent action for which to list child actions. |
Returns
| Type | Description |
|---|---|
[]*executorv1.TaskAction, error | A slice of child TaskActions and an error if the listing failed. |
Subscribe()
@classmethod
def Subscribe(
parentActionName: string
) - > chan *k8s.ActionUpdate
Creates a new subscription channel for action updates for the given parent action name.
Parameters
| Name | Type | Description |
|---|---|---|
| parentActionName | string | The name of the parent action to subscribe to for updates. |
Returns
| Type | Description |
|---|---|
chan *k8s.ActionUpdate | A channel that will receive updates for the specified parent action. |
Unsubscribe()
@classmethod
def Unsubscribe(
parentActionName: string,
ch: chan *k8s.ActionUpdate
)
Removes the given channel from the subscription list for the parent action name.
Parameters
| Name | Type | Description |
|---|---|---|
| parentActionName | string | The name of the parent action from which to unsubscribe the channel. |
| ch | chan *k8s.ActionUpdate | The channel to be removed from the subscription list. |
StartWatching()
@classmethod
def StartWatching(
ctx: context.Context
) - > error
Starts watching TaskAction resources.
Parameters
| Name | Type | Description |
|---|---|---|
| ctx | context.Context | The context for the operation, allowing cancellation and timeouts. |
Returns
| Type | Description |
|---|---|
error | An error if the watcher could not be started. |
StopWatching()
@classmethod
def StopWatching()
Stops the TaskAction watcher.