Skip to main content

Google Cloud Pub/Sub

This Integration is part of the Google Cloud Pub / Sub Pack.#

Google Cloud Pub / Sub is a fully-managed real-time messaging service that allows you to send and receive messages between independent applications. This integration was integrated and tested with Google Cloud Pub/Sub

Required Permissions#

To use this integration you must have a Service Account with one of the following roles:

  • Project-Owner
  • Project-Editor
  • Pub/Sub Admin
  • Pub/Sub Editor

Known Limitations#

When clicking on Reset the "last run" timestamp, messages that were recently pulled (including pulls via classification mapper) might take a few minutes before they can be fetched again. Because the fetch ignores older messages once newer ones were fetched, it's recommended to wait a few minutes following a reset before trying to fetch again, to prevent older messages from being dropped.

Configure GooglePubSub on Cortex XSOAR#

  1. Navigate to Settings > Integrations > Servers & Services.
  2. Search for GooglePubSub.
  3. Click Add instance to create and configure a new integration instance.
ParameterDescriptionRequired
service_account_jsonService Account Private Key File Contents (JSON)True
insecureTrust any certificate (not secure)False
proxyUse system proxy settingsFalse
isFetchFetch incidentsFalse
incidentTypeIncident typeFalse
default_subscriptionFetch Incidents Subscription IDFalse
default_projectFetch Incidents Project IDFalse
default_max_msgsMax Incidents Per FetchFalse
  1. Click Test to validate the URLs, token, and connection.

Commands#

You can execute these commands from the Cortex XSOAR CLI, as part of an automation, or in a playbook. After you successfully execute a command, a DBot message appears in the War Room with the command details.

gcp-pubsub-topics-list#


Get a list of the project's topics.

Base Command#

gcp-pubsub-topics-list

Input#
Argument NameDescriptionRequired
project_idID of the project to look in.Optional
page_sizeMax amount of entries to get.Optional
page_tokenNext page token as returned from "gcp-pubsub-topics-list" commandOptional
Context Output#
PathTypeDescription
GoogleCloudPubSubTopics.nameStringName of the topic
GoogleCloudPubSub.Topics.nextPageTokenStringIf not empty, indicates that there may be more topics that match the request.
Command Example#

!gcp-pubsub-topics-list project_id=dmst-integrations

Context Example#
{
"GoogleCloudPubSubTopics": {
"name": "projects/dmst-integrations/topics/dmst-topic"
}
}
Human Readable Output#

Topics for project dmst-integrations#

name
projects/dmst-integrations/topics/dmst-topic

gcp-pubsub-topic-publish-message#


Publish a message in a topic.

Base Command#

gcp-pubsub-topic-publish-message

Input#
Argument NameDescriptionRequired
topic_idID of the topic e.g. "projects/{project_id}/topics/topic_id".Required
dataThe message data field. If this field is empty, the message must contain at least one attribute.Optional
attributesAttributes for this message. If this field is empty, the message must contain non-empty data. Input format: "key=val" pairs sepearated by ",".Optional
project_idProject ID.Optional
delim_char_attributesSet delimiter of attributes split.Optional
Context Output#
PathTypeDescription
GoogleCloudPubSubPublishedMessages.messageIdStringID of the published message
GoogleCloudPubSubPublishedMessages.topicStringTopic of the published message
GoogleCloudPubSubPublishedMessages.dataStringText data of the published message.
GoogleCloudPubSubPublishedMessages.attributesUnknownThe message attributes.
Command Example#

!gcp-pubsub-topic-publish-message data="42 is the answer" project_id=dmst-integrations topic_id=dmst-topic delim_char_attributes=","

Context Example#
{
"GoogleCloudPubSubPublishedMessages": {
"attributes": null,
"data": "42 is the answer",
"messageId": "874663628353499",
"topic": "dmst-topic",
"delim_char_attributes": ","
}
}
Human Readable Output#

Google Cloud PubSub has published the message successfully#

DataMessage IdTopic
42 is the answer874663628353499dmst-topic

gcp-pubsub-topic-subscription-get-by-name#


Get subscription details by subscription ID.

Base Command#

gcp-pubsub-topic-subscription-get-by-name

