JobSchedule Class

Class for managing job schedules.

Inheritance
azure.ai.ml.entities._mixins.RestTranslatableMixin
JobSchedule
azure.ai.ml.entities._schedule.schedule.Schedule
JobSchedule
azure.ai.ml.entities._mixins.TelemetryMixin
JobSchedule

Constructor

JobSchedule(*, name: str, trigger: CronTrigger | RecurrenceTrigger | None, create_job: Job | str, display_name: str | None = None, description: str | None = None, tags: Dict | None = None, properties: Dict | None = None, **kwargs: Any)

Keyword-Only Parameters

Name Description
name
str

The name of the schedule.

trigger

The trigger configuration for the schedule.

create_job

The job definition or an existing job name.

display_name

The display name of the schedule.

description

The description of the schedule.

tags

Tag dictionary. Tags can be added, removed, and updated.

properties

A dictionary of properties to associate with the schedule.

Examples

Configuring a JobSchedule.


   from azure.ai.ml import load_job
   from azure.ai.ml.entities import JobSchedule, RecurrencePattern, RecurrenceTrigger

   pipeline_job = load_job("./sdk/ml/azure-ai-ml/tests/test_configs/command_job/command_job_test_local_env.yml")
   trigger = RecurrenceTrigger(
       frequency="week",
       interval=4,
       schedule=RecurrencePattern(hours=10, minutes=15, week_days=["Monday", "Tuesday"]),
       start_time="2023-03-10",
   )
   job_schedule = JobSchedule(name="simple_sdk_create_schedule", trigger=trigger, create_job=pipeline_job)

Methods

dump

Dump the schedule content into a file in YAML format.

dump

Dump the schedule content into a file in YAML format.

dump(dest: str | PathLike | IO, **kwargs: Any) -> None

Parameters

Name Description
dest
Required
Union[<xref:PathLike>, str, IO[AnyStr]]

The local path or file stream to write the YAML content to. If dest is a file path, a new file will be created. If dest is an open file, the file will be written to directly.

Exceptions

Type Description

Raised if dest is a file path and the file already exists.

Raised if dest is an open file and the file is not writable.

Attributes

base_path

The base path of the resource.

Returns

Type Description
str

The base path of the resource.

create_job

Return the job associated with the schedule.

Returns

Type Description

The job definition or an existing job name.

creation_context

The creation context of the resource.

Returns

Type Description

The creation metadata for the resource.

id

The resource ID.

Returns

Type Description

The global ID of the resource, an Azure Resource Manager (ARM) ID.

is_enabled

Specifies if the schedule is enabled or not.

Returns

Type Description

True if the schedule is enabled, False otherwise.

provisioning_state

Returns the schedule's provisioning state. The possible values include "Creating", "Updating", "Deleting", "Succeeded", "Failed", "Canceled".

Returns

Type Description
str

The schedule's provisioning state.

type

The schedule type. Accepted values are 'job' and 'monitor'.

Returns

Type Description
str

The schedule type.