Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 1 | <html><body> |
| 2 | <style> |
| 3 | |
| 4 | body, 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 | |
| 15 | body { |
| 16 | font-size: 13px; |
| 17 | padding: 1em; |
| 18 | } |
| 19 | |
| 20 | h1 { |
| 21 | font-size: 26px; |
| 22 | margin-bottom: 1em; |
| 23 | } |
| 24 | |
| 25 | h2 { |
| 26 | font-size: 24px; |
| 27 | margin-bottom: 1em; |
| 28 | } |
| 29 | |
| 30 | h3 { |
| 31 | font-size: 20px; |
| 32 | margin-bottom: 1em; |
| 33 | margin-top: 1em; |
| 34 | } |
| 35 | |
| 36 | pre, code { |
| 37 | line-height: 1.5; |
| 38 | font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Lucida Console', monospace; |
| 39 | } |
| 40 | |
| 41 | pre { |
| 42 | margin-top: 0.5em; |
| 43 | } |
| 44 | |
| 45 | h1, h2, h3, p { |
| 46 | font-family: Arial, sans serif; |
| 47 | } |
| 48 | |
| 49 | h1, 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_v1beta1.html">Cloud Pub/Sub API</a> . <a href="pubsub_v1beta1.subscriptions.html">subscriptions</a></h1> |
| 76 | <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> |
| 100 | <p class="firstline">Modifies the PushConfig for a specified subscription. This method can be used to suspend the flow of messages to an end point 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> |
| 101 | <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> |
| 104 | <h3>Method Details</h3> |
| 105 | <div class="method"> |
| 106 | <code class="details" id="acknowledge">acknowledge(body)</code> |
| 107 | <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. |
| 108 | |
| 109 | Args: |
| 110 | body: object, The request body. (required) |
| 111 | The object takes the form of: |
| 112 | |
| 113 | { |
| 114 | "ackId": [ # The Ack ID for the message being acknowledged. This was returned by the Pub/Sub system in the Pull response. |
| 115 | "A String", |
| 116 | ], |
| 117 | "subscription": "A String", # The subscription whose message is being acknowledged. |
| 118 | } |
| 119 | |
| 120 | </pre> |
| 121 | </div> |
| 122 | |
| 123 | <div class="method"> |
| 124 | <code class="details" id="create">create(body)</code> |
| 125 | <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. |
| 126 | |
| 127 | Args: |
| 128 | body: object, The request body. (required) |
| 129 | The object takes the form of: |
| 130 | |
| 131 | { # A subscription resource. |
| 132 | "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. |
| 133 | # |
| 134 | # For push delivery, this value is used to set the request timeout for the call to the push endpoint. |
| 135 | # |
| 136 | # 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). |
| 137 | "topic": "A String", # The name of the topic from which this subscription is receiving messages. |
| 138 | "pushConfig": { # Configuration for a push delivery endpoint. # If push delivery is used with this subscription, this field is used to configure it. |
| 139 | "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". |
| 140 | }, |
| 141 | "name": "A String", # Name of the subscription. |
| 142 | } |
| 143 | |
| 144 | |
| 145 | Returns: |
| 146 | An object of the form: |
| 147 | |
| 148 | { # A subscription resource. |
| 149 | "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. |
| 150 | # |
| 151 | # For push delivery, this value is used to set the request timeout for the call to the push endpoint. |
| 152 | # |
| 153 | # 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). |
| 154 | "topic": "A String", # The name of the topic from which this subscription is receiving messages. |
| 155 | "pushConfig": { # Configuration for a push delivery endpoint. # If push delivery is used with this subscription, this field is used to configure it. |
| 156 | "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". |
| 157 | }, |
| 158 | "name": "A String", # Name of the subscription. |
| 159 | }</pre> |
| 160 | </div> |
| 161 | |
| 162 | <div class="method"> |
| 163 | <code class="details" id="delete">delete(subscription)</code> |
| 164 | <pre>Deletes an existing subscription. All pending messages in the subscription are immediately dropped. Calls to Pull after deletion will return NOT_FOUND. |
| 165 | |
| 166 | Args: |
| 167 | subscription: string, The subscription to delete. (required) |
| 168 | </pre> |
| 169 | </div> |
| 170 | |
| 171 | <div class="method"> |
| 172 | <code class="details" id="get">get(subscription)</code> |
| 173 | <pre>Gets the configuration details of a subscription. |
| 174 | |
| 175 | Args: |
| 176 | subscription: string, The name of the subscription to get. (required) |
| 177 | |
| 178 | Returns: |
| 179 | An object of the form: |
| 180 | |
| 181 | { # A subscription resource. |
| 182 | "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. |
| 183 | # |
| 184 | # For push delivery, this value is used to set the request timeout for the call to the push endpoint. |
| 185 | # |
| 186 | # 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). |
| 187 | "topic": "A String", # The name of the topic from which this subscription is receiving messages. |
| 188 | "pushConfig": { # Configuration for a push delivery endpoint. # If push delivery is used with this subscription, this field is used to configure it. |
| 189 | "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". |
| 190 | }, |
| 191 | "name": "A String", # Name of the subscription. |
| 192 | }</pre> |
| 193 | </div> |
| 194 | |
| 195 | <div class="method"> |
| 196 | <code class="details" id="list">list(pageToken=None, maxResults=None, query=None)</code> |
| 197 | <pre>Lists matching subscriptions. |
| 198 | |
| 199 | Args: |
| 200 | pageToken: string, The value obtained in the last ListSubscriptionsResponse for continuation. |
| 201 | maxResults: integer, Maximum number of subscriptions to return. |
| 202 | query: string, A valid label query expression. |
| 203 | |
| 204 | Returns: |
| 205 | An object of the form: |
| 206 | |
| 207 | { |
| 208 | "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. |
| 209 | "subscription": [ # The subscriptions that match the request. |
| 210 | { # A subscription resource. |
| 211 | "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. |
| 212 | # |
| 213 | # For push delivery, this value is used to set the request timeout for the call to the push endpoint. |
| 214 | # |
| 215 | # 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). |
| 216 | "topic": "A String", # The name of the topic from which this subscription is receiving messages. |
| 217 | "pushConfig": { # Configuration for a push delivery endpoint. # If push delivery is used with this subscription, this field is used to configure it. |
| 218 | "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". |
| 219 | }, |
| 220 | "name": "A String", # Name of the subscription. |
| 221 | }, |
| 222 | ], |
| 223 | }</pre> |
| 224 | </div> |
| 225 | |
| 226 | <div class="method"> |
| 227 | <code class="details" id="list_next">list_next(previous_request, previous_response)</code> |
| 228 | <pre>Retrieves the next page of results. |
| 229 | |
| 230 | Args: |
| 231 | previous_request: The request for the previous page. (required) |
| 232 | previous_response: The response from the request for the previous page. (required) |
| 233 | |
| 234 | Returns: |
| 235 | A request object that you can call 'execute()' on to request the next |
| 236 | page. Returns None if there are no more items in the collection. |
| 237 | </pre> |
| 238 | </div> |
| 239 | |
| 240 | <div class="method"> |
| 241 | <code class="details" id="modifyAckDeadline">modifyAckDeadline(body)</code> |
| 242 | <pre>Modifies the Ack deadline for a message received from a pull request. |
| 243 | |
| 244 | Args: |
| 245 | body: object, The request body. (required) |
| 246 | The object takes the form of: |
| 247 | |
| 248 | { |
Craig Citro | 0e5b9bf | 2014-10-15 10:26:14 -0700 | [diff] [blame] | 249 | "ackDeadlineSeconds": 42, # The new Ack deadline. Must be >= 0. |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 250 | "ackId": "A String", # The Ack ID. |
| 251 | "subscription": "A String", # The name of the subscription from which messages are being pulled. |
| 252 | } |
| 253 | |
| 254 | </pre> |
| 255 | </div> |
| 256 | |
| 257 | <div class="method"> |
| 258 | <code class="details" id="modifyPushConfig">modifyPushConfig(body)</code> |
| 259 | <pre>Modifies the PushConfig for a specified subscription. This method can be used to suspend the flow of messages to an end point 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. |
| 260 | |
| 261 | Args: |
| 262 | body: object, The request body. (required) |
| 263 | The object takes the form of: |
| 264 | |
| 265 | { |
| 266 | "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. |
| 267 | "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". |
| 268 | }, |
| 269 | "subscription": "A String", # The name of the subscription. |
| 270 | } |
| 271 | |
| 272 | </pre> |
| 273 | </div> |
| 274 | |
| 275 | <div class="method"> |
| 276 | <code class="details" id="pull">pull(body)</code> |
| 277 | <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). |
| 278 | |
| 279 | Args: |
| 280 | body: object, The request body. (required) |
| 281 | The object takes the form of: |
| 282 | |
| 283 | { |
| 284 | "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. |
| 285 | "subscription": "A String", # The subscription from which a message should be pulled. |
| 286 | } |
| 287 | |
| 288 | |
| 289 | Returns: |
| 290 | An object of the form: |
| 291 | |
| 292 | { # Either a PubsubMessage or a truncation event. One of these two must be populated. |
| 293 | "pubsubEvent": { # An event indicating a received message or truncation event. # A pubsub message or truncation event. |
| 294 | "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.) |
| 295 | "message": { # A message data and its labels. # A received message. |
| 296 | "data": "A String", # The message payload. |
| 297 | "label": [ # Optional list of labels for this message. Keys in this collection must be unique. |
| 298 | { # A key-value pair applied to a given object. |
| 299 | "numValue": "A String", # An integer value. |
| 300 | "strValue": "A String", # A string value. |
| 301 | "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. |
| 302 | # |
| 303 | # Keys are defined by the following grammar: |
| 304 | # |
| 305 | # key = hostname "/" kpath kpath = ksegment *[ "/" ksegment ] ksegment = alphadigit | *[ alphadigit | "-" | "_" | "." ] |
| 306 | # |
| 307 | # where "hostname" and "alphadigit" are defined as in RFC 1738. |
| 308 | # |
| 309 | # Example key: spanner.google.com/universe |
| 310 | }, |
| 311 | ], |
| 312 | }, |
| 313 | "truncated": True or False, # Indicates that this subscription has been truncated. |
| 314 | "subscription": "A String", # The subscription that received the event. |
| 315 | }, |
| 316 | "ackId": "A String", # This ID must be used to acknowledge the received event or message. |
| 317 | }</pre> |
| 318 | </div> |
| 319 | |
| 320 | </body></html> |