Input#
Argument NameDescriptionRequired
project_idID of the project from which the subscription is receiving messages.Optional
subscription_idID of the subscription, without project/topic prefix.Required
Context Output#
PathTypeDescription
GoogleCloudPubSubSubscriptions.ackDeadlineSecondsNumberThe amount of time Pub/Sub waits for the subscriber to acknowledge receipt before resending the message.
GoogleCloudPubSubSubscriptions.expirationPolicy.ttlStringThe "time-to-live" duration for the subscription.
GoogleCloudPubSubSubscriptions.messageRetentionDurationStringHow long to retain unacknowledged messages in the subscription's backlog
GoogleCloudPubSubSubscriptions.nameStringName of the subscription
GoogleCloudPubSubSubscriptions.topicStringName of the topic from which the subscription is receiving messages
Command Example#

!gcp-pubsub-topic-subscription-get-by-name subscription_id=test_sub_2 project_id=dmst-integrations

Context Example#
{
"GoogleCloudPubSubSubscriptions": {
"ackDeadlineSeconds": 10,
"expirationPolicy": {
"ttl": "9999999999s"
},
"messageRetentionDuration": "604800s",
"name": "projects/dmst-integrations/subscriptions/test_sub_2",
"pushConfig": {},
"topic": "projects/dmst-integrations/topics/dmst-topic"
}
}
Human Readable Output#

Subscription test_sub_2#

ackDeadlineSecondsexpirationPolicymessageRetentionDurationnamepushConfigtopic
10ttl: 9999999999s604800sprojects/dmst-integrations/subscriptions/test_sub_2projects/dmst-integrations/topics/dmst-topic

gcp-pubsub-topic-subscriptions-list#


Get a list of subscriptions by project ID or topic ID.

Base Command#

gcp-pubsub-topic-subscriptions-list

Input#
Argument NameDescriptionRequired
project_idID of the project from which the subscription is receiving messages.Optional
topic_idID of the topic from which the subscription is receiving messages.Optional
page_sizeMax number of resultsOptional
page_tokenNext page token as returned from the API.Optional
Context Output#
PathTypeDescription
GoogleCloudPubSubSubscriptions.ackDeadlineSecondsNumberThe amount of time Pub/Sub waits for the subscriber to acknowledge receipt before resending the message.
GoogleCloudPubSubSubscriptions.expirationPolicy.ttlStringThe "time-to-live" duration for the subscription
GoogleCloudPubSubSubscriptions.messageRetentionDurationStringHow long to retain unacknowledged messages in the subscription's backlog
GoogleCloudPubSubSubscriptions.nameStringName of the subscription
GoogleCloudPubSubSubscriptions.topicStringName of the topic from which the subscription is receiving messages.
GoogleCloudPubSubSubscriptions.pushConfig.pushEndpointStringA URL locating the endpoint to which messages should be pushed.
cUnknownIf not empty, indicates that there may be more snapshot that match the request.
Command Example#

!gcp-pubsub-topic-subscriptions-list project_id=dmst-integrations

