Skip to content

prefect.orion.schemas.responses

Schemas for special responses from the Orion API.

HistoryResponse pydantic-model

Represents a history of aggregation states over an interval

Source code in prefect/orion/schemas/responses.py
class HistoryResponse(PrefectBaseModel):
    """Represents a history of aggregation states over an interval"""

    interval_start: DateTimeTZ = Field(
        default=..., description="The start date of the interval."
    )
    interval_end: DateTimeTZ = Field(
        default=..., description="The end date of the interval."
    )
    states: List[HistoryResponseState] = Field(
        default=..., description="A list of state histories during the interval."
    )

interval_end pydantic-field required

Type: DateTimeTZ

The end date of the interval.

interval_start pydantic-field required

Type: DateTimeTZ

The start date of the interval.

states pydantic-field required

Type: List[prefect.orion.schemas.responses.HistoryResponseState]

A list of state histories during the interval.

HistoryResponseState pydantic-model

Represents a single state's history over an interval.

Source code in prefect/orion/schemas/responses.py
class HistoryResponseState(PrefectBaseModel):
    """Represents a single state's history over an interval."""

    state_type: schemas.states.StateType = Field(
        default=..., description="The state type."
    )
    state_name: str = Field(default=..., description="The state name.")
    count_runs: int = Field(
        default=...,
        description="The number of runs in the specified state during the interval.",
    )
    sum_estimated_run_time: datetime.timedelta = Field(
        default=...,
        description="The total estimated run time of all runs during the interval.",
    )
    sum_estimated_lateness: datetime.timedelta = Field(
        default=...,
        description="The sum of differences between actual and expected start time during the interval.",
    )

count_runs pydantic-field required

Type: int

The number of runs in the specified state during the interval.

state_name pydantic-field required

Type: str

The state name.

state_type pydantic-field required

Type: StateType

The state type.

sum_estimated_lateness pydantic-field required

Type: timedelta

The sum of differences between actual and expected start time during the interval.

sum_estimated_run_time pydantic-field required

Type: timedelta

The total estimated run time of all runs during the interval.

SetStateStatus

Enumerates return statuses for setting run states.

Source code in prefect/orion/schemas/responses.py
class SetStateStatus(AutoEnum):
    """Enumerates return statuses for setting run states."""

    ACCEPT = AutoEnum.auto()
    REJECT = AutoEnum.auto()
    ABORT = AutoEnum.auto()
    WAIT = AutoEnum.auto()

StateAbortDetails pydantic-model

Details associated with an ABORT state transition.

Source code in prefect/orion/schemas/responses.py
class StateAbortDetails(PrefectBaseModel):
    """Details associated with an ABORT state transition."""

    type: Literal["abort_details"] = Field(
        default="abort_details",
        description="The type of state transition detail. Used to ensure pydantic does not coerce into a different type.",
    )
    reason: Optional[str] = Field(
        default=None, description="The reason why the state transition was aborted."
    )

reason pydantic-field

Type: str

The reason why the state transition was aborted.

type pydantic-field

Type: Literal['abort_details']

The type of state transition detail. Used to ensure pydantic does not coerce into a different type.

StateAcceptDetails pydantic-model

Details associated with an ACCEPT state transition.

Source code in prefect/orion/schemas/responses.py
class StateAcceptDetails(PrefectBaseModel):
    """Details associated with an ACCEPT state transition."""

    type: Literal["accept_details"] = Field(
        default="accept_details",
        description="The type of state transition detail. Used to ensure pydantic does not coerce into a different type.",
    )

type pydantic-field

Type: Literal['accept_details']

The type of state transition detail. Used to ensure pydantic does not coerce into a different type.

StateRejectDetails pydantic-model

Details associated with a REJECT state transition.

Source code in prefect/orion/schemas/responses.py
class StateRejectDetails(PrefectBaseModel):
    """Details associated with a REJECT state transition."""

    type: Literal["reject_details"] = Field(
        default="reject_details",
        description="The type of state transition detail. Used to ensure pydantic does not coerce into a different type.",
    )
    reason: Optional[str] = Field(
        default=None, description="The reason why the state transition was rejected."
    )

reason pydantic-field

Type: str

The reason why the state transition was rejected.

type pydantic-field

Type: Literal['reject_details']

The type of state transition detail. Used to ensure pydantic does not coerce into a different type.

StateWaitDetails pydantic-model

Details associated with a WAIT state transition.

Source code in prefect/orion/schemas/responses.py
class StateWaitDetails(PrefectBaseModel):
    """Details associated with a WAIT state transition."""

    type: Literal["wait_details"] = Field(
        default="wait_details",
        description="The type of state transition detail. Used to ensure pydantic does not coerce into a different type.",
    )
    delay_seconds: int = Field(
        default=...,
        description="The length of time in seconds the client should wait before transitioning states.",
    )
    reason: Optional[str] = Field(
        default=None, description="The reason why the state transition should wait."
    )

delay_seconds pydantic-field required

Type: int

The length of time in seconds the client should wait before transitioning states.

reason pydantic-field

Type: str

The reason why the state transition should wait.

type pydantic-field

Type: Literal['wait_details']

The type of state transition detail. Used to ensure pydantic does not coerce into a different type.