gcloud_alpha_pubsub_topics_publish (1)
NAME
- gcloud alpha pubsub topics publish - publishes a message to the specified topic
SYNOPSIS
-
gcloud alpha pubsub topics publish TOPIC [MESSAGE_BODY] [--attribute=[ATTRIBUTE,...]] [--message=MESSAGE] [GCLOUD_WIDE_FLAG ...]
DESCRIPTION
(ALPHA) Publishes a message to the specified topic name for testing and
POSITIONAL ARGUMENTS
-
-
Topic resource - Name of the topic to publish messages to. 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
[topic] on the command line with a fully specified name; provide the argument
[--project] on the command line; set the property [core/project]. This must be
specified.
-
- TOPIC
-
ID of the topic or fully qualified identifier for the topic.
-
- [MESSAGE_BODY]
-
(DEPRECATED) The 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
Positional argument MESSAGE_BODY is deprecated. Please use --message instead.
-
Topic resource - Name of the topic to publish messages to. 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
[topic] on the command line with a fully specified name; provide the argument
[--project] on the command line; set the property [core/project]. This must be
specified.
FLAGS
-
- --attribute=[ATTRIBUTE,...]
-
Comma-separated list of attributes. Each ATTRIBUTE has the form name=value".
You can specify up to 100 attributes.
- --message=MESSAGE
-
The 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
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.
EXAMPLES
To publish messages in a batch to a specific Cloud Pub/Sub topic, run:
-
$ gcloud alpha pubsub topics publish mytopic \
--message "Hello World!" --attribute KEY1=VAL1,KEY2=VAL2
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 These variants are also available:
- $ gcloud pubsub topics publish $ gcloud beta pubsub topics publish