Google Cloud Pub/Sub C++ Client
2.0.0
A C++ Client Library for Google Cloud Pub/Sub
|
Performs subscription administrative operations in Cloud Pub/Sub. More...
#include <google/cloud/pubsub/subscription_admin_client.h>
Public Member Functions | |
SubscriptionAdminClient (std::shared_ptr< SubscriptionAdminConnection > connection, Options opts={}) | |
SubscriptionAdminClient ()=delete | |
The default constructor is deleted. More... | |
StatusOr< google::pubsub::v1::Subscription > | CreateSubscription (Topic const &topic, Subscription const &subscription, SubscriptionBuilder builder={}, Options opts={}) |
Creates a new subscription in Cloud Pub/Sub. More... | |
StatusOr< google::pubsub::v1::Subscription > | GetSubscription (Subscription subscription, Options opts={}) |
Gets the metadata for an existing Cloud Pub/Sub subscription. More... | |
StatusOr< google::pubsub::v1::Subscription > | UpdateSubscription (Subscription const &subscription, SubscriptionBuilder builder, Options opts={}) |
Updates an existing subscription in Cloud Pub/Sub. More... | |
ListSubscriptionsRange | ListSubscriptions (std::string const &project_id, Options opts={}) |
Lists all the subscriptions for a given project id. More... | |
Status | DeleteSubscription (Subscription subscription, Options opts={}) |
Deletes an existing subscription in Cloud Pub/Sub. More... | |
Status | ModifyPushSubscription (Subscription const &subscription, PushConfigBuilder builder, Options opts={}) |
Modifies an existing subscription's push configuration. More... | |
StatusOr< google::pubsub::v1::Snapshot > | CreateSnapshot (Subscription const &subscription, SnapshotBuilder builder={}, Options opts={}) |
Creates a new snapshot for a subscription with a server-assigned name. More... | |
StatusOr< google::pubsub::v1::Snapshot > | CreateSnapshot (Subscription const &subscription, Snapshot const &snapshot, SnapshotBuilder builder={}, Options opts={}) |
Creates a new snapshot for a subscription with a given name. More... | |
StatusOr< google::pubsub::v1::Snapshot > | GetSnapshot (Snapshot const &snapshot, Options opts={}) |
Gets information about an existing snapshot. More... | |
StatusOr< google::pubsub::v1::Snapshot > | UpdateSnapshot (Snapshot const &snapshot, SnapshotBuilder builder, Options opts={}) |
Updates an existing snapshot. More... | |
ListSnapshotsRange | ListSnapshots (std::string const &project_id, Options opts={}) |
Lists all the snapshots for a given project id. More... | |
Status | DeleteSnapshot (Snapshot const &snapshot, Options opts={}) |
Deletes a snapshot. More... | |
StatusOr< google::pubsub::v1::SeekResponse > | Seek (Subscription const &subscription, std::chrono::system_clock::time_point timestamp, Options opts={}) |
Seeks a subscription to its state at timestamp . More... | |
StatusOr< google::pubsub::v1::SeekResponse > | Seek (Subscription const &subscription, Snapshot const &snapshot, Options opts={}) |
Seeks a subscription to its state at snapshot . More... | |
Performs subscription administrative operations in Cloud Pub/Sub.
Applications use this class to perform subscription administrative operations on Cloud Pub/Sub.
SubscriptionAdminClient
objects are relatively cheap to create, copy, and move. However, each SubscriptionAdminClient
object must be created with a std::shared_ptr<SubscriptionAdminConnection>
, which itself is relatively expensive to create. Therefore, connection instances should be shared when possible. See the MakeSubscriptionAdminConnection()
function and the SubscriptionAdminConnection
interface for more details.StatusOr<T>
to report errors. When an operation fails to perform its work the returned StatusOr<T>
contains the error details. If the ok()
member function in the StatusOr<T>
returns true
then it contains the expected result. Please consult the StatusOr<T>
documentation for more details. Definition at line 60 of file subscription_admin_client.h.
|
explicit |
|
delete |
The default constructor is deleted.
Use SubscriberClient(std::shared_ptr<SubscriberConnection>)
|
inline |
Creates a new snapshot for a subscription with a given name.
subscription | the name of the subscription |
snapshot | the name of the snapshot |
builder | additional configuration for the snapshot, e.g., labels |
opts | Override the class-level options, such as retry and backoff policies. |
Definition at line 250 of file subscription_admin_client.h.
|
inline |
Creates a new snapshot for a subscription with a server-assigned name.
subscription | the name of the subscription |
builder | additional configuration for the snapshot, e.g., labels |
opts | Override the class-level options, such as retry and backoff policies. |
Definition at line 222 of file subscription_admin_client.h.
|
inline |
Creates a new subscription in Cloud Pub/Sub.
kAlreadyExists
as a consequence of retrying a successful (but reported as failed) request.topic | the topic that the subscription will attach to |
subscription | the name for the subscription |
builder | any additional configuration for the subscription |
opts | Override the class-level options, such as retry and backoff policies. |
Definition at line 94 of file subscription_admin_client.h.
|
inline |
Deletes a snapshot.
snapshot | the name of the snapshot |
opts | Override the class-level options, such as retry and backoff policies. |
Definition at line 344 of file subscription_admin_client.h.
|
inline |
Deletes an existing subscription in Cloud Pub/Sub.
kNotFound
as a consequence of retrying a successful (but reported as failed) request.subscription | the name of the subscription to be deleted. |
opts | Override the class-level options, such as retry and backoff policies. |
Definition at line 175 of file subscription_admin_client.h.
|
inline |
Gets information about an existing snapshot.
snapshot | the name of the snapshot |
opts | Override the class-level options, such as retry and backoff policies. |
Definition at line 275 of file subscription_admin_client.h.
|
inline |
Gets the metadata for an existing Cloud Pub/Sub subscription.
Definition at line 112 of file subscription_admin_client.h.
|
inline |
Lists all the snapshots for a given project id.
Definition at line 320 of file subscription_admin_client.h.
|
inline |
Lists all the subscriptions for a given project id.
Definition at line 152 of file subscription_admin_client.h.
|
inline |
Modifies an existing subscription's push configuration.
This can change a push subscription into a pull subscription (by setting an empty push config), change the push endpoint, or change a pull subscription into a push config.
subscription | the name of the subscription to be modified. |
builder | a description of the changes to be made. |
opts | Override the class-level options, such as retry and backoff policies. |
Definition at line 200 of file subscription_admin_client.h.
StatusOr<google::pubsub::v1::SeekResponse> google::cloud::pubsub::SubscriptionAdminClient::Seek | ( | Subscription const & | subscription, |
Snapshot const & | snapshot, | ||
Options | opts = {} |
||
) |
Seeks a subscription to its state at snapshot
.
Seek()
functionality. StatusOr<google::pubsub::v1::SeekResponse> google::cloud::pubsub::SubscriptionAdminClient::Seek | ( | Subscription const & | subscription, |
std::chrono::system_clock::time_point | timestamp, | ||
Options | opts = {} |
||
) |
Seeks a subscription to its state at timestamp
.
Messages retained in the subscription that were published before timestamp
are marked as acknowledged, while messages published after timestamp
are marked as unacknowledged.
Seek()
functionality.
|
inline |
Updates an existing snapshot.
snapshot | the name of the snapshot |
builder | the changes applied to the snapshot |
opts | Override the class-level options, such as retry and backoff policies. |
Definition at line 300 of file subscription_admin_client.h.
|
inline |
Updates an existing subscription in Cloud Pub/Sub.
subscription | the name for the subscription |
builder | any additional configuration for the subscription |
opts | Override the class-level options, such as retry and backoff policies. |
Definition at line 134 of file subscription_admin_client.h.