File: //snap/google-cloud-cli/396/help/man/man1/gcloud_alpha_scheduler_jobs_create_http.1
.TH "GCLOUD_ALPHA_SCHEDULER_JOBS_CREATE_HTTP" 1
.SH "NAME"
.HP
gcloud alpha scheduler jobs create http \- create a Cloud Scheduler job that triggers an action via HTTP
.SH "SYNOPSIS"
.HP
\f5gcloud alpha scheduler jobs create http\fR (\fIJOB\fR\ :\ \fB\-\-location\fR=\fILOCATION\fR) \fB\-\-schedule\fR=\fISCHEDULE\fR \fB\-\-uri\fR=\fIURI\fR [\fB\-\-attempt\-deadline\fR=\fIATTEMPT_DEADLINE\fR] [\fB\-\-description\fR=\fIDESCRIPTION\fR] [\fB\-\-headers\fR=[\fIKEY\fR=\fIVALUE\fR,...]] [\fB\-\-http\-method\fR=\fIHTTP_METHOD\fR;\ default="post"] [\fB\-\-max\-backoff\fR=\fIMAX_BACKOFF\fR;\ default="3600s"] [\fB\-\-max\-doublings\fR=\fIMAX_DOUBLINGS\fR;\ default=5] [\fB\-\-max\-retry\-attempts\fR=\fIMAX_RETRY_ATTEMPTS\fR] [\fB\-\-max\-retry\-duration\fR=\fIMAX_RETRY_DURATION\fR] [\fB\-\-min\-backoff\fR=\fIMIN_BACKOFF\fR;\ default="5s"] [\fB\-\-time\-zone\fR=\fITIME_ZONE\fR;\ default="Etc/UTC"] [\fB\-\-message\-body\fR=\fIMESSAGE_BODY\fR\ |\ \fB\-\-message\-body\-from\-file\fR=\fIPATH_TO_FILE\fR] [[\fB\-\-oauth\-service\-account\-email\fR=\fIOAUTH_SERVICE_ACCOUNT_EMAIL\fR\ :\ \fB\-\-oauth\-token\-scope\fR=\fIOAUTH_TOKEN_SCOPE\fR]\ |\ [\fB\-\-oidc\-service\-account\-email\fR=\fIOIDC_SERVICE_ACCOUNT_EMAIL\fR\ :\ \fB\-\-oidc\-token\-audience\fR=\fIOIDC_TOKEN_AUDIENCE\fR]] [\fIGCLOUD_WIDE_FLAG\ ...\fR]
.SH "DESCRIPTION"
\fB(ALPHA)\fR Create a Cloud Scheduler job that triggers an action via HTTP.
.SH "EXAMPLES"
The following command creates a job that sends a HTTP GET request to
\'http://example.com/path' every 3 hours:
.RS 2m
$ gcloud alpha scheduler jobs create http my\-job \e
\-\-schedule="0 */3 * * *" \-\-uri="http://example.com/path" \e
\-\-http\-method=GET
.RE
.SH "POSITIONAL ARGUMENTS"
.RS 2m
.TP 2m
Job resource \- Job to create. The arguments in this group can be used to
specify the attributes of this resource. (NOTE) Some attributes are not given
arguments in this group but can be set in other ways.
To set the \f5project\fR attribute:
.RS 2m
.IP "\(em" 2m
provide the argument \f5job\fR on the command line with a fully specified name;
.IP "\(em" 2m
provide the argument \f5\-\-project\fR on the command line;
.IP "\(em" 2m
set the property \f5core/project\fR.
.RE
.sp
This must be specified.
.RS 2m
.TP 2m
\fIJOB\fR
ID of the job or fully qualified identifier for the job.
To set the \f5job\fR attribute:
.RS 2m
.IP "\(bu" 2m
provide the argument \f5job\fR on the command line.
.RE
.sp
This positional argument must be specified if any of the other arguments in this
group are specified.
.TP 2m
\fB\-\-location\fR=\fILOCATION\fR
The location of the job. By default, uses the location of the current project's
App Engine app if there is an associated app.
To set the \f5location\fR attribute:
.RS 2m
.IP "\(bu" 2m
provide the argument \f5job\fR on the command line with a fully specified name;
.IP "\(bu" 2m
provide the argument \f5\-\-location\fR on the command line;
.IP "\(bu" 2m
defaults to App Engine's app location if not provided & an app exists.
.RE
.sp
.RE
.RE
.sp
.SH "REQUIRED FLAGS"
.RS 2m
.TP 2m
\fB\-\-schedule\fR=\fISCHEDULE\fR
Schedule on which the job will be executed.
As a general rule, execution \f5n + 1\fR of a job will not begin until execution
\f5n\fR has finished. Cloud Scheduler will never allow two simultaneously
outstanding executions. For example, this implies that if the \f5n+1\fR
execution is scheduled to run at \f516:00\fR but the \f5n\fR execution takes
until \f516:15\fR, the \f5n+1\fR execution will not start until \f516:15\fR. A
scheduled start time will be delayed if the previous execution has not ended
when its scheduled time occurs. Learn more about the cron job format
(https://cloud.google.com/scheduler/docs/configuring/cron\-job\-schedules).
If \f5\-\-retry\-count\fR > 0 and a job attempt fails, the job will be tried a
total of \f5\-\-retry\-count\fR times, with exponential backoff, until the job
succeeds or the number of retries is exhausted. Note that the next scheduled
execution time might be skipped if the retries continue through that time. For
more information, see Retry jobs
(https://cloud.google.com/scheduler/docs/configuring/retry\-jobs).
.TP 2m
\fB\-\-uri\fR=\fIURI\fR
The full URI path that the request will be sent to. This string must begin with
either "http://" or "https://". For example, \f5http://acme.com\fR or
\f5https://acme.com/sales:8080\fR. Cloud Scheduler will encode some characters
for safety and compatibility. The maximum allowed URL length is 2083 characters
after encoding.
.RE
.sp
.SH "OPTIONAL FLAGS"
.RS 2m
.TP 2m
\fB\-\-attempt\-deadline\fR=\fIATTEMPT_DEADLINE\fR
The deadline for job attempts. If the request handler doesn't respond by this
dealine, the request is cancelled and the attempt is marked as failed. For
example, 20s.
.TP 2m
\fB\-\-description\fR=\fIDESCRIPTION\fR
Human\-readable description of the job.
.TP 2m
\fB\-\-headers\fR=[\fIKEY\fR=\fIVALUE\fR,...]
KEY=VALUE pairs of HTTP headers to include in the request. \fBCannot be
repeated\fR. For example: \f5\-\-headers
Accept\-Language=en\-us,Accept=text/plain\fR
.TP 2m
\fB\-\-http\-method\fR=\fIHTTP_METHOD\fR; default="post"
HTTP method to use for the request. \fIHTTP_METHOD\fR must be one of:
\fBdelete\fR, \fBget\fR, \fBhead\fR, \fBpost\fR, \fBput\fR.
.TP 2m
\fB\-\-max\-backoff\fR=\fIMAX_BACKOFF\fR; default="3600s"
Maximum amount of time to wait before retrying a job after it fails. For
example, \f560s\fR. Default is \f53600s\fR (1 hour).
.TP 2m
\fB\-\-max\-doublings\fR=\fIMAX_DOUBLINGS\fR; default=5
Maximum number of times that the interval between failed job retries will be
doubled before the increase becomes constant.
.TP 2m
\fB\-\-max\-retry\-attempts\fR=\fIMAX_RETRY_ATTEMPTS\fR
Number of times to retry the request if it fails or times out. Must be in range
0\-5 inclusive. Default is 0.
.TP 2m
\fB\-\-max\-retry\-duration\fR=\fIMAX_RETRY_DURATION\fR
Time limit for retrying a failed job, measured from when the job was first run.
If specified with \f5\-\-max\-retry\-attempts\fR greater than 0, the job will be
retried until both limits are reached. Default is 0 seconds (which means
unlimited); however, if \f5\-\-max\-retry\-attempts\fR is also 0, a job attempt
won't be retried if it fails.
.TP 2m
\fB\-\-min\-backoff\fR=\fIMIN_BACKOFF\fR; default="5s"
Minimum amount of time to wait before retrying a job after it fails. For
example, \f510s\fR. Default is \f55s\fR.
.TP 2m
\fB\-\-time\-zone\fR=\fITIME_ZONE\fR; default="Etc/UTC"
Specifies the time zone to be used in interpreting \-\-schedule. The value of
this field must be a time zone name from the 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 time zone.
For UTC use the string "utc". Default is "utc".
.TP 2m
At most one of these can be specified:
.RS 2m
.TP 2m
\fB\-\-message\-body\fR=\fIMESSAGE_BODY\fR
Data payload to be included as the body of the HTTP request. May only be given
with compatible HTTP methods (PUT or POST).
.TP 2m
\fB\-\-message\-body\-from\-file\fR=\fIPATH_TO_FILE\fR
Path to file containing the data payload to be included as the body of the HTTP
request. May only be given with compatible HTTP methods (PUT or POST). Use a
full or relative path to a local file containing the value of message_body.
.RE
.sp
.TP 2m
How the request sent to the target when executing the job should be
authenticated.
At most one of these can be specified:
.RS 2m
.TP 2m
OAuth2
.RS 2m
.TP 2m
\fB\-\-oauth\-service\-account\-email\fR=\fIOAUTH_SERVICE_ACCOUNT_EMAIL\fR
The service account email to be used for generating an OAuth2 access token to be
included in the request sent to the target when executing the job. The service
account must be within the same project as the job. The caller must have
iam.serviceAccounts.actAs permission for the service account. The token must be
OAuth if the target is a Google APIs service with URL \f5*.googleapis.com\fR.
This flag argument must be specified if any of the other arguments in this group
are specified.
.TP 2m
\fB\-\-oauth\-token\-scope\fR=\fIOAUTH_TOKEN_SCOPE\fR
The scope to be used when generating an OAuth2 access token to be included in
the request sent to the target when executing the job. If not specified,
"https://www.googleapis.com/auth/cloud\-platform" will be used.
.RE
.sp
.TP 2m
OpenId Connect
.RS 2m
.TP 2m
\fB\-\-oidc\-service\-account\-email\fR=\fIOIDC_SERVICE_ACCOUNT_EMAIL\fR
The service account email to be used for generating an OpenId Connect token to
be included in the request sent to the target when executing the job. The
service account must be within the same project as the job. The caller must have
iam.serviceAccounts.actAs permission for the service account. The OIDC token is
generally used \fBexcept\fR for Google APIs hosted on \f5*.googleapis.com\fR:
these APIs expect an OAuth token.
This flag argument must be specified if any of the other arguments in this group
are specified.
.TP 2m
\fB\-\-oidc\-token\-audience\fR=\fIOIDC_TOKEN_AUDIENCE\fR
The audience to be used when generating an OpenId Connect token to be included
in the request sent to the target when executing the job. If not specified, the
URI specified in target will be used.
.RE
.RE
.RE
.sp
.SH "GCLOUD WIDE FLAGS"
These flags are available to all commands: \-\-access\-token\-file, \-\-account,
\-\-billing\-project, \-\-configuration, \-\-flags\-file, \-\-flatten,
\-\-format, \-\-help, \-\-impersonate\-service\-account, \-\-log\-http,
\-\-project, \-\-quiet, \-\-trace\-token, \-\-user\-output\-enabled,
\-\-verbosity.
Run \fB$ gcloud help\fR for details.
.SH "API REFERENCE"
This command uses the \fBcloudscheduler/v1\fR API. The full documentation for
this API can be found at: https://cloud.google.com/scheduler/
.SH "NOTES"
This command is currently in alpha and might change without notice. If this
command fails with API permission errors despite specifying the correct project,
you might be trying to access an API with an invitation\-only early access
allowlist. These variants are also available:
.RS 2m
$ gcloud scheduler jobs create http
.RE
.RS 2m
$ gcloud beta scheduler jobs create http
.RE