REST Resource: projects.subscriptions

Resource: Subscription

A subscription resource.

JSON representation
{
  "name": string,
  "topic": string,
  "pushConfig": {
    object (PushConfig)
  },
  "ackDeadlineSeconds": integer
}
Fields
name

string

The name of the subscription. It must have the format "projects/{project}/subscriptions/{subscription}". {subscription} must start with a letter, and contain only letters ([A-Za-z]), numbers ([0-9]), dashes (-), underscores (_), periods (.), tildes (~), plus (+) or percent signs (%). It must be between 3 and 255 characters in length, and it must not start with "goog".

topic

string

The name of the topic from which this subscription is receiving messages. The value of this field will be _deleted-topic_ if the topic has been deleted.

pushConfig

object (PushConfig)

If push delivery is used with this subscription, this field is used to configure it. An empty pushConfig signifies that the subscriber will pull and ack messages using API methods.

ackDeadlineSeconds

integer

This value is the maximum time after a subscriber receives a message before the subscriber should acknowledge the message. After message delivery but before the ack deadline expires and before the message is acknowledged, it is an outstanding message and will not be delivered again during that time (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 subscriptions.modifyAckDeadline with the corresponding ackId if using pull. The maximum custom deadline you can specify is 600 seconds (10 minutes).

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.

If this parameter is 0, a default value of 10 seconds is used.

PushConfig

Configuration for a push delivery endpoint.

JSON representation
{
  "pushEndpoint": string,
  "attributes": {
    string: string,
    ...
  },

  // Union field authentication_method can be only one of the following:
  "oidcToken": {
    object (OidcToken)
  }
  // End of list of possible types for union field authentication_method.
}
Fields
pushEndpoint

string

A URL locating the endpoint to which messages should be pushed. For example, a Webhook endpoint might use "https://example.com/push".

attributes

map (key: string, value: string)

Endpoint configuration attributes.

Every endpoint has a set of API supported attributes that can be used to control different aspects of the message delivery.

The currently supported attribute is x-goog-version, which you can use to change the format of the push message. This attribute indicates the version of the data expected by the endpoint. This controls the shape of the envelope (i.e. its fields and metadata). The endpoint version is based on the version of the Pub/Sub API.

If not present during the subscriptions.create call, it will default to the version of the API used to make such call. If not present during a subscriptions.modifyPushConfig call, its value will not be changed. subscriptions.get calls will always return a valid version, even if the subscription was created without this attribute.

The possible values for this attribute are:

  • v1beta1: uses the push format defined in the v1beta1 Pub/Sub API.
  • v1 or v1beta2: uses the push format defined in the v1 Pub/Sub API.

An object containing a list of "key": value pairs. Example: { "name": "wrench", "mass": "1.3kg", "count": "3" }.

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 Cloud 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

object (OidcToken)

If specified, Pub/Sub will generate and attach an OIDC JWT token as an Authorization header in the HTTP request for every pushed message.

OidcToken

Contains information needed for generating an OpenID Connect token.

JSON representation
{
  "serviceAccountEmail": string,
  "audience": string
}
Fields
serviceAccountEmail

string

Service account email to be used for generating the OIDC token. The caller (for subscriptions.create, subscriptions.patch, and subscriptions.modifyPushConfig RPCs) must have the iam.serviceAccounts.actAs permission for the service account.

audience

string

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.

Methods

acknowledge

The method google.pubsub.v1beta2.Subscriber.Acknowledge is not available in this universe.

create

The method google.pubsub.v1beta2.Subscriber.CreateSubscription is not available in this universe.

delete

The method google.pubsub.v1beta2.Subscriber.DeleteSubscription is not available in this universe.

get

The method google.pubsub.v1beta2.Subscriber.GetSubscription is not available in this universe.

getIamPolicy

The method google.iam.v1.IAMPolicy.GetIamPolicy is not available in this universe.

list

The method google.pubsub.v1beta2.Subscriber.ListSubscriptions is not available in this universe.

modifyAckDeadline

The method google.pubsub.v1beta2.Subscriber.ModifyAckDeadline is not available in this universe.

modifyPushConfig

The method google.pubsub.v1beta2.Subscriber.ModifyPushConfig is not available in this universe.

pull

The method google.pubsub.v1beta2.Subscriber.Pull is not available in this universe.

setIamPolicy

The method google.iam.v1.IAMPolicy.SetIamPolicy is not available in this universe.

testIamPermissions

The method google.iam.v1.IAMPolicy.TestIamPermissions is not available in this universe.