Context Example#
{
"GoogleCloudPubSubSubscriptions": [
{
"ackDeadlineSeconds": 11,
"expirationPolicy": {
"ttl": "2678400s"
},
"messageRetentionDuration": "604800s",
"name": "projects/dmst-integrations/subscriptions/dean-sub1",
"pushConfig": {},
"topic": "projects/dmst-integrations/topics/dmst-topic"
},
{
"ackDeadlineSeconds": 10,
"expirationPolicy": {
"ttl": "2678400s"
},
"messageRetentionDuration": "604800s",
"name": "projects/dmst-integrations/subscriptions/dean-sub2",
"pushConfig": {},
"topic": "projects/dmst-integrations/topics/dmst-topic"
},
{
"ackDeadlineSeconds": 10,
"expirationPolicy": {
"ttl": "22678400s"
},
"messageRetentionDuration": "604800s",
"name": "projects/dmst-integrations/subscriptions/test_sub_1",
"pushConfig": {},
"topic": "projects/dmst-integrations/topics/dmst-topic"
},
{
"ackDeadlineSeconds": 10,
"expirationPolicy": {
"ttl": "2678400s"
},
"messageRetentionDuration": "604800s",
"name": "projects/dmst-integrations/subscriptions/test_sub",
"pushConfig": {},
"topic": "projects/dmst-integrations/topics/dmst-topic"
},
{
"ackDeadlineSeconds": 10,
"expirationPolicy": {
"ttl": "9999999999s"
},
"messageRetentionDuration": "604800s",
"name": "projects/dmst-integrations/subscriptions/test_sub_2",
"pushConfig": {},
"topic": "projects/dmst-integrations/topics/dmst-topic"
},
{
"ackDeadlineSeconds": 10,
"expirationPolicy": {
"ttl": "86400s"
},
"messageRetentionDuration": "86400s",
"name": "projects/dmst-integrations/subscriptions/test_sub_1587031883059",
"pushConfig": {},
"topic": "projects/dmst-integrations/topics/dmst-topic"
},
{
"ackDeadlineSeconds": 10,
"expirationPolicy": {
"ttl": "86400s"
},
"labels": {
"test": "true"
},
"messageRetentionDuration": "86400s",
"name": "projects/dmst-integrations/subscriptions/test_sub_1587032827289",
"pushConfig": {},
"topic": "projects/dmst-integrations/topics/dmst-topic"
},
{
"ackDeadlineSeconds": 10,
"expirationPolicy": {
"ttl": "86400s"
},
"labels": {
"test": "true"
},
"messageRetentionDuration": "86400s",
"name": "projects/dmst-integrations/subscriptions/test_sub_1587039285961",
"pushConfig": {},
"topic": "projects/dmst-integrations/topics/dmst-topic"
},
{
"ackDeadlineSeconds": 10,
"expirationPolicy": {
"ttl": "86400s"
},
"labels": {
"test": "true"
},
"messageRetentionDuration": "86400s",
"name": "projects/dmst-integrations/subscriptions/test_sub_1587038878685",
"pushConfig": {},
"topic": "projects/dmst-integrations/topics/dmst-topic"
},
{
"ackDeadlineSeconds": 10,
"expirationPolicy": {
"ttl": "86400s"
},
"labels": {
"test": "true"
},
"messageRetentionDuration": "86400s",
"name": "projects/dmst-integrations/subscriptions/test_sub_1587039587203",
"pushConfig": {},
"topic": "projects/dmst-integrations/topics/dmst-topic"
},
{
"ackDeadlineSeconds": 10,
"expirationPolicy": {
"ttl": "86400s"
},
"labels": {
"test": "true"
},
"messageRetentionDuration": "86400s",
"name": "projects/dmst-integrations/subscriptions/test_sub_1587040075117",
"pushConfig": {},
"topic": "projects/dmst-integrations/topics/dmst-topic"
},
{
"ackDeadlineSeconds": 10,
"expirationPolicy": {
"ttl": "86400s"
},
"labels": {
"test": "true"
},
"messageRetentionDuration": "86400s",
"name": "projects/dmst-integrations/subscriptions/test_sub_1587042146495",
"pushConfig": {},
"topic": "projects/dmst-integrations/topics/dmst-topic"
},
{
"ackDeadlineSeconds": 10,
"expirationPolicy": {
"ttl": "86400s"
},
"labels": {
"test": "true"
},
"messageRetentionDuration": "86400s",
"name": "projects/dmst-integrations/subscriptions/test_sub_1587043084505",
"pushConfig": {},
"topic": "projects/dmst-integrations/topics/dmst-topic"
},
{
"ackDeadlineSeconds": 10,
"expirationPolicy": {
"ttl": "86400s"
},
"labels": {
"doc": "true"
},
"messageRetentionDuration": "86400s",
"name": "projects/dmst-integrations/subscriptions/doc_sub",
"pushConfig": {},
"topic": "projects/dmst-integrations/topics/dmst-topic"
},
{
"ackDeadlineSeconds": 600,
"expirationPolicy": {},
"messageRetentionDuration": "604800s",
"name": "projects/dmst-integrations/subscriptions/gcf-function-1-us-central1-dmst-topic",
"pushConfig": {
"attributes": {
"x-goog-version": "v1"
},
"pushEndpoint": "https://d4d1290519676f29baf13a7bf18a25bf-dot-j40fd5d18d8c290e1p-tp.appspot.com/_ah/push-handlers/pubsub/projects/dmst-integrations/topics/dmst-topic?pubsub_trigger=true"
},
"topic": "projects/dmst-integrations/topics/dmst-topic"
}
]
}
Human Readable Output#

