topics
Creates, updates, deletes, gets or lists a topics resource.
Overview
| Name | topics |
| Type | Resource |
| Id | google.pubsublite.topics |
Fields
The following fields are returned by SELECT queries:
- admin_projects_locations_reservations_topics_list
- admin_projects_locations_topics_get
- admin_projects_locations_topics_list
| Name | Datatype | Description |
|---|
| Name | Datatype | Description |
|---|---|---|
name | string | The name of the topic. Structured like: projects/{project_number}/locations/{location}/topics/{topic_id} |
partitionConfig | object | The settings for this topic's partitions. (id: PartitionConfig) |
reservationConfig | object | The settings for this topic's Reservation usage. (id: ReservationConfig) |
retentionConfig | object | The settings for this topic's message retention. (id: RetentionConfig) |
| Name | Datatype | Description |
|---|---|---|
name | string | The name of the topic. Structured like: projects/{project_number}/locations/{location}/topics/{topic_id} |
partitionConfig | object | The settings for this topic's partitions. (id: PartitionConfig) |
reservationConfig | object | The settings for this topic's Reservation usage. (id: ReservationConfig) |
retentionConfig | object | The settings for this topic's message retention. (id: RetentionConfig) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
admin_projects_locations_reservations_topics_list | select | projectsId, locationsId, reservationsId | pageSize, pageToken | Lists the topics attached to the specified reservation. |
admin_projects_locations_topics_get | select | projectsId, locationsId, topicsId | Returns the topic configuration. | |
admin_projects_locations_topics_list | select | projectsId, locationsId | pageSize, pageToken | Returns the list of topics for the given project. |
admin_projects_locations_topics_create | insert | projectsId, locationsId | topicId | Creates a new topic. |
admin_projects_locations_topics_patch | update | projectsId, locationsId, topicsId | updateMask | Updates properties of the specified topic. |
admin_projects_locations_topics_delete | delete | projectsId, locationsId, topicsId | Deletes the specified topic. | |
topic_stats_projects_locations_topics_compute_head_cursor | exec | projectsId, locationsId, topicsId | Compute the head cursor for the partition. The head cursor's offset is guaranteed to be less than or equal to all messages which have not yet been acknowledged as published, and greater than the offset of any message whose publish has already been acknowledged. It is zero if there have never been messages in the partition. | |
topic_stats_projects_locations_topics_compute_message_stats | exec | projectsId, locationsId, topicsId | Compute statistics about a range of messages in a given topic and partition. | |
topic_stats_projects_locations_topics_compute_time_cursor | exec | projectsId, locationsId, topicsId | Compute the corresponding cursor for a publish or event time in a topic partition. |
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 | |
reservationsId | string | |
topicsId | string | |
pageSize | integer (int32) | |
pageToken | string | |
topicId | string | |
updateMask | string (google-fieldmask) |
SELECT examples
- admin_projects_locations_reservations_topics_list
- admin_projects_locations_topics_get
- admin_projects_locations_topics_list
Lists the topics attached to the specified reservation.
SELECT
*
FROM google.pubsublite.topics
WHERE projectsId = '{{ projectsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND reservationsId = '{{ reservationsId }}' -- required
AND pageSize = '{{ pageSize }}'
AND pageToken = '{{ pageToken }}'
;
Returns the topic configuration.
SELECT
name,
partitionConfig,
reservationConfig,
retentionConfig
FROM google.pubsublite.topics
WHERE projectsId = '{{ projectsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND topicsId = '{{ topicsId }}' -- required
;
Returns the list of topics for the given project.
SELECT
name,
partitionConfig,
reservationConfig,
retentionConfig
FROM google.pubsublite.topics
WHERE projectsId = '{{ projectsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND pageSize = '{{ pageSize }}'
AND pageToken = '{{ pageToken }}'
;
INSERT examples
- admin_projects_locations_topics_create
- Manifest
Creates a new topic.
INSERT INTO google.pubsublite.topics (
data__name,
data__partitionConfig,
data__reservationConfig,
data__retentionConfig,
projectsId,
locationsId,
topicId
)
SELECT
'{{ name }}',
'{{ partitionConfig }}',
'{{ reservationConfig }}',
'{{ retentionConfig }}',
'{{ projectsId }}',
'{{ locationsId }}',
'{{ topicId }}'
RETURNING
name,
partitionConfig,
reservationConfig,
retentionConfig
;
# Description fields are for documentation purposes
- name: topics
props:
- name: projectsId
value: "{{ projectsId }}"
description: Required parameter for the topics resource.
- name: locationsId
value: "{{ locationsId }}"
description: Required parameter for the topics resource.
- name: name
value: "{{ name }}"
description: |
The name of the topic. Structured like: projects/{project_number}/locations/{location}/topics/{topic_id}
- name: partitionConfig
description: |
The settings for this topic's partitions.
value:
capacity:
publishMibPerSec: {{ publishMibPerSec }}
subscribeMibPerSec: {{ subscribeMibPerSec }}
count: "{{ count }}"
scale: {{ scale }}
- name: reservationConfig
description: |
The settings for this topic's Reservation usage.
value:
throughputReservation: "{{ throughputReservation }}"
- name: retentionConfig
description: |
The settings for this topic's message retention.
value:
perPartitionBytes: "{{ perPartitionBytes }}"
period: "{{ period }}"
- name: topicId
value: "{{ topicId }}"
UPDATE examples
- admin_projects_locations_topics_patch
Updates properties of the specified topic.
UPDATE google.pubsublite.topics
SET
data__name = '{{ name }}',
data__partitionConfig = '{{ partitionConfig }}',
data__reservationConfig = '{{ reservationConfig }}',
data__retentionConfig = '{{ retentionConfig }}'
WHERE
projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND topicsId = '{{ topicsId }}' --required
AND updateMask = '{{ updateMask}}'
RETURNING
name,
partitionConfig,
reservationConfig,
retentionConfig;
DELETE examples
- admin_projects_locations_topics_delete
Deletes the specified topic.
DELETE FROM google.pubsublite.topics
WHERE projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND topicsId = '{{ topicsId }}' --required
;
Lifecycle Methods
- topic_stats_projects_locations_topics_compute_head_cursor
- topic_stats_projects_locations_topics_compute_message_stats
- topic_stats_projects_locations_topics_compute_time_cursor
Compute the head cursor for the partition. The head cursor's offset is guaranteed to be less than or equal to all messages which have not yet been acknowledged as published, and greater than the offset of any message whose publish has already been acknowledged. It is zero if there have never been messages in the partition.
EXEC google.pubsublite.topics.topic_stats_projects_locations_topics_compute_head_cursor
@projectsId='{{ projectsId }}' --required,
@locationsId='{{ locationsId }}' --required,
@topicsId='{{ topicsId }}' --required
@@json=
'{
"partition": "{{ partition }}"
}'
;
Compute statistics about a range of messages in a given topic and partition.
EXEC google.pubsublite.topics.topic_stats_projects_locations_topics_compute_message_stats
@projectsId='{{ projectsId }}' --required,
@locationsId='{{ locationsId }}' --required,
@topicsId='{{ topicsId }}' --required
@@json=
'{
"endCursor": "{{ endCursor }}",
"partition": "{{ partition }}",
"startCursor": "{{ startCursor }}"
}'
;
Compute the corresponding cursor for a publish or event time in a topic partition.
EXEC google.pubsublite.topics.topic_stats_projects_locations_topics_compute_time_cursor
@projectsId='{{ projectsId }}' --required,
@locationsId='{{ locationsId }}' --required,
@topicsId='{{ topicsId }}' --required
@@json=
'{
"partition": "{{ partition }}",
"target": "{{ target }}"
}'
;