topics
Creates, updates, deletes, gets or lists a topics
resource.
Overview
Name | topics |
Type | Resource |
Id | google.pubsublite.topics |
Fields
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 a topic's partitions. |
reservationConfig | object | The settings for this topic's Reservation usage. |
retentionConfig | object | The settings for a topic's message retention. |
Methods
Name | Accessible by | Required Params | Description |
---|---|---|---|
admin_projects_locations_reservations_topics_list | SELECT | locationsId, projectsId, reservationsId | Lists the topics attached to the specified reservation. |
admin_projects_locations_topics_get | SELECT | locationsId, projectsId, topicsId | Returns the topic configuration. |
admin_projects_locations_topics_list | SELECT | locationsId, projectsId | Returns the list of topics for the given project. |
admin_projects_locations_topics_create | INSERT | locationsId, projectsId | Creates a new topic. |
admin_projects_locations_topics_delete | DELETE | locationsId, projectsId, topicsId | Deletes the specified topic. |
admin_projects_locations_topics_patch | UPDATE | locationsId, projectsId, topicsId | Updates properties of the specified topic. |
topic_stats_projects_locations_topics_compute_head_cursor | EXEC | locationsId, projectsId, 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 | locationsId, projectsId, topicsId | Compute statistics about a range of messages in a given topic and partition. |
topic_stats_projects_locations_topics_compute_time_cursor | EXEC | locationsId, projectsId, topicsId | Compute the corresponding cursor for a publish or event time in a topic partition. |
SELECT
examples
Returns the list of topics for the given project.
SELECT
name,
partitionConfig,
reservationConfig,
retentionConfig
FROM google.pubsublite.topics
WHERE locationsId = '{{ locationsId }}'
AND projectsId = '{{ projectsId }}';
INSERT
example
Use the following StackQL query and manifest file to create a new topics
resource.
- All Properties
- Manifest
/*+ create */
INSERT INTO google.pubsublite.topics (
locationsId,
projectsId,
name,
partitionConfig,
retentionConfig,
reservationConfig
)
SELECT
'{{ locationsId }}',
'{{ projectsId }}',
'{{ name }}',
'{{ partitionConfig }}',
'{{ retentionConfig }}',
'{{ reservationConfig }}'
;
- name: your_resource_model_name
props:
- name: name
value: string
- name: partitionConfig
value:
- name: count
value: string
- name: scale
value: integer
- name: capacity
value:
- name: publishMibPerSec
value: integer
- name: subscribeMibPerSec
value: integer
- name: retentionConfig
value:
- name: perPartitionBytes
value: string
- name: period
value: string
- name: reservationConfig
value:
- name: throughputReservation
value: string
UPDATE
example
Updates a topics
resource.
/*+ update */
UPDATE google.pubsublite.topics
SET
name = '{{ name }}',
partitionConfig = '{{ partitionConfig }}',
retentionConfig = '{{ retentionConfig }}',
reservationConfig = '{{ reservationConfig }}'
WHERE
locationsId = '{{ locationsId }}'
AND projectsId = '{{ projectsId }}'
AND topicsId = '{{ topicsId }}';
DELETE
example
Deletes the specified topics
resource.
/*+ delete */
DELETE FROM google.pubsublite.topics
WHERE locationsId = '{{ locationsId }}'
AND projectsId = '{{ projectsId }}'
AND topicsId = '{{ topicsId }}';