-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathgate-api-swagger2.yml
134 lines (134 loc) · 3.2 KB
/
gate-api-swagger2.yml
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
swagger: '2.0'
info:
description: 'Gate api for Hercules. The method to send event to Apache Kafka.'
version: 1.9.0
title: Hercules gate API
host: 'vm-hercules05:6306'
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/send:
post:
tags:
- gate
summary: Gate
description: Send events to Apache Kafka
operationId: gate
parameters:
- $ref: '#/parameters/apiKey'
- $ref: '#/parameters/contentType'
- name: stream
in: query
description: Name of stream
required: true
type: string
pattern: '[a-z0-9_]{1,48}'
responses:
'200':
$ref: '#/responses/success'
'400':
$ref: '#/responses/badRequest'
'401':
$ref: '#/responses/writeRulesIsAbsent'
'403':
$ref: '#/responses/forbidden'
'404':
$ref: '#/responses/notFoundSourceStream'
'413':
$ref: '#/responses/entityTooLarge'
/stream/sendAsync:
post:
tags:
- gate
summary: Gate
description: Asynchronously send events to Apache Kafka
operationId: gateAsync
parameters:
- $ref: '#/parameters/apiKey'
- $ref: '#/parameters/contentType'
- name: stream
in: query
description: Name of stream
required: true
type: string
pattern: '[a-z0-9_]{1,48}'
responses:
'200':
$ref: '#/responses/success'
'400':
$ref: '#/responses/badRequest'
'401':
$ref: '#/responses/writeRulesIsAbsent'
'403':
$ref: '#/responses/forbidden'
'404':
$ref: '#/responses/notFoundSourceStream'
'413':
$ref: '#/responses/entityTooLarge'
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
writeRulesIsAbsent:
description: Write rule 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
entityTooLarge:
description: Request entity too large