-
Notifications
You must be signed in to change notification settings - Fork 4
/
topicStats.clj
105 lines (86 loc) · 3.2 KB
/
topicStats.clj
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
(ns happygapi.pubsublite.topicStats
"Pub/Sub Lite API: topicStats.
See: https://cloud.google.com/pubsub/lite/docsapi/reference/rest/v1/topicStats"
(:require [cheshire.core :as json]
[clj-http.client :as http]
[happy.util :as util]))
(defn projects-locations-topics-computeMessageStats$
"https://cloud.google.com/pubsub/lite/docsapi/reference/rest/v1/topicStats/projects/locations/topics/computeMessageStats
Required parameters: topic
Optional parameters: none
Body:
{:partition string,
:startCursor {:offset string},
:endCursor {:offset string}}
Compute statistics about a range of messages in a given topic and partition."
{:scopes ["https://www.googleapis.com/auth/cloud-platform"]}
[auth parameters body]
{:pre [(util/has-keys? parameters #{:topic})]}
(util/get-response
(http/post
(util/get-url
"https://pubsublite.googleapis.com/"
"v1/topicStats/{+topic}:computeMessageStats"
#{:topic}
parameters)
(merge-with
merge
{:content-type :json,
:body (json/generate-string body),
:throw-exceptions false,
:query-params parameters,
:accept :json,
:as :json}
auth))))
(defn projects-locations-topics-computeHeadCursor$
"https://cloud.google.com/pubsub/lite/docsapi/reference/rest/v1/topicStats/projects/locations/topics/computeHeadCursor
Required parameters: topic
Optional parameters: none
Body:
{:partition string}
Compute the head cursor for the partition. The head cursor's offset is guaranteed to be less than or equal to all messages which have not yet been acknowledged as published, and greater than the offset of any message whose publish has already been acknowledged. It is zero if there have never been messages in the partition."
{:scopes ["https://www.googleapis.com/auth/cloud-platform"]}
[auth parameters body]
{:pre [(util/has-keys? parameters #{:topic})]}
(util/get-response
(http/post
(util/get-url
"https://pubsublite.googleapis.com/"
"v1/topicStats/{+topic}:computeHeadCursor"
#{:topic}
parameters)
(merge-with
merge
{:content-type :json,
:body (json/generate-string body),
:throw-exceptions false,
:query-params parameters,
:accept :json,
:as :json}
auth))))
(defn projects-locations-topics-computeTimeCursor$
"https://cloud.google.com/pubsub/lite/docsapi/reference/rest/v1/topicStats/projects/locations/topics/computeTimeCursor
Required parameters: topic
Optional parameters: none
Body:
{:partition string, :target {:publishTime string, :eventTime string}}
Compute the corresponding cursor for a publish or event time in a topic partition."
{:scopes ["https://www.googleapis.com/auth/cloud-platform"]}
[auth parameters body]
{:pre [(util/has-keys? parameters #{:topic})]}
(util/get-response
(http/post
(util/get-url
"https://pubsublite.googleapis.com/"
"v1/topicStats/{+topic}:computeTimeCursor"
#{:topic}
parameters)
(merge-with
merge
{:content-type :json,
:body (json/generate-string body),
:throw-exceptions false,
:query-params parameters,
:accept :json,
:as :json}
auth))))