subscriptions
Creates, updates, deletes, gets or lists a subscriptions
resource.
Overview
Name | subscriptions |
Type | Resource |
Id | google.pubsublite.subscriptions |
Fields
The following fields are returned by SELECT
queries:
- admin_projects_locations_topics_subscriptions_list
- admin_projects_locations_subscriptions_get
- admin_projects_locations_subscriptions_list
Successful response
Name | Datatype | Description |
---|
Successful response
Name | Datatype | Description |
---|---|---|
name | string | The name of the subscription. Structured like: projects/{project_number}/locations/{location}/subscriptions/{subscription_id} |
deliveryConfig | object | The settings for this subscription's message delivery. (id: DeliveryConfig) |
exportConfig | object | If present, messages are automatically written from the Pub/Sub Lite topic associated with this subscription to a destination. (id: ExportConfig) |
topic | string | The name of the topic this subscription is attached to. Structured like: projects/{project_number}/locations/{location}/topics/{topic_id} |
Successful response
Name | Datatype | Description |
---|---|---|
name | string | The name of the subscription. Structured like: projects/{project_number}/locations/{location}/subscriptions/{subscription_id} |
deliveryConfig | object | The settings for this subscription's message delivery. (id: DeliveryConfig) |
exportConfig | object | If present, messages are automatically written from the Pub/Sub Lite topic associated with this subscription to a destination. (id: ExportConfig) |
topic | string | The name of the topic this subscription is attached to. Structured like: projects/{project_number}/locations/{location}/topics/{topic_id} |
Methods
The following methods are available for this resource:
Name | Accessible by | Required Params | Optional Params | Description |
---|---|---|---|---|
admin_projects_locations_topics_subscriptions_list | select | projectsId , locationsId , topicsId | pageSize , pageToken | Lists the subscriptions attached to the specified topic. |
admin_projects_locations_subscriptions_get | select | projectsId , locationsId , subscriptionsId | Returns the subscription configuration. | |
admin_projects_locations_subscriptions_list | select | projectsId , locationsId | pageSize , pageToken | Returns the list of subscriptions for the given project. |
admin_projects_locations_subscriptions_create | insert | projectsId , locationsId | subscriptionId , skipBacklog | Creates a new subscription. |
admin_projects_locations_subscriptions_patch | update | projectsId , locationsId , subscriptionsId | updateMask | Updates properties of the specified subscription. |
admin_projects_locations_subscriptions_delete | delete | projectsId , locationsId , subscriptionsId | Deletes the specified subscription. | |
admin_projects_locations_subscriptions_seek | exec | projectsId , locationsId , subscriptionsId | Performs an out-of-band seek for a subscription to a specified target, which may be timestamps or named positions within the message backlog. Seek translates these targets to cursors for each partition and orchestrates subscribers to start consuming messages from these seek cursors. If an operation is returned, the seek has been registered and subscribers will eventually receive messages from the seek cursors (i.e. eventual consistency), as long as they are using a minimum supported client library version and not a system that tracks cursors independently of Pub/Sub Lite (e.g. Apache Beam, Dataflow, Spark). The seek operation will fail for unsupported clients. If clients would like to know when subscribers react to the seek (or not), they can poll the operation. The seek operation will succeed and complete once subscribers are ready to receive messages from the seek cursors for all partitions of the topic. This means that the seek operation will not complete until all subscribers come online. If the previous seek operation has not yet completed, it will be aborted and the new invocation of seek will supersede it. | |
cursor_projects_locations_subscriptions_commit_cursor | exec | projectsId , locationsId , subscriptionsId | Updates the committed cursor. |
Parameters
Parameters can be passed in the WHERE
clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
Name | Datatype | Description |
---|---|---|
locationsId | string | |
projectsId | string | |
subscriptionsId | string | |
topicsId | string | |
pageSize | integer (int32) | |
pageToken | string | |
skipBacklog | boolean | |
subscriptionId | string | |
updateMask | string (google-fieldmask) |
SELECT
examples
- admin_projects_locations_topics_subscriptions_list
- admin_projects_locations_subscriptions_get
- admin_projects_locations_subscriptions_list
Lists the subscriptions attached to the specified topic.
SELECT
*
FROM google.pubsublite.subscriptions
WHERE projectsId = '{{ projectsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND topicsId = '{{ topicsId }}' -- required
AND pageSize = '{{ pageSize }}'
AND pageToken = '{{ pageToken }}';
Returns the subscription configuration.
SELECT
name,
deliveryConfig,
exportConfig,
topic
FROM google.pubsublite.subscriptions
WHERE projectsId = '{{ projectsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND subscriptionsId = '{{ subscriptionsId }}' -- required;
Returns the list of subscriptions for the given project.
SELECT
name,
deliveryConfig,
exportConfig,
topic
FROM google.pubsublite.subscriptions
WHERE projectsId = '{{ projectsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND pageSize = '{{ pageSize }}'
AND pageToken = '{{ pageToken }}';
INSERT
examples
- admin_projects_locations_subscriptions_create
- Manifest
Creates a new subscription.
INSERT INTO google.pubsublite.subscriptions (
data__name,
data__topic,
data__deliveryConfig,
data__exportConfig,
projectsId,
locationsId,
subscriptionId,
skipBacklog
)
SELECT
'{{ name }}',
'{{ topic }}',
'{{ deliveryConfig }}',
'{{ exportConfig }}',
'{{ projectsId }}',
'{{ locationsId }}',
'{{ subscriptionId }}',
'{{ skipBacklog }}'
RETURNING
name,
deliveryConfig,
exportConfig,
topic
;
# Description fields are for documentation purposes
- name: subscriptions
props:
- name: projectsId
value: string
description: Required parameter for the subscriptions resource.
- name: locationsId
value: string
description: Required parameter for the subscriptions resource.
- name: name
value: string
description: >
The name of the subscription. Structured like: projects/{project_number}/locations/{location}/subscriptions/{subscription_id}
- name: topic
value: string
description: >
The name of the topic this subscription is attached to. Structured like: projects/{project_number}/locations/{location}/topics/{topic_id}
- name: deliveryConfig
value: object
description: >
The settings for this subscription's message delivery.
- name: exportConfig
value: object
description: >
If present, messages are automatically written from the Pub/Sub Lite topic associated with this subscription to a destination.
- name: subscriptionId
value: string
- name: skipBacklog
value: boolean
UPDATE
examples
- admin_projects_locations_subscriptions_patch
Updates properties of the specified subscription.
UPDATE google.pubsublite.subscriptions
SET
data__name = '{{ name }}',
data__topic = '{{ topic }}',
data__deliveryConfig = '{{ deliveryConfig }}',
data__exportConfig = '{{ exportConfig }}'
WHERE
projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND subscriptionsId = '{{ subscriptionsId }}' --required
AND updateMask = '{{ updateMask}}'
RETURNING
name,
deliveryConfig,
exportConfig,
topic;
DELETE
examples
- admin_projects_locations_subscriptions_delete
Deletes the specified subscription.
DELETE FROM google.pubsublite.subscriptions
WHERE projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND subscriptionsId = '{{ subscriptionsId }}' --required;
Lifecycle Methods
- admin_projects_locations_subscriptions_seek
- cursor_projects_locations_subscriptions_commit_cursor
Performs an out-of-band seek for a subscription to a specified target, which may be timestamps or named positions within the message backlog. Seek translates these targets to cursors for each partition and orchestrates subscribers to start consuming messages from these seek cursors. If an operation is returned, the seek has been registered and subscribers will eventually receive messages from the seek cursors (i.e. eventual consistency), as long as they are using a minimum supported client library version and not a system that tracks cursors independently of Pub/Sub Lite (e.g. Apache Beam, Dataflow, Spark). The seek operation will fail for unsupported clients. If clients would like to know when subscribers react to the seek (or not), they can poll the operation. The seek operation will succeed and complete once subscribers are ready to receive messages from the seek cursors for all partitions of the topic. This means that the seek operation will not complete until all subscribers come online. If the previous seek operation has not yet completed, it will be aborted and the new invocation of seek will supersede it.
EXEC google.pubsublite.subscriptions.admin_projects_locations_subscriptions_seek
@projectsId='{{ projectsId }}' --required,
@locationsId='{{ locationsId }}' --required,
@subscriptionsId='{{ subscriptionsId }}' --required
@@json=
'{
"namedTarget": "{{ namedTarget }}",
"timeTarget": "{{ timeTarget }}"
}';
Updates the committed cursor.
EXEC google.pubsublite.subscriptions.cursor_projects_locations_subscriptions_commit_cursor
@projectsId='{{ projectsId }}' --required,
@locationsId='{{ locationsId }}' --required,
@subscriptionsId='{{ subscriptionsId }}' --required
@@json=
'{
"partition": "{{ partition }}",
"cursor": "{{ cursor }}"
}';