Skip to content

Commit 47444ff

Browse files
Google APIscopybara-github
authored andcommitted
docs: update comments
docs: annotate output-only fields as such PiperOrigin-RevId: 719865415
1 parent e134beb commit 47444ff

4 files changed

Lines changed: 52 additions & 40 deletions

File tree

google/cloud/scheduler/v1/cloudscheduler.proto

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -161,11 +161,7 @@ message ListJobsRequest {
161161
// request the next page of results, page_token must be the value of
162162
// [next_page_token][google.cloud.scheduler.v1.ListJobsResponse.next_page_token]
163163
// returned from the previous call to
164-
// [ListJobs][google.cloud.scheduler.v1.CloudScheduler.ListJobs]. It is an
165-
// error to switch the value of
166-
// [filter][google.cloud.scheduler.v1.ListJobsRequest.filter] or
167-
// [order_by][google.cloud.scheduler.v1.ListJobsRequest.order_by] while
168-
// iterating through pages.
164+
// [ListJobs][google.cloud.scheduler.v1.CloudScheduler.ListJobs].
169165
string page_token = 6;
170166
}
171167

google/cloud/scheduler/v1/cloudscheduler_v1.yaml

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ title: Cloud Scheduler API
66
apis:
77
- name: google.cloud.location.Locations
88
- name: google.cloud.scheduler.v1.CloudScheduler
9+
- name: google.longrunning.Operations
910

1011
documentation:
1112
summary: Creates and manages jobs run on a regular recurring schedule.
@@ -16,15 +17,6 @@ documentation:
1617
- selector: google.cloud.location.Locations.ListLocations
1718
description: Lists information about the supported locations for this service.
1819

19-
backend:
20-
rules:
21-
- selector: google.cloud.location.Locations.GetLocation
22-
deadline: 30.0
23-
- selector: google.cloud.location.Locations.ListLocations
24-
deadline: 30.0
25-
- selector: 'google.cloud.scheduler.v1.CloudScheduler.*'
26-
deadline: 30.0
27-
2820
http:
2921
rules:
3022
- selector: google.cloud.location.Locations.GetLocation

google/cloud/scheduler/v1/job.proto

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ syntax = "proto3";
1616

1717
package google.cloud.scheduler.v1;
1818

