Tool: create_subscription
Create a new Cloud Pub/Sub subscription to a given topic.
Parameters
name: The name of the subscription in the formatprojects/{project_id}/subscriptions/{name}.topic: The name of the topic to subscribe to in the formatprojects/{project_id}/topics/{topic_name}.
Returns
The created subscription configuration if successful.
An
ALREADY_EXISTSerror if the subscription already exists.A
NOT_FOUNDerror if the corresponding topic doesn't exist.
Important Notes
A subscription is a named resource that represents a stream of messages from a single, specific topic, to be delivered to the subscribing application.
A project ID, topic name, and subscription name must be provided.
The following sample demonstrate how to use curl to invoke the create_subscription MCP tool.
| Curl Request |
|---|
curl --location 'https://pubsub.googleapis.com/mcp' \ --header 'content-type: application/json' \ --header 'accept: application/json, text/event-stream' \ --data '{ "method": "tools/call", "params": { "name": "create_subscription", "arguments": { // provide these details according to the tool's MCP specification } }, "jsonrpc": "2.0", "id": 1 }' |
Input Schema
A subscription resource. If none of push_config, bigquery_config, or cloud_storage_config is set, then the subscriber will pull and ack messages using API methods. At most one of these fields may be set.
Subscription
| JSON representation |
|---|
{ "name": string, "topic": string, "pushConfig": { object ( |
| Fields | |
|---|---|
name |
Required. Identifier. The name of the subscription. It must have the format |
topic |
Required. The name of the topic from which this subscription is receiving messages. Format is |
pushConfig |
Optional. If push delivery is used with this subscription, this field is used to configure it. |
bigqueryConfig |
Optional. If delivery to BigQuery is used with this subscription, this field is used to configure it. |
cloudStorageConfig |
Optional. If delivery to Google Cloud Storage is used with this subscription, this field is used to configure it. |
ackDeadlineSeconds |
Optional. The approximate amount of time (on a best-effort basis) Pub/Sub waits for the subscriber to acknowledge receipt before resending the message. In the interval after the message is delivered and before it is acknowledged, it is considered to be outstanding. During that time period, the message will not be redelivered (on a best-effort basis). For pull subscriptions, this value is used as the initial value for the ack deadline. To override this value for a given message, call For push delivery, this value is also used to set the request timeout for the call to the push endpoint. If the subscriber never acknowledges the message, the Pub/Sub system will eventually redeliver the message. |
retainAckedMessages |
Optional. Indicates whether to retain acknowledged messages. If true, then messages are not expunged from the subscription's backlog, even if they are acknowledged, until they fall out of the |
messageRetentionDuration |
Optional. How long to retain unacknowledged messages in the subscription's backlog, from the moment a message is published. If A duration in seconds with up to nine fractional digits, ending with ' |
labels |
Optional. See Creating and managing labels. An object containing a list of |
enableMessageOrdering |
Optional. If true, messages published with the same |
expirationPolicy |
Optional. A policy that specifies the conditions for this subscription's expiration. A subscription is considered active as long as any connected subscriber is successfully consuming messages from the subscription or is issuing operations on the subscription. If |
filter |
Optional. An expression written in the Pub/Sub filter language. If non-empty, then only |
deadLetterPolicy |
Optional. A policy that specifies the conditions for dead lettering messages in this subscription. If dead_letter_policy is not set, dead lettering is disabled. The Pub/Sub service account associated with this subscriptions's parent project (i.e., service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com) must have permission to Acknowledge() messages on this subscription. |
retryPolicy |
Optional. A policy that specifies how Pub/Sub retries message delivery for this subscription. If not set, the default retry policy is applied. This generally implies that messages will be retried as soon as possible for healthy subscribers. RetryPolicy will be triggered on NACKs or acknowledgment deadline exceeded events for a given message. |
detached |
Optional. Indicates whether the subscription is detached from its topic. Detached subscriptions don't receive messages from their topic and don't retain any backlog. |
enableExactlyOnceDelivery |
Optional. If true, Pub/Sub provides the following guarantees for the delivery of a message with a given value of
Note that subscribers may still receive multiple copies of a message when |
topicMessageRetentionDuration |
Output only. Indicates the minimum duration for which a message is retained after it is published to the subscription's topic. If this field is set, messages published to the subscription's topic in the last A duration in seconds with up to nine fractional digits, ending with ' |
state |
Output only. An output-only field indicating whether or not the subscription can receive messages. |
analyticsHubSubscriptionInfo |
Output only. Information about the associated Analytics Hub subscription. Only set if the subscription is created by Analytics Hub. |
messageTransforms[] |
Optional. Transforms to be applied to messages before they are delivered to subscribers. Transforms are applied in the order specified. |
tags |
Optional. Input only. Immutable. Tag keys/values directly bound to this resource. For example: "123/environment": "production", "123/costCenter": "marketing" An object containing a list of |
PushConfig
| JSON representation |
|---|
{ "pushEndpoint": string, "attributes": { string: string, ... }, // Union field |
| Fields | |
|---|---|
pushEndpoint |
Optional. A URL locating the endpoint to which messages should be pushed. For example, a Webhook endpoint might use |
attributes |
Optional. Endpoint configuration attributes that can be used to control different aspects of the message delivery. The only currently supported attribute is If not present during the The only supported values for the
For example: An object containing a list of |
Union field authentication_method. An authentication method used by push endpoints to verify the source of push requests. This can be used with push endpoints that are private by default to allow requests only from the Pub/Sub system, for example. This field is optional and should be set only by users interested in authenticated push. authentication_method can be only one of the following: |
|
oidcToken |
Optional. If specified, Pub/Sub will generate and attach an OIDC JWT token as an |
Union field wrapper. The format of the delivered message to the push endpoint is defined by the chosen wrapper. When unset, PubsubWrapper is used. wrapper can be only one of the following: |
|
pubsubWrapper |
Optional. When set, the payload to the push endpoint is in the form of the JSON representation of a PubsubMessage (https://cloud.google.com/pubsub/docs/reference/rpc/google.pubsub.v1#pubsubmessage). |
noWrapper |
Optional. When set, the payload to the push endpoint is not wrapped. |
AttributesEntry
| JSON representation |
|---|
{ "key": string, "value": string } |
| Fields | |
|---|---|
key |
|
value |
|
OidcToken
| JSON representation |
|---|
{ "serviceAccountEmail": string, "audience": string } |
| Fields | |
|---|---|
serviceAccountEmail |
Optional. Service account email used for generating the OIDC token. For more information on setting up authentication, see Push subscriptions. |
audience |
Optional. Audience to be used when generating OIDC token. The audience claim identifies the recipients that the JWT is intended for. The audience value is a single case-sensitive string. Having multiple values (array) for the audience field is not supported. More info about the OIDC JWT token audience here: https://tools.ietf.org/html/rfc7519#section-4.1.3 Note: if not specified, the Push endpoint URL will be used. |
NoWrapper
| JSON representation |
|---|
{ "writeMetadata": boolean } |
| Fields | |
|---|---|
writeMetadata |
Optional. When true, writes the Pub/Sub message metadata to |
BigQueryConfig
| JSON representation |
|---|
{
"table": string,
"useTopicSchema": boolean,
"writeMetadata": boolean,
"dropUnknownFields": boolean,
"state": enum ( |
| Fields | |
|---|---|
table |
Optional. The name of the table to which to write data, of the form {projectId}.{datasetId}.{tableId} |
useTopicSchema |
Optional. When true, use the topic's schema as the columns to write to in BigQuery, if it exists. |
writeMetadata |
Optional. When true, write the subscription name, message_id, publish_time, attributes, and ordering_key to additional columns in the table. The subscription name, message_id, and publish_time fields are put in their own columns while all other message properties (other than data) are written to a JSON object in the attributes column. |
dropUnknownFields |
Optional. When true and use_topic_schema is true, any fields that are a part of the topic schema that are not part of the BigQuery table schema are dropped when writing to BigQuery. Otherwise, the schemas must be kept in sync and any messages with extra fields are not written and remain in the subscription's backlog. |
state |
Output only. An output-only field that indicates whether or not the subscription can receive messages. |
useTableSchema |
Optional. When true, use the BigQuery table's schema as the columns to write to in BigQuery. |
serviceAccountEmail |
Optional. The service account to use to write to BigQuery. The subscription creator or updater that specifies this field must have |
CloudStorageConfig
| JSON representation |
|---|
{ "bucket": string, "filenamePrefix": string, "filenameSuffix": string, "filenameDatetimeFormat": string, "maxDuration": string, "maxBytes": string, "maxMessages": string, "state": enum ( |
| Fields | |
|---|---|
bucket |
Required. User-provided name for the Cloud Storage bucket. The bucket must be created by the user. The bucket name must be without any prefix like "gs://". See the bucket naming requirements. |
filenamePrefix |
Optional. User-provided prefix for Cloud Storage filename. See the object naming requirements. |
filenameSuffix |
Optional. User-provided suffix for Cloud Storage filename. See the object naming requirements. Must not end in "/". |
filenameDatetimeFormat |
Optional. User-provided format string specifying how to represent datetimes in Cloud Storage filenames. See the datetime format guidance. |
maxDuration |
Optional. The maximum duration that can elapse before a new Cloud Storage file is created. Min 1 minute, max 10 minutes, default 5 minutes. May not exceed the subscription's acknowledgment deadline. A duration in seconds with up to nine fractional digits, ending with ' |
maxBytes |
Optional. The maximum bytes that can be written to a Cloud Storage file before a new file is created. Min 1 KB, max 10 GiB. The max_bytes limit may be exceeded in cases where messages are larger than the limit. |
maxMessages |
Optional. The maximum number of messages that can be written to a Cloud Storage file before a new file is created. Min 1000 messages. |
state |
Output only. An output-only field that indicates whether or not the subscription can receive messages. |
serviceAccountEmail |
Optional. The service account to use to write to Cloud Storage. The subscription creator or updater that specifies this field must have |
Union field output_format. Defaults to text format. output_format can be only one of the following: |
|
textConfig |
Optional. If set, message data will be written to Cloud Storage in text format. |
avroConfig |
Optional. If set, message data will be written to Cloud Storage in Avro format. |
AvroConfig
| JSON representation |
|---|
{ "writeMetadata": boolean, "useTopicSchema": boolean } |
| Fields | |
|---|---|
writeMetadata |
Optional. When true, write the subscription name, message_id, publish_time, attributes, and ordering_key as additional fields in the output. The subscription name, message_id, and publish_time fields are put in their own fields while all other message properties other than data (for example, an ordering_key, if present) are added as entries in the attributes map. |
useTopicSchema |
Optional. When true, the output Cloud Storage file will be serialized using the topic schema, if it exists. |
Duration
| JSON representation |
|---|
{ "seconds": string, "nanos": integer } |
| Fields | |
|---|---|
seconds |
Signed seconds of the span of time. Must be from -315,576,000,000 to +315,576,000,000 inclusive. Note: these bounds are computed from: 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years |
nanos |
Signed fractions of a second at nanosecond resolution of the span of time. Durations less than one second are represented with a 0 |
LabelsEntry
| JSON representation |
|---|
{ "key": string, "value": string } |
| Fields | |
|---|---|
key |
|
value |
|
ExpirationPolicy
| JSON representation |
|---|
{ "ttl": string } |
| Fields | |
|---|---|
ttl |
Optional. Specifies the "time-to-live" duration for an associated resource. The resource expires if it is not active for a period of A duration in seconds with up to nine fractional digits, ending with ' |
DeadLetterPolicy
| JSON representation |
|---|
{ "deadLetterTopic": string, "maxDeliveryAttempts": integer } |
| Fields | |
|---|---|
deadLetterTopic |
Optional. The name of the topic to which dead letter messages should be published. Format is The operation will fail if the topic does not exist. Users should ensure that there is a subscription attached to this topic since messages published to a topic with no subscriptions are lost. |
maxDeliveryAttempts |
Optional. The maximum number of delivery attempts for any message. The value must be between 5 and 100. The number of delivery attempts is defined as 1 + (the sum of number of NACKs and number of times the acknowledgment deadline has been exceeded for the message). A NACK is any call to ModifyAckDeadline with a 0 deadline. Note that client libraries may automatically extend ack_deadlines. This field will be honored on a best effort basis. If this parameter is 0, a default value of 5 is used. |
RetryPolicy
| JSON representation |
|---|
{ "minimumBackoff": string, "maximumBackoff": string } |
| Fields | |
|---|---|
minimumBackoff |
Optional. The minimum delay between consecutive deliveries of a given message. Value should be between 0 and 600 seconds. Defaults to 10 seconds. A duration in seconds with up to nine fractional digits, ending with ' |
maximumBackoff |
Optional. The maximum delay between consecutive deliveries of a given message. Value should be between 0 and 600 seconds. Defaults to 600 seconds. A duration in seconds with up to nine fractional digits, ending with ' |
AnalyticsHubSubscriptionInfo
| JSON representation |
|---|
{ "listing": string, "subscription": string } |
| Fields | |
|---|---|
listing |
Optional. The name of the associated Analytics Hub listing resource. Pattern: "projects/{project}/locations/{location}/dataExchanges/{data_exchange}/listings/{listing}" |
subscription |
Optional. The name of the associated Analytics Hub subscription resource. Pattern: "projects/{project}/locations/{location}/subscriptions/{subscription}" |
MessageTransform
| JSON representation |
|---|
{ "enabled": boolean, "disabled": boolean, // Union field |
| Fields | |
|---|---|
enabled |
Optional. This field is deprecated, use the |
disabled |
Optional. If true, the transform is disabled and will not be applied to messages. Defaults to |
Union field
|
|
javascriptUdf |
Optional. JavaScript User Defined Function. If multiple JavaScriptUDF's are specified on a resource, each must have a unique |
aiInference |
Optional. AI Inference. Specifies the Vertex AI endpoint that inference requests built from the Pub/Sub message data and provided parameters will be sent to. |
JavaScriptUDF
| JSON representation |
|---|
{ "functionName": string, "code": string } |
| Fields | |
|---|---|
functionName |
Required. Name of the JavasScript function that should applied to Pub/Sub messages. |
code |
Required. JavaScript code that contains a function |
AIInference
| JSON representation |
|---|
{ "endpoint": string, "serviceAccountEmail": string, // Union field |
| Fields | |
|---|---|
endpoint |
Required. An endpoint to a Vertex AI model of the form |
serviceAccountEmail |
Optional. The service account to use to make prediction requests against endpoints. The resource creator or updater that specifies this field must have |
Union field inference_mode. The format of inference requests made to the endpoint. inference_mode can be only one of the following: |
|
unstructuredInference |
Optional. Requests and responses can be any arbitrary JSON object. |
UnstructuredInference
| JSON representation |
|---|
{ "parameters": { object } } |
| Fields | |
|---|---|
parameters |
Optional. A parameters object to be included in each inference request. The parameters object is combined with the data field of the Pub/Sub message to form the inference request. |
Struct
| JSON representation |
|---|
{ "fields": { string: value, ... } } |
| Fields | |
|---|---|
fields |
Unordered map of dynamically typed values. An object containing a list of |
FieldsEntry
| JSON representation |
|---|
{ "key": string, "value": value } |
| Fields | |
|---|---|
key |
|
value |
|
Value
| JSON representation |
|---|
{ // Union field |
| Fields | |
|---|---|
Union field kind. The kind of value. kind can be only one of the following: |
|
nullValue |
Represents a null value. |
numberValue |
Represents a double value. |
stringValue |
Represents a string value. |
boolValue |
Represents a boolean value. |
structValue |
Represents a structured value. |
listValue |
Represents a repeated |
ListValue
| JSON representation |
|---|
{ "values": [ value ] } |
| Fields | |
|---|---|
values[] |
Repeated field of dynamically typed values. |
TagsEntry
| JSON representation |
|---|
{ "key": string, "value": string } |
| Fields | |
|---|---|
key |
|
value |
|
Output Schema
A subscription resource. If none of push_config, bigquery_config, or cloud_storage_config is set, then the subscriber will pull and ack messages using API methods. At most one of these fields may be set.
Subscription
| JSON representation |
|---|
{ "name": string, "topic": string, "pushConfig": { object ( |
| Fields | |
|---|---|
name |
Required. Identifier. The name of the subscription. It must have the format |
topic |
Required. The name of the topic from which this subscription is receiving messages. Format is |
pushConfig |
Optional. If push delivery is used with this subscription, this field is used to configure it. |
bigqueryConfig |
Optional. If delivery to BigQuery is used with this subscription, this field is used to configure it. |
cloudStorageConfig |
Optional. If delivery to Google Cloud Storage is used with this subscription, this field is used to configure it. |
ackDeadlineSeconds |
Optional. The approximate amount of time (on a best-effort basis) Pub/Sub waits for the subscriber to acknowledge receipt before resending the message. In the interval after the message is delivered and before it is acknowledged, it is considered to be outstanding. During that time period, the message will not be redelivered (on a best-effort basis). For pull subscriptions, this value is used as the initial value for the ack deadline. To override this value for a given message, call For push delivery, this value is also used to set the request timeout for the call to the push endpoint. If the subscriber never acknowledges the message, the Pub/Sub system will eventually redeliver the message. |
retainAckedMessages |
Optional. Indicates whether to retain acknowledged messages. If true, then messages are not expunged from the subscription's backlog, even if they are acknowledged, until they fall out of the |
messageRetentionDuration |
Optional. How long to retain unacknowledged messages in the subscription's backlog, from the moment a message is published. If A duration in seconds with up to nine fractional digits, ending with ' |
labels |
Optional. See Creating and managing labels. An object containing a list of |
enableMessageOrdering |
Optional. If true, messages published with the same |
expirationPolicy |
Optional. A policy that specifies the conditions for this subscription's expiration. A subscription is considered active as long as any connected subscriber is successfully consuming messages from the subscription or is issuing operations on the subscription. If |
filter |
Optional. An expression written in the Pub/Sub filter language. If non-empty, then only |
deadLetterPolicy |
Optional. A policy that specifies the conditions for dead lettering messages in this subscription. If dead_letter_policy is not set, dead lettering is disabled. The Pub/Sub service account associated with this subscriptions's parent project (i.e., service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com) must have permission to Acknowledge() messages on this subscription. |
retryPolicy |
Optional. A policy that specifies how Pub/Sub retries message delivery for this subscription. If not set, the default retry policy is applied. This generally implies that messages will be retried as soon as possible for healthy subscribers. RetryPolicy will be triggered on NACKs or acknowledgment deadline exceeded events for a given message. |
detached |
Optional. Indicates whether the subscription is detached from its topic. Detached subscriptions don't receive messages from their topic and don't retain any backlog. |
enableExactlyOnceDelivery |
Optional. If true, Pub/Sub provides the following guarantees for the delivery of a message with a given value of
Note that subscribers may still receive multiple copies of a message when |
topicMessageRetentionDuration |
Output only. Indicates the minimum duration for which a message is retained after it is published to the subscription's topic. If this field is set, messages published to the subscription's topic in the last A duration in seconds with up to nine fractional digits, ending with ' |
state |
Output only. An output-only field indicating whether or not the subscription can receive messages. |
analyticsHubSubscriptionInfo |
Output only. Information about the associated Analytics Hub subscription. Only set if the subscription is created by Analytics Hub. |
messageTransforms[] |
Optional. Transforms to be applied to messages before they are delivered to subscribers. Transforms are applied in the order specified. |
tags |
Optional. Input only. Immutable. Tag keys/values directly bound to this resource. For example: "123/environment": "production", "123/costCenter": "marketing" An object containing a list of |
PushConfig
| JSON representation |
|---|
{ "pushEndpoint": string, "attributes": { string: string, ... }, // Union field |
| Fields | |
|---|---|
pushEndpoint |
Optional. A URL locating the endpoint to which messages should be pushed. For example, a Webhook endpoint might use |
attributes |
Optional. Endpoint configuration attributes that can be used to control different aspects of the message delivery. The only currently supported attribute is If not present during the The only supported values for the
For example: An object containing a list of |
Union field authentication_method. An authentication method used by push endpoints to verify the source of push requests. This can be used with push endpoints that are private by default to allow requests only from the Pub/Sub system, for example. This field is optional and should be set only by users interested in authenticated push. authentication_method can be only one of the following: |
|
oidcToken |
Optional. If specified, Pub/Sub will generate and attach an OIDC JWT token as an |
Union field wrapper. The format of the delivered message to the push endpoint is defined by the chosen wrapper. When unset, PubsubWrapper is used. wrapper can be only one of the following: |
|
pubsubWrapper |
Optional. When set, the payload to the push endpoint is in the form of the JSON representation of a PubsubMessage (https://cloud.google.com/pubsub/docs/reference/rpc/google.pubsub.v1#pubsubmessage). |
noWrapper |
Optional. When set, the payload to the push endpoint is not wrapped. |
AttributesEntry
| JSON representation |
|---|
{ "key": string, "value": string } |
| Fields | |
|---|---|
key |
|
value |
|
OidcToken
| JSON representation |
|---|
{ "serviceAccountEmail": string, "audience": string } |
| Fields | |
|---|---|
serviceAccountEmail |
Optional. Service account email used for generating the OIDC token. For more information on setting up authentication, see Push subscriptions. |
audience |
Optional. Audience to be used when generating OIDC token. The audience claim identifies the recipients that the JWT is intended for. The audience value is a single case-sensitive string. Having multiple values (array) for the audience field is not supported. More info about the OIDC JWT token audience here: https://tools.ietf.org/html/rfc7519#section-4.1.3 Note: if not specified, the Push endpoint URL will be used. |
NoWrapper
| JSON representation |
|---|
{ "writeMetadata": boolean } |
| Fields | |
|---|---|
writeMetadata |
Optional. When true, writes the Pub/Sub message metadata to |
BigQueryConfig
| JSON representation |
|---|
{
"table": string,
"useTopicSchema": boolean,
"writeMetadata": boolean,
"dropUnknownFields": boolean,
"state": enum ( |
| Fields | |
|---|---|
table |
Optional. The name of the table to which to write data, of the form {projectId}.{datasetId}.{tableId} |
useTopicSchema |
Optional. When true, use the topic's schema as the columns to write to in BigQuery, if it exists. |
writeMetadata |
Optional. When true, write the subscription name, message_id, publish_time, attributes, and ordering_key to additional columns in the table. The subscription name, message_id, and publish_time fields are put in their own columns while all other message properties (other than data) are written to a JSON object in the attributes column. |
dropUnknownFields |
Optional. When true and use_topic_schema is true, any fields that are a part of the topic schema that are not part of the BigQuery table schema are dropped when writing to BigQuery. Otherwise, the schemas must be kept in sync and any messages with extra fields are not written and remain in the subscription's backlog. |
state |
Output only. An output-only field that indicates whether or not the subscription can receive messages. |
useTableSchema |
Optional. When true, use the BigQuery table's schema as the columns to write to in BigQuery. |
serviceAccountEmail |
Optional. The service account to use to write to BigQuery. The subscription creator or updater that specifies this field must have |
CloudStorageConfig
| JSON representation |
|---|
{ "bucket": string, "filenamePrefix": string, "filenameSuffix": string, "filenameDatetimeFormat": string, "maxDuration": string, "maxBytes": string, "maxMessages": string, "state": enum ( |
| Fields | |
|---|---|
bucket |
Required. User-provided name for the Cloud Storage bucket. The bucket must be created by the user. The bucket name must be without any prefix like "gs://". See the bucket naming requirements. |
filenamePrefix |
Optional. User-provided prefix for Cloud Storage filename. See the object naming requirements. |
filenameSuffix |
Optional. User-provided suffix for Cloud Storage filename. See the object naming requirements. Must not end in "/". |
filenameDatetimeFormat |
Optional. User-provided format string specifying how to represent datetimes in Cloud Storage filenames. See the datetime format guidance. |
maxDuration |
Optional. The maximum duration that can elapse before a new Cloud Storage file is created. Min 1 minute, max 10 minutes, default 5 minutes. May not exceed the subscription's acknowledgment deadline. A duration in seconds with up to nine fractional digits, ending with ' |
maxBytes |
Optional. The maximum bytes that can be written to a Cloud Storage file before a new file is created. Min 1 KB, max 10 GiB. The max_bytes limit may be exceeded in cases where messages are larger than the limit. |
maxMessages |
Optional. The maximum number of messages that can be written to a Cloud Storage file before a new file is created. Min 1000 messages. |
state |
Output only. An output-only field that indicates whether or not the subscription can receive messages. |
serviceAccountEmail |
Optional. The service account to use to write to Cloud Storage. The subscription creator or updater that specifies this field must have |
Union field output_format. Defaults to text format. output_format can be only one of the following: |
|
textConfig |
Optional. If set, message data will be written to Cloud Storage in text format. |
avroConfig |
Optional. If set, message data will be written to Cloud Storage in Avro format. |
AvroConfig
| JSON representation |
|---|
{ "writeMetadata": boolean, "useTopicSchema": boolean } |
| Fields | |
|---|---|
writeMetadata |
Optional. When true, write the subscription name, message_id, publish_time, attributes, and ordering_key as additional fields in the output. The subscription name, message_id, and publish_time fields are put in their own fields while all other message properties other than data (for example, an ordering_key, if present) are added as entries in the attributes map. |
useTopicSchema |
Optional. When true, the output Cloud Storage file will be serialized using the topic schema, if it exists. |
Duration
| JSON representation |
|---|
{ "seconds": string, "nanos": integer } |
| Fields | |
|---|---|
seconds |
Signed seconds of the span of time. Must be from -315,576,000,000 to +315,576,000,000 inclusive. Note: these bounds are computed from: 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years |
nanos |
Signed fractions of a second at nanosecond resolution of the span of time. Durations less than one second are represented with a 0 |
LabelsEntry
| JSON representation |
|---|
{ "key": string, "value": string } |
| Fields | |
|---|---|
key |
|
value |
|
ExpirationPolicy
| JSON representation |
|---|
{ "ttl": string } |
| Fields | |
|---|---|
ttl |
Optional. Specifies the "time-to-live" duration for an associated resource. The resource expires if it is not active for a period of A duration in seconds with up to nine fractional digits, ending with ' |
DeadLetterPolicy
| JSON representation |
|---|
{ "deadLetterTopic": string, "maxDeliveryAttempts": integer } |
| Fields | |
|---|---|
deadLetterTopic |
Optional. The name of the topic to which dead letter messages should be published. Format is The operation will fail if the topic does not exist. Users should ensure that there is a subscription attached to this topic since messages published to a topic with no subscriptions are lost. |
maxDeliveryAttempts |
Optional. The maximum number of delivery attempts for any message. The value must be between 5 and 100. The number of delivery attempts is defined as 1 + (the sum of number of NACKs and number of times the acknowledgment deadline has been exceeded for the message). A NACK is any call to ModifyAckDeadline with a 0 deadline. Note that client libraries may automatically extend ack_deadlines. This field will be honored on a best effort basis. If this parameter is 0, a default value of 5 is used. |
RetryPolicy
| JSON representation |
|---|
{ "minimumBackoff": string, "maximumBackoff": string } |
| Fields | |
|---|---|
minimumBackoff |
Optional. The minimum delay between consecutive deliveries of a given message. Value should be between 0 and 600 seconds. Defaults to 10 seconds. A duration in seconds with up to nine fractional digits, ending with ' |
maximumBackoff |
Optional. The maximum delay between consecutive deliveries of a given message. Value should be between 0 and 600 seconds. Defaults to 600 seconds. A duration in seconds with up to nine fractional digits, ending with ' |
AnalyticsHubSubscriptionInfo
| JSON representation |
|---|
{ "listing": string, "subscription": string } |
| Fields | |
|---|---|
listing |
Optional. The name of the associated Analytics Hub listing resource. Pattern: "projects/{project}/locations/{location}/dataExchanges/{data_exchange}/listings/{listing}" |
subscription |
Optional. The name of the associated Analytics Hub subscription resource. Pattern: "projects/{project}/locations/{location}/subscriptions/{subscription}" |
MessageTransform
| JSON representation |
|---|
{ "enabled": boolean, "disabled": boolean, // Union field |
| Fields | |
|---|---|
enabled |
Optional. This field is deprecated, use the |
disabled |
Optional. If true, the transform is disabled and will not be applied to messages. Defaults to |
Union field
|
|
javascriptUdf |
Optional. JavaScript User Defined Function. If multiple JavaScriptUDF's are specified on a resource, each must have a unique |
aiInference |
Optional. AI Inference. Specifies the Vertex AI endpoint that inference requests built from the Pub/Sub message data and provided parameters will be sent to. |
JavaScriptUDF
| JSON representation |
|---|
{ "functionName": string, "code": string } |
| Fields | |
|---|---|
functionName |
Required. Name of the JavasScript function that should applied to Pub/Sub messages. |
code |
Required. JavaScript code that contains a function |
AIInference
| JSON representation |
|---|
{ "endpoint": string, "serviceAccountEmail": string, // Union field |
| Fields | |
|---|---|
endpoint |
Required. An endpoint to a Vertex AI model of the form |
serviceAccountEmail |
Optional. The service account to use to make prediction requests against endpoints. The resource creator or updater that specifies this field must have |
Union field inference_mode. The format of inference requests made to the endpoint. inference_mode can be only one of the following: |
|
unstructuredInference |
Optional. Requests and responses can be any arbitrary JSON object. |
UnstructuredInference
| JSON representation |
|---|
{ "parameters": { object } } |
| Fields | |
|---|---|
parameters |
Optional. A parameters object to be included in each inference request. The parameters object is combined with the data field of the Pub/Sub message to form the inference request. |
Struct
| JSON representation |
|---|
{ "fields": { string: value, ... } } |
| Fields | |
|---|---|
fields |
Unordered map of dynamically typed values. An object containing a list of |
FieldsEntry
| JSON representation |
|---|
{ "key": string, "value": value } |
| Fields | |
|---|---|
key |
|
value |
|
Value
| JSON representation |
|---|
{ // Union field |
| Fields | |
|---|---|
Union field kind. The kind of value. kind can be only one of the following: |
|
nullValue |
Represents a null value. |
numberValue |
Represents a double value. |
stringValue |
Represents a string value. |
boolValue |
Represents a boolean value. |
structValue |
Represents a structured value. |
listValue |
Represents a repeated |
ListValue
| JSON representation |
|---|
{ "values": [ value ] } |
| Fields | |
|---|---|
values[] |
Repeated field of dynamically typed values. |
TagsEntry
| JSON representation |
|---|
{ "key": string, "value": string } |
| Fields | |
|---|---|
key |
|
value |
|
Tool Annotations
Destructive Hint: ❌ | Idempotent Hint: ✅ | Read Only Hint: ❌ | Open World Hint: ✅