Subscriptions in project dmst-integrations#

NameTopicAck Deadline SecondsLabels
projects/dmst-integrations/subscriptions/dean-sub1projects/dmst-integrations/topics/dmst-topic11
projects/dmst-integrations/subscriptions/dean-sub2projects/dmst-integrations/topics/dmst-topic10
projects/dmst-integrations/subscriptions/test_sub_1projects/dmst-integrations/topics/dmst-topic10
projects/dmst-integrations/subscriptions/test_subprojects/dmst-integrations/topics/dmst-topic10
projects/dmst-integrations/subscriptions/test_sub_2projects/dmst-integrations/topics/dmst-topic10
projects/dmst-integrations/subscriptions/test_sub_1587031883059projects/dmst-integrations/topics/dmst-topic10
projects/dmst-integrations/subscriptions/test_sub_1587032827289projects/dmst-integrations/topics/dmst-topic10test: true
projects/dmst-integrations/subscriptions/test_sub_1587039285961projects/dmst-integrations/topics/dmst-topic10test: true
projects/dmst-integrations/subscriptions/test_sub_1587038878685projects/dmst-integrations/topics/dmst-topic10test: true
projects/dmst-integrations/subscriptions/test_sub_1587039587203projects/dmst-integrations/topics/dmst-topic10test: true
projects/dmst-integrations/subscriptions/test_sub_1587040075117projects/dmst-integrations/topics/dmst-topic10test: true
projects/dmst-integrations/subscriptions/test_sub_1587042146495projects/dmst-integrations/topics/dmst-topic10test: true
projects/dmst-integrations/subscriptions/test_sub_1587043084505projects/dmst-integrations/topics/dmst-topic10test: true
projects/dmst-integrations/subscriptions/doc_subprojects/dmst-integrations/topics/dmst-topic10doc: true
projects/dmst-integrations/subscriptions/gcf-function-1-us-central1-dmst-topicprojects/dmst-integrations/topics/dmst-topic600

gcp-pubsub-topic-messages-pull#


Pull messages that were published.

Base Command#

gcp-pubsub-topic-messages-pull

Input#
Argument NameDescriptionRequired
project_idProject ID to pull messages from.Optional
subscription_idSubscription ID to pull messages from.Required
max_messagesThe maximum number of messages to return for this request. Must be a positive integer.Optional
ackAcknowledge the messages pulled.Optional
Context Output#
PathTypeDescription
GoogleCloudPubSubPulledMessages.dataStringText data of the pulled message.
GoogleCloudPubSubPulledMessages.messageIdStringID of the message
GoogleCloudPubSubPulledMessages.publishTimeDateThe time the message was published
GoogleCloudPubSubPulledMessages.attributesUnknownThe message attributes.
Command Example#

!gcp-pubsub-topic-messages-pull ack=true max_messages=1 project_id=dmst-integrations subscription_id=test_sub_2

Context Example#
{
"GoogleCloudPubSubPulledMessages": {
"data": "42 is the answer",
"messageId": "874662740221427",
"publishTime": "2020-04-16T13:32:41.398Z"
}
}
Human Readable Output#

Google Cloud PubSub Messages#

datamessageIdpublishTime
42 is the answer8746627402214272020-04-16T13:32:41.398Z

gcp-pubsub-topic-subscription-create#


Create a pull or push subscription.

Base Command#

gcp-pubsub-topic-subscription-create

