This repository has been archived by the owner on Sep 5, 2023. It is now read-only.
/
schedule.py
97 lines (85 loc) · 3.83 KB
/
schedule.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
# -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
import proto # type: ignore
from google.cloud.notebooks_v1.types import execution
from google.protobuf import timestamp_pb2 # type: ignore
__protobuf__ = proto.module(
package="google.cloud.notebooks.v1", manifest={"Schedule",},
)
class Schedule(proto.Message):
r"""The definition of a schedule.
Attributes:
name (str):
Output only. The name of this schedule. Format:
``projects/{project_id}/locations/{location}/schedules/{schedule_id}``
display_name (str):
Output only. Display name used for UI purposes. Name can
only contain alphanumeric characters, hyphens '-', and
underscores '_'.
description (str):
A brief description of this environment.
state (google.cloud.notebooks_v1.types.Schedule.State):
cron_schedule (str):
Cron-tab formatted schedule by which the job will execute
Format: minute, hour, day of month, month, day of week e.g.
0 0 \* \* WED = every Wednesday More examples:
https://crontab.guru/examples.html
time_zone (str):
Timezone on which the cron_schedule. The value of this field
must be a time zone name from the tz database. TZ Database:
https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
Note that some time zones include a provision for daylight
savings time. The rules for daylight saving time are
determined by the chosen tz. For UTC use the string "utc".
If a time zone is not specified, the default will be in UTC
(also known as GMT).
create_time (google.protobuf.timestamp_pb2.Timestamp):
Output only. Time the schedule was created.
update_time (google.protobuf.timestamp_pb2.Timestamp):
Output only. Time the schedule was last
updated.
execution_template (google.cloud.notebooks_v1.types.ExecutionTemplate):
Notebook Execution Template corresponding to
this schedule.
recent_executions (Sequence[google.cloud.notebooks_v1.types.Execution]):
Output only. The most recent execution names
triggered from this schedule and their
corresponding states.
"""
class State(proto.Enum):
r"""State of the job."""
STATE_UNSPECIFIED = 0
ENABLED = 1
PAUSED = 2
DISABLED = 3
UPDATE_FAILED = 4
INITIALIZING = 5
DELETING = 6
name = proto.Field(proto.STRING, number=1,)
display_name = proto.Field(proto.STRING, number=2,)
description = proto.Field(proto.STRING, number=3,)
state = proto.Field(proto.ENUM, number=4, enum=State,)
cron_schedule = proto.Field(proto.STRING, number=5,)
time_zone = proto.Field(proto.STRING, number=6,)
create_time = proto.Field(proto.MESSAGE, number=7, message=timestamp_pb2.Timestamp,)
update_time = proto.Field(proto.MESSAGE, number=8, message=timestamp_pb2.Timestamp,)
execution_template = proto.Field(
proto.MESSAGE, number=9, message=execution.ExecutionTemplate,
)
recent_executions = proto.RepeatedField(
proto.MESSAGE, number=10, message=execution.Execution,
)
__all__ = tuple(sorted(__protobuf__.manifest))