Class AdminClient (1.7.0)

AdminClient(
    region: google.cloud.pubsublite.types.location.CloudRegion,
    credentials: Optional[google.auth.credentials.Credentials] = None,
    transport: Optional[str] = None,
    client_options: Optional[google.api_core.client_options.ClientOptions] = None,
)

An admin client for Pub/Sub Lite. Only operates on a single region.

Methods

AdminClient

AdminClient(
    region: google.cloud.pubsublite.types.location.CloudRegion,
    credentials: Optional[google.auth.credentials.Credentials] = None,
    transport: Optional[str] = None,
    client_options: Optional[google.api_core.client_options.ClientOptions] = None,
)

Create a new AdminClient.

create_reservation

create_reservation(
    reservation: google.cloud.pubsublite_v1.types.common.Reservation,
)

Create a reservation, returns the created reservation.

create_subscription

create_subscription(subscription: google.cloud.pubsublite_v1.types.common.Subscription, target: Union[google.cloud.pubsublite.types.backlog_location.BacklogLocation, google.cloud.pubsublite.types.backlog_location.PublishTime, google.cloud.pubsublite.types.backlog_location.EventTime] = <BacklogLocation.END: 1>, starting_offset: Optional[google.cloud.pubsublite.types.backlog_location.BacklogLocation] = None)

Create a subscription, returns the created subscription. By default a subscription will only receive messages published after the subscription was created.

starting_offset is deprecated. Use target to initialize the subscription to a target location within the message backlog instead. starting_offset has higher precedence if target is also set.

A seek is initiated if the target location is a publish or event time. If the seek fails, the created subscription is not deleted.

create_topic

create_topic(topic: google.cloud.pubsublite_v1.types.common.Topic)

Create a topic, returns the created topic.

delete_reservation

delete_reservation(
    reservation_path: google.cloud.pubsublite.types.paths.ReservationPath,
)

Delete a reservation and all associated messages.

delete_subscription

delete_subscription(
    subscription_path: google.cloud.pubsublite.types.paths.SubscriptionPath,
)

Delete a subscription and all associated messages.

delete_topic

delete_topic(topic_path: google.cloud.pubsublite.types.paths.TopicPath)

Delete a topic and all associated messages.

get_reservation

get_reservation(
    reservation_path: google.cloud.pubsublite.types.paths.ReservationPath,
)

Get the reservation object from the server.

get_subscription

get_subscription(
    subscription_path: google.cloud.pubsublite.types.paths.SubscriptionPath,
)

Get the subscription object from the server.

get_topic

get_topic(topic_path: google.cloud.pubsublite.types.paths.TopicPath)

Get the topic object from the server.

get_topic_partition_count

get_topic_partition_count(
    topic_path: google.cloud.pubsublite.types.paths.TopicPath,
)

Get the number of partitions in the provided topic.

list_reservation_topics

list_reservation_topics(
    reservation_path: google.cloud.pubsublite.types.paths.ReservationPath,
)

List the subscriptions that exist for a given reservation.

list_reservations

list_reservations(location_path: google.cloud.pubsublite.types.paths.LocationPath)

List the Pub/Sub lite reservations that exist for a project in a given location.

list_subscriptions

list_subscriptions(location_path: google.cloud.pubsublite.types.paths.LocationPath)

List the Pub/Sub lite subscriptions that exist for a project in a given location.

list_topic_subscriptions

list_topic_subscriptions(topic_path: google.cloud.pubsublite.types.paths.TopicPath)

List the subscriptions that exist for a given topic.

list_topics

list_topics(location_path: google.cloud.pubsublite.types.paths.LocationPath)

List the Pub/Sub lite topics that exist for a project in a given location.

region

region()

The region this client is for.

seek_subscription

seek_subscription(
    subscription_path: google.cloud.pubsublite.types.paths.SubscriptionPath,
    target: Union[
        google.cloud.pubsublite.types.backlog_location.BacklogLocation,
        google.cloud.pubsublite.types.backlog_location.PublishTime,
        google.cloud.pubsublite.types.backlog_location.EventTime,
    ],
)

Initiate an out-of-band seek for a subscription to a specified target.

The seek target may be timestamps or named positions within the message backlog See https://cloud.google.com/pubsub/lite/docs/seek for more information.

Returns
TypeDescription
google.api_core.operation.Operation withresult type: google.cloud.pubsublite.SeekSubscriptionResponse metadata type: google.cloud.pubsublite.OperationMetadata

update_reservation

update_reservation(
    reservation: google.cloud.pubsublite_v1.types.common.Reservation,
    update_mask: google.protobuf.field_mask_pb2.FieldMask,
)

Update the masked fields of the provided reservation.

update_subscription

update_subscription(
    subscription: google.cloud.pubsublite_v1.types.common.Subscription,
    update_mask: google.protobuf.field_mask_pb2.FieldMask,
)

Update the masked fields of the provided subscription.

update_topic

update_topic(
    topic: google.cloud.pubsublite_v1.types.common.Topic,
    update_mask: google.protobuf.field_mask_pb2.FieldMask,
)

Update the masked fields of the provided topic.