blob: 3261e3aa61619cf9c658c4030761c5aee1d61ec6 [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 #
141 # For pull delivery, this value is used as the initial value for the Ack deadline. It may be overridden for a specific pull request (message) 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).
142 "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 #
158 # For pull delivery, this value is used as the initial value for the Ack deadline. It may be overridden for a specific pull request (message) 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).
159 "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 #
191 # For pull delivery, this value is used as the initial value for the Ack deadline. It may be overridden for a specific pull request (message) 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).
192 "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 #
220 # For pull delivery, this value is used as the initial value for the Ack deadline. It may be overridden for a specific pull request (message) 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).
221 "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.
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700254 "ackDeadlineSeconds": 42, # The new Ack deadline. Must be >= 0.
Craig Citroe633be12015-03-02 13:40:36 -0800255 "ackId": "A String", # The acknowledgment ID.
Craig Citro065b5302014-08-14 00:47:23 -0700256 "subscription": "A String", # The name of the subscription from which messages are being pulled.
257 }
258
259</pre>
260</div>
261
262<div class="method">
263 <code class="details" id="modifyPushConfig">modifyPushConfig(body)</code>
Craig Citroe633be12015-03-02 13:40:36 -0800264 <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 -0700265
266Args:
267 body: object, The request body. (required)
268 The object takes the form of:
269
Craig Citroe633be12015-03-02 13:40:36 -0800270{ # Request for the ModifyPushConfig method.
Craig Citro065b5302014-08-14 00:47:23 -0700271 "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.
272 "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".
273 },
274 "subscription": "A String", # The name of the subscription.
275 }
276
277</pre>
278</div>
279
280<div class="method">
281 <code class="details" id="pull">pull(body)</code>
282 <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).
283
284Args:
285 body: object, The request body. (required)
286 The object takes the form of:
287
Craig Citroe633be12015-03-02 13:40:36 -0800288{ # Request for the Pull method.
Craig Citro065b5302014-08-14 00:47:23 -0700289 "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.
290 "subscription": "A String", # The subscription from which a message should be pulled.
291 }
292
293
294Returns:
295 An object of the form:
296
297 { # Either a PubsubMessage or a truncation event. One of these two must be populated.
298 "pubsubEvent": { # An event indicating a received message or truncation event. # A pubsub message or truncation event.
299 "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.)
300 "message": { # A message data and its labels. # A received message.
Craig Citroe633be12015-03-02 13:40:36 -0800301 "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 -0700302 "data": "A String", # The message payload.
303 "label": [ # Optional list of labels for this message. Keys in this collection must be unique.
304 { # A key-value pair applied to a given object.
305 "numValue": "A String", # An integer value.
306 "strValue": "A String", # A string value.
307 "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.
308 #
309 # Keys are defined by the following grammar:
310 #
311 # key = hostname "/" kpath kpath = ksegment *[ "/" ksegment ] ksegment = alphadigit | *[ alphadigit | "-" | "_" | "." ]
312 #
313 # where "hostname" and "alphadigit" are defined as in RFC 1738.
314 #
315 # Example key: spanner.google.com/universe
316 },
317 ],
318 },
319 "truncated": True or False, # Indicates that this subscription has been truncated.
320 "subscription": "A String", # The subscription that received the event.
321 },
322 "ackId": "A String", # This ID must be used to acknowledge the received event or message.
323 }</pre>
324</div>
325
Craig Citroe633be12015-03-02 13:40:36 -0800326<div class="method">
327 <code class="details" id="pullBatch">pullBatch(body)</code>
328 <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.
329
330Args:
331 body: object, The request body. (required)
332 The object takes the form of:
333
334{ # Request for the PullBatch method.
335 "maxEvents": 42, # The maximum number of PubsubEvents returned for this request. The Pub/Sub system may return fewer than the number of events specified.
336 "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.
337 "subscription": "A String", # The subscription from which messages should be pulled.
338 }
339
340
341Returns:
342 An object of the form:
343
344 { # Response for the PullBatch method.
345 "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.
346 { # Either a PubsubMessage or a truncation event. One of these two must be populated.
347 "pubsubEvent": { # An event indicating a received message or truncation event. # A pubsub message or truncation event.
348 "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.)
349 "message": { # A message data and its labels. # A received message.
350 "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.
351 "data": "A String", # The message payload.
352 "label": [ # Optional list of labels for this message. Keys in this collection must be unique.
353 { # A key-value pair applied to a given object.
354 "numValue": "A String", # An integer value.
355 "strValue": "A String", # A string value.
356 "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.
357 #
358 # Keys are defined by the following grammar:
359 #
360 # key = hostname "/" kpath kpath = ksegment *[ "/" ksegment ] ksegment = alphadigit | *[ alphadigit | "-" | "_" | "." ]
361 #
362 # where "hostname" and "alphadigit" are defined as in RFC 1738.
363 #
364 # Example key: spanner.google.com/universe
365 },
366 ],
367 },
368 "truncated": True or False, # Indicates that this subscription has been truncated.
369 "subscription": "A String", # The subscription that received the event.
370 },
371 "ackId": "A String", # This ID must be used to acknowledge the received event or message.
372 },
373 ],
374 }</pre>
375</div>
376
Craig Citro065b5302014-08-14 00:47:23 -0700377</body></html>