-
Notifications
You must be signed in to change notification settings - Fork 0
/
pubsub-api.json
594 lines (594 loc) · 19.7 KB
/
pubsub-api.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
{
"kind": "discovery#restDescription",
"etag": "\"FrPV2U6xXFUq8eRv_PO3IoAURkc/cp0KDkMehu3SqUw99RgMeyF5zdU\"",
"discoveryVersion": "v1",
"id": "pubsub:v1beta1",
"name": "pubsub",
"version": "v1beta1",
"title": "Cloud Pub/Sub API",
"description": "Provides reliable, many-to-many, asynchronous messaging between applications.",
"ownerDomain": "google.com",
"ownerName": "Google",
"icons": {
"x16": "http://www.google.com/images/icons/product/search-16.gif",
"x32": "http://www.google.com/images/icons/product/search-32.gif"
},
"documentationLink": "https://developers.google.com/pubsub/v1beta1",
"labels": [
"limited_availability"
],
"protocol": "rest",
"baseUrl": "https://www.googleapis.com/pubsub/v1beta1/",
"basePath": "/pubsub/v1beta1/",
"rootUrl": "https://www.googleapis.com/",
"servicePath": "pubsub/v1beta1/",
"batchPath": "batch",
"parameters": {
"alt": {
"type": "string",
"description": "Data format for the response.",
"default": "json",
"enum": [
"json"
],
"enumDescriptions": [
"Responses with Content-Type of application/json"
],
"location": "query"
},
"fields": {
"type": "string",
"description": "Selector specifying which fields to include in a partial response.",
"location": "query"
},
"key": {
"type": "string",
"description": "API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.",
"location": "query"
},
"oauth_token": {
"type": "string",
"description": "OAuth 2.0 token for the current user.",
"location": "query"
},
"prettyPrint": {
"type": "boolean",
"description": "Returns response with indentations and line breaks.",
"default": "true",
"location": "query"
},
"quotaUser": {
"type": "string",
"description": "Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided.",
"location": "query"
},
"userIp": {
"type": "string",
"description": "IP address of the site where the request originates. Use this if you want to enforce per-user limits.",
"location": "query"
}
},
"auth": {
"oauth2": {
"scopes": {
"https://www.googleapis.com/auth/cloud-platform": {
"description": "View and manage your data across Google Cloud Platform services"
},
"https://www.googleapis.com/auth/pubsub": {
"description": "View and manage Pub/Sub topics and subscriptions"
}
}
}
},
"schemas": {
"AcknowledgeRequest": {
"id": "AcknowledgeRequest",
"type": "object",
"externalTypeName": "tech.pubsub.AcknowledgeRequest",
"properties": {
"ackId": {
"type": "array",
"description": "The Ack ID for the message being acknowledged. This was returned by the Pub/Sub system in the Pull response.",
"items": {
"type": "string"
}
},
"subscription": {
"type": "string",
"description": "The subscription whose message is being acknowledged."
}
}
},
"Label": {
"id": "Label",
"type": "object",
"description": "A key-value pair applied to a given object.",
"externalTypeName": "tech.label.Label",
"properties": {
"key": {
"type": "string",
"description": "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.\n\nKeys are defined by the following grammar:\n\nkey = hostname \"/\" kpath kpath = ksegment *[ \"/\" ksegment ] ksegment = alphadigit | *[ alphadigit | \"-\" | \"_\" | \".\" ]\n\nwhere \"hostname\" and \"alphadigit\" are defined as in RFC 1738.\n\nExample key: spanner.google.com/universe"
},
"numValue": {
"type": "string",
"format": "int64"
},
"strValue": {
"type": "string"
}
}
},
"ListSubscriptionsResponse": {
"id": "ListSubscriptionsResponse",
"type": "object",
"externalTypeName": "tech.pubsub.ListSubscriptionsResponse",
"properties": {
"nextPageToken": {
"type": "string",
"description": "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."
},
"subscription": {
"type": "array",
"description": "The subscriptions that match the request.",
"items": {
"$ref": "Subscription"
}
}
}
},
"ListTopicsResponse": {
"id": "ListTopicsResponse",
"type": "object",
"externalTypeName": "tech.pubsub.ListTopicsResponse",
"properties": {
"nextPageToken": {
"type": "string",
"description": "If not empty, indicates that there are more topics that match the request, and this value should be passed to the next ListTopicsRequest to continue."
},
"topic": {
"type": "array",
"description": "The resulting topics.",
"items": {
"$ref": "Topic"
}
}
}
},
"ModifyAckDeadlineRequest": {
"id": "ModifyAckDeadlineRequest",
"type": "object",
"externalTypeName": "tech.pubsub.ModifyAckDeadlineRequest",
"properties": {
"ackDeadlineSeconds": {
"type": "integer",
"description": "The new Ack deadline. Must be \u003e= 1.",
"format": "int32"
},
"ackId": {
"type": "string",
"description": "The Ack ID."
},
"subscription": {
"type": "string",
"description": "The name of the subscription from which messages are being pulled."
}
}
},
"ModifyPushConfigRequest": {
"id": "ModifyPushConfigRequest",
"type": "object",
"externalTypeName": "tech.pubsub.ModifyPushConfigRequest",
"properties": {
"pushConfig": {
"$ref": "PushConfig",
"description": "An empty push_config indicates that the Pub/Sub system should pause pushing messages from the given subscription."
},
"subscription": {
"type": "string",
"description": "The name of the subscription."
}
}
},
"PublishRequest": {
"id": "PublishRequest",
"type": "object",
"externalTypeName": "tech.pubsub.PublishRequest",
"properties": {
"message": {
"$ref": "PubsubMessage",
"description": "The message to publish."
},
"topic": {
"type": "string",
"description": "The name of the topic for which the message is being added."
}
}
},
"PubsubEvent": {
"id": "PubsubEvent",
"type": "object",
"description": "An event indicating a received message or truncation event.",
"externalTypeName": "tech.pubsub.PubsubEvent",
"properties": {
"deleted": {
"type": "boolean",
"description": "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.)"
},
"message": {
"$ref": "PubsubMessage",
"description": "A received message."
},
"subscription": {
"type": "string",
"description": "The subscription that received the event."
},
"truncated": {
"type": "boolean",
"description": "Indicates that this subscription has been truncated."
}
}
},
"PubsubMessage": {
"id": "PubsubMessage",
"type": "object",
"description": "A message data and its labels.",
"externalTypeName": "tech.pubsub.PubsubMessage",
"properties": {
"data": {
"type": "string",
"description": "The message payload.",
"format": "byte"
},
"label": {
"type": "array",
"description": "Optional list of labels for this message. Keys in this collection must be unique.",
"items": {
"$ref": "Label"
}
}
}
},
"PullRequest": {
"id": "PullRequest",
"type": "object",
"externalTypeName": "tech.pubsub.PullRequest",
"properties": {
"returnImmediately": {
"type": "boolean",
"description": "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."
},
"subscription": {
"type": "string",
"description": "The subscription from which a message should be pulled."
}
}
},
"PullResponse": {
"id": "PullResponse",
"type": "object",
"description": "Either a PubsubMessage or a truncation event. One of these two must be populated.",
"externalTypeName": "tech.pubsub.PullResponse",
"properties": {
"ackId": {
"type": "string",
"description": "This ID must be used to acknowledge the received event or message."
},
"pubsubEvent": {
"$ref": "PubsubEvent",
"description": "A pubsub message or truncation event."
}
}
},
"PushConfig": {
"id": "PushConfig",
"type": "object",
"description": "Configuration for a push delivery endpoint.",
"externalTypeName": "tech.pubsub.PushConfig",
"properties": {
"pushEndpoint": {
"type": "string",
"description": "A URL locating the endpoint to which messages should be pushed. For example, a Webhook endpoint might use \"https://example.com/push\"."
}
}
},
"Subscription": {
"id": "Subscription",
"type": "object",
"description": "A subscription resource.",
"externalTypeName": "tech.pubsub.Subscription",
"properties": {
"ackDeadlineSeconds": {
"type": "integer",
"description": "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.\n\nFor push delivery, this value is used to set the request timeout for the call to the push endpoint.\n\nFor 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).",
"format": "int32"
},
"name": {
"type": "string",
"description": "Name of the subscription."
},
"pushConfig": {
"$ref": "PushConfig",
"description": "If push delivery is used with this subscription, this field is used to configure it."
},
"topic": {
"type": "string",
"description": "The name of the topic from which this subscription is receiving messages."
}
}
},
"Topic": {
"id": "Topic",
"type": "object",
"description": "A topic resource.",
"externalTypeName": "tech.pubsub.Topic",
"properties": {
"name": {
"type": "string",
"description": "Name of the topic."
}
}
}
},
"resources": {
"subscriptions": {
"methods": {
"acknowledge": {
"id": "pubsub.subscriptions.acknowledge",
"path": "subscriptions/acknowledge",
"httpMethod": "POST",
"description": "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.",
"request": {
"$ref": "AcknowledgeRequest"
},
"scopes": [
"https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/pubsub"
]
},
"create": {
"id": "pubsub.subscriptions.create",
"path": "subscriptions",
"httpMethod": "POST",
"description": "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.",
"request": {
"$ref": "Subscription"
},
"response": {
"$ref": "Subscription"
},
"scopes": [
"https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/pubsub"
]
},
"delete": {
"id": "pubsub.subscriptions.delete",
"path": "subscriptions/{+subscription}",
"httpMethod": "DELETE",
"description": "Deletes an existing subscription. All pending messages in the subscription are immediately dropped. Calls to Pull after deletion will return NOT_FOUND.",
"parameters": {
"subscription": {
"type": "string",
"description": "The subscription to delete.",
"required": true,
"location": "path"
}
},
"parameterOrder": [
"subscription"
],
"scopes": [
"https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/pubsub"
]
},
"get": {
"id": "pubsub.subscriptions.get",
"path": "subscriptions/{+subscription}",
"httpMethod": "GET",
"description": "Gets the configuration details of a subscription.",
"parameters": {
"subscription": {
"type": "string",
"description": "The name of the subscription to get.",
"required": true,
"location": "path"
}
},
"parameterOrder": [
"subscription"
],
"response": {
"$ref": "Subscription"
},
"scopes": [
"https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/pubsub"
]
},
"list": {
"id": "pubsub.subscriptions.list",
"path": "subscriptions",
"httpMethod": "GET",
"description": "Lists matching subscriptions.",
"parameters": {
"maxResults": {
"type": "integer",
"description": "Maximum number of subscriptions to return.",
"format": "int32",
"location": "query"
},
"pageToken": {
"type": "string",
"description": "The value obtained in the last ListSubscriptionsResponse for continuation.",
"location": "query"
},
"query": {
"type": "string",
"description": "A valid label query expression.",
"location": "query"
}
},
"response": {
"$ref": "ListSubscriptionsResponse"
},
"scopes": [
"https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/pubsub"
]
},
"modifyAckDeadline": {
"id": "pubsub.subscriptions.modifyAckDeadline",
"path": "subscriptions/modifyAckDeadline",
"httpMethod": "POST",
"description": "Modifies the Ack deadline for a message received from a pull request.",
"request": {
"$ref": "ModifyAckDeadlineRequest"
},
"scopes": [
"https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/pubsub"
]
},
"modifyPushConfig": {
"id": "pubsub.subscriptions.modifyPushConfig",
"path": "subscriptions/modifyPushConfig",
"httpMethod": "POST",
"description": "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.",
"request": {
"$ref": "ModifyPushConfigRequest"
},
"scopes": [
"https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/pubsub"
]
},
"pull": {
"id": "pubsub.subscriptions.pull",
"path": "subscriptions/pull",
"httpMethod": "POST",
"description": "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).",
"request": {
"$ref": "PullRequest"
},
"response": {
"$ref": "PullResponse"
},
"scopes": [
"https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/pubsub"
]
}
}
},
"topics": {
"methods": {
"create": {
"id": "pubsub.topics.create",
"path": "topics",
"httpMethod": "POST",
"description": "Creates the given topic with the given name.",
"request": {
"$ref": "Topic"
},
"response": {
"$ref": "Topic"
},
"scopes": [
"https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/pubsub"
]
},
"delete": {
"id": "pubsub.topics.delete",
"path": "topics/{+topic}",
"httpMethod": "DELETE",
"description": "Deletes the topic with the given name. All subscriptions to this topic are also deleted. Returns NOT_FOUND if the topic does not exist. After a topic is deleted, a new topic may be created with the same name.",
"parameters": {
"topic": {
"type": "string",
"description": "Name of the topic to delete.",
"required": true,
"location": "path"
}
},
"parameterOrder": [
"topic"
],
"scopes": [
"https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/pubsub"
]
},
"get": {
"id": "pubsub.topics.get",
"path": "topics/{+topic}",
"httpMethod": "GET",
"description": "Gets the configuration of a topic. Since the topic only has the name attribute, this method is only useful to check the existence of a topic. If other attributes are added in the future, they will be returned here.",
"parameters": {
"topic": {
"type": "string",
"description": "The name of the topic to get.",
"required": true,
"location": "path"
}
},
"parameterOrder": [
"topic"
],
"response": {
"$ref": "Topic"
},
"scopes": [
"https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/pubsub"
]
},
"list": {
"id": "pubsub.topics.list",
"path": "topics",
"httpMethod": "GET",
"description": "Lists matching topics.",
"parameters": {
"maxResults": {
"type": "integer",
"description": "Maximum number of topics to return.",
"format": "int32",
"location": "query"
},
"pageToken": {
"type": "string",
"description": "The value obtained in the last ListTopicsResponse for continuation.",
"location": "query"
},
"query": {
"type": "string",
"description": "A valid label query expression.",
"location": "query"
}
},
"response": {
"$ref": "ListTopicsResponse"
},
"scopes": [
"https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/pubsub"
]
},
"publish": {
"id": "pubsub.topics.publish",
"path": "topics/publish",
"httpMethod": "POST",
"description": "Adds a message to the topic. Returns NOT_FOUND if the topic does not exist.",
"request": {
"$ref": "PublishRequest"
},
"scopes": [
"https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/pubsub"
]
}
}
}
}
}