Reference documentation and code samples for the Cloud PubSub Client class Snapshot.
Represents a Pub/Sub Snapshot
Example:
use Google\Cloud\PubSub\PubSubClient;
$pubsub = new PubSubClient(['projectId' => 'my-project']);
$snapshot = $pubsub->snapshot($snapshotName);
Namespace
Google \ Cloud \ PubSubMethods
__construct
requestHandler
Google\Cloud\Core\RequestHandler
serializer
projectId
string
The current Project ID.
name
string
The snapshot name.
encode
bool
Whether certain request arguments should be base64-encoded.
info
array
[optional] The snapshot data. When creating a
Snapshot, this array mustcontain a $info.subscription
argument with a fully-qualified subscription name.
clientConfig
array
[optional] Configuration options for the PubSub client used to handle processing of batch items through the daemon. For valid options please see Google\Cloud\PubSub\PubSubClient::__construct() . Defaults tothe options provided to the PubSub client associated with this instance.
name
Get the Snapshot name.
Example:
echo $snapshot->name();
string
info
Get the snapshot info.
Example:
$info = $snapshot->info();
array
create
Create a new Snapshot.
When creating a snapshot, a subscription name must be supplied at instantiation.
Please note that this method may not yet be available in your project.
Example:
$info = $snapshot->create();
options
array
[optional] Configuration options.
array
delete
Delete the snapshot.
Please note that this method may not yet be available in your project.
Example:
$snapshot->delete();
options
array
[optional] Configuration options.
void
topic
Get the Topic attached to the snapshot, if one exists.
Example:
$topic = $snapshot->topic();
subscription
Get the Subscription attached to the snapshot, if one exists.
Example:
$subscription = $snapshot->subscription();