blob: b6f7747b736ce064407fc5f27efb1fb2a527be8a [file] [log] [blame]
Craig Citroe633be12015-03-02 13:40:36 -08001<html><body>
2<style>
3
4body, h1, h2, h3, div, span, p, pre, a {
5 margin: 0;
6 padding: 0;
7 border: 0;
8 font-weight: inherit;
9 font-style: inherit;
10 font-size: 100%;
11 font-family: inherit;
12 vertical-align: baseline;
13}
14
15body {
16 font-size: 13px;
17 padding: 1em;
18}
19
20h1 {
21 font-size: 26px;
22 margin-bottom: 1em;
23}
24
25h2 {
26 font-size: 24px;
27 margin-bottom: 1em;
28}
29
30h3 {
31 font-size: 20px;
32 margin-bottom: 1em;
33 margin-top: 1em;
34}
35
36pre, code {
37 line-height: 1.5;
38 font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Lucida Console', monospace;
39}
40
41pre {
42 margin-top: 0.5em;
43}
44
45h1, h2, h3, p {
46 font-family: Arial, sans serif;
47}
48
49h1, h2, h3 {
50 border-bottom: solid #CCC 1px;
51}
52
53.toc_element {
54 margin-top: 0.5em;
55}
56
57.firstline {
58 margin-left: 2 em;
59}
60
61.method {
62 margin-top: 1em;
63 border: solid 1px #CCC;
64 padding: 1em;
65 background: #EEE;
66}
67
68.details {
69 font-weight: bold;
70 font-size: 14px;
71}
72
73</style>
74
75<h1><a href="pubsub_v1beta2.html">Google Cloud Pub/Sub API</a> . <a href="pubsub_v1beta2.projects.html">projects</a> . <a href="pubsub_v1beta2.projects.subscriptions.html">subscriptions</a></h1>
76<h2>Instance Methods</h2>
77<p class="toc_element">
78 <code><a href="#acknowledge">acknowledge(subscription, body)</a></code></p>
79<p class="firstline">Acknowledges the messages associated with the ack tokens in the AcknowledgeRequest. The Pub/Sub system can remove the relevant messages from the subscription. Acknowledging a message whose ack deadline has expired may succeed, but such a message may be redelivered later. Acknowledging a message more than once will not result in an error.</p>
80<p class="toc_element">
81 <code><a href="#create">create(name, body)</a></code></p>
82<p class="firstline">Creates a subscription to a given topic for a given subscriber. If the subscription already exists, returns ALREADY_EXISTS. If the corresponding topic doesn't exist, returns NOT_FOUND. If the name is not provided in the request, the server will assign a random name for this subscription on the same project as the topic.</p>
83<p class="toc_element">
84 <code><a href="#delete">delete(subscription)</a></code></p>
85<p class="firstline">Deletes an existing subscription. All pending messages in the subscription are immediately dropped. Calls to Pull after deletion will return NOT_FOUND. After a subscription is deleted, a new one may be created with the same name, but the new one has no association with the old subscription, or its topic unless the same topic is specified.</p>
86<p class="toc_element">
87 <code><a href="#get">get(subscription)</a></code></p>
88<p class="firstline">Gets the configuration details of a subscription.</p>
89<p class="toc_element">
90 <code><a href="#list">list(project, pageSize=None, pageToken=None)</a></code></p>
91<p class="firstline">Lists matching subscriptions.</p>
92<p class="toc_element">
93 <code><a href="#list_next">list_next(previous_request, previous_response)</a></code></p>
94<p class="firstline">Retrieves the next page of results.</p>
95<p class="toc_element">
96 <code><a href="#modifyAckDeadline">modifyAckDeadline(subscription, body)</a></code></p>
97<p class="firstline">Modifies the ack deadline for a specific message. This method is useful to indicate that more time is needed to process a message by the subscriber, or to make the message available for redelivery if the processing was interrupted.</p>
98<p class="toc_element">
99 <code><a href="#modifyPushConfig">modifyPushConfig(subscription, body)</a></code></p>
100<p class="firstline">Modifies the PushConfig for a specified subscription. This may be used to change a push subscription to a pull one (signified by an empty PushConfig) or vice versa, or change the endpoint URL and other attributes of a push subscription. Messages will accumulate for delivery continuously through the call regardless of changes to the PushConfig.</p>
101<p class="toc_element">
102 <code><a href="#pull">pull(subscription, body)</a></code></p>
103<p class="firstline">Pulls messages from the server. Returns an empty list if there are no messages available in the backlog. The server may return UNAVAILABLE if there are too many concurrent pull requests pending for the given subscription.</p>
104<h3>Method Details</h3>
105<div class="method">
106 <code class="details" id="acknowledge">acknowledge(subscription, body)</code>
107 <pre>Acknowledges the messages associated with the ack tokens in the AcknowledgeRequest. The Pub/Sub system can remove the relevant messages from the subscription. Acknowledging a message whose ack deadline has expired may succeed, but such a message may be redelivered later. Acknowledging a message more than once will not result in an error.
108
109Args:
110 subscription: string, A parameter (required)
111 body: object, The request body. (required)
112 The object takes the form of:
113
114{
115 "ackIds": [
116 "A String",
117 ],
118 }
119
120
121Returns:
122 An object of the form:
123
124 {
125 }</pre>
126</div>
127
128<div class="method">
129 <code class="details" id="create">create(name, body)</code>
130 <pre>Creates a subscription to a given topic for a given subscriber. If the subscription already exists, returns ALREADY_EXISTS. If the corresponding topic doesn't exist, returns NOT_FOUND. If the name is not provided in the request, the server will assign a random name for this subscription on the same project as the topic.
131
132Args:
133 name: string, A parameter (required)
134 body: object, The request body. (required)
135 The object takes the form of:
136
137{
138 "ackDeadlineSeconds": 42,
139 "topic": "A String",
140 "pushConfig": {
141 "attributes": {
142 "a_key": "A String",
143 },
144 "pushEndpoint": "A String",
145 },
146 "name": "A String",
147}
148
149
150Returns:
151 An object of the form:
152
153 {
154 "ackDeadlineSeconds": 42,
155 "topic": "A String",
156 "pushConfig": {
157 "attributes": {
158 "a_key": "A String",
159 },
160 "pushEndpoint": "A String",
161 },
162 "name": "A String",
163 }</pre>
164</div>
165
166<div class="method">
167 <code class="details" id="delete">delete(subscription)</code>
168 <pre>Deletes an existing subscription. All pending messages in the subscription are immediately dropped. Calls to Pull after deletion will return NOT_FOUND. After a subscription is deleted, a new one may be created with the same name, but the new one has no association with the old subscription, or its topic unless the same topic is specified.
169
170Args:
171 subscription: string, A parameter (required)
172
173Returns:
174 An object of the form:
175
176 {
177 }</pre>
178</div>
179
180<div class="method">
181 <code class="details" id="get">get(subscription)</code>
182 <pre>Gets the configuration details of a subscription.
183
184Args:
185 subscription: string, A parameter (required)
186
187Returns:
188 An object of the form:
189
190 {
191 "ackDeadlineSeconds": 42,
192 "topic": "A String",
193 "pushConfig": {
194 "attributes": {
195 "a_key": "A String",
196 },
197 "pushEndpoint": "A String",
198 },
199 "name": "A String",
200 }</pre>
201</div>
202
203<div class="method">
204 <code class="details" id="list">list(project, pageSize=None, pageToken=None)</code>
205 <pre>Lists matching subscriptions.
206
207Args:
208 project: string, A parameter (required)
209 pageSize: integer, A parameter
210 pageToken: string, A parameter
211
212Returns:
213 An object of the form:
214
215 {
216 "nextPageToken": "A String",
217 "subscriptions": [
218 {
219 "ackDeadlineSeconds": 42,
220 "topic": "A String",
221 "pushConfig": {
222 "attributes": {
223 "a_key": "A String",
224 },
225 "pushEndpoint": "A String",
226 },
227 "name": "A String",
228 },
229 ],
230 }</pre>
231</div>
232
233<div class="method">
234 <code class="details" id="list_next">list_next(previous_request, previous_response)</code>
235 <pre>Retrieves the next page of results.
236
237Args:
238 previous_request: The request for the previous page. (required)
239 previous_response: The response from the request for the previous page. (required)
240
241Returns:
242 A request object that you can call 'execute()' on to request the next
243 page. Returns None if there are no more items in the collection.
244 </pre>
245</div>
246
247<div class="method">
248 <code class="details" id="modifyAckDeadline">modifyAckDeadline(subscription, body)</code>
249 <pre>Modifies the ack deadline for a specific message. This method is useful to indicate that more time is needed to process a message by the subscriber, or to make the message available for redelivery if the processing was interrupted.
250
251Args:
252 subscription: string, A parameter (required)
253 body: object, The request body. (required)
254 The object takes the form of:
255
256{
257 "ackDeadlineSeconds": 42,
258 "ackId": "A String",
259 }
260
261
262Returns:
263 An object of the form:
264
265 {
266 }</pre>
267</div>
268
269<div class="method">
270 <code class="details" id="modifyPushConfig">modifyPushConfig(subscription, body)</code>
271 <pre>Modifies the PushConfig for a specified subscription. This may be used to change a push subscription to a pull one (signified by an empty PushConfig) or vice versa, or change the endpoint URL and other attributes of a push subscription. Messages will accumulate for delivery continuously through the call regardless of changes to the PushConfig.
272
273Args:
274 subscription: string, A parameter (required)
275 body: object, The request body. (required)
276 The object takes the form of:
277
278{
279 "pushConfig": {
280 "attributes": {
281 "a_key": "A String",
282 },
283 "pushEndpoint": "A String",
284 },
285 }
286
287
288Returns:
289 An object of the form:
290
291 {
292 }</pre>
293</div>
294
295<div class="method">
296 <code class="details" id="pull">pull(subscription, body)</code>
297 <pre>Pulls messages from the server. Returns an empty list if there are no messages available in the backlog. The server may return UNAVAILABLE if there are too many concurrent pull requests pending for the given subscription.
298
299Args:
300 subscription: string, A parameter (required)
301 body: object, The request body. (required)
302 The object takes the form of:
303
304{
305 "returnImmediately": True or False,
306 "maxMessages": 42,
307 }
308
309
310Returns:
311 An object of the form:
312
313 {
314 "receivedMessages": [
315 {
316 "ackId": "A String",
317 "message": {
318 "attributes": {
319 "a_key": "A String",
320 },
321 "data": "A String",
322 "messageId": "A String",
323 },
324 },
325 ],
326 }</pre>
327</div>
328
329</body></html>