As of January 1, 2020 this library no longer supports Python 2 on the latest released version. Library versions released prior to that date will continue to be available. For more information please visit Python 2 support on Google Cloud.

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.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

project: Union[int, str]

Alias for field number 0

class google.cloud.pubsublite.types.MessageMetadata(partition, cursor)[source]

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.SubscriptionPath(project, location, name)[source]

Create new instance of SubscriptionPath(project, location, name)

location: google.cloud.pubsublite.types.location.CloudZone

Alias for field number 1

name: str

Alias for field number 2

project: Union[int, str]

Alias for field number 0

class google.cloud.pubsublite.types.TopicPath(project, location, name)[source]

Create new instance of TopicPath(project, location, name)

location: google.cloud.pubsublite.types.location.CloudZone

Alias for field number 1

name: str

Alias for field number 2

project: Union[int, str]

Alias for field number 0

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

int

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

str

topic

The name of the topic this subscription is attached to. Structured like: projects/{project_number}/locations/{location}/topics/{topic_id}

Type

str

delivery_config

The settings for this subscription’s message delivery.

Type

google.cloud.pubsublite_v1.types.Subscription.DeliveryConfig

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.

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

str

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.

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

int

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 with scale of 2 and count of 10 is charged for 20 partitions. This value must be in the range [1,4].

Type

int

capacity

The capacity configuration.

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

int

subscribe_mib_per_sec

Subscribe throughput capacity per partition in MiB/s. Must be >= 4 and <= 32.

Type

int

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

str

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

int

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.

Type

google.protobuf.duration_pb2.Duration