Input#
Argument NameDescriptionRequired
project_idID of the project from which the subscription is receiving messages.Optional
subscription_idID of the created subscription.Required
topic_idID of the topic from which the subscription is receiving messages.Required
push_endpointA URL locating the endpoint to which messages should be pushed.Optional
push_attributesEndpoint configuration attributes that can be used to control the message delivery, such as "x-goog-version", which you can use to change the format of the pushed message. Input format: "key=val" pairs sepearated by ",".Optional
ack_deadline_secondsThe amount of time Pub/Sub waits for the subscriber to acknowledge receipt before resending the message.Optional
retain_acked_messagesIndicates whether to retain acknowledged messages.Optional
message_retention_durationHow long to retain unacknowledged messages in the subscription's backlog. A duration of seconds e.g. "4.2s"Optional
labelsInput format: "key=val" pairs sepearated by ",".Optional
expiration_ttlThe "time-to-live" duration for the subscription.Optional
Context Output#
PathTypeDescription
GoogleCloudPubSubSubscriptions.ackDeadlineSecondsNumberThe amount of time Pub/Sub waits for the subscriber to acknowledge receipt before resending the message.
GoogleCloudPubSubSubscriptions.expirationPolicy.ttlStringThe "time-to-live" duration for the subscription.
GoogleCloudPubSubSubscriptions.messageRetentionDurationStringHow long to retain unacknowledged messages in the subscription's backlog
GoogleCloudPubSubSubscriptions.nameStringName of the subscription
GoogleCloudPubSubSubscriptions.topicStringName of the topic from which the subscription is receiving messages
GoogleCloudPubSubSubscriptions.projectNameStringName of the project from which the subscription is receiving messages
GoogleCloudPubSubSubscriptions.subscriptionNameStringName of the newly created subscription
GoogleCloudPubSubSubscriptions.labelsStringAn object containing a list of "key": value pairs.
Command Example#

!gcp-pubsub-topic-subscription-create expiration_ttl=86400s project_id=dmst-integrations topic_id=dmst-topic subscription_id=doc_sub_1

Context Example#
{
"GoogleCloudPubSubSubscriptions": {
"ackDeadlineSeconds": 10,
"expirationPolicy": {
"ttl": "86400s"
},
"messageRetentionDuration": "86400s",
"name": "projects/dmst-integrations/subscriptions/doc_sub_1",
"projectName": "dmst-integrations",
"pushConfig": {},
"subscriptionName": "doc_sub_1",
"topic": "projects/dmst-integrations/topics/dmst-topic"
}
}
Human Readable Output#

Subscription doc_sub_1 was created successfully#

ackDeadlineSecondsexpirationPolicymessageRetentionDurationnamepushConfigtopic
10ttl: 86400s86400sprojects/dmst-integrations/subscriptions/doc_sub_1projects/dmst-integrations/topics/dmst-topic

gcp-pubsub-topic-create#


Create a topic.

Base Command#

gcp-pubsub-topic-create

Input#
Argument NameDescriptionRequired
project_idID of the project the topic will belong to.Optional
topic_idID of the newly created topic.Required
labels'Input format: "key=val" pairs sepearated by ",".'Optional
allowed_persistence_regionsA comma separated list of IDs of GCP regions where messages that are published to the topic may be persisted in storage. e.g. "us-east4,asia-1".
https://cloud.google.com/compute/docs/regions-zones#locations
Optional
kms_key_nameThe full name of the Cloud KMS CryptoKey to be used to restrict access to messages published on this topic.

Full name format: projects//locations//keyRings//cryptoKeys/.
Optional
Context Output#
PathTypeDescription
GoogleCloudPubSubTopics.nameStringName of the topic
GoogleCloudPubSubTopics.labelsUnknownAn object containing a list of "key": value pairs.
GoogleCloudPubSubTopics.messageStoragePolicy.allowedPersistenceRegionsUnknownA list of IDs of GCP regions where messages that are published to the topic may be persisted in storage.
GoogleCloudPubSubTopics.kmsKeyNameStringThe resource name of the Cloud KMS CryptoKey to be used to restrict access.
Command Example#

!gcp-pubsub-topic-create project_id=dmst-integrations topic_id=dmst-doc-topic

Context Example#
{
"GoogleCloudPubSubTopics": {
"name": "projects/dmst-integrations/topics/dmst-doc-topic"
}
}
Human Readable Output#

Topic dmst-doc-topic was created successfully#

Name
projects/dmst-integrations/topics/dmst-doc-topic

gcp-pubsub-topic-delete#


Delete a topic.

Base Command#

gcp-pubsub-topic-delete

Input#
Argument NameDescriptionRequired
project_idID of the project the topic will belong to.Optional
topic_idID of the newly created topic.Required
Context Output#

There is no context output for this command.

Command Example#

!gcp-pubsub-topic-delete project_id=dmst-integrations topic_id=dmst-doc-topic

Context Example#
{}
Human Readable Output#

Topic dmst-doc-topic was deleted successfully

gcp-pubsub-topic-update#


Updates a topic.

