Skip to content

prefect.orion.schemas.actions

Reduced schemas for accepting API actions.

BlockCreate pydantic-model

Data used by the Orion API to create a block.

Source code in prefect/orion/schemas/actions.py
class BlockCreate(
    schemas.core.Block.subclass(
        name="BlockCreate",
        include_fields=["name", "data", "block_spec_id"],
    )
):
    """Data used by the Orion API to create a block."""

block_spec_id pydantic-field required

Type: UUID

A block spec ID

data pydantic-field

Type: dict

The block's data

name pydantic-field required

Type: str

The block's name'

BlockSpecCreate pydantic-model

Data used by the Orion API to create a block spec.

Source code in prefect/orion/schemas/actions.py
class BlockSpecCreate(
    schemas.core.BlockSpec.subclass(
        name="BlockSpecCreate",
        include_fields=["name", "version", "type", "fields"],
    )
):
    """Data used by the Orion API to create a block spec."""

fields pydantic-field

Type: dict

The block spec's field schema

name pydantic-field required

Type: str

The block spec's name

type pydantic-field

Type: str

The block spec's type

version pydantic-field required

Type: str

The block spec's version

BlockUpdate pydantic-model

Data used by the Orion API to update a block.

Source code in prefect/orion/schemas/actions.py
class BlockUpdate(PrefectBaseModel):
    """Data used by the Orion API to update a block."""

    name: Optional[str]
    data: Optional[dict]

ConcurrencyLimitCreate pydantic-model

Data used by the Orion API to create a concurrency limit.

Source code in prefect/orion/schemas/actions.py
class ConcurrencyLimitCreate(
    schemas.core.ConcurrencyLimit.subclass(
        name="ConcurrencyLimitCreate",
        include_fields=["tag", "concurrency_limit"],
    )
):
    """Data used by the Orion API to create a concurrency limit."""

concurrency_limit pydantic-field required

Type: int

The concurrency limit.

tag pydantic-field required

Type: str

A tag the concurrency limit is applied to.

DeploymentCreate pydantic-model

Data used by the Orion API to create a deployment.

Source code in prefect/orion/schemas/actions.py
class DeploymentCreate(
    schemas.core.Deployment.subclass(
        name="DeploymentCreate",
        include_fields=[
            "name",
            "flow_id",
            "schedule",
            "is_schedule_active",
            "tags",
            "parameters",
            "flow_data",
            "flow_runner",
        ],
    )
):
    """Data used by the Orion API to create a deployment."""

flow_data pydantic-field required

Type: DataDocument

A data document representing the flow code to execute.

flow_id pydantic-field required

Type: UUID

The flow id associated with the deployment.

flow_runner pydantic-field

Type: FlowRunnerSettings

The flow runner to assign to flow runs associated with this deployment.

is_schedule_active pydantic-field

Type: bool

Whether or not the deployment schedule is active.

name pydantic-field required

Type: str

The name of the deployment.

parameters pydantic-field

Type: Dict[str, Any]

Parameters for flow runs scheduled by the deployment.

schedule pydantic-field

Type: Union[prefect.orion.schemas.schedules.IntervalSchedule, prefect.orion.schemas.schedules.CronSchedule, prefect.orion.schemas.schedules.RRuleSchedule]

A schedule for the deployment.

tags pydantic-field

Type: List[str]

A list of tags for the deployment

DeploymentFlowRunCreate pydantic-model

Data used by the Orion API to create a flow run from a deployment.

Source code in prefect/orion/schemas/actions.py
class DeploymentFlowRunCreate(
    schemas.core.FlowRun.subclass(
        name="FlowRunCreate",
        include_fields=[
            "name",
            "parameters",
            "context",
            "tags",
            "idempotency_key",
            "flow_runner",
        ],
    )
):
    """Data used by the Orion API to create a flow run from a deployment."""

    # FlowRunCreate states must be provided as StateCreate objects
    state: StateCreate = Field(None, description="The state of the flow run to create")

context pydantic-field

Type: dict

Additional context for the flow run.

flow_runner pydantic-field

Type: FlowRunnerSettings

The flow runner to use to create infrastructure to execute this flow run

idempotency_key pydantic-field

Type: str

An optional idempotency key for the flow run. Used to ensure the same flow run is not created multiple times.

