-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathstream-api-swagger2.yml
More file actions
165 lines (165 loc) · 4.13 KB
/
stream-api-swagger2.yml
File metadata and controls
165 lines (165 loc) · 4.13 KB
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
swagger: '2.0'
info:
description: 'Stream api for Hercules. Uses for read the stream content.'
version: 1.9.0
title: Hercules stream API
host: 'vm-hercules05:6307'
schemes:
- http
paths:
/ping:
get:
summary: Ping
description: Check server status
operationId: ping
responses:
'200':
$ref: '#/responses/success'
/about:
get:
summary: About
description: Check server description
operationId: about
responses:
'200':
description: Info about service
schema:
$ref: '#/definitions/about'
/stream/seekToEnd:
get:
tags:
- stream
summary: Stream
description: Seek the end of the stream
operationId: seekEndOfStream
produces:
- application/octet-stream
parameters:
- $ref: '#/parameters/apiKey'
- $ref: '#/parameters/contentType'
- name: stream
in: query
description: Stream name
required: true
type: string
pattern: '[a-z0-9_]{1,48}'
- name: shardIndex
in: query
description: The logical shard index. Starts with `0` up to `shardCount - 1`
required: true
type: integer
- name: shardCount
in: query
description: The total logical shards
required: true
type: integer
responses:
'200':
$ref: '#/responses/success'
'400':
$ref: '#/responses/badRequest'
'401':
$ref: '#/responses/readRulesIsAbsent'
'403':
$ref: '#/responses/forbidden'
'404':
$ref: '#/responses/notFoundSourceStream'
'500':
$ref: '#/responses/internalServiceError'
/stream/read:
post:
tags:
- stream
summary: Strean
description: Read the stream content
operationId: readStream
produces:
- application/octet-stream
parameters:
- $ref: '#/parameters/apiKey'
- $ref: '#/parameters/contentType'
- name: stream
in: query
description: Stream name
required: true
type: string
pattern: '[a-z0-9_]{1,48}'
- name: shardIndex
in: query
description: The logical shard index. Starts with `0` up to `shardCount - 1`
required: true
type: integer
- name: shardCount
in: query
description: The total logical shards
required: true
type: integer
- name: take
in: query
description: Maximum events to read
required: true
type: integer
responses:
'200':
$ref: '#/responses/success'
'400':
$ref: '#/responses/badRequest'
'401':
$ref: '#/responses/readRulesIsAbsent'
'403':
$ref: '#/responses/forbidden'
'404':
$ref: '#/responses/notFoundSourceStream'
'411':
$ref: '#/responses/lengthRequired'
'500':
$ref: '#/responses/internalServiceError'
definitions:
about:
type: object
properties:
applicationName:
type: string
applicationId:
type: string
version:
type: string
commitId:
type: string
environment:
type: string
zone:
type: string
hostName:
type: string
instanceId:
type: string
parameters:
apiKey:
name: Authorization
in: header
type: string
pattern: '^Hercules apiKey .+'
required: true
description: API key for authorization
contentType:
name: contentType
in: header
type: string
required: true
description: application/octet-stream
responses:
success:
description: OK
badRequest:
description: Bad request
readRulesIsAbsent:
description: Read rules for this apiKey is absent
forbidden:
description: Forbidden for this API-key
notFoundSourceStream:
description: Not found source stream
lengthRequired:
description: Can't get Content-Length value
internalServiceError:
description: Internal service error