Base Command#

gcp-pubsub-topic-update

Input#
Argument NameDescriptionRequired
project_idID of the project the topic belongs to.Optional
topic_idID of the topic.Required
labels'Input format: "key=val" pairs sepearated by ",".'Optional
allowed_persistence_regionsA comma separated list of IDs of GCP regions where messages that are published to the topic may be persisted in storage. e.g. "us-east4,asia-1".
https://cloud.google.com/compute/docs/regions-zones#locations
Optional
kms_key_nameThe full name of the Cloud KMS CryptoKey to be used to restrict access to messages published on this topic.

Full name format: projects//locations//keyRings//cryptoKeys/.
Optional
update_maskIndicates which fields in the provided topic to update.
A comma-separated list of fields. Example: "labels,messageStoragePolicy".
Required
Context Output#
PathTypeDescription
GoogleCloudPubSubTopics.nameStringName of the topic
GoogleCloudPubSubTopics.labelsUnknownAn object containing a list of "key": value pairs.
GoogleCloudPubSubTopics.messageStoragePolicy.allowedPersistenceRegionsUnknownA list of IDs of GCP regions where messages that are published to the topic may be persisted in storage.
GoogleCloudPubSubTopics.kmsKeyNameStringThe resource name of the Cloud KMS CryptoKey to be used to restrict access.
Command Example#

!gcp-pubsub-topic-update project_id=dmst-integrations topic_id=dmst-doc-topic labels="doc=true" update_mask=labels

Context Example#
{
"GoogleCloudPubSubTopics": {
"labels": {
"doc": "true"
},
"name": "projects/dmst-integrations/topics/dmst-doc-topic"
}
}
Human Readable Output#

Topic dmst-doc-topic was updated successfully#

LabelsName
doc: trueprojects/dmst-integrations/topics/dmst-doc-topic

gcp-pubsub-topic-subscription-update#


Update a subscription.

Base Command#

gcp-pubsub-topic-subscription-update

Input#
Argument NameDescriptionRequired
update_maskIndicates which fields in the provided subscription to update.
A comma-separated list of fully qualified names of fields.
Example: "pushConfig.pushEndpoint,ackDeadlineSeconds".
Required
project_idID of the project from which the subscription is receiving messages.Optional
subscription_idID of the updated subscription.Required
topic_idID of the topic from which the subscription is receiving messages.Required
push_endpointA URL locating the endpoint to which messages should be pushed.Optional
push_attributesEndpoint configuration attributes that can be used to control the message delivery. Input format: "key=val" pairs sepearated by ",".Optional
ack_deadline_secondsThe amount of time Pub/Sub waits for the subscriber to acknowledge receipt before resending the message.Optional
retain_acked_messagesIndicates whether to retain acknowledged messages.Optional
message_retention_durationHow long to retain unacknowledged messages in the subscription's backlog. A duration of seconds e.g. "4.2s"Optional
labelsInput format: "key=val" pairs sepearated by ",".Optional
expiration_ttlThe "time-to-live" duration for the subscription.Optional
Context Output#
PathTypeDescription
GoogleCloudPubSubSubscriptions.ackDeadlineSecondsNumberThe amount of time Pub/Sub waits for the subscriber to acknowledge receipt before resending the message.
GoogleCloudPubSubSubscriptions.expirationPolicy.ttlStringThe "time-to-live" duration for the subscription.
GoogleCloudPubSubSubscriptions.messageRetentionDurationStringHow long to retain unacknowledged messages in the subscription's backlog.
GoogleCloudPubSubSubscriptions.nameStringName of the subscription.
GoogleCloudPubSubSubscriptions.topicStringName of the topic from which the subscription is receiving messages.
GoogleCloudPubSubSubscriptions.projectNameStringName of the project from which the subscription is receiving messages.
GoogleCloudPubSubSubscriptions.subscriptionNameStringName of the subscription.
GoogleCloudPubSubSubscriptions.labelsStringAn object containing a list of "key": value pairs.
Command Example#

!gcp-pubsub-topic-subscription-update labels="doc=true" project_id=dmst-integrations subscription_id=doc_sub_1 topic_id=dmst-topic update_mask=labels

