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_topics_get
- admin_projects_locations_reservations_topics_list
- admin_projects_locations_topics_list
Successful response
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) |
Successful response
Name | Datatype | Description |
---|
Successful response
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_topics_get | select | projectsId , locationsId , topicsId | Returns the topic configuration. | |
admin_projects_locations_reservations_topics_list | select | projectsId , locationsId , reservationsId | pageSize , pageToken | Lists the topics attached to the specified reservation. |
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_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_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_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_topics_get
- admin_projects_locations_reservations_topics_list
- admin_projects_locations_topics_list
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;
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 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__retentionConfig,
data__reservationConfig,
projectsId,
locationsId,
topicId
)
SELECT
'{{ name }}',
'{{ partitionConfig }}',
'{{ retentionConfig }}',
'{{ reservationConfig }}',
'{{ projectsId }}',
'{{ locationsId }}',
'{{ topicId }}'
RETURNING
name,
partitionConfig,
reservationConfig,
retentionConfig
;
# Description fields are for documentation purposes
- name: topics
props:
- name: projectsId
value: string
description: Required parameter for the topics resource.
- name: locationsId
value: string
description: Required parameter for the topics resource.
- name: name
value: string
description: >
The name of the topic. Structured like: projects/{project_number}/locations/{location}/topics/{topic_id}
- name: partitionConfig
value: object
description: >
The settings for this topic's partitions.
- name: retentionConfig
value: object
description: >
The settings for this topic's message retention.
- name: reservationConfig
value: object
description: >
The settings for this topic's Reservation usage.
- name: topicId
value: string
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__retentionConfig = '{{ retentionConfig }}',
data__reservationConfig = '{{ reservationConfig }}'
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_message_stats
- topic_stats_projects_locations_topics_compute_head_cursor
- topic_stats_projects_locations_topics_compute_time_cursor
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=
'{
"partition": "{{ partition }}",
"startCursor": "{{ startCursor }}",
"endCursor": "{{ endCursor }}"
}';
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 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 }}"
}';