monitor_schema.models.commons#

Common schema definitions.

Attributes#

Classes#

NoExtrasBaseModel

No extras base model.

ImmediateSchedule

Schedule the monitor to run immediately.

TimeRange

Support for a specific time range.

CronSchedule

Support for scheduling.

Cadence

Cadence for an analyzer or monitor run.

FixedCadenceSchedule

Support for scheduling based on a predefined cadence.

Metadata

Metadata for a top-level objects such as monitors, analyzers, and schema.

Module Contents#

monitor_schema.models.commons.CRON_REGEX = '(@(annually|yearly|monthly|weekly|daily|hourly))|((((\\d+,)+\\d+|(\\d+(\\/|-)\\d+)|\\d+|\\*) ?){5,7})'#
monitor_schema.models.commons.DATASET_ID_REGEX = '[a-zA-Z0-9\\-_\\.]+'#
monitor_schema.models.commons.DATASET_ID_DEF#
class monitor_schema.models.commons.NoExtrasBaseModel[source]#

Bases: pydantic.BaseModel

No extras base model.

Inherit to prevent accidental extra fields.

class monitor_schema.models.commons.ImmediateSchedule[source]#

Bases: NoExtrasBaseModel

Schedule the monitor to run immediately.

type: Literal['immediate']#
class monitor_schema.models.commons.TimeRange[source]#

Bases: NoExtrasBaseModel

Support for a specific time range.

start: datetime.datetime#
end: datetime.datetime#
class monitor_schema.models.commons.CronSchedule[source]#

Bases: NoExtrasBaseModel

Support for scheduling.

type: Literal['cron']#
cron: str#
exclusionRanges: List[TimeRange] | None#
class monitor_schema.models.commons.Cadence[source]#

Bases: str, enum.Enum

Cadence for an analyzer or monitor run.

hourly = 'hourly'#
daily = 'daily'#
weekly = 'weekly'#
monthly = 'monthly'#
class monitor_schema.models.commons.FixedCadenceSchedule[source]#

Bases: NoExtrasBaseModel

Support for scheduling based on a predefined cadence.

type: Literal['fixed']#
cadence: Literal[Cadence, Cadence, Cadence, Cadence]#
exclusionRanges: List[TimeRange] | None#
class monitor_schema.models.commons.Metadata[source]#

Bases: NoExtrasBaseModel

Metadata for a top-level objects such as monitors, analyzers, and schema.

This object is managed by WhyLabs. Any user-provided values will be ignored on WhyLabs side.

version: int#
schemaVersion: int | None#
updatedTimestamp: int#
author: str#
description: str | None#