Back to Prefect

automations

docs/v3/api-ref/python/prefect-events-schemas-automations.mdx

3.6.30.dev314.5 KB
Original Source

prefect.events.schemas.automations

Functions

trigger_discriminator <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/events/schemas/automations.py#L430" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

python
trigger_discriminator(value: Any) -> str

Discriminator for triggers that defaults to 'event' if no type is specified.

Classes

Posture <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/events/schemas/automations.py#L40" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

Methods:

auto <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/utilities/collections.py#L70" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

python
auto() -> str

Exposes enum.auto() to avoid requiring a second import to use AutoEnum

Trigger <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/events/schemas/automations.py#L46" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

Base class describing a set of criteria that must be satisfied in order to trigger an automation.

Methods:

actions <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/events/schemas/automations.py#L69" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

python
actions(self) -> List[ActionTypes]

as_automation <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/events/schemas/automations.py#L81" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

python
as_automation(self) -> 'AutomationCore'

describe_for_cli <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/events/schemas/automations.py#L55" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

python
describe_for_cli(self, indent: int = 0) -> str

Return a human-readable description of this trigger for the CLI

model_validate_list <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/_internal/schemas/bases.py#L56" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

python
model_validate_list(cls, obj: Any) -> list[Self]

owner_resource <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/events/schemas/automations.py#L66" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

python
owner_resource(self) -> Optional[str]

reset_fields <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/_internal/schemas/bases.py#L85" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

python
reset_fields(self: Self) -> Self

Reset the fields of the model that are in the _reset_fields set.

Returns:

  • A new instance of the model with the reset fields.

set_deployment_id <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/events/schemas/automations.py#L63" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

python
set_deployment_id(self, deployment_id: UUID) -> None

ResourceTrigger <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/events/schemas/automations.py#L104" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

Base class for triggers that may filter by the labels of resources.

Methods:

actions <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/events/schemas/automations.py#L69" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

python
actions(self) -> List[ActionTypes]

as_automation <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/events/schemas/automations.py#L81" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

python
as_automation(self) -> 'AutomationCore'

coerce_match <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/events/schemas/automations.py#L126" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

python
coerce_match(cls, v: Any) -> Any

coerce_match_related <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/events/schemas/automations.py#L133" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

python
coerce_match_related(cls, v: Any) -> Any

describe_for_cli <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/events/schemas/automations.py#L55" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

python
describe_for_cli(self, indent: int = 0) -> str

Return a human-readable description of this trigger for the CLI

owner_resource <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/events/schemas/automations.py#L66" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

python
owner_resource(self) -> Optional[str]

set_deployment_id <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/events/schemas/automations.py#L63" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

python
set_deployment_id(self, deployment_id: UUID) -> None

EventTrigger <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/events/schemas/automations.py#L146" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

A trigger that fires based on the presence or absence of events within a given period of time.

Methods:

coerce_match <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/events/schemas/automations.py#L126" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

python
coerce_match(cls, v: Any) -> Any

coerce_match_related <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/events/schemas/automations.py#L133" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

python
coerce_match_related(cls, v: Any) -> Any

describe_for_cli <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/events/schemas/automations.py#L239" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

python
describe_for_cli(self, indent: int = 0) -> str

Return a human-readable description of this trigger for the CLI

enforce_minimum_within_for_proactive_triggers <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/events/schemas/automations.py#L211" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

python
enforce_minimum_within_for_proactive_triggers(cls, data: Dict[str, Any]) -> Dict[str, Any]

MetricTriggerOperator <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/events/schemas/automations.py#L262" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

PrefectMetric <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/events/schemas/automations.py#L269" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

MetricTriggerQuery <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/events/schemas/automations.py#L275" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

Defines a subset of the Trigger subclass, which is specific to Metric automations, that specify the query configurations and breaching conditions for the Automation

Methods:

enforce_minimum_range <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/events/schemas/automations.py#L316" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

python
enforce_minimum_range(cls, value: timedelta) -> timedelta

model_validate_list <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/_internal/schemas/bases.py#L56" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

python
model_validate_list(cls, obj: Any) -> list[Self]

reset_fields <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/_internal/schemas/bases.py#L85" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

python
reset_fields(self: Self) -> Self

Reset the fields of the model that are in the _reset_fields set.

Returns:

  • A new instance of the model with the reset fields.

MetricTrigger <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/events/schemas/automations.py#L322" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

A trigger that fires based on the results of a metric query.

Methods:

coerce_match <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/events/schemas/automations.py#L126" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

python
coerce_match(cls, v: Any) -> Any

coerce_match_related <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/events/schemas/automations.py#L133" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

python
coerce_match_related(cls, v: Any) -> Any

describe_for_cli <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/events/schemas/automations.py#L339" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

python
describe_for_cli(self, indent: int = 0) -> str

Return a human-readable description of this trigger for the CLI

CompositeTrigger <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/events/schemas/automations.py#L352" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

Requires some number of triggers to have fired within the given time period.

Methods:

actions <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/events/schemas/automations.py#L69" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

python
actions(self) -> List[ActionTypes]

as_automation <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/events/schemas/automations.py#L81" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

python
as_automation(self) -> 'AutomationCore'

describe_for_cli <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/events/schemas/automations.py#L55" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

python
describe_for_cli(self, indent: int = 0) -> str

Return a human-readable description of this trigger for the CLI

owner_resource <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/events/schemas/automations.py#L66" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

python
owner_resource(self) -> Optional[str]

set_deployment_id <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/events/schemas/automations.py#L63" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

python
set_deployment_id(self, deployment_id: UUID) -> None

CompoundTrigger <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/events/schemas/automations.py#L369" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

A composite trigger that requires some number of triggers to have fired within the given time period

Methods:

describe_for_cli <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/events/schemas/automations.py#L388" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

python
describe_for_cli(self, indent: int = 0) -> str

Return a human-readable description of this trigger for the CLI

validate_require <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/events/schemas/automations.py#L377" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

python
validate_require(self) -> Self

SequenceTrigger <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/events/schemas/automations.py#L406" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

A composite trigger that requires some number of triggers to have fired within the given time period in a specific order

Methods:

describe_for_cli <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/events/schemas/automations.py#L412" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

python
describe_for_cli(self, indent: int = 0) -> str

Return a human-readable description of this trigger for the CLI

AutomationCore <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/events/schemas/automations.py#L464" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

Defines an action a user wants to take when a certain number of events do or don't happen to the matching resources

Methods:

model_validate_list <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/_internal/schemas/bases.py#L56" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

python
model_validate_list(cls, obj: Any) -> list[Self]

reset_fields <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/_internal/schemas/bases.py#L85" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

python
reset_fields(self: Self) -> Self

Reset the fields of the model that are in the _reset_fields set.

Returns:

  • A new instance of the model with the reset fields.

Automation <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/events/schemas/automations.py#L509" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>