xref: /aosp_15_r20/external/googleapis/google/cloud/notebooks/v1/schedule.proto (revision d5c09012810ac0c9f33fe448fb6da8260d444cc9)
1// Copyright 2023 Google LLC
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//     http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15syntax = "proto3";
16
17package google.cloud.notebooks.v1;
18
19import "google/api/field_behavior.proto";
20import "google/api/resource.proto";
21import "google/cloud/notebooks/v1/execution.proto";
22import "google/protobuf/timestamp.proto";
23
24option go_package = "cloud.google.com/go/notebooks/apiv1/notebookspb;notebookspb";
25option java_multiple_files = true;
26option java_outer_classname = "ScheduleProto";
27option java_package = "com.google.cloud.notebooks.v1";
28
29// The definition of a schedule.
30message Schedule {
31  option (google.api.resource) = {
32    type: "notebooks.googleapis.com/Schedule"
33    pattern: "projects/{project}/location/{location}/schedules/{schedule}"
34  };
35
36  // State of the job.
37  enum State {
38    // Unspecified state.
39    STATE_UNSPECIFIED = 0;
40
41    // The job is executing normally.
42    ENABLED = 1;
43
44    // The job is paused by the user. It will not execute. A user can
45    // intentionally pause the job using
46    // [PauseJobRequest][].
47    PAUSED = 2;
48
49    // The job is disabled by the system due to error. The user
50    // cannot directly set a job to be disabled.
51    DISABLED = 3;
52
53    // The job state resulting from a failed [CloudScheduler.UpdateJob][]
54    // operation. To recover a job from this state, retry
55    // [CloudScheduler.UpdateJob][] until a successful response is received.
56    UPDATE_FAILED = 4;
57
58    // The schedule resource is being created.
59    INITIALIZING = 5;
60
61    // The schedule resource is being deleted.
62    DELETING = 6;
63  }
64
65  // Output only. The name of this schedule. Format:
66  // `projects/{project_id}/locations/{location}/schedules/{schedule_id}`
67  string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
68
69  // Output only. Display name used for UI purposes.
70  // Name can only contain alphanumeric characters, hyphens `-`,
71  // and underscores `_`.
72  string display_name = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
73
74  // A brief description of this environment.
75  string description = 3;
76
77  State state = 4;
78
79  // Cron-tab formatted schedule by which the job will execute.
80  // Format: minute, hour, day of month, month, day of week,
81  // e.g. `0 0 * * WED` = every Wednesday
82  // More examples: https://crontab.guru/examples.html
83  string cron_schedule = 5;
84
85  // Timezone on which the cron_schedule.
86  // The value of this field must be a time zone name from the tz database.
87  // TZ Database: https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
88  //
89  // Note that some time zones include a provision for daylight savings time.
90  // The rules for daylight saving time are determined by the chosen tz.
91  // For UTC use the string "utc". If a time zone is not specified,
92  // the default will be in UTC (also known as GMT).
93  string time_zone = 6;
94
95  // Output only. Time the schedule was created.
96  google.protobuf.Timestamp create_time = 7 [(google.api.field_behavior) = OUTPUT_ONLY];
97
98  // Output only. Time the schedule was last updated.
99  google.protobuf.Timestamp update_time = 8 [(google.api.field_behavior) = OUTPUT_ONLY];
100
101  // Notebook Execution Template corresponding to this schedule.
102  ExecutionTemplate execution_template = 9;
103
104  // Output only. The most recent execution names triggered from this schedule and their
105  // corresponding states.
106  repeated Execution recent_executions = 10 [(google.api.field_behavior) = OUTPUT_ONLY];
107}
108