19+
import "google/api/field_behavior.proto";
1920
import "google/api/resource.proto";
2021
import "google/cloud/scheduler/v1/target.proto";
2122
import "google/protobuf/duration.proto";
@@ -33,6 +34,8 @@ message Job {
3334
option (google.api.resource) = {
3435
type: "cloudscheduler.googleapis.com/Job"
3536
pattern: "projects/{project}/locations/{location}/jobs/{job}"
37+
plural: "jobs"
38+
singular: "job"
3639
};
3740

3841
// State of the job.
@@ -125,7 +128,11 @@ message Job {
125128
// If [retry_count][google.cloud.scheduler.v1.RetryConfig.retry_count] > 0 and
126129
// a job attempt fails, the job will be tried a total of
127130
// [retry_count][google.cloud.scheduler.v1.RetryConfig.retry_count] times,
128-
// with exponential backoff, until the next scheduled start time.
131+
// with exponential backoff, until the next scheduled start time. If
132+
// retry_count is 0, a job attempt will not be retried if it fails. Instead
133+
// the Cloud Scheduler system will wait for the next scheduled execution time.
134+
// Setting retry_count to 0 does not prevent failed jobs from running
135+
// according to schedule after the failure.
129136
string schedule = 20;
130137

131138
// Specifies the time zone to be used in interpreting
@@ -141,21 +148,24 @@ message Job {
141148
string time_zone = 21;
142149

143150
// Output only. The creation time of the job.
144-
google.protobuf.Timestamp user_update_time = 9;
151+
google.protobuf.Timestamp user_update_time = 9
152+
[(google.api.field_behavior) = OUTPUT_ONLY];
145153

146154
// Output only. State of the job.
147-
State state = 10;
155+
State state = 10 [(google.api.field_behavior) = OUTPUT_ONLY];
148156

149157
// Output only. The response from the target for the last attempted execution.
150-
google.rpc.Status status = 11;
158+
google.rpc.Status status = 11 [(google.api.field_behavior) = OUTPUT_ONLY];
151159

152160
// Output only. The next time the job is scheduled. Note that this may be a
153161
// retry of a previously failed attempt or the next execution time
154162
// according to the schedule.
155-
google.protobuf.Timestamp schedule_time = 17;
163+
google.protobuf.Timestamp schedule_time = 17
164+
[(google.api.field_behavior) = OUTPUT_ONLY];
156165

157166
// Output only. The time the last job attempt started.
158-
google.protobuf.Timestamp last_attempt_time = 18;
167+
google.protobuf.Timestamp last_attempt_time = 18
168+
[(google.api.field_behavior) = OUTPUT_ONLY];
159169

160170
// Settings that determine the retry behavior.
161171
RetryConfig retry_config = 19;
@@ -198,9 +208,10 @@ message RetryConfig {
198208
//
199209
// The default value of retry_count is zero.
200210
//
201-
// If retry_count is zero, a job attempt will *not* be retried if
211+
// If retry_count is 0, a job attempt will not be retried if
202212
// it fails. Instead the Cloud Scheduler system will wait for the
203-
// next scheduled execution time.
213+
// next scheduled execution time. Setting retry_count to 0 does not prevent
214+
// failed jobs from running according to schedule after the failure.
204215
//
205216
// If retry_count is set to a non-zero number then Cloud Scheduler
206217
// will retry failed attempts, using exponential backoff,
@@ -245,7 +256,7 @@ message RetryConfig {
245256
// [min_backoff_duration][google.cloud.scheduler.v1.RetryConfig.min_backoff_duration]
246257
// is 10s,
247258
// [max_backoff_duration][google.cloud.scheduler.v1.RetryConfig.max_backoff_duration]
248-
// is 300s, and `max_doublings` is 3, then the a job will first be retried in
259+
// is 300s, and `max_doublings` is 3, then the job will first be retried in
249260
// 10s. The retry interval will double three times, and then increase linearly
250261
// by 2^3 * 10s. Finally, the job will retry at intervals of
251262
// [max_backoff_duration][google.cloud.scheduler.v1.RetryConfig.max_backoff_duration]

google/cloud/scheduler/v1/target.proto

Lines changed: 30 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -46,14 +46,20 @@ message HttpTarget {
4646
// Which HTTP method to use for the request.
4747
HttpMethod http_method = 2;
4848

49+
// HTTP request headers.
50+
//
51+
// This map contains the header field names and values.
52+
//
4953
// The user can specify HTTP request headers to send with the job's
50-
// HTTP request. This map contains the header field names and
51-
// values. Repeated headers are not supported, but a header value can
52-
// contain commas. These headers represent a subset of the headers
53-
// that will accompany the job's HTTP request. Some HTTP request
54-
// headers will be ignored or replaced. A partial list of headers that
55-
// will be ignored or replaced is below:
56-
// - Host: This will be computed by Cloud Scheduler and derived from
54+
// HTTP request. Repeated headers are not supported, but a header value can
55+
// contain commas.
56+
//
57+
// The following headers represent a subset of the headers
58+
// that accompany the job's HTTP request. Some HTTP request
59+
// headers are ignored or replaced. A partial list of headers that
60+
// are ignored or replaced is below:
61+
//
62+
// * Host: This will be computed by Cloud Scheduler and derived from
5763
// [uri][google.cloud.scheduler.v1.HttpTarget.uri].
5864
// * `Content-Length`: This will be computed by Cloud Scheduler.
5965
// * `User-Agent`: This will be set to `"Google-Cloud-Scheduler"`.
@@ -65,6 +71,15 @@ message HttpTarget {
6571
// the unix-cron format, this header will contain the job schedule as an
6672
// offset of UTC parsed according to RFC3339.
6773
//
74+
// If the job has a [body][google.cloud.scheduler.v1.HttpTarget.body] and the
75+
// following headers are not set by the user, Cloud Scheduler sets default
76+
// values:
77+
//
78+
// * `Content-Type`: This will be set to `"application/octet-stream"`. You
79+
// can override this default by explicitly setting `Content-Type` to a
80+
// particular media type when creating the job. For example, you can set
81+
// `Content-Type` to `"application/json"`.
82+
//
6883
// The total size of headers must be less than 80KB.
6984
map<string, string> headers = 3;
7085

@@ -144,20 +159,18 @@ message AppEngineHttpTarget {
144159
// the unix-cron format, this header will contain the job schedule as an
145160
// offset of UTC parsed according to RFC3339.
146161
//
147-
// If the job has an
148-
// [body][google.cloud.scheduler.v1.AppEngineHttpTarget.body], Cloud Scheduler
149-
// sets the following headers:
162+
// If the job has a [body][google.cloud.scheduler.v1.AppEngineHttpTarget.body]
163+
// and the following headers are not set by the user, Cloud Scheduler sets
164+
// default values:
150165
//
151-
// * `Content-Type`: By default, the `Content-Type` header is set to
152-
// `"application/octet-stream"`. The default can be overridden by explictly
153-
// setting `Content-Type` to a particular media type when the job is
154-
// created.
155-
// For example, `Content-Type` can be set to `"application/json"`.
156-
// * `Content-Length`: This is computed by Cloud Scheduler. This value is
157-
// output only. It cannot be changed.
166+
// * `Content-Type`: This will be set to `"application/octet-stream"`. You
167+
// can override this default by explicitly setting `Content-Type` to a
168+
// particular media type when creating the job. For example, you can set
169+
// `Content-Type` to `"application/json"`.
158170
//
159171
// The headers below are output only. They cannot be set or overridden:
160172
//
173+
// * `Content-Length`: This is computed by Cloud Scheduler.
161174
// * `X-Google-*`: For Google internal use only.
162175
// * `X-AppEngine-*`: For Google internal use only.
163176
//

0 commit comments

Comments
 (0)