Context Example#
{
"GoogleCloudPubSubSubscriptions": {
"ackDeadlineSeconds": 10,
"expirationPolicy": {
"ttl": "86400s"
},
"labels": {
"doc": "true"
},
"messageRetentionDuration": "86400s",
"name": "projects/dmst-integrations/subscriptions/doc_sub_1",
"projectName": "dmst-integrations",
"pushConfig": {
"attributes": {
"x-goog-version": "v1"
}
},
"subscriptionName": "doc_sub_1",
"topic": "projects/dmst-integrations/topics/dmst-topic"
}
}
Human Readable Output#

Subscription doc_sub_1 was updated successfully#

ackDeadlineSecondsexpirationPolicylabelsmessageRetentionDurationnamepushConfigtopic
10ttl: 86400sdoc: true86400sprojects/dmst-integrations/subscriptions/doc_sub_1attributes: {"x-goog-version": "v1"}projects/dmst-integrations/topics/dmst-topic

gcp-pubsub-topic-messages-seek#


Seeks a subscription to a given point in time or to a given snapshot.

Base Command#

gcp-pubsub-topic-messages-seek

Input#
Argument NameDescriptionRequired
project_idID of the project from which the subscription is receiving messages.Optional
subscription_idID of the subscription, without project/topic prefix.Required
time_stringA timestamp in RFC3339 UTC "Zulu" format, accurate to nanoseconds. Example: "2014-10-02T15:01:23.045123456Z".Optional
snapshotThe snapshot to seek to.Optional
Context Output#

There is no context output for this command.

Command Example#

!gcp-pubsub-topic-messages-seek time_string="2020-04-16T13:27:55.117Z" project_id=dmst-integrations topic_id=dmst-topic subscription_id=doc_sub_1

Context Example#
{}
Human Readable Output#

Message seek was successful for time: 2020-04-16T13:27:55.117Z

gcp-pubsub-topic-snapshots-list#


Get a list of snapshots by project ID and topic ID.

Base Command#

gcp-pubsub-topic-snapshots-list

Input#
Argument NameDescriptionRequired
project_idThe ID of the project from which this snapshot is retaining messages.Optional
topic_idThe ID of the topic from which this snapshot is retaining messages.Optional
page_sizeMax number of resultsOptional
page_tokenNext page token as returned from the API.Optional
Context Output#
PathTypeDescription
GoogleCloudPubSubSnapshots.nameStringThe name of the snapshot.
GoogleCloudPubSubSnapshots.topicUnknownThe name of the topic from which this snapshot is retaining messages.
GoogleCloudPubSubSnapshots.expireTimeDateThe snapshot is guaranteed to exist up until this time.
GoogleCloudPubSubSnapshots.labelsUnknownAn object containing a list of "key": value pairs.
GoogleCloudPubSub.Snapshots.nextPageTokenStringIf not empty, indicates that there may be more snapshot that match the request.
Command Example#

!gcp-pubsub-topic-snapshots-list project_id=dmst-integrations

Context Example#
{
"GoogleCloudPubSubSnapshots": {
"expireTime": "2020-04-23T13:37:26.199Z",
"labels": {
"doc": "true"
},
"name": "projects/dmst-integrations/snapshots/doc_snapshot",
"topic": "projects/dmst-integrations/topics/dmst-topic"
}
}
Human Readable Output#

Snapshots for project dmst-integrations#

name
projects/dmst-integrations/snapshots/doc_snapshot

gcp-pubsub-topic-snapshot-create#


Creates a snapshot from the requested subscription. Snapshots are used in gcp-pubsub-topic-messages-seek command.

Base Command#

gcp-pubsub-topic-snapshot-create

Input#
Argument NameDescriptionRequired
project_idID of the project from which the subscription is receiving messages.Optional
subscription_idThe subscription whose backlog the snapshot retains.Required
labelsInput format: "key=val" pairs sepearated by ",".Optional
snapshot_idThe id of the snapshot.Required
Context Output#
PathTypeDescription
GoogleCloudPubSubSnapshots.nameStringThe name of the snapshot.
GoogleCloudPubSubSnapshots.topicUnknownThe name of the topic from which this snapshot is retaining messages.
GoogleCloudPubSubSnapshots.expireTimeDateThe snapshot is guaranteed to exist up until this time.
GoogleCloudPubSubSnapshots.labelsUnknownAn object containing a list of "key": value pairs
Command Example#

