Skip to main content

Task

No overview available.

Attributes

AttributeTypeDescription
pb2task_definition_pb2.TaskThe task protobuf definition.

Constructor

Signature

def Task(
pb2: task_definition_pb2.Task
) - > null

Parameters

NameTypeDescription
pb2task_definition_pb2.TaskThe task protobuf definition.

Methods


name()

@classmethod
def name() - > str

The name of the task.

Returns

TypeDescription
strThe name of the task.

version()

@classmethod
def version() - > str

The version of the task.

Returns

TypeDescription
strThe version of the task.

entrypoint()

@classmethod
def entrypoint() - > bool

Whether this task is marked as an entrypoint. Not populated in listing responses; fetch TaskDetails to read the authoritative value from the task template.

Returns

TypeDescription
boolWhether this task is marked as an entrypoint.

url()

@classmethod
def url() - > str

Get the console URL for viewing the task.

Returns

TypeDescription
strThe console URL for viewing the task.

get()

@classmethod
def get(
name: str,
project: str | None = None,
domain: str | None = None,
version: str | None = None,
auto_version: AutoVersioning | None = None
) - > LazyEntity

Get a task by its ID or name. If both are provided, the ID will take precedence. Either version or auto_version are required parameters.

Parameters

NameTypeDescription
namestrThe name of the task.
project`strNone` = None
domain`strNone` = None
version`strNone` = None
auto_version`AutoVersioningNone` = None

Returns

TypeDescription
LazyEntityThe LazyEntity representing the task.

listall()

@classmethod
def listall(
by_task_name: str | None = None,
by_task_env: str | None = None,
project: str | None = None,
domain: str | None = None,
sort_by: Tuple[str, Literal["asc", "desc"]]| None = None,
limit: int = 100,
entrypoint: bool | None = None
) - > Union[AsyncIterator[[Task](task.md?sid=flyte_remote__task_task)], Iterator[[Task](task.md?sid=flyte_remote__task_task)]]

Get all tasks for the current project and domain.

Parameters

NameTypeDescription
by_task_name`strNone` = None
by_task_env`strNone` = None
project`strNone` = None
domain`strNone` = None
sort_by`Tuple[str, Literal["asc", "desc"]]None` = None
limitint = 100The maximum number of tasks to return.
entrypoint`boolNone` = None

Returns

TypeDescription
Union[AsyncIterator[[Task](task.md?sid=flyte_remote__task_task)], Iterator[[Task](task.md?sid=flyte_remote__task_task)]]An iterator of tasks.