Class Snapshot (2.17.0)

A Snapshot object will give you access to your Cloud Pub/Sub snapshot.

Snapshots are sometimes retrieved when using various methods:


Snapshots may be created with:

  • You can use snapshots to seek a subscription to a specific point in time.

-

Package

@google-cloud/pubsub!

Constructors

(constructor)(parent, name)

constructor(parent: Subscription | PubSub, name: string);

Constructs a new instance of the Snapshot class

Parameters
NameDescription
parent Subscription | PubSub
name string

Properties

metadata

metadata?: google.pubsub.v1.ISnapshot;
Property Value
TypeDescription
google.pubsub.v1.ISnapshot

name

name: string;
Property Value
TypeDescription
string

parent

parent: Subscription | PubSub;
Property Value
TypeDescription
Subscription | PubSub

Methods

create(gaxOpts)

create(gaxOpts?: CallOptions): Promise<CreateSnapshotResponse>;
Parameter
NameDescription
gaxOpts CallOptions
Returns
TypeDescription
Promise<CreateSnapshotResponse>

create(callback)

create(callback: CreateSnapshotCallback): void;
Parameter
NameDescription
callback CreateSnapshotCallback
Returns
TypeDescription
void

create(gaxOpts, callback)

create(gaxOpts: CallOptions, callback: CreateSnapshotCallback): void;
Parameters
NameDescription
gaxOpts CallOptions
callback CreateSnapshotCallback
Returns
TypeDescription
void

delete()

delete(): Promise<EmptyResponse>;
Returns
TypeDescription
Promise<EmptyResponse>

delete(callback)

delete(callback: EmptyCallback): void;
Parameter
NameDescription
callback EmptyCallback
Returns
TypeDescription
void

formatName_(projectId, name)

static formatName_(projectId: string, name: string): string;
Parameters
NameDescription
projectId string
name string
Returns
TypeDescription
string

seek(gaxOpts)

seek(gaxOpts?: CallOptions): Promise<SeekResponse>;
Parameter
NameDescription
gaxOpts CallOptions
Returns
TypeDescription
Promise<SeekResponse>

seek(callback)

seek(callback: SeekCallback): void;
Parameter
NameDescription
callback SeekCallback
Returns
TypeDescription
void

seek(gaxOpts, callback)

seek(gaxOpts: CallOptions, callback: SeekCallback): void;
Parameters
NameDescription
gaxOpts CallOptions
callback SeekCallback
Returns
TypeDescription
void