gcloud pubsub lite-subscriptions create - create a Pub/Sub Lite subscription
gcloud pubsub lite-subscriptions create SUBSCRIPTION --topic=TOPIC [--delivery-requirement=DELIVERY_REQUIREMENT; default="deliver-immediately"] [--location=LOCATION] [--event-time=EVENT_TIME | --publish-time=PUBLISH_TIME | --starting-offset=STARTING_OFFSET; default="end"] [--export-pubsub-topic=EXPORT_PUBSUB_TOPIC : --export-dead-letter-topic=EXPORT_DEAD_LETTER_TOPIC --export-desired-state=EXPORT_DESIRED_STATE; default="active"] [GCLOUD_WIDE_FLAG ...]
Create a Pub/Sub Lite subscription.
To create a Pub/Sub Lite subscription, run:
$ gcloud pubsub lite-subscriptions create mysubscription \ --location=us-central1-a --topic=mytopic
To create a Pub/Sub Lite subscription at the offset of the oldest retained message, run:
$ gcloud pubsub lite-subscriptions create mysubscription \ --location=us-central1-a --topic=mytopic \ --starting-offset=beginning
To create a Pub/Sub Lite subscription that exports messages from a Pub/Sub Lite topic to a Pub/Sub topic, run:
$ gcloud pubsub lite-subscriptions create mysubscription \ --location=us-central1-a --topic=mytopic \ --export-pubsub-topic=pubsubtopic
- SUBSCRIPTION
Subscription ID.
- --topic=TOPIC
Topic ID associated with the subscription.
- --delivery-requirement=DELIVERY_REQUIREMENT; default="deliver-immediately"
When this subscription should send messages to subscribers relative to messages persistence in storage. See https://cloud.google.com/pubsub/lite/docs/subscriptions#creating_lite_subscriptions for more info. DELIVERY_REQUIREMENT must be one of: deliver-after-stored, deliver-immediately.
- Location resource - Identifies the Cloud zone this command will be executed on.
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 --location on the command line with a fully specified name;
- —
provide the argument --zone on the command line with a fully specified name;
- —
provide the argument --project on the command line;
- —
set the property core/project.
- --location=LOCATION
ID of the location or fully qualified identifier for the location. To set the location attribute:
provide the argument --location on the command line;
provide the argument --zone on the command line.
- At most one of these can be specified:
- --event-time=EVENT_TIME
The event time to which you seek a subscription. The subscription seeks to the first message with event time greater than or equal to the specified event time. Messages missing an event time use publish time as a fallback. As event times are user supplied, subsequent messages may have event times less than the specified event time and must be filtered by the client, if necessary. Run $ gcloud topic datetimes for information on time formats.
- --publish-time=PUBLISH_TIME
The publish time to which you seek a subscription. Messages with publish time greater than or equal to the specified time are delivered after the seek operation. Run $ gcloud topic datetimes for information on time formats.
- --starting-offset=STARTING_OFFSET; default="end"
The offset at which a newly created or seeked subscription starts receiving messages. A subscription can be initialized at the offset of the oldest retained message (beginning), or at the current HEAD offset (end). STARTING_OFFSET must be one of: beginning, end.
- --export-pubsub-topic=EXPORT_PUBSUB_TOPIC
The name of the destination Pub/Sub topic to which messages are exported. Must be the topic's fully specified path if it is not in the same project as the subscription to be created.
- --export-dead-letter-topic=EXPORT_DEAD_LETTER_TOPIC
The name of the Pub/Sub Lite topic to write messages that cannot be exported. Must be in the same project and location as the subscription to be created. Note that this is a Lite topic.
- --export-desired-state=EXPORT_DESIRED_STATE; default="active"
The desired state of the export. Process messages by setting the value to ACTIVE or pause message processing by setting the value to PAUSED. EXPORT_DESIRED_STATE must be one of: active, paused.
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 $ gcloud help for details.
This command uses the pubsublite/v1 API. The full documentation for this API can be found at: https://cloud.google.com/pubsub/lite/docs
These variants are also available:
$ gcloud alpha pubsub lite-subscriptions create
$ gcloud beta pubsub lite-subscriptions create