name pydantic-field

Type: str

The name of the flow run. Defaults to a random slug if not specified.

parameters pydantic-field

Type: dict

Parameters for the flow run.

state pydantic-field

Type: StateCreate

The state of the flow run to create

tags pydantic-field

Type: List[str]

A list of tags on the flow run

FlowCreate pydantic-model

Data used by the Orion API to create a flow.

Source code in prefect/orion/schemas/actions.py
class FlowCreate(
    schemas.core.Flow.subclass(
        name="FlowCreate",
        include_fields=["name", "tags"],
    )
):
    """Data used by the Orion API to create a flow."""

name pydantic-field required

Type: str

The name of the flow

tags pydantic-field

Type: List[str]

A list of flow tags

FlowRunCreate pydantic-model

Data used by the Orion API to create a flow run.

Source code in prefect/orion/schemas/actions.py
class FlowRunCreate(
    schemas.core.FlowRun.subclass(
        name="FlowRunCreate",
        include_fields=[
            "name",
            "flow_id",
            "deployment_id",
            "flow_version",
            "parameters",
            "context",
            "tags",
            "idempotency_key",
            "parent_task_run_id",
            "flow_runner",
        ],
    )
):
    """Data used by the Orion API to create a flow run."""

    # FlowRunCreate states must be provided as StateCreate objects
    state: StateCreate = Field(None, description="The state of the flow run to create")

context pydantic-field

Type: dict

Additional context for the flow run.

deployment_id pydantic-field

Type: UUID

The id of the deployment associated with this flow run, if available.

flow_id pydantic-field required

Type: UUID

The id of the flow being run.

flow_runner pydantic-field

Type: FlowRunnerSettings

The flow runner to use to create infrastructure to execute this flow run

flow_version pydantic-field

Type: str

The version of the flow executed in this flow run.

idempotency_key pydantic-field

Type: str

An optional idempotency key for the flow run. Used to ensure the same flow run is not created multiple times.

name pydantic-field

Type: str

The name of the flow run. Defaults to a random slug if not specified.

parameters pydantic-field

Type: dict

Parameters for the flow run.

parent_task_run_id pydantic-field

Type: UUID

If the flow run is a subflow, the id of the 'dummy' task in the parent flow used to track subflow state.

state pydantic-field

Type: StateCreate

The state of the flow run to create

tags pydantic-field

Type: List[str]

A list of tags on the flow run

FlowRunUpdate pydantic-model

Data used by the Orion API to update a flow run.

Source code in prefect/orion/schemas/actions.py
class FlowRunUpdate(
    schemas.core.FlowRun.subclass(
        name="FlowRunUpdate",
        include_fields=["flow_version", "parameters", "name", "flow_runner"],
    )
):
    """Data used by the Orion API to update a flow run."""

flow_runner pydantic-field

Type: FlowRunnerSettings

The flow runner to use to create infrastructure to execute this flow run

flow_version pydantic-field

Type: str

The version of the flow executed in this flow run.

name pydantic-field

Type: str

The name of the flow run. Defaults to a random slug if not specified.

parameters pydantic-field

Type: dict

Parameters for the flow run.

FlowUpdate pydantic-model

Data used by the Orion API to update a flow.

Source code in prefect/orion/schemas/actions.py
class FlowUpdate(
    schemas.core.Flow.subclass(name="FlowUpdate", include_fields=["tags"])
):
    """Data used by the Orion API to update a flow."""

tags pydantic-field

Type: List[str]

A list of flow tags

LogCreate pydantic-model

Data used by the Orion API to create a log.

Source code in prefect/orion/schemas/actions.py
class LogCreate(
    schemas.core.Log.subclass(
        name="LogCreate",
        include_fields=[
            "name",
            "level",
            "message",
            "timestamp",
            "flow_run_id",
            "task_run_id",
        ],
    )
):
    """Data used by the Orion API to create a log."""

flow_run_id pydantic-field required

Type: UUID

The flow run ID associated with the log.

level pydantic-field required

Type: int

The log level.

message pydantic-field required

Type: str

The log message.

name pydantic-field required

Type: str

The logger name.

task_run_id pydantic-field

Type: UUID

The task run ID associated with the log.

timestamp pydantic-field required

