gcloud_alpha_scheduler_jobs_create_pubsub (1)
NAME
- gcloud alpha scheduler jobs create pubsub - create a Cloud Scheduler job with a Pub/Sub target
SYNOPSIS
-
gcloud alpha scheduler jobs create pubsub JOB --schedule=SCHEDULE --topic=TOPIC (--message-body=MESSAGE_BODY | --message-body-from-file=MESSAGE_BODY_FROM_FILE) [--attributes=ATTRIBUTES] [--description=DESCRIPTION] [--max-backoff=MAX_BACKOFF; default="1h"] [--max-doublings=MAX_DOUBLINGS; default=16] [--max-retry-attempts=MAX_RETRY_ATTEMPTS] [--max-retry-duration=MAX_RETRY_DURATION] [--min-backoff=MIN_BACKOFF; default="5s"] [--time-zone=TIME_ZONE; default="Etc/UTC"] [GCLOUD_WIDE_FLAG ...]
DESCRIPTION
(ALPHA) Create a Cloud Scheduler job with a Pub/Sub target.
POSITIONAL ARGUMENTS
-
-
- Job resource - Job to create. This represents a Cloud resource. (NOTE) Some attributes are not given arguments in this group but can be set in other ways. To set the [project] attribute: provide the argument [job] on the command line with a fully specified name; provide the argument [--project] on the command line; set the property [core/project]. To set the [location] attribute: provide the argument [job] on the command line with a fully specified name; as the location of the current project's App Engine App. This must be specified.
-
- JOB
-
ID of the job or fully qualified identifier for the job.
- Job resource - Job to create. This represents a Cloud resource. (NOTE) Some attributes are not given arguments in this group but can be set in other ways. To set the [project] attribute: provide the argument [job] on the command line with a fully specified name; provide the argument [--project] on the command line; set the property [core/project]. To set the [location] attribute: provide the argument [job] on the command line with a fully specified name; as the location of the current project's App Engine App. This must be specified.
-
REQUIRED FLAGS
-
- --schedule=SCHEDULE
-
Schedule on which the job will be executed.
As a general rule, execution n + 1 of a job will not begin until execution n has finished. Cloud Scheduler will never allow two simultaneously outstanding executions. For example, this implies that if the n+1 execution is scheduled to run at 16:00 but the n execution takes until 16:15, the n+1 execution will not start until 16:15. A scheduled start time will be delayed if the previous execution has not ended when its scheduled time occurs.
If --retry-count > 0 and a job attempt fails, the job will be tried a total of --retry-count times, with exponential backoff, until the next scheduled start time.
The schedule can be either of the following types:-
- ---
- Crontab: en.wikipedia.org/wiki/Cron#Overview
- ---
- English-like schedule: cloud.google.com/scheduler/docs/quickstart#defining_the_job_schedule
-
-
- --topic=TOPIC
-
Name of the Google Cloud Pub/Sub topic to publish to when the job runs.
-
Body of the message to publish to the given topic name. Information on message
formatting and size limits can be found at:
cloud.google.com/pubsub/docs/publisher#publish Exactly one of these must
be specified:
-
- --message-body=MESSAGE_BODY
-
Body of the message.
- --message-body-from-file=MESSAGE_BODY_FROM_FILE
-
Path to a file containing the body of the message.
-
OPTIONAL FLAGS
-
- --attributes=ATTRIBUTES
-
Comma-separated list of attributes. Each attribute has the form "NAME=VALUE".
You can specify up to 100 attributes.
- --description=DESCRIPTION
-
Human-readable description of the job.
- --max-backoff=MAX_BACKOFF; default="1h"
-
Maximum amount of time to wait before retrying a task after it fails. For
example, 10m. Default is 1h.
- --max-doublings=MAX_DOUBLINGS; default=16
-
Maximum number of times that the interval between failed job retries will be
doubled before the increase becomes constant.
- --max-retry-attempts=MAX_RETRY_ATTEMPTS
-
Number of times to retry the request if it fails or times out. Must be in range
0-5 inclusive. Default is 0.
- --max-retry-duration=MAX_RETRY_DURATION
-
Time limit for retrying a failed task, measured from when the task was first
run. If specified with --max-retry-attempts greater than 0, the task
will be retried until both limits are reached. Default is 0 (which means
unlimited).
- --min-backoff=MIN_BACKOFF; default="5s"
-
Minimum amount of time to wait before retrying a task after it fails. For
example, 10s. Default is 5s.
- --time-zone=TIME_ZONE; 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
(en.wikipedia.org/wiki/Tz_database
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".
GCLOUD WIDE FLAGS
These flags are available to all commands: --account, --configuration, --flags-file, --flatten, --format, --help, --log-http, --project, --quiet, --trace-token, --user-output-enabled, --verbosity. Run $ gcloud help for details.
API REFERENCE
This command uses the cloudscheduler/v1beta1 API. The full documentation for this API can be found at: cloud.google.com/scheduler
NOTES
This command is currently in ALPHA and may change without notice. If this command fails with API permission errors despite specifying the right project, you will have to apply for early access and have your projects registered on the API whitelist to use it. To do so, contact Support at cloud.google.com/support This variant is also available:
- $ gcloud beta scheduler jobs create pubsub