Pub/Sub Lite Client Types¶
- class google.cloud.pubsublite.types.BacklogLocation(value)[source]
A location with respect to the message backlog. BEGINNING refers to the location of the oldest retained message. END refers to the location past all currently published messages, skipping the entire message backlog.
- class google.cloud.pubsublite.types.CloudRegion(name)[source]
Create new instance of CloudRegion(name,)
- name: str
Alias for field number 0
- class google.cloud.pubsublite.types.CloudZone(region, zone_id)[source]
Create new instance of CloudZone(region, zone_id)
- region: google.cloud.pubsublite.types.location.CloudRegion
Alias for field number 0
- zone_id: str
Alias for field number 1
- class google.cloud.pubsublite.types.EventTime(value: datetime.datetime)[source]
A user-defined event timestamp of a message.
Create new instance of EventTime(value,)
- value: datetime.datetime
Alias for field number 0
- class google.cloud.pubsublite.types.FlowControlSettings(messages_outstanding, bytes_outstanding)[source]
Create new instance of FlowControlSettings(messages_outstanding, bytes_outstanding)
- bytes_outstanding: int
Alias for field number 1
- messages_outstanding: int
Alias for field number 0
- class google.cloud.pubsublite.types.LocationPath(project, location)[source]
Create new instance of LocationPath(project, location)
- location: Union[google.cloud.pubsublite.types.location.CloudRegion, google.cloud.pubsublite.types.location.CloudZone]
Alias for field number 1
- class google.cloud.pubsublite.types.MessageMetadata(partition: google.cloud.pubsublite.types.partition.Partition, cursor: google.cloud.pubsublite_v1.types.common.Cursor)[source]
Information about a message in Pub/Sub Lite.
- partition
The partition of the topic that the message was published to.
- Type
Partition
- cursor
A cursor containing the offset that the message was assigned. If this MessageMetadata was returned for a publish result and publish idempotence was enabled, the offset may be -1 when the message was identified as a duplicate of an already successfully published message, but the server did not have sufficient information to return the message’s offset at publish time. Messages received by subscribers will always have the correct offset.
- Type
Cursor
Create new instance of MessageMetadata(partition, cursor)
- cursor: google.cloud.pubsublite_v1.types.common.Cursor
Alias for field number 1
- partition: google.cloud.pubsublite.types.partition.Partition
Alias for field number 0
- class google.cloud.pubsublite.types.Partition(value)[source]
Create new instance of Partition(value,)
- value: int
Alias for field number 0
- class google.cloud.pubsublite.types.PublishTime(value: datetime.datetime)[source]
The publish timestamp of a message.
Create new instance of PublishTime(value,)
- value: datetime.datetime
Alias for field number 0
- class google.cloud.pubsublite.types.ReservationPath(project, location, name)[source]
Create new instance of ReservationPath(project, location, name)
- location: google.cloud.pubsublite.types.location.CloudRegion
Alias for field number 1
- name: str
Alias for field number 2
- class google.cloud.pubsublite.types.SubscriptionPath(project, location, name)[source]
Create new instance of SubscriptionPath(project, location, name)
- location: Union[google.cloud.pubsublite.types.location.CloudRegion, google.cloud.pubsublite.types.location.CloudZone]
Alias for field number 1
- name: str
Alias for field number 2
- class google.cloud.pubsublite.types.TopicPath(project, location, name)[source]
Create new instance of TopicPath(project, location, name)
- location: Union[google.cloud.pubsublite.types.location.CloudRegion, google.cloud.pubsublite.types.location.CloudZone]
Alias for field number 1
- name: str
Alias for field number 2
- class google.cloud.pubsublite_v1.Cursor(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]
A cursor that describes the position of a message within a topic partition.
- offset
The offset of a message within a topic partition. Must be greater than or equal 0.
- Type
- class google.cloud.pubsublite_v1.Subscription(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]
Metadata about a subscription resource.
- name
The name of the subscription. Structured like: projects/{project_number}/locations/{location}/subscriptions/{subscription_id}
- Type
- topic
The name of the topic this subscription is attached to. Structured like: projects/{project_number}/locations/{location}/topics/{topic_id}
- Type
- delivery_config
The settings for this subscription’s message delivery.
- Type
google.cloud.pubsublite_v1.types.Subscription.DeliveryConfig
- export_config
If present, messages are automatically written from the Pub/Sub Lite topic associated with this subscription to a destination.
- Type
google.cloud.pubsublite_v1.types.ExportConfig
- class DeliveryConfig(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]
The settings for a subscription’s message delivery.
- delivery_requirement
The DeliveryRequirement for this subscription.
- Type
google.cloud.pubsublite_v1.types.Subscription.DeliveryConfig.DeliveryRequirement
- class DeliveryRequirement(value)[source]
When this subscription should send messages to subscribers relative to messages persistence in storage. For details, see Creating Lite subscriptions.
- Values:
- DELIVERY_REQUIREMENT_UNSPECIFIED (0):
Default value. This value is unused.
- DELIVER_IMMEDIATELY (1):
The server does not wait for a published message to be successfully written to storage before delivering it to subscribers.
- DELIVER_AFTER_STORED (2):
The server will not deliver a published message to subscribers until the message has been successfully written to storage. This will result in higher end-to-end latency, but consistent delivery.
- class google.cloud.pubsublite_v1.Topic(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]
Metadata about a topic resource.
- name
The name of the topic. Structured like: projects/{project_number}/locations/{location}/topics/{topic_id}
- Type
- partition_config
The settings for this topic’s partitions.
- Type
google.cloud.pubsublite_v1.types.Topic.PartitionConfig
- retention_config
The settings for this topic’s message retention.
- Type
google.cloud.pubsublite_v1.types.Topic.RetentionConfig
- reservation_config
The settings for this topic’s Reservation usage.
- Type
google.cloud.pubsublite_v1.types.Topic.ReservationConfig
- class PartitionConfig(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]
The settings for a topic’s partitions.
This message has oneof fields (mutually exclusive fields). For each oneof, at most one member field can be set at the same time. Setting any member of the oneof automatically clears all other members.
- count
The number of partitions in the topic. Must be at least 1.
Once a topic has been created the number of partitions can be increased but not decreased. Message ordering is not guaranteed across a topic resize. For more information see https://cloud.google.com/pubsub/lite/docs/topics#scaling_capacity
- Type
- scale
DEPRECATED: Use capacity instead which can express a superset of configurations.
Every partition in the topic is allocated throughput equivalent to
scale
times the standard partition throughput (4 MiB/s). This is also reflected in the cost of this topic; a topic withscale
of 2 and count of 10 is charged for 20 partitions. This value must be in the range [1,4].This field is a member of oneof
dimension
.- Type
- capacity
The capacity configuration.
This field is a member of oneof
dimension
.- Type
google.cloud.pubsublite_v1.types.Topic.PartitionConfig.Capacity
- class Capacity(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]
The throughput capacity configuration for each partition.
- publish_mib_per_sec
Publish throughput capacity per partition in MiB/s. Must be >= 4 and <= 16.
- Type
- subscribe_mib_per_sec
Subscribe throughput capacity per partition in MiB/s. Must be >= 4 and <= 32.
- Type
- class ReservationConfig(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]
The settings for this topic’s Reservation usage.
- throughput_reservation
The Reservation to use for this topic’s throughput capacity. Structured like: projects/{project_number}/locations/{location}/reservations/{reservation_id}
- Type
- class RetentionConfig(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]
The settings for a topic’s message retention.
- per_partition_bytes
The provisioned storage, in bytes, per partition. If the number of bytes stored in any of the topic’s partitions grows beyond this value, older messages will be dropped to make room for newer ones, regardless of the value of
period
.- Type
- period
How long a published message is retained. If unset, messages will be retained as long as the bytes retained for each partition is below
per_partition_bytes
.