Type: datetime

The log timestamp.

SavedSearchCreate pydantic-model

Data used by the Orion API to create a saved search.

Source code in prefect/orion/schemas/actions.py
class SavedSearchCreate(
    schemas.core.SavedSearch.subclass(
        name="SavedSearchCreate",
        include_fields=["name", "filters"],
    )
):
    """Data used by the Orion API to create a saved search."""

filters pydantic-field

Type: List[prefect.orion.schemas.core.SavedSearchFilter]

The filter set for the saved search.

name pydantic-field required

Type: str

The name of the saved search.

StateCreate pydantic-model

Data used by the Orion API to create a new state.

Source code in prefect/orion/schemas/actions.py
class StateCreate(
    schemas.states.State.subclass(
        name="StateCreate",
        include_fields=[
            "type",
            "name",
            "message",
            "data",
            "state_details",
        ],
    )
):
    """Data used by the Orion API to create a new state."""

TaskRunCreate pydantic-model

Data used by the Orion API to create a task run

Source code in prefect/orion/schemas/actions.py
class TaskRunCreate(
    schemas.core.TaskRun.subclass(
        name="TaskRunCreate",
        include_fields=[
            "name",
            "flow_run_id",
            "task_key",
            "dynamic_key",
            "cache_key",
            "cache_expiration",
            "task_version",
            "empirical_policy",
            "tags",
            "task_inputs",
        ],
    )
):
    """Data used by the Orion API to create a task run"""

    # TaskRunCreate states must be provided as StateCreate objects
    state: StateCreate = Field(None, description="The state of the task run to create")

cache_expiration pydantic-field

Type: datetime

Specifies when the cached state should expire.

cache_key pydantic-field

Type: str

An optional cache key. If a COMPLETED state associated with this cache key is found, the cached COMPLETED state will be used instead of executing the task run.

dynamic_key pydantic-field required

Type: str

A dynamic key used to differentiate between multiple runs of the same task within the same flow run.

flow_run_id pydantic-field required

Type: UUID

The flow run id of the task run.

state pydantic-field

Type: StateCreate

The state of the task run to create

tags pydantic-field

Type: List[str]

A list of tags for the task run.

task_inputs pydantic-field

Type: Dict[str, List[Union[prefect.orion.schemas.core.TaskRunResult, prefect.orion.schemas.core.Parameter, prefect.orion.schemas.core.Constant]]]

Tracks the source of inputs to a task run. Used for internal bookkeeping.

task_key pydantic-field required

Type: str

A unique identifier for the task being run.

task_version pydantic-field

Type: str

The version of the task being run.

WorkQueueCreate pydantic-model

Data used by the Orion API to create a work queue.

Source code in prefect/orion/schemas/actions.py
class WorkQueueCreate(
    schemas.core.WorkQueue.subclass(
        "WorkQueueCreate",
        include_fields=[
            "filter",
            "name",
            "description",
            "is_paused",
            "concurrency_limit",
        ],
    )
):
    """Data used by the Orion API to create a work queue."""

concurrency_limit pydantic-field

Type: int

An optional concurrency limit for the work queue.

description pydantic-field

Type: str

An optional description for the work queue.

filter pydantic-field

Type: QueueFilter

Filter criteria for the work queue.

is_paused pydantic-field

Type: bool

Whether or not the work queue is paused.

name pydantic-field required

Type: str

The name of the work queue.

WorkQueueUpdate pydantic-model

Data used by the Orion API to update a work queue.

Source code in prefect/orion/schemas/actions.py
class WorkQueueUpdate(
    schemas.core.WorkQueue.subclass(
        "WorkQueueUpdate",
        include_fields=[
            "filter",
            "name",
            "description",
            "is_paused",
            "concurrency_limit",
        ],
    )
):
    """Data used by the Orion API to update a work queue."""

    name: Optional[str] = Field(None, description="The name of the work queue.")

concurrency_limit pydantic-field

Type: int

An optional concurrency limit for the work queue.

description pydantic-field

Type: str

An optional description for the work queue.

filter pydantic-field

Type: QueueFilter

Filter criteria for the work queue.

is_paused pydantic-field

Type: bool

Whether or not the work queue is paused.

name pydantic-field

Type: str

The name of the work queue.