google-cloud-pubsub 0.23.0 → 0.23.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/google/cloud/pubsub/service.rb +4 -4
- data/lib/google/cloud/pubsub/v1/doc/google/protobuf/duration.rb +71 -0
- data/lib/google/cloud/pubsub/v1/doc/google/protobuf/field_mask.rb +171 -0
- data/lib/google/cloud/pubsub/v1/doc/google/protobuf/timestamp.rb +2 -2
- data/lib/google/cloud/pubsub/v1/doc/google/pubsub/v1/pubsub.rb +129 -7
- data/lib/google/cloud/pubsub/v1/publisher_client.rb +14 -11
- data/lib/google/cloud/pubsub/v1/publisher_client_config.json +9 -9
- data/lib/google/cloud/pubsub/v1/subscriber_client.rb +307 -13
- data/lib/google/cloud/pubsub/v1/subscriber_client_config.json +30 -5
- data/lib/google/cloud/pubsub/version.rb +1 -1
- data/lib/google/pubsub/v1/pubsub_pb.rb +46 -0
- data/lib/google/pubsub/v1/pubsub_services_pb.rb +25 -1
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: edaab95bea428b012e4d4140021eacf1101217e4
|
4
|
+
data.tar.gz: dacbd91c662d112accfed0358f39f47772ad6765
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b681c9885ff292601453dcb235d4a3d3b8faa71dac2db7527e7cfc8084fc0be9452e9ee3faeb451d833c44e3da407217eebb201b4e5bc854396d9cdc91c7d433
|
7
|
+
data.tar.gz: 25b78fc9efa359d9e071a703a92f36ccfa1e4f88e69edea86203855235124dd8c120090b048b9df968f1e436a1fc0f647794e71d1209d610fdc73c283f04d688
|
@@ -59,8 +59,8 @@ module Google
|
|
59
59
|
channel: channel,
|
60
60
|
timeout: timeout,
|
61
61
|
client_config: client_config,
|
62
|
-
|
63
|
-
|
62
|
+
lib_name: "gccl",
|
63
|
+
lib_version: Google::Cloud::Pubsub::VERSION)
|
64
64
|
end
|
65
65
|
end
|
66
66
|
attr_accessor :mocked_subscriber
|
@@ -72,8 +72,8 @@ module Google
|
|
72
72
|
service_path: host,
|
73
73
|
channel: channel,
|
74
74
|
timeout: timeout,
|
75
|
-
|
76
|
-
|
75
|
+
lib_name: "gccl",
|
76
|
+
lib_version: Google::Cloud::Pubsub::VERSION)
|
77
77
|
end
|
78
78
|
end
|
79
79
|
attr_accessor :mocked_publisher
|
@@ -0,0 +1,71 @@
|
|
1
|
+
# Copyright 2017, Google Inc. All rights reserved.
|
2
|
+
#
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
+
# you may not use this file except in compliance with the License.
|
5
|
+
# You may obtain a copy of the License at
|
6
|
+
#
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
8
|
+
#
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
+
# See the License for the specific language governing permissions and
|
13
|
+
# limitations under the License.
|
14
|
+
|
15
|
+
module Google
|
16
|
+
module Protobuf
|
17
|
+
# A Duration represents a signed, fixed-length span of time represented
|
18
|
+
# as a count of seconds and fractions of seconds at nanosecond
|
19
|
+
# resolution. It is independent of any calendar and concepts like "day"
|
20
|
+
# or "month". It is related to Timestamp in that the difference between
|
21
|
+
# two Timestamp values is a Duration and it can be added or subtracted
|
22
|
+
# from a Timestamp. Range is approximately +-10,000 years.
|
23
|
+
#
|
24
|
+
# Example 1: Compute Duration from two Timestamps in pseudo code.
|
25
|
+
#
|
26
|
+
# Timestamp start = ...;
|
27
|
+
# Timestamp end = ...;
|
28
|
+
# Duration duration = ...;
|
29
|
+
#
|
30
|
+
# duration.seconds = end.seconds - start.seconds;
|
31
|
+
# duration.nanos = end.nanos - start.nanos;
|
32
|
+
#
|
33
|
+
# if (duration.seconds < 0 && duration.nanos > 0) {
|
34
|
+
# duration.seconds += 1;
|
35
|
+
# duration.nanos -= 1000000000;
|
36
|
+
# } else if (durations.seconds > 0 && duration.nanos < 0) {
|
37
|
+
# duration.seconds -= 1;
|
38
|
+
# duration.nanos += 1000000000;
|
39
|
+
# }
|
40
|
+
#
|
41
|
+
# Example 2: Compute Timestamp from Timestamp + Duration in pseudo code.
|
42
|
+
#
|
43
|
+
# Timestamp start = ...;
|
44
|
+
# Duration duration = ...;
|
45
|
+
# Timestamp end = ...;
|
46
|
+
#
|
47
|
+
# end.seconds = start.seconds + duration.seconds;
|
48
|
+
# end.nanos = start.nanos + duration.nanos;
|
49
|
+
#
|
50
|
+
# if (end.nanos < 0) {
|
51
|
+
# end.seconds -= 1;
|
52
|
+
# end.nanos += 1000000000;
|
53
|
+
# } else if (end.nanos >= 1000000000) {
|
54
|
+
# end.seconds += 1;
|
55
|
+
# end.nanos -= 1000000000;
|
56
|
+
# }
|
57
|
+
# @!attribute [rw] seconds
|
58
|
+
# @return [Integer]
|
59
|
+
# Signed seconds of the span of time. Must be from -315,576,000,000
|
60
|
+
# to +315,576,000,000 inclusive.
|
61
|
+
# @!attribute [rw] nanos
|
62
|
+
# @return [Integer]
|
63
|
+
# Signed fractions of a second at nanosecond resolution of the span
|
64
|
+
# of time. Durations less than one second are represented with a 0
|
65
|
+
# +seconds+ field and a positive or negative +nanos+ field. For durations
|
66
|
+
# of one second or more, a non-zero value for the +nanos+ field must be
|
67
|
+
# of the same sign as the +seconds+ field. Must be from -999,999,999
|
68
|
+
# to +999,999,999 inclusive.
|
69
|
+
class Duration; end
|
70
|
+
end
|
71
|
+
end
|
@@ -0,0 +1,171 @@
|
|
1
|
+
# Copyright 2017, Google Inc. All rights reserved.
|
2
|
+
#
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
+
# you may not use this file except in compliance with the License.
|
5
|
+
# You may obtain a copy of the License at
|
6
|
+
#
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
8
|
+
#
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
+
# See the License for the specific language governing permissions and
|
13
|
+
# limitations under the License.
|
14
|
+
|
15
|
+
module Google
|
16
|
+
module Protobuf
|
17
|
+
# +FieldMask+ represents a set of symbolic field paths, for example:
|
18
|
+
#
|
19
|
+
# paths: "f.a"
|
20
|
+
# paths: "f.b.d"
|
21
|
+
#
|
22
|
+
# Here +f+ represents a field in some root message, +a+ and +b+
|
23
|
+
# fields in the message found in +f+, and +d+ a field found in the
|
24
|
+
# message in +f.b+.
|
25
|
+
#
|
26
|
+
# Field masks are used to specify a subset of fields that should be
|
27
|
+
# returned by a get operation or modified by an update operation.
|
28
|
+
# Field masks also have a custom JSON encoding (see below).
|
29
|
+
#
|
30
|
+
# = Field Masks in Projections
|
31
|
+
#
|
32
|
+
# When used in the context of a projection, a response message or
|
33
|
+
# sub-message is filtered by the API to only contain those fields as
|
34
|
+
# specified in the mask. For example, if the mask in the previous
|
35
|
+
# example is applied to a response message as follows:
|
36
|
+
#
|
37
|
+
# f {
|
38
|
+
# a : 22
|
39
|
+
# b {
|
40
|
+
# d : 1
|
41
|
+
# x : 2
|
42
|
+
# }
|
43
|
+
# y : 13
|
44
|
+
# }
|
45
|
+
# z: 8
|
46
|
+
#
|
47
|
+
# The result will not contain specific values for fields x,y and z
|
48
|
+
# (their value will be set to the default, and omitted in proto text
|
49
|
+
# output):
|
50
|
+
#
|
51
|
+
#
|
52
|
+
# f {
|
53
|
+
# a : 22
|
54
|
+
# b {
|
55
|
+
# d : 1
|
56
|
+
# }
|
57
|
+
# }
|
58
|
+
#
|
59
|
+
# A repeated field is not allowed except at the last position of a
|
60
|
+
# field mask.
|
61
|
+
#
|
62
|
+
# If a FieldMask object is not present in a get operation, the
|
63
|
+
# operation applies to all fields (as if a FieldMask of all fields
|
64
|
+
# had been specified).
|
65
|
+
#
|
66
|
+
# Note that a field mask does not necessarily apply to the
|
67
|
+
# top-level response message. In case of a REST get operation, the
|
68
|
+
# field mask applies directly to the response, but in case of a REST
|
69
|
+
# list operation, the mask instead applies to each individual message
|
70
|
+
# in the returned resource list. In case of a REST custom method,
|
71
|
+
# other definitions may be used. Where the mask applies will be
|
72
|
+
# clearly documented together with its declaration in the API. In
|
73
|
+
# any case, the effect on the returned resource/resources is required
|
74
|
+
# behavior for APIs.
|
75
|
+
#
|
76
|
+
# = Field Masks in Update Operations
|
77
|
+
#
|
78
|
+
# A field mask in update operations specifies which fields of the
|
79
|
+
# targeted resource are going to be updated. The API is required
|
80
|
+
# to only change the values of the fields as specified in the mask
|
81
|
+
# and leave the others untouched. If a resource is passed in to
|
82
|
+
# describe the updated values, the API ignores the values of all
|
83
|
+
# fields not covered by the mask.
|
84
|
+
#
|
85
|
+
# In order to reset a field's value to the default, the field must
|
86
|
+
# be in the mask and set to the default value in the provided resource.
|
87
|
+
# Hence, in order to reset all fields of a resource, provide a default
|
88
|
+
# instance of the resource and set all fields in the mask, or do
|
89
|
+
# not provide a mask as described below.
|
90
|
+
#
|
91
|
+
# If a field mask is not present on update, the operation applies to
|
92
|
+
# all fields (as if a field mask of all fields has been specified).
|
93
|
+
# Note that in the presence of schema evolution, this may mean that
|
94
|
+
# fields the client does not know and has therefore not filled into
|
95
|
+
# the request will be reset to their default. If this is unwanted
|
96
|
+
# behavior, a specific service may require a client to always specify
|
97
|
+
# a field mask, producing an error if not.
|
98
|
+
#
|
99
|
+
# As with get operations, the location of the resource which
|
100
|
+
# describes the updated values in the request message depends on the
|
101
|
+
# operation kind. In any case, the effect of the field mask is
|
102
|
+
# required to be honored by the API.
|
103
|
+
#
|
104
|
+
# == Considerations for HTTP REST
|
105
|
+
#
|
106
|
+
# The HTTP kind of an update operation which uses a field mask must
|
107
|
+
# be set to PATCH instead of PUT in order to satisfy HTTP semantics
|
108
|
+
# (PUT must only be used for full updates).
|
109
|
+
#
|
110
|
+
# = JSON Encoding of Field Masks
|
111
|
+
#
|
112
|
+
# In JSON, a field mask is encoded as a single string where paths are
|
113
|
+
# separated by a comma. Fields name in each path are converted
|
114
|
+
# to/from lower-camel naming conventions.
|
115
|
+
#
|
116
|
+
# As an example, consider the following message declarations:
|
117
|
+
#
|
118
|
+
# message Profile {
|
119
|
+
# User user = 1;
|
120
|
+
# Photo photo = 2;
|
121
|
+
# }
|
122
|
+
# message User {
|
123
|
+
# string display_name = 1;
|
124
|
+
# string address = 2;
|
125
|
+
# }
|
126
|
+
#
|
127
|
+
# In proto a field mask for +Profile+ may look as such:
|
128
|
+
#
|
129
|
+
# mask {
|
130
|
+
# paths: "user.display_name"
|
131
|
+
# paths: "photo"
|
132
|
+
# }
|
133
|
+
#
|
134
|
+
# In JSON, the same mask is represented as below:
|
135
|
+
#
|
136
|
+
# {
|
137
|
+
# mask: "user.displayName,photo"
|
138
|
+
# }
|
139
|
+
#
|
140
|
+
# = Field Masks and Oneof Fields
|
141
|
+
#
|
142
|
+
# Field masks treat fields in oneofs just as regular fields. Consider the
|
143
|
+
# following message:
|
144
|
+
#
|
145
|
+
# message SampleMessage {
|
146
|
+
# oneof test_oneof {
|
147
|
+
# string name = 4;
|
148
|
+
# SubMessage sub_message = 9;
|
149
|
+
# }
|
150
|
+
# }
|
151
|
+
#
|
152
|
+
# The field mask can be:
|
153
|
+
#
|
154
|
+
# mask {
|
155
|
+
# paths: "name"
|
156
|
+
# }
|
157
|
+
#
|
158
|
+
# Or:
|
159
|
+
#
|
160
|
+
# mask {
|
161
|
+
# paths: "sub_message"
|
162
|
+
# }
|
163
|
+
#
|
164
|
+
# Note that oneof type names ("test_oneof" in this case) cannot be used in
|
165
|
+
# paths.
|
166
|
+
# @!attribute [rw] paths
|
167
|
+
# @return [Array<String>]
|
168
|
+
# The set of field mask paths.
|
169
|
+
class FieldMask; end
|
170
|
+
end
|
171
|
+
end
|
@@ -1,10 +1,10 @@
|
|
1
|
-
# Copyright
|
1
|
+
# Copyright 2017, Google Inc. All rights reserved.
|
2
2
|
#
|
3
3
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
4
|
# you may not use this file except in compliance with the License.
|
5
5
|
# You may obtain a copy of the License at
|
6
6
|
#
|
7
|
-
#
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
8
8
|
#
|
9
9
|
# Unless required by applicable law or agreed to in writing, software
|
10
10
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
@@ -1,10 +1,10 @@
|
|
1
|
-
# Copyright
|
1
|
+
# Copyright 2017, Google Inc. All rights reserved.
|
2
2
|
#
|
3
3
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
4
|
# you may not use this file except in compliance with the License.
|
5
5
|
# You may obtain a copy of the License at
|
6
6
|
#
|
7
|
-
#
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
8
8
|
#
|
9
9
|
# Unless required by applicable law or agreed to in writing, software
|
10
10
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
@@ -171,6 +171,20 @@ module Google
|
|
171
171
|
#
|
172
172
|
# If the subscriber never acknowledges the message, the Pub/Sub
|
173
173
|
# system will eventually redeliver the message.
|
174
|
+
# @!attribute [rw] retain_acked_messages
|
175
|
+
# @return [true, false]
|
176
|
+
# Indicates whether to retain acknowledged messages. If true, then
|
177
|
+
# messages are not expunged from the subscription's backlog, even if they are
|
178
|
+
# acknowledged, until they fall out of the +message_retention_duration+
|
179
|
+
# window.
|
180
|
+
# @!attribute [rw] message_retention_duration
|
181
|
+
# @return [Google::Protobuf::Duration]
|
182
|
+
# How long to retain unacknowledged messages in the subscription's backlog,
|
183
|
+
# from the moment a message is published.
|
184
|
+
# If +retain_acked_messages+ is true, then this also configures the retention
|
185
|
+
# of acknowledged messages, and thus configures how far back in time a +Seek+
|
186
|
+
# can be done. Defaults to 7 days. Cannot be more than 7 days or less than 10
|
187
|
+
# minutes.
|
174
188
|
class Subscription; end
|
175
189
|
|
176
190
|
# Configuration for a push delivery endpoint.
|
@@ -186,11 +200,10 @@ module Google
|
|
186
200
|
# control different aspects of the message delivery.
|
187
201
|
#
|
188
202
|
# The currently supported attribute is +x-goog-version+, which you can
|
189
|
-
# use to change the format of the
|
203
|
+
# use to change the format of the pushed message. This attribute
|
190
204
|
# indicates the version of the data expected by the endpoint. This
|
191
|
-
# controls the shape of the
|
192
|
-
# The endpoint version is based on the version of the Pub/Sub
|
193
|
-
# API.
|
205
|
+
# controls the shape of the pushed message (i.e., its fields and metadata).
|
206
|
+
# The endpoint version is based on the version of the Pub/Sub API.
|
194
207
|
#
|
195
208
|
# If not present during the +CreateSubscription+ call, it will default to
|
196
209
|
# the version of the API used to make such call. If not present during a
|
@@ -220,6 +233,16 @@ module Google
|
|
220
233
|
# Format is +projects/{project}/subscriptions/{sub}+.
|
221
234
|
class GetSubscriptionRequest; end
|
222
235
|
|
236
|
+
# Request for the UpdateSubscription method.
|
237
|
+
# @!attribute [rw] subscription
|
238
|
+
# @return [Google::Pubsub::V1::Subscription]
|
239
|
+
# The updated subscription object.
|
240
|
+
# @!attribute [rw] update_mask
|
241
|
+
# @return [Google::Protobuf::FieldMask]
|
242
|
+
# Indicates which fields in the provided subscription to update.
|
243
|
+
# Must be specified and non-empty.
|
244
|
+
class UpdateSubscriptionRequest; end
|
245
|
+
|
223
246
|
# Request for the +ListSubscriptions+ method.
|
224
247
|
# @!attribute [rw] project
|
225
248
|
# @return [String]
|
@@ -376,6 +399,105 @@ module Google
|
|
376
399
|
# @return [Array<Google::Pubsub::V1::ReceivedMessage>]
|
377
400
|
# Received Pub/Sub messages. This will not be empty.
|
378
401
|
class StreamingPullResponse; end
|
402
|
+
|
403
|
+
# Request for the +CreateSnapshot+ method.
|
404
|
+
# @!attribute [rw] name
|
405
|
+
# @return [String]
|
406
|
+
# Optional user-provided name for this snapshot.
|
407
|
+
# If the name is not provided in the request, the server will assign a random
|
408
|
+
# name for this snapshot on the same project as the subscription.
|
409
|
+
# Note that for REST API requests, you must specify a name.
|
410
|
+
# Format is +projects/{project}/snapshots/{snap}+.
|
411
|
+
# @!attribute [rw] subscription
|
412
|
+
# @return [String]
|
413
|
+
# The subscription whose backlog the snapshot retains.
|
414
|
+
# Specifically, the created snapshot is guaranteed to retain:
|
415
|
+
# (a) The existing backlog on the subscription. More precisely, this is
|
416
|
+
# defined as the messages in the subscription's backlog that are
|
417
|
+
# unacknowledged upon the successful completion of the
|
418
|
+
# +CreateSnapshot+ request; as well as:
|
419
|
+
# (b) Any messages published to the subscription's topic following the
|
420
|
+
# successful completion of the CreateSnapshot request.
|
421
|
+
# Format is +projects/{project}/subscriptions/{sub}+.
|
422
|
+
class CreateSnapshotRequest; end
|
423
|
+
|
424
|
+
# A snapshot resource.
|
425
|
+
# @!attribute [rw] name
|
426
|
+
# @return [String]
|
427
|
+
# The name of the snapshot.
|
428
|
+
# @!attribute [rw] topic
|
429
|
+
# @return [String]
|
430
|
+
# The name of the topic from which this snapshot is retaining messages.
|
431
|
+
# @!attribute [rw] expiration_time
|
432
|
+
# @return [Google::Protobuf::Timestamp]
|
433
|
+
# The snapshot is guaranteed to exist up until this time.
|
434
|
+
# A newly-created snapshot expires no later than 7 days from the time of its
|
435
|
+
# creation. Its exact lifetime is determined at creation by the existing
|
436
|
+
# backlog in the source subscription. Specifically, the lifetime of the
|
437
|
+
# snapshot is +7 days - (age of oldest unacked message in the subscription)+.
|
438
|
+
# For example, consider a subscription whose oldest unacked message is 3 days
|
439
|
+
# old. If a snapshot is created from this subscription, the snapshot -- which
|
440
|
+
# will always capture this 3-day-old backlog as long as the snapshot
|
441
|
+
# exists -- will expire in 4 days.
|
442
|
+
class Snapshot; end
|
443
|
+
|
444
|
+
# Request for the +ListSnapshots+ method.
|
445
|
+
# @!attribute [rw] project
|
446
|
+
# @return [String]
|
447
|
+
# The name of the cloud project that snapshots belong to.
|
448
|
+
# Format is +projects/{project}+.
|
449
|
+
# @!attribute [rw] page_size
|
450
|
+
# @return [Integer]
|
451
|
+
# Maximum number of snapshots to return.
|
452
|
+
# @!attribute [rw] page_token
|
453
|
+
# @return [String]
|
454
|
+
# The value returned by the last +ListSnapshotsResponse+; indicates that this
|
455
|
+
# is a continuation of a prior +ListSnapshots+ call, and that the system
|
456
|
+
# should return the next page of data.
|
457
|
+
class ListSnapshotsRequest; end
|
458
|
+
|
459
|
+
# Response for the +ListSnapshots+ method.
|
460
|
+
# @!attribute [rw] snapshots
|
461
|
+
# @return [Array<Google::Pubsub::V1::Snapshot>]
|
462
|
+
# The resulting snapshots.
|
463
|
+
# @!attribute [rw] next_page_token
|
464
|
+
# @return [String]
|
465
|
+
# If not empty, indicates that there may be more snapshot that match the
|
466
|
+
# request; this value should be passed in a new +ListSnapshotsRequest+.
|
467
|
+
class ListSnapshotsResponse; end
|
468
|
+
|
469
|
+
# Request for the +DeleteSnapshot+ method.
|
470
|
+
# @!attribute [rw] snapshot
|
471
|
+
# @return [String]
|
472
|
+
# The name of the snapshot to delete.
|
473
|
+
# Format is +projects/{project}/snapshots/{snap}+.
|
474
|
+
class DeleteSnapshotRequest; end
|
475
|
+
|
476
|
+
# Request for the +Seek+ method.
|
477
|
+
# @!attribute [rw] subscription
|
478
|
+
# @return [String]
|
479
|
+
# The subscription to affect.
|
480
|
+
# @!attribute [rw] time
|
481
|
+
# @return [Google::Protobuf::Timestamp]
|
482
|
+
# The time to seek to.
|
483
|
+
# Messages retained in the subscription that were published before this
|
484
|
+
# time are marked as acknowledged, and messages retained in the
|
485
|
+
# subscription that were published after this time are marked as
|
486
|
+
# unacknowledged. Note that this operation affects only those messages
|
487
|
+
# retained in the subscription (configured by the combination of
|
488
|
+
# +message_retention_duration+ and +retain_acked_messages+). For example,
|
489
|
+
# if +time+ corresponds to a point before the message retention
|
490
|
+
# window (or to a point before the system's notion of the subscription
|
491
|
+
# creation time), only retained messages will be marked as unacknowledged,
|
492
|
+
# and already-expunged messages will not be restored.
|
493
|
+
# @!attribute [rw] snapshot
|
494
|
+
# @return [String]
|
495
|
+
# The snapshot to seek to. The snapshot's topic must be the same as that of
|
496
|
+
# the provided subscription.
|
497
|
+
# Format is +projects/{project}/snapshots/{snap}+.
|
498
|
+
class SeekRequest; end
|
499
|
+
|
500
|
+
class SeekResponse; end
|
379
501
|
end
|
380
502
|
end
|
381
|
-
end
|
503
|
+
end
|
@@ -49,8 +49,6 @@ module Google
|
|
49
49
|
# The default port of the service.
|
50
50
|
DEFAULT_SERVICE_PORT = 443
|
51
51
|
|
52
|
-
CODE_GEN_NAME_VERSION = "gapic/0.1.0".freeze
|
53
|
-
|
54
52
|
DEFAULT_TIMEOUT = 30
|
55
53
|
|
56
54
|
PAGE_DESCRIPTORS = {
|
@@ -152,10 +150,6 @@ module Google
|
|
152
150
|
# or the specified config is missing data points.
|
153
151
|
# @param timeout [Numeric]
|
154
152
|
# The default timeout, in seconds, for calls made through this client.
|
155
|
-
# @param app_name [String]
|
156
|
-
# The codename of the calling service.
|
157
|
-
# @param app_version [String]
|
158
|
-
# The version of the calling service.
|
159
153
|
def initialize \
|
160
154
|
service_path: SERVICE_ADDRESS,
|
161
155
|
port: DEFAULT_SERVICE_PORT,
|
@@ -164,8 +158,10 @@ module Google
|
|
164
158
|
scopes: ALL_SCOPES,
|
165
159
|
client_config: {},
|
166
160
|
timeout: DEFAULT_TIMEOUT,
|
167
|
-
app_name:
|
168
|
-
app_version:
|
161
|
+
app_name: nil,
|
162
|
+
app_version: nil,
|
163
|
+
lib_name: nil,
|
164
|
+
lib_version: ""
|
169
165
|
# These require statements are intentionally placed here to initialize
|
170
166
|
# the gRPC module only when it's required.
|
171
167
|
# See https://github.com/googleapis/toolkit/issues/446
|
@@ -174,9 +170,16 @@ module Google
|
|
174
170
|
require "google/pubsub/v1/pubsub_services_pb"
|
175
171
|
|
176
172
|
|
177
|
-
|
178
|
-
"
|
179
|
-
|
173
|
+
if app_name || app_version
|
174
|
+
warn "`app_name` and `app_version` are no longer being used in the request headers."
|
175
|
+
end
|
176
|
+
|
177
|
+
google_api_client = "gl-ruby/#{RUBY_VERSION}"
|
178
|
+
google_api_client << " #{lib_name}/#{lib_version}" if lib_name
|
179
|
+
google_api_client << " gapic/ gax/#{Google::Gax::VERSION}"
|
180
|
+
google_api_client << " grpc/#{GRPC::VERSION}"
|
181
|
+
google_api_client.freeze
|
182
|
+
|
180
183
|
headers = { :"x-goog-api-client" => google_api_client }
|
181
184
|
client_config_file = Pathname.new(__dir__).join(
|
182
185
|
"publisher_client_config.json"
|
@@ -2,15 +2,15 @@
|
|
2
2
|
"interfaces": {
|
3
3
|
"google.pubsub.v1.Publisher": {
|
4
4
|
"retry_codes": {
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
5
|
+
"idempotent": [
|
6
|
+
"DEADLINE_EXCEEDED",
|
7
|
+
"UNAVAILABLE"
|
8
|
+
],
|
9
|
+
"one_plus_delivery": [
|
10
|
+
"DEADLINE_EXCEEDED",
|
11
|
+
"UNAVAILABLE"
|
12
|
+
],
|
13
|
+
"non_idempotent": []
|
14
14
|
},
|
15
15
|
"retry_params": {
|
16
16
|
"default": {
|
@@ -49,15 +49,17 @@ module Google
|
|
49
49
|
# The default port of the service.
|
50
50
|
DEFAULT_SERVICE_PORT = 443
|
51
51
|
|
52
|
-
CODE_GEN_NAME_VERSION = "gapic/0.1.0".freeze
|
53
|
-
|
54
52
|
DEFAULT_TIMEOUT = 30
|
55
53
|
|
56
54
|
PAGE_DESCRIPTORS = {
|
57
55
|
"list_subscriptions" => Google::Gax::PageDescriptor.new(
|
58
56
|
"page_token",
|
59
57
|
"next_page_token",
|
60
|
-
"subscriptions")
|
58
|
+
"subscriptions"),
|
59
|
+
"list_snapshots" => Google::Gax::PageDescriptor.new(
|
60
|
+
"page_token",
|
61
|
+
"next_page_token",
|
62
|
+
"snapshots")
|
61
63
|
}.freeze
|
62
64
|
|
63
65
|
private_constant :PAGE_DESCRIPTORS
|
@@ -75,6 +77,12 @@ module Google
|
|
75
77
|
|
76
78
|
private_constant :PROJECT_PATH_TEMPLATE
|
77
79
|
|
80
|
+
SNAPSHOT_PATH_TEMPLATE = Google::Gax::PathTemplate.new(
|
81
|
+
"projects/{project}/snapshots/{snapshot}"
|
82
|
+
)
|
83
|
+
|
84
|
+
private_constant :SNAPSHOT_PATH_TEMPLATE
|
85
|
+
|
78
86
|
SUBSCRIPTION_PATH_TEMPLATE = Google::Gax::PathTemplate.new(
|
79
87
|
"projects/{project}/subscriptions/{subscription}"
|
80
88
|
)
|
@@ -96,6 +104,17 @@ module Google
|
|
96
104
|
)
|
97
105
|
end
|
98
106
|
|
107
|
+
# Returns a fully-qualified snapshot resource name string.
|
108
|
+
# @param project [String]
|
109
|
+
# @param snapshot [String]
|
110
|
+
# @return [String]
|
111
|
+
def self.snapshot_path project, snapshot
|
112
|
+
SNAPSHOT_PATH_TEMPLATE.render(
|
113
|
+
:"project" => project,
|
114
|
+
:"snapshot" => snapshot
|
115
|
+
)
|
116
|
+
end
|
117
|
+
|
99
118
|
# Returns a fully-qualified subscription resource name string.
|
100
119
|
# @param project [String]
|
101
120
|
# @param subscription [String]
|
@@ -125,6 +144,20 @@ module Google
|
|
125
144
|
PROJECT_PATH_TEMPLATE.match(project_name)["project"]
|
126
145
|
end
|
127
146
|
|
147
|
+
# Parses the project from a snapshot resource.
|
148
|
+
# @param snapshot_name [String]
|
149
|
+
# @return [String]
|
150
|
+
def self.match_project_from_snapshot_name snapshot_name
|
151
|
+
SNAPSHOT_PATH_TEMPLATE.match(snapshot_name)["project"]
|
152
|
+
end
|
153
|
+
|
154
|
+
# Parses the snapshot from a snapshot resource.
|
155
|
+
# @param snapshot_name [String]
|
156
|
+
# @return [String]
|
157
|
+
def self.match_snapshot_from_snapshot_name snapshot_name
|
158
|
+
SNAPSHOT_PATH_TEMPLATE.match(snapshot_name)["snapshot"]
|
159
|
+
end
|
160
|
+
|
128
161
|
# Parses the project from a subscription resource.
|
129
162
|
# @param subscription_name [String]
|
130
163
|
# @return [String]
|
@@ -168,10 +201,6 @@ module Google
|
|
168
201
|
# or the specified config is missing data points.
|
169
202
|
# @param timeout [Numeric]
|
170
203
|
# The default timeout, in seconds, for calls made through this client.
|
171
|
-
# @param app_name [String]
|
172
|
-
# The codename of the calling service.
|
173
|
-
# @param app_version [String]
|
174
|
-
# The version of the calling service.
|
175
204
|
def initialize \
|
176
205
|
service_path: SERVICE_ADDRESS,
|
177
206
|
port: DEFAULT_SERVICE_PORT,
|
@@ -180,8 +209,10 @@ module Google
|
|
180
209
|
scopes: ALL_SCOPES,
|
181
210
|
client_config: {},
|
182
211
|
timeout: DEFAULT_TIMEOUT,
|
183
|
-
app_name:
|
184
|
-
app_version:
|
212
|
+
app_name: nil,
|
213
|
+
app_version: nil,
|
214
|
+
lib_name: nil,
|
215
|
+
lib_version: ""
|
185
216
|
# These require statements are intentionally placed here to initialize
|
186
217
|
# the gRPC module only when it's required.
|
187
218
|
# See https://github.com/googleapis/toolkit/issues/446
|
@@ -190,9 +221,16 @@ module Google
|
|
190
221
|
require "google/pubsub/v1/pubsub_services_pb"
|
191
222
|
|
192
223
|
|
193
|
-
|
194
|
-
"
|
195
|
-
|
224
|
+
if app_name || app_version
|
225
|
+
warn "`app_name` and `app_version` are no longer being used in the request headers."
|
226
|
+
end
|
227
|
+
|
228
|
+
google_api_client = "gl-ruby/#{RUBY_VERSION}"
|
229
|
+
google_api_client << " #{lib_name}/#{lib_version}" if lib_name
|
230
|
+
google_api_client << " gapic/ gax/#{Google::Gax::VERSION}"
|
231
|
+
google_api_client << " grpc/#{GRPC::VERSION}"
|
232
|
+
google_api_client.freeze
|
233
|
+
|
196
234
|
headers = { :"x-goog-api-client" => google_api_client }
|
197
235
|
client_config_file = Pathname.new(__dir__).join(
|
198
236
|
"subscriber_client_config.json"
|
@@ -246,6 +284,10 @@ module Google
|
|
246
284
|
@subscriber_stub.method(:get_subscription),
|
247
285
|
defaults["get_subscription"]
|
248
286
|
)
|
287
|
+
@update_subscription = Google::Gax.create_api_call(
|
288
|
+
@subscriber_stub.method(:update_subscription),
|
289
|
+
defaults["update_subscription"]
|
290
|
+
)
|
249
291
|
@list_subscriptions = Google::Gax.create_api_call(
|
250
292
|
@subscriber_stub.method(:list_subscriptions),
|
251
293
|
defaults["list_subscriptions"]
|
@@ -274,6 +316,22 @@ module Google
|
|
274
316
|
@subscriber_stub.method(:modify_push_config),
|
275
317
|
defaults["modify_push_config"]
|
276
318
|
)
|
319
|
+
@list_snapshots = Google::Gax.create_api_call(
|
320
|
+
@subscriber_stub.method(:list_snapshots),
|
321
|
+
defaults["list_snapshots"]
|
322
|
+
)
|
323
|
+
@create_snapshot = Google::Gax.create_api_call(
|
324
|
+
@subscriber_stub.method(:create_snapshot),
|
325
|
+
defaults["create_snapshot"]
|
326
|
+
)
|
327
|
+
@delete_snapshot = Google::Gax.create_api_call(
|
328
|
+
@subscriber_stub.method(:delete_snapshot),
|
329
|
+
defaults["delete_snapshot"]
|
330
|
+
)
|
331
|
+
@seek = Google::Gax.create_api_call(
|
332
|
+
@subscriber_stub.method(:seek),
|
333
|
+
defaults["seek"]
|
334
|
+
)
|
277
335
|
end
|
278
336
|
|
279
337
|
# Service calls
|
@@ -325,6 +383,18 @@ module Google
|
|
325
383
|
#
|
326
384
|
# If the subscriber never acknowledges the message, the Pub/Sub
|
327
385
|
# system will eventually redeliver the message.
|
386
|
+
# @param retain_acked_messages [true, false]
|
387
|
+
# Indicates whether to retain acknowledged messages. If true, then
|
388
|
+
# messages are not expunged from the subscription's backlog, even if they are
|
389
|
+
# acknowledged, until they fall out of the +message_retention_duration+
|
390
|
+
# window.
|
391
|
+
# @param message_retention_duration [Google::Protobuf::Duration]
|
392
|
+
# How long to retain unacknowledged messages in the subscription's backlog,
|
393
|
+
# from the moment a message is published.
|
394
|
+
# If +retain_acked_messages+ is true, then this also configures the retention
|
395
|
+
# of acknowledged messages, and thus configures how far back in time a +Seek+
|
396
|
+
# can be done. Defaults to 7 days. Cannot be more than 7 days or less than 10
|
397
|
+
# minutes.
|
328
398
|
# @param options [Google::Gax::CallOptions]
|
329
399
|
# Overrides the default settings for this call, e.g, timeout,
|
330
400
|
# retries, etc.
|
@@ -345,12 +415,16 @@ module Google
|
|
345
415
|
topic,
|
346
416
|
push_config: nil,
|
347
417
|
ack_deadline_seconds: nil,
|
418
|
+
retain_acked_messages: nil,
|
419
|
+
message_retention_duration: nil,
|
348
420
|
options: nil
|
349
421
|
req = Google::Pubsub::V1::Subscription.new({
|
350
422
|
name: name,
|
351
423
|
topic: topic,
|
352
424
|
push_config: push_config,
|
353
|
-
ack_deadline_seconds: ack_deadline_seconds
|
425
|
+
ack_deadline_seconds: ack_deadline_seconds,
|
426
|
+
retain_acked_messages: retain_acked_messages,
|
427
|
+
message_retention_duration: message_retention_duration
|
354
428
|
}.delete_if { |_, v| v.nil? })
|
355
429
|
@create_subscription.call(req, options)
|
356
430
|
end
|
@@ -383,6 +457,42 @@ module Google
|
|
383
457
|
@get_subscription.call(req, options)
|
384
458
|
end
|
385
459
|
|
460
|
+
# Updates an existing subscription. Note that certain properties of a
|
461
|
+
# subscription, such as its topic, are not modifiable.
|
462
|
+
#
|
463
|
+
# @param subscription [Google::Pubsub::V1::Subscription]
|
464
|
+
# The updated subscription object.
|
465
|
+
# @param update_mask [Google::Protobuf::FieldMask]
|
466
|
+
# Indicates which fields in the provided subscription to update.
|
467
|
+
# Must be specified and non-empty.
|
468
|
+
# @param options [Google::Gax::CallOptions]
|
469
|
+
# Overrides the default settings for this call, e.g, timeout,
|
470
|
+
# retries, etc.
|
471
|
+
# @return [Google::Pubsub::V1::Subscription]
|
472
|
+
# @raise [Google::Gax::GaxError] if the RPC is aborted.
|
473
|
+
# @example
|
474
|
+
# require "google/cloud/pubsub/v1/subscriber_client"
|
475
|
+
#
|
476
|
+
# FieldMask = Google::Protobuf::FieldMask
|
477
|
+
# SubscriberClient = Google::Cloud::Pubsub::V1::SubscriberClient
|
478
|
+
# Subscription = Google::Pubsub::V1::Subscription
|
479
|
+
#
|
480
|
+
# subscriber_client = SubscriberClient.new
|
481
|
+
# subscription = Subscription.new
|
482
|
+
# update_mask = FieldMask.new
|
483
|
+
# response = subscriber_client.update_subscription(subscription, update_mask)
|
484
|
+
|
485
|
+
def update_subscription \
|
486
|
+
subscription,
|
487
|
+
update_mask,
|
488
|
+
options: nil
|
489
|
+
req = Google::Pubsub::V1::UpdateSubscriptionRequest.new({
|
490
|
+
subscription: subscription,
|
491
|
+
update_mask: update_mask
|
492
|
+
}.delete_if { |_, v| v.nil? })
|
493
|
+
@update_subscription.call(req, options)
|
494
|
+
end
|
495
|
+
|
386
496
|
# Lists matching subscriptions.
|
387
497
|
#
|
388
498
|
# @param project [String]
|
@@ -694,6 +804,190 @@ module Google
|
|
694
804
|
nil
|
695
805
|
end
|
696
806
|
|
807
|
+
# Lists the existing snapshots.
|
808
|
+
#
|
809
|
+
# @param project [String]
|
810
|
+
# The name of the cloud project that snapshots belong to.
|
811
|
+
# Format is +projects/{project}+.
|
812
|
+
# @param page_size [Integer]
|
813
|
+
# The maximum number of resources contained in the underlying API
|
814
|
+
# response. If page streaming is performed per-resource, this
|
815
|
+
# parameter does not affect the return value. If page streaming is
|
816
|
+
# performed per-page, this determines the maximum number of
|
817
|
+
# resources in a page.
|
818
|
+
# @param options [Google::Gax::CallOptions]
|
819
|
+
# Overrides the default settings for this call, e.g, timeout,
|
820
|
+
# retries, etc.
|
821
|
+
# @return [Google::Gax::PagedEnumerable<Google::Pubsub::V1::Snapshot>]
|
822
|
+
# An enumerable of Google::Pubsub::V1::Snapshot instances.
|
823
|
+
# See Google::Gax::PagedEnumerable documentation for other
|
824
|
+
# operations such as per-page iteration or access to the response
|
825
|
+
# object.
|
826
|
+
# @raise [Google::Gax::GaxError] if the RPC is aborted.
|
827
|
+
# @example
|
828
|
+
# require "google/cloud/pubsub/v1/subscriber_client"
|
829
|
+
#
|
830
|
+
# SubscriberClient = Google::Cloud::Pubsub::V1::SubscriberClient
|
831
|
+
#
|
832
|
+
# subscriber_client = SubscriberClient.new
|
833
|
+
# formatted_project = SubscriberClient.project_path("[PROJECT]")
|
834
|
+
#
|
835
|
+
# # Iterate over all results.
|
836
|
+
# subscriber_client.list_snapshots(formatted_project).each do |element|
|
837
|
+
# # Process element.
|
838
|
+
# end
|
839
|
+
#
|
840
|
+
# # Or iterate over results one page at a time.
|
841
|
+
# subscriber_client.list_snapshots(formatted_project).each_page do |page|
|
842
|
+
# # Process each page at a time.
|
843
|
+
# page.each do |element|
|
844
|
+
# # Process element.
|
845
|
+
# end
|
846
|
+
# end
|
847
|
+
|
848
|
+
def list_snapshots \
|
849
|
+
project,
|
850
|
+
page_size: nil,
|
851
|
+
options: nil
|
852
|
+
req = Google::Pubsub::V1::ListSnapshotsRequest.new({
|
853
|
+
project: project,
|
854
|
+
page_size: page_size
|
855
|
+
}.delete_if { |_, v| v.nil? })
|
856
|
+
@list_snapshots.call(req, options)
|
857
|
+
end
|
858
|
+
|
859
|
+
# Creates a snapshot from the requested subscription.
|
860
|
+
# If the snapshot already exists, returns +ALREADY_EXISTS+.
|
861
|
+
# If the requested subscription doesn't exist, returns +NOT_FOUND+.
|
862
|
+
#
|
863
|
+
# If the name is not provided in the request, the server will assign a random
|
864
|
+
# name for this snapshot on the same project as the subscription, conforming
|
865
|
+
# to the
|
866
|
+
# {resource name format}[https://cloud.google.com/pubsub/docs/overview#names].
|
867
|
+
# The generated name is populated in the returned Snapshot object.
|
868
|
+
# Note that for REST API requests, you must specify a name in the request.
|
869
|
+
#
|
870
|
+
# @param name [String]
|
871
|
+
# Optional user-provided name for this snapshot.
|
872
|
+
# If the name is not provided in the request, the server will assign a random
|
873
|
+
# name for this snapshot on the same project as the subscription.
|
874
|
+
# Note that for REST API requests, you must specify a name.
|
875
|
+
# Format is +projects/{project}/snapshots/{snap}+.
|
876
|
+
# @param subscription [String]
|
877
|
+
# The subscription whose backlog the snapshot retains.
|
878
|
+
# Specifically, the created snapshot is guaranteed to retain:
|
879
|
+
# (a) The existing backlog on the subscription. More precisely, this is
|
880
|
+
# defined as the messages in the subscription's backlog that are
|
881
|
+
# unacknowledged upon the successful completion of the
|
882
|
+
# +CreateSnapshot+ request; as well as:
|
883
|
+
# (b) Any messages published to the subscription's topic following the
|
884
|
+
# successful completion of the CreateSnapshot request.
|
885
|
+
# Format is +projects/{project}/subscriptions/{sub}+.
|
886
|
+
# @param options [Google::Gax::CallOptions]
|
887
|
+
# Overrides the default settings for this call, e.g, timeout,
|
888
|
+
# retries, etc.
|
889
|
+
# @return [Google::Pubsub::V1::Snapshot]
|
890
|
+
# @raise [Google::Gax::GaxError] if the RPC is aborted.
|
891
|
+
# @example
|
892
|
+
# require "google/cloud/pubsub/v1/subscriber_client"
|
893
|
+
#
|
894
|
+
# SubscriberClient = Google::Cloud::Pubsub::V1::SubscriberClient
|
895
|
+
#
|
896
|
+
# subscriber_client = SubscriberClient.new
|
897
|
+
# formatted_name = SubscriberClient.snapshot_path("[PROJECT]", "[SNAPSHOT]")
|
898
|
+
# formatted_subscription = SubscriberClient.subscription_path("[PROJECT]", "[SUBSCRIPTION]")
|
899
|
+
# response = subscriber_client.create_snapshot(formatted_name, formatted_subscription)
|
900
|
+
|
901
|
+
def create_snapshot \
|
902
|
+
name,
|
903
|
+
subscription,
|
904
|
+
options: nil
|
905
|
+
req = Google::Pubsub::V1::CreateSnapshotRequest.new({
|
906
|
+
name: name,
|
907
|
+
subscription: subscription
|
908
|
+
}.delete_if { |_, v| v.nil? })
|
909
|
+
@create_snapshot.call(req, options)
|
910
|
+
end
|
911
|
+
|
912
|
+
# Removes an existing snapshot. All messages retained in the snapshot
|
913
|
+
# are immediately dropped. After a snapshot is deleted, a new one may be
|
914
|
+
# created with the same name, but the new one has no association with the old
|
915
|
+
# snapshot or its subscription, unless the same subscription is specified.
|
916
|
+
#
|
917
|
+
# @param snapshot [String]
|
918
|
+
# The name of the snapshot to delete.
|
919
|
+
# Format is +projects/{project}/snapshots/{snap}+.
|
920
|
+
# @param options [Google::Gax::CallOptions]
|
921
|
+
# Overrides the default settings for this call, e.g, timeout,
|
922
|
+
# retries, etc.
|
923
|
+
# @raise [Google::Gax::GaxError] if the RPC is aborted.
|
924
|
+
# @example
|
925
|
+
# require "google/cloud/pubsub/v1/subscriber_client"
|
926
|
+
#
|
927
|
+
# SubscriberClient = Google::Cloud::Pubsub::V1::SubscriberClient
|
928
|
+
#
|
929
|
+
# subscriber_client = SubscriberClient.new
|
930
|
+
# formatted_snapshot = SubscriberClient.snapshot_path("[PROJECT]", "[SNAPSHOT]")
|
931
|
+
# subscriber_client.delete_snapshot(formatted_snapshot)
|
932
|
+
|
933
|
+
def delete_snapshot \
|
934
|
+
snapshot,
|
935
|
+
options: nil
|
936
|
+
req = Google::Pubsub::V1::DeleteSnapshotRequest.new({
|
937
|
+
snapshot: snapshot
|
938
|
+
}.delete_if { |_, v| v.nil? })
|
939
|
+
@delete_snapshot.call(req, options)
|
940
|
+
nil
|
941
|
+
end
|
942
|
+
|
943
|
+
# Seeks an existing subscription to a point in time or to a given snapshot,
|
944
|
+
# whichever is provided in the request.
|
945
|
+
#
|
946
|
+
# @param subscription [String]
|
947
|
+
# The subscription to affect.
|
948
|
+
# @param time [Google::Protobuf::Timestamp]
|
949
|
+
# The time to seek to.
|
950
|
+
# Messages retained in the subscription that were published before this
|
951
|
+
# time are marked as acknowledged, and messages retained in the
|
952
|
+
# subscription that were published after this time are marked as
|
953
|
+
# unacknowledged. Note that this operation affects only those messages
|
954
|
+
# retained in the subscription (configured by the combination of
|
955
|
+
# +message_retention_duration+ and +retain_acked_messages+). For example,
|
956
|
+
# if +time+ corresponds to a point before the message retention
|
957
|
+
# window (or to a point before the system's notion of the subscription
|
958
|
+
# creation time), only retained messages will be marked as unacknowledged,
|
959
|
+
# and already-expunged messages will not be restored.
|
960
|
+
# @param snapshot [String]
|
961
|
+
# The snapshot to seek to. The snapshot's topic must be the same as that of
|
962
|
+
# the provided subscription.
|
963
|
+
# Format is +projects/{project}/snapshots/{snap}+.
|
964
|
+
# @param options [Google::Gax::CallOptions]
|
965
|
+
# Overrides the default settings for this call, e.g, timeout,
|
966
|
+
# retries, etc.
|
967
|
+
# @return [Google::Pubsub::V1::SeekResponse]
|
968
|
+
# @raise [Google::Gax::GaxError] if the RPC is aborted.
|
969
|
+
# @example
|
970
|
+
# require "google/cloud/pubsub/v1/subscriber_client"
|
971
|
+
#
|
972
|
+
# SubscriberClient = Google::Cloud::Pubsub::V1::SubscriberClient
|
973
|
+
#
|
974
|
+
# subscriber_client = SubscriberClient.new
|
975
|
+
# formatted_subscription = SubscriberClient.subscription_path("[PROJECT]", "[SUBSCRIPTION]")
|
976
|
+
# response = subscriber_client.seek(formatted_subscription)
|
977
|
+
|
978
|
+
def seek \
|
979
|
+
subscription,
|
980
|
+
time: nil,
|
981
|
+
snapshot: nil,
|
982
|
+
options: nil
|
983
|
+
req = Google::Pubsub::V1::SeekRequest.new({
|
984
|
+
subscription: subscription,
|
985
|
+
time: time,
|
986
|
+
snapshot: snapshot
|
987
|
+
}.delete_if { |_, v| v.nil? })
|
988
|
+
@seek.call(req, options)
|
989
|
+
end
|
990
|
+
|
697
991
|
# Sets the access control policy on the specified resource. Replaces any
|
698
992
|
# existing policy.
|
699
993
|
#
|
@@ -2,11 +2,11 @@
|
|
2
2
|
"interfaces": {
|
3
3
|
"google.pubsub.v1.Subscriber": {
|
4
4
|
"retry_codes": {
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
5
|
+
"idempotent": [
|
6
|
+
"DEADLINE_EXCEEDED",
|
7
|
+
"UNAVAILABLE"
|
8
|
+
],
|
9
|
+
"non_idempotent": []
|
10
10
|
},
|
11
11
|
"retry_params": {
|
12
12
|
"default": {
|
@@ -39,6 +39,11 @@
|
|
39
39
|
"retry_codes_name": "idempotent",
|
40
40
|
"retry_params_name": "default"
|
41
41
|
},
|
42
|
+
"UpdateSubscription": {
|
43
|
+
"timeout_millis": 60000,
|
44
|
+
"retry_codes_name": "idempotent",
|
45
|
+
"retry_params_name": "default"
|
46
|
+
},
|
42
47
|
"ListSubscriptions": {
|
43
48
|
"timeout_millis": 60000,
|
44
49
|
"retry_codes_name": "idempotent",
|
@@ -74,6 +79,26 @@
|
|
74
79
|
"retry_codes_name": "non_idempotent",
|
75
80
|
"retry_params_name": "default"
|
76
81
|
},
|
82
|
+
"ListSnapshots": {
|
83
|
+
"timeout_millis": 60000,
|
84
|
+
"retry_codes_name": "idempotent",
|
85
|
+
"retry_params_name": "default"
|
86
|
+
},
|
87
|
+
"CreateSnapshot": {
|
88
|
+
"timeout_millis": 60000,
|
89
|
+
"retry_codes_name": "idempotent",
|
90
|
+
"retry_params_name": "default"
|
91
|
+
},
|
92
|
+
"DeleteSnapshot": {
|
93
|
+
"timeout_millis": 60000,
|
94
|
+
"retry_codes_name": "idempotent",
|
95
|
+
"retry_params_name": "default"
|
96
|
+
},
|
97
|
+
"Seek": {
|
98
|
+
"timeout_millis": 60000,
|
99
|
+
"retry_codes_name": "non_idempotent",
|
100
|
+
"retry_params_name": "default"
|
101
|
+
},
|
77
102
|
"SetIamPolicy": {
|
78
103
|
"timeout_millis": 60000,
|
79
104
|
"retry_codes_name": "non_idempotent",
|
@@ -4,7 +4,9 @@
|
|
4
4
|
require 'google/protobuf'
|
5
5
|
|
6
6
|
require 'google/api/annotations_pb'
|
7
|
+
require 'google/protobuf/duration_pb'
|
7
8
|
require 'google/protobuf/empty_pb'
|
9
|
+
require 'google/protobuf/field_mask_pb'
|
8
10
|
require 'google/protobuf/timestamp_pb'
|
9
11
|
Google::Protobuf::DescriptorPool.generated_pool.build do
|
10
12
|
add_message "google.pubsub.v1.Topic" do
|
@@ -52,6 +54,8 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
|
|
52
54
|
optional :topic, :string, 2
|
53
55
|
optional :push_config, :message, 4, "google.pubsub.v1.PushConfig"
|
54
56
|
optional :ack_deadline_seconds, :int32, 5
|
57
|
+
optional :retain_acked_messages, :bool, 7
|
58
|
+
optional :message_retention_duration, :message, 8, "google.protobuf.Duration"
|
55
59
|
end
|
56
60
|
add_message "google.pubsub.v1.PushConfig" do
|
57
61
|
optional :push_endpoint, :string, 1
|
@@ -64,6 +68,10 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
|
|
64
68
|
add_message "google.pubsub.v1.GetSubscriptionRequest" do
|
65
69
|
optional :subscription, :string, 1
|
66
70
|
end
|
71
|
+
add_message "google.pubsub.v1.UpdateSubscriptionRequest" do
|
72
|
+
optional :subscription, :message, 1, "google.pubsub.v1.Subscription"
|
73
|
+
optional :update_mask, :message, 2, "google.protobuf.FieldMask"
|
74
|
+
end
|
67
75
|
add_message "google.pubsub.v1.ListSubscriptionsRequest" do
|
68
76
|
optional :project, :string, 1
|
69
77
|
optional :page_size, :int32, 2
|
@@ -107,6 +115,36 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
|
|
107
115
|
add_message "google.pubsub.v1.StreamingPullResponse" do
|
108
116
|
repeated :received_messages, :message, 1, "google.pubsub.v1.ReceivedMessage"
|
109
117
|
end
|
118
|
+
add_message "google.pubsub.v1.CreateSnapshotRequest" do
|
119
|
+
optional :name, :string, 1
|
120
|
+
optional :subscription, :string, 2
|
121
|
+
end
|
122
|
+
add_message "google.pubsub.v1.Snapshot" do
|
123
|
+
optional :name, :string, 1
|
124
|
+
optional :topic, :string, 2
|
125
|
+
optional :expiration_time, :message, 3, "google.protobuf.Timestamp"
|
126
|
+
end
|
127
|
+
add_message "google.pubsub.v1.ListSnapshotsRequest" do
|
128
|
+
optional :project, :string, 1
|
129
|
+
optional :page_size, :int32, 2
|
130
|
+
optional :page_token, :string, 3
|
131
|
+
end
|
132
|
+
add_message "google.pubsub.v1.ListSnapshotsResponse" do
|
133
|
+
repeated :snapshots, :message, 1, "google.pubsub.v1.Snapshot"
|
134
|
+
optional :next_page_token, :string, 2
|
135
|
+
end
|
136
|
+
add_message "google.pubsub.v1.DeleteSnapshotRequest" do
|
137
|
+
optional :snapshot, :string, 1
|
138
|
+
end
|
139
|
+
add_message "google.pubsub.v1.SeekRequest" do
|
140
|
+
optional :subscription, :string, 1
|
141
|
+
oneof :target do
|
142
|
+
optional :time, :message, 2, "google.protobuf.Timestamp"
|
143
|
+
optional :snapshot, :string, 3
|
144
|
+
end
|
145
|
+
end
|
146
|
+
add_message "google.pubsub.v1.SeekResponse" do
|
147
|
+
end
|
110
148
|
end
|
111
149
|
|
112
150
|
module Google
|
@@ -126,6 +164,7 @@ module Google
|
|
126
164
|
PushConfig = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.PushConfig").msgclass
|
127
165
|
ReceivedMessage = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.ReceivedMessage").msgclass
|
128
166
|
GetSubscriptionRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.GetSubscriptionRequest").msgclass
|
167
|
+
UpdateSubscriptionRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.UpdateSubscriptionRequest").msgclass
|
129
168
|
ListSubscriptionsRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.ListSubscriptionsRequest").msgclass
|
130
169
|
ListSubscriptionsResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.ListSubscriptionsResponse").msgclass
|
131
170
|
DeleteSubscriptionRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.DeleteSubscriptionRequest").msgclass
|
@@ -136,6 +175,13 @@ module Google
|
|
136
175
|
AcknowledgeRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.AcknowledgeRequest").msgclass
|
137
176
|
StreamingPullRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.StreamingPullRequest").msgclass
|
138
177
|
StreamingPullResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.StreamingPullResponse").msgclass
|
178
|
+
CreateSnapshotRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.CreateSnapshotRequest").msgclass
|
179
|
+
Snapshot = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.Snapshot").msgclass
|
180
|
+
ListSnapshotsRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.ListSnapshotsRequest").msgclass
|
181
|
+
ListSnapshotsResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.ListSnapshotsResponse").msgclass
|
182
|
+
DeleteSnapshotRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.DeleteSnapshotRequest").msgclass
|
183
|
+
SeekRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.SeekRequest").msgclass
|
184
|
+
SeekResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.SeekResponse").msgclass
|
139
185
|
end
|
140
186
|
end
|
141
187
|
end
|
@@ -1,7 +1,7 @@
|
|
1
1
|
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
2
2
|
# Source: google/pubsub/v1/pubsub.proto for package 'google.pubsub.v1'
|
3
3
|
# Original file comments:
|
4
|
-
# Copyright
|
4
|
+
# Copyright 2017 Google Inc.
|
5
5
|
#
|
6
6
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
7
7
|
# you may not use this file except in compliance with the License.
|
@@ -46,6 +46,9 @@ module Google
|
|
46
46
|
rpc :CreateSubscription, Subscription, Subscription
|
47
47
|
# Gets the configuration details of a subscription.
|
48
48
|
rpc :GetSubscription, GetSubscriptionRequest, Subscription
|
49
|
+
# Updates an existing subscription. Note that certain properties of a
|
50
|
+
# subscription, such as its topic, are not modifiable.
|
51
|
+
rpc :UpdateSubscription, UpdateSubscriptionRequest, Subscription
|
49
52
|
# Lists matching subscriptions.
|
50
53
|
rpc :ListSubscriptions, ListSubscriptionsRequest, ListSubscriptionsResponse
|
51
54
|
# Deletes an existing subscription. All messages retained in the subscription
|
@@ -93,6 +96,27 @@ module Google
|
|
93
96
|
# attributes of a push subscription. Messages will accumulate for delivery
|
94
97
|
# continuously through the call regardless of changes to the `PushConfig`.
|
95
98
|
rpc :ModifyPushConfig, ModifyPushConfigRequest, Google::Protobuf::Empty
|
99
|
+
# Lists the existing snapshots.
|
100
|
+
rpc :ListSnapshots, ListSnapshotsRequest, ListSnapshotsResponse
|
101
|
+
# Creates a snapshot from the requested subscription.
|
102
|
+
# If the snapshot already exists, returns `ALREADY_EXISTS`.
|
103
|
+
# If the requested subscription doesn't exist, returns `NOT_FOUND`.
|
104
|
+
#
|
105
|
+
# If the name is not provided in the request, the server will assign a random
|
106
|
+
# name for this snapshot on the same project as the subscription, conforming
|
107
|
+
# to the
|
108
|
+
# [resource name format](https://cloud.google.com/pubsub/docs/overview#names).
|
109
|
+
# The generated name is populated in the returned Snapshot object.
|
110
|
+
# Note that for REST API requests, you must specify a name in the request.
|
111
|
+
rpc :CreateSnapshot, CreateSnapshotRequest, Snapshot
|
112
|
+
# Removes an existing snapshot. All messages retained in the snapshot
|
113
|
+
# are immediately dropped. After a snapshot is deleted, a new one may be
|
114
|
+
# created with the same name, but the new one has no association with the old
|
115
|
+
# snapshot or its subscription, unless the same subscription is specified.
|
116
|
+
rpc :DeleteSnapshot, DeleteSnapshotRequest, Google::Protobuf::Empty
|
117
|
+
# Seeks an existing subscription to a point in time or to a given snapshot,
|
118
|
+
# whichever is provided in the request.
|
119
|
+
rpc :Seek, SeekRequest, SeekResponse
|
96
120
|
end
|
97
121
|
|
98
122
|
Stub = Service.rpc_stub_class
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: google-cloud-pubsub
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.23.
|
4
|
+
version: 0.23.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mike Moore
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2017-
|
12
|
+
date: 2017-03-01 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: google-cloud-core
|
@@ -204,6 +204,8 @@ files:
|
|
204
204
|
- lib/google/cloud/pubsub/topic/list.rb
|
205
205
|
- lib/google/cloud/pubsub/topic/publisher.rb
|
206
206
|
- lib/google/cloud/pubsub/v1.rb
|
207
|
+
- lib/google/cloud/pubsub/v1/doc/google/protobuf/duration.rb
|
208
|
+
- lib/google/cloud/pubsub/v1/doc/google/protobuf/field_mask.rb
|
207
209
|
- lib/google/cloud/pubsub/v1/doc/google/protobuf/timestamp.rb
|
208
210
|
- lib/google/cloud/pubsub/v1/doc/google/pubsub/v1/pubsub.rb
|
209
211
|
- lib/google/cloud/pubsub/v1/publisher_client.rb
|