blob: 929a0c6339297712ac160fbc3e73bd6754af4988 [file] [log] [blame]
Craig Citro065b5302014-08-14 00:47:23 -07001<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
Craig Citroe633be12015-03-02 13:40:36 -080075<h1><a href="pubsub_v1beta1.html">Google Cloud Pub/Sub API</a> . <a href="pubsub_v1beta1.subscriptions.html">subscriptions</a></h1>
Craig Citro065b5302014-08-14 00:47:23 -070076<h2>Instance Methods</h2>
77<p class="toc_element">
78 <code><a href="#acknowledge">acknowledge(body)</a></code></p>
79<p class="firstline">Acknowledges a particular received message: the Pub/Sub system can remove the given message from the subscription. Acknowledging a message whose Ack deadline has expired may succeed, but the message could have been already redelivered. Acknowledging a message more than once will not result in an error. This is only used for messages received via pull.</p>
80<p class="toc_element">
81 <code><a href="#create">create(body)</a></code></p>
82<p class="firstline">Creates a subscription on 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.</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.</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(pageToken=None, maxResults=None, query=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(body)</a></code></p>
97<p class="firstline">Modifies the Ack deadline for a message received from a pull request.</p>
98<p class="toc_element">
99 <code><a href="#modifyPushConfig">modifyPushConfig(body)</a></code></p>
Craig Citroe633be12015-03-02 13:40:36 -0800100<p class="firstline">Modifies the PushConfig for a specified subscription. This method can be used to suspend the flow of messages to an endpoint by clearing the PushConfig field in the request. Messages will be accumulated for delivery even if no push configuration is defined or while the configuration is modified.</p>
Craig Citro065b5302014-08-14 00:47:23 -0700101<p class="toc_element">
102 <code><a href="#pull">pull(body)</a></code></p>
103<p class="firstline">Pulls a single message from the server. If return_immediately is true, and no messages are available in the subscription, this method returns FAILED_PRECONDITION. The system is free to return an UNAVAILABLE error if no messages are available in a reasonable amount of time (to reduce system load).</p>
Craig Citroe633be12015-03-02 13:40:36 -0800104<p class="toc_element">
105 <code><a href="#pullBatch">pullBatch(body)</a></code></p>
106<p class="firstline">Pulls messages from the server. Returns an empty list if there are no messages available in the backlog. The system is free to return UNAVAILABLE if there are too many pull requests outstanding for the given subscription.</p>
Craig Citro065b5302014-08-14 00:47:23 -0700107<h3>Method Details</h3>
108<div class="method">
109 <code class="details" id="acknowledge">acknowledge(body)</code>
110 <pre>Acknowledges a particular received message: the Pub/Sub system can remove the given message from the subscription. Acknowledging a message whose Ack deadline has expired may succeed, but the message could have been already redelivered. Acknowledging a message more than once will not result in an error. This is only used for messages received via pull.
111
112Args:
113 body: object, The request body. (required)
114 The object takes the form of:
115
Craig Citroe633be12015-03-02 13:40:36 -0800116{ # Request for the Acknowledge method.
117 "ackId": [ # The acknowledgment ID for the message being acknowledged. This was returned by the Pub/Sub system in the Pull response.
Craig Citro065b5302014-08-14 00:47:23 -0700118 "A String",
119 ],
120 "subscription": "A String", # The subscription whose message is being acknowledged.
121 }
122
123</pre>
124</div>
125
126<div class="method">
127 <code class="details" id="create">create(body)</code>
128 <pre>Creates a subscription on 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.
129
Craig Citroe633be12015-03-02 13:40:36 -0800130If 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
Craig Citro065b5302014-08-14 00:47:23 -0700132Args:
133 body: object, The request body. (required)
134 The object takes the form of:
135
136{ # A subscription resource.
137 "ackDeadlineSeconds": 42, # For either push or pull delivery, the value is the maximum time after a subscriber receives a message before the subscriber should acknowledge or Nack the message. If the Ack deadline for a message passes without an Ack or a Nack, the Pub/Sub system will eventually redeliver the message. If a subscriber acknowledges after the deadline, the Pub/Sub system may accept the Ack, but it is possible that the message has been already delivered again. Multiple Acks to the message are allowed and will succeed.
138 #
139 # For push delivery, this value is used to set the request timeout for the call to the push endpoint.
140 #
Nathaniel Manista4f877e52015-06-15 16:44:50 +0000141 # For pull delivery, this value is used as the initial value for the Ack deadline. It may be overridden for each message using its corresponding ack_id with ModifyAckDeadline. While a message is outstanding (i.e. it has been delivered to a pull subscriber and the subscriber has not yet Acked or Nacked), the Pub/Sub system will not deliver that message to another pull subscriber (on a best-effort basis).
Craig Citro065b5302014-08-14 00:47:23 -0700142 "topic": "A String", # The name of the topic from which this subscription is receiving messages.
143 "pushConfig": { # Configuration for a push delivery endpoint. # If push delivery is used with this subscription, this field is used to configure it.
144 "pushEndpoint": "A String", # A URL locating the endpoint to which messages should be pushed. For example, a Webhook endpoint might use "https://example.com/push".
145 },
146 "name": "A String", # Name of the subscription.
147}
148
149
150Returns:
151 An object of the form:
152
153 { # A subscription resource.
154 "ackDeadlineSeconds": 42, # For either push or pull delivery, the value is the maximum time after a subscriber receives a message before the subscriber should acknowledge or Nack the message. If the Ack deadline for a message passes without an Ack or a Nack, the Pub/Sub system will eventually redeliver the message. If a subscriber acknowledges after the deadline, the Pub/Sub system may accept the Ack, but it is possible that the message has been already delivered again. Multiple Acks to the message are allowed and will succeed.
155 #
156 # For push delivery, this value is used to set the request timeout for the call to the push endpoint.
157 #
Nathaniel Manista4f877e52015-06-15 16:44:50 +0000158 # For pull delivery, this value is used as the initial value for the Ack deadline. It may be overridden for each message using its corresponding ack_id with ModifyAckDeadline. While a message is outstanding (i.e. it has been delivered to a pull subscriber and the subscriber has not yet Acked or Nacked), the Pub/Sub system will not deliver that message to another pull subscriber (on a best-effort basis).
Craig Citro065b5302014-08-14 00:47:23 -0700159 "topic": "A String", # The name of the topic from which this subscription is receiving messages.
160 "pushConfig": { # Configuration for a push delivery endpoint. # If push delivery is used with this subscription, this field is used to configure it.
161 "pushEndpoint": "A String", # A URL locating the endpoint to which messages should be pushed. For example, a Webhook endpoint might use "https://example.com/push".
162 },
163 "name": "A String", # Name of the subscription.
164 }</pre>
165</div>
166
167<div class="method">
168 <code class="details" id="delete">delete(subscription)</code>
169 <pre>Deletes an existing subscription. All pending messages in the subscription are immediately dropped. Calls to Pull after deletion will return NOT_FOUND.
170
171Args:
172 subscription: string, The subscription to delete. (required)
173</pre>
174</div>
175
176<div class="method">
177 <code class="details" id="get">get(subscription)</code>
178 <pre>Gets the configuration details of a subscription.
179
180Args:
181 subscription: string, The name of the subscription to get. (required)
182
183Returns:
184 An object of the form:
185
186 { # A subscription resource.
187 "ackDeadlineSeconds": 42, # For either push or pull delivery, the value is the maximum time after a subscriber receives a message before the subscriber should acknowledge or Nack the message. If the Ack deadline for a message passes without an Ack or a Nack, the Pub/Sub system will eventually redeliver the message. If a subscriber acknowledges after the deadline, the Pub/Sub system may accept the Ack, but it is possible that the message has been already delivered again. Multiple Acks to the message are allowed and will succeed.
188 #
189 # For push delivery, this value is used to set the request timeout for the call to the push endpoint.
190 #
Nathaniel Manista4f877e52015-06-15 16:44:50 +0000191 # For pull delivery, this value is used as the initial value for the Ack deadline. It may be overridden for each message using its corresponding ack_id with ModifyAckDeadline. While a message is outstanding (i.e. it has been delivered to a pull subscriber and the subscriber has not yet Acked or Nacked), the Pub/Sub system will not deliver that message to another pull subscriber (on a best-effort basis).
Craig Citro065b5302014-08-14 00:47:23 -0700192 "topic": "A String", # The name of the topic from which this subscription is receiving messages.
193 "pushConfig": { # Configuration for a push delivery endpoint. # If push delivery is used with this subscription, this field is used to configure it.
194 "pushEndpoint": "A String", # A URL locating the endpoint to which messages should be pushed. For example, a Webhook endpoint might use "https://example.com/push".
195 },
196 "name": "A String", # Name of the subscription.
197 }</pre>
198</div>
199
200<div class="method">
201 <code class="details" id="list">list(pageToken=None, maxResults=None, query=None)</code>
202 <pre>Lists matching subscriptions.
203
204Args:
205 pageToken: string, The value obtained in the last ListSubscriptionsResponse for continuation.
206 maxResults: integer, Maximum number of subscriptions to return.
207 query: string, A valid label query expression.
208
209Returns:
210 An object of the form:
211
Craig Citroe633be12015-03-02 13:40:36 -0800212 { # Response for the ListSubscriptions method.
Craig Citro065b5302014-08-14 00:47:23 -0700213 "nextPageToken": "A String", # If not empty, indicates that there are more subscriptions that match the request and this value should be passed to the next ListSubscriptionsRequest to continue.
214 "subscription": [ # The subscriptions that match the request.
215 { # A subscription resource.
216 "ackDeadlineSeconds": 42, # For either push or pull delivery, the value is the maximum time after a subscriber receives a message before the subscriber should acknowledge or Nack the message. If the Ack deadline for a message passes without an Ack or a Nack, the Pub/Sub system will eventually redeliver the message. If a subscriber acknowledges after the deadline, the Pub/Sub system may accept the Ack, but it is possible that the message has been already delivered again. Multiple Acks to the message are allowed and will succeed.
217 #
218 # For push delivery, this value is used to set the request timeout for the call to the push endpoint.
219 #
Nathaniel Manista4f877e52015-06-15 16:44:50 +0000220 # For pull delivery, this value is used as the initial value for the Ack deadline. It may be overridden for each message using its corresponding ack_id with ModifyAckDeadline. While a message is outstanding (i.e. it has been delivered to a pull subscriber and the subscriber has not yet Acked or Nacked), the Pub/Sub system will not deliver that message to another pull subscriber (on a best-effort basis).
Craig Citro065b5302014-08-14 00:47:23 -0700221 "topic": "A String", # The name of the topic from which this subscription is receiving messages.
222 "pushConfig": { # Configuration for a push delivery endpoint. # If push delivery is used with this subscription, this field is used to configure it.
223 "pushEndpoint": "A String", # A URL locating the endpoint to which messages should be pushed. For example, a Webhook endpoint might use "https://example.com/push".
224 },
225 "name": "A String", # Name of the subscription.
226 },
227 ],
228 }</pre>
229</div>
230
231<div class="method">
232 <code class="details" id="list_next">list_next(previous_request, previous_response)</code>
233 <pre>Retrieves the next page of results.
234
235Args:
236 previous_request: The request for the previous page. (required)
237 previous_response: The response from the request for the previous page. (required)
238
239Returns:
240 A request object that you can call 'execute()' on to request the next
241 page. Returns None if there are no more items in the collection.
242 </pre>
243</div>
244
245<div class="method">
246 <code class="details" id="modifyAckDeadline">modifyAckDeadline(body)</code>
247 <pre>Modifies the Ack deadline for a message received from a pull request.
248
249Args:
250 body: object, The request body. (required)
251 The object takes the form of:
252
Craig Citroe633be12015-03-02 13:40:36 -0800253{ # Request for the ModifyAckDeadline method.
Nathaniel Manista4f877e52015-06-15 16:44:50 +0000254 "ackDeadlineSeconds": 42, # The new ack deadline with respect to the time this request was sent to the Pub/Sub system. Must be >= 0. For example, if the value is 10, the new ack deadline will expire 10 seconds after the ModifyAckDeadline call was made. Specifying zero may immediately make the message available for another pull request.
255 "ackId": "A String", # The acknowledgment ID. Either this or ack_ids must be populated, not both.
256 "subscription": "A String", # Next Index: 5 The name of the subscription from which messages are being pulled.
257 "ackIds": [ # List of acknowledgment IDs. Either this field or ack_id should be populated, not both. TODO(handrei): mark the above field deprecated once it's not used internally.
258 "A String",
259 ],
Craig Citro065b5302014-08-14 00:47:23 -0700260 }
261
262</pre>
263</div>
264
265<div class="method">
266 <code class="details" id="modifyPushConfig">modifyPushConfig(body)</code>
Craig Citroe633be12015-03-02 13:40:36 -0800267 <pre>Modifies the PushConfig for a specified subscription. This method can be used to suspend the flow of messages to an endpoint by clearing the PushConfig field in the request. Messages will be accumulated for delivery even if no push configuration is defined or while the configuration is modified.
Craig Citro065b5302014-08-14 00:47:23 -0700268
269Args:
270 body: object, The request body. (required)
271 The object takes the form of:
272
Craig Citroe633be12015-03-02 13:40:36 -0800273{ # Request for the ModifyPushConfig method.
Craig Citro065b5302014-08-14 00:47:23 -0700274 "pushConfig": { # Configuration for a push delivery endpoint. # An empty push_config indicates that the Pub/Sub system should pause pushing messages from the given subscription.
275 "pushEndpoint": "A String", # A URL locating the endpoint to which messages should be pushed. For example, a Webhook endpoint might use "https://example.com/push".
276 },
277 "subscription": "A String", # The name of the subscription.
278 }
279
280</pre>
281</div>
282
283<div class="method">
284 <code class="details" id="pull">pull(body)</code>
285 <pre>Pulls a single message from the server. If return_immediately is true, and no messages are available in the subscription, this method returns FAILED_PRECONDITION. The system is free to return an UNAVAILABLE error if no messages are available in a reasonable amount of time (to reduce system load).
286
287Args:
288 body: object, The request body. (required)
289 The object takes the form of:
290
Craig Citroe633be12015-03-02 13:40:36 -0800291{ # Request for the Pull method.
Craig Citro065b5302014-08-14 00:47:23 -0700292 "returnImmediately": True or False, # If this is specified as true the system will respond immediately even if it is not able to return a message in the Pull response. Otherwise the system is allowed to wait until at least one message is available rather than returning FAILED_PRECONDITION. The client may cancel the request if it does not wish to wait any longer for the response.
293 "subscription": "A String", # The subscription from which a message should be pulled.
294 }
295
296
297Returns:
298 An object of the form:
299
300 { # Either a PubsubMessage or a truncation event. One of these two must be populated.
301 "pubsubEvent": { # An event indicating a received message or truncation event. # A pubsub message or truncation event.
302 "deleted": True or False, # Indicates that this subscription has been deleted. (Note that pull subscribers will always receive NOT_FOUND in response in their pull request on the subscription, rather than seeing this boolean.)
303 "message": { # A message data and its labels. # A received message.
Craig Citroe633be12015-03-02 13:40:36 -0800304 "messageId": "A String", # ID of this message assigned by the server at publication time. Guaranteed to be unique within the topic. This value may be read by a subscriber that receives a PubsubMessage via a Pull call or a push delivery. It must not be populated by a publisher in a Publish call.
Craig Citro065b5302014-08-14 00:47:23 -0700305 "data": "A String", # The message payload.
306 "label": [ # Optional list of labels for this message. Keys in this collection must be unique.
307 { # A key-value pair applied to a given object.
308 "numValue": "A String", # An integer value.
309 "strValue": "A String", # A string value.
310 "key": "A String", # The key of a label is a syntactically valid URL (as per RFC 1738) with the "scheme" and initial slashes omitted and with the additional restrictions noted below. Each key should be globally unique. The "host" portion is called the "namespace" and is not necessarily resolvable to a network endpoint. Instead, the namespace indicates what system or entity defines the semantics of the label. Namespaces do not restrict the set of objects to which a label may be associated.
311 #
312 # Keys are defined by the following grammar:
313 #
314 # key = hostname "/" kpath kpath = ksegment *[ "/" ksegment ] ksegment = alphadigit | *[ alphadigit | "-" | "_" | "." ]
315 #
316 # where "hostname" and "alphadigit" are defined as in RFC 1738.
317 #
318 # Example key: spanner.google.com/universe
319 },
320 ],
321 },
322 "truncated": True or False, # Indicates that this subscription has been truncated.
323 "subscription": "A String", # The subscription that received the event.
324 },
325 "ackId": "A String", # This ID must be used to acknowledge the received event or message.
326 }</pre>
327</div>
328
Craig Citroe633be12015-03-02 13:40:36 -0800329<div class="method">
330 <code class="details" id="pullBatch">pullBatch(body)</code>
331 <pre>Pulls messages from the server. Returns an empty list if there are no messages available in the backlog. The system is free to return UNAVAILABLE if there are too many pull requests outstanding for the given subscription.
332
333Args:
334 body: object, The request body. (required)
335 The object takes the form of:
336
337{ # Request for the PullBatch method.
338 "maxEvents": 42, # The maximum number of PubsubEvents returned for this request. The Pub/Sub system may return fewer than the number of events specified.
339 "returnImmediately": True or False, # If this is specified as true the system will respond immediately even if it is not able to return a message in the Pull response. Otherwise the system is allowed to wait until at least one message is available rather than returning no messages. The client may cancel the request if it does not wish to wait any longer for the response.
340 "subscription": "A String", # The subscription from which messages should be pulled.
341 }
342
343
344Returns:
345 An object of the form:
346
347 { # Response for the PullBatch method.
348 "pullResponses": [ # Received Pub/Sub messages or status events. The Pub/Sub system will return zero messages if there are no more messages available in the backlog. The Pub/Sub system may return fewer than the max_events requested even if there are more messages available in the backlog.
349 { # Either a PubsubMessage or a truncation event. One of these two must be populated.
350 "pubsubEvent": { # An event indicating a received message or truncation event. # A pubsub message or truncation event.
351 "deleted": True or False, # Indicates that this subscription has been deleted. (Note that pull subscribers will always receive NOT_FOUND in response in their pull request on the subscription, rather than seeing this boolean.)
352 "message": { # A message data and its labels. # A received message.
353 "messageId": "A String", # ID of this message assigned by the server at publication time. Guaranteed to be unique within the topic. This value may be read by a subscriber that receives a PubsubMessage via a Pull call or a push delivery. It must not be populated by a publisher in a Publish call.
354 "data": "A String", # The message payload.
355 "label": [ # Optional list of labels for this message. Keys in this collection must be unique.
356 { # A key-value pair applied to a given object.
357 "numValue": "A String", # An integer value.
358 "strValue": "A String", # A string value.
359 "key": "A String", # The key of a label is a syntactically valid URL (as per RFC 1738) with the "scheme" and initial slashes omitted and with the additional restrictions noted below. Each key should be globally unique. The "host" portion is called the "namespace" and is not necessarily resolvable to a network endpoint. Instead, the namespace indicates what system or entity defines the semantics of the label. Namespaces do not restrict the set of objects to which a label may be associated.
360 #
361 # Keys are defined by the following grammar:
362 #
363 # key = hostname "/" kpath kpath = ksegment *[ "/" ksegment ] ksegment = alphadigit | *[ alphadigit | "-" | "_" | "." ]
364 #
365 # where "hostname" and "alphadigit" are defined as in RFC 1738.
366 #
367 # Example key: spanner.google.com/universe
368 },
369 ],
370 },
371 "truncated": True or False, # Indicates that this subscription has been truncated.
372 "subscription": "A String", # The subscription that received the event.
373 },
374 "ackId": "A String", # This ID must be used to acknowledge the received event or message.
375 },
376 ],
377 }</pre>
378</div>
379
Craig Citro065b5302014-08-14 00:47:23 -0700380</body></html>