!gcp-pubsub-topic-snapshot-create project_id=dmst-integrations subscription_id=test_sub_2 snapshot_id=doc_snapshot

Context Example#
{
"GoogleCloudPubSubSnapshots": {
"expireTime": "2020-04-23T13:37:26.199Z",
"name": "projects/dmst-integrations/snapshots/doc_snapshot",
"topic": "projects/dmst-integrations/topics/dmst-topic"
}
}
Human Readable Output#

Snapshot doc_snapshot was created successfully#

Expire TimeNameTopic
2020-04-23T13:37:26.199Zprojects/dmst-integrations/snapshots/doc_snapshotprojects/dmst-integrations/topics/dmst-topic

gcp-pubsub-topic-snapshot-update#


Updates an existing snapshot. Snapshots are used in gcp-pubsub-topic-messages-seek command.

Base Command#

gcp-pubsub-topic-snapshot-update

Input#
Argument NameDescriptionRequired
project_idThe ID of the project from which the subscription is receiving messages.Optional
expire_timeThe snapshot is guaranteed to exist up until this time. A newly-created snapshot expires no later than 7 days from the time of its creation.

A timestamp in RFC3339 UTC "Zulu" format, accurate to nanoseconds. Example: "2020-04-01T08:01:23.045678910Z"
Optional
labelsInput format: "key=val" pairs sepearated by ",".Optional
snapshot_idThe id of the snapshot.Required
update_maskIndicates which fields in the provided snapshot to update.
A comma-separated list of fields. Example: "labels,topic,expireTime".
Required
topic_idThe ID of the topic from which this snapshot is retaining messages.Required
Context Output#
PathTypeDescription
GoogleCloudPubSubSnapshots.nameStringThe name of the snapshot.
GoogleCloudPubSubSnapshots.topicUnknownThe name of the topic from which this snapshot is retaining messages.
GoogleCloudPubSubSnapshots.expireTimeDateThe snapshot is guaranteed to exist up until this time.
GoogleCloudPubSubSnapshots.labelsUnknownAn object containing a list of "key": value pairs
Command Example#

!gcp-pubsub-topic-snapshot-update project_id=dmst-integrations subscription_id=test_sub_2 snapshot_id=doc_snapshot labels="doc=true" update_mask=labels topic_id=dmst-topic

Context Example#
{
"GoogleCloudPubSubSnapshots": {
"expireTime": "2020-04-23T13:37:26.199Z",
"labels": {
"doc": "true"
},
"name": "projects/dmst-integrations/snapshots/doc_snapshot",
"topic": "projects/dmst-integrations/topics/dmst-topic"
}
}
Human Readable Output#

Snapshot doc_snapshot was updated successfully#

Expire TimeLabelsNameTopic
2020-04-23T13:37:26.199Zdoc: trueprojects/dmst-integrations/snapshots/doc_snapshotprojects/dmst-integrations/topics/dmst-topic

gcp-pubsub-topic-snapshot-delete#


Removes an existing snapshot.

Base Command#

gcp-pubsub-topic-snapshot-delete

Input#
Argument NameDescriptionRequired
project_idThe ID of the project from which the subscription is receiving messages.Optional
snapshot_idThe id of the snapshot.Required
Context Output#

There is no context output for this command.

Command Example#

!gcp-pubsub-topic-snapshot-delete project_id=dmst-integrations snapshot_id=doc_snapshot

Context Example#
{}
Human Readable Output#

Snapshot doc_snapshot was deleted successfully

gcp-pubsub-topic-snapshot-delete#


Removes an existing snapshot.

Base Command#

gcp-pubsub-topic-ack-messages

Input#
Argument NameDescriptionRequired
subscription_idThe subscription that will have the messages acked.Required
ack_idsList of comma separated ids to ACK, as received from "gcp-pubsub-topic-messages-pull" or from "fetch-incidents".Required
project_idThe project id that the messages were pulled from.Optional
Context Output#

There is no context output for this command.

Command Example#

!gcp-pubsub-topic-ack-messages ack_ids=example_ack_id subscription_id=test_sub_2

Context Example#
{}
Human Readable Output#

Subscription test_sub_2 had the following ids acknowledged#

ACK ID
example_ack_id