-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathservice.yml
136 lines (136 loc) · 3.37 KB
/
service.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
135
136
swagger: '2.0'
info:
description: 'Description of concurrency service implementation made for the coding interview'
version: '1.0.0'
title: 'Pavel Kovalenko Interview'
contact:
email: '[email protected]'
host: 'pk-concurrency-service-lb-1804676257.us-east-1.elb.amazonaws.com'
tags:
- name: 'concurrency'
description: 'Supports the check of number of the simultaneously played streams by single user'
schemes:
- 'http'
paths:
/concurrency:
post:
tags:
- 'concurrency'
summary: 'Set new concurrency session'
consumes:
- 'application/json'
produces:
- 'application/json'
parameters:
- in: 'body'
name: 'body'
description: 'Identifiers for concurrency session'
required: true
schema:
$ref: '#/definitions/ConcurrencyInitRequest'
responses:
200:
description: 'Success'
schema:
$ref: '#/definitions/HeartbeatRequest'
400:
description: 'Invalid input parameters'
403:
description: 'User has reached concurrency limit'
500:
description: 'Internal server error'
put:
tags:
- 'concurrency'
summary: 'Concurrency session heartbeat'
consumes:
- 'application/json'
produces:
- 'application/json'
parameters:
- in: 'body'
name: 'body'
description: 'Identifiers of session and token'
required: true
schema:
$ref: '#/definitions/HeartbeatRequest'
responses:
200:
description: 'Success'
schema:
$ref: '#/definitions/ConcurrencyResponse'
400:
description: 'Invalid input parameters'
500:
description: 'Internal server error'
delete:
tags:
- 'concurrency'
summary: 'Terminate session'
consumes:
- 'application/json'
produces:
- 'application/json'
parameters:
- in: 'body'
name: 'body'
description: 'Identifier of session'
required: true
schema:
$ref: '#/definitions/DeleteRequest'
responses:
204:
description: 'Success no content'
400:
description: 'Invalid input parameters'
500:
description: 'Internal server error'
definitions:
ConcurrencyInitRequest:
type: 'object'
required:
- 'userId'
- 'deviceId'
- 'streamId'
properties:
userId:
type: 'string'
example: 'testUserId'
deviceId:
type: 'string'
example: 'laptop'
streamId:
type: 'string'
example: 'seattleSeahawks'
HeartbeatRequest:
type: 'object'
required:
- 'sessionKey'
- 'token'
properties:
sessionKey:
type: 'string'
example: 'testUserId_1'
token:
type: 'string'
example: 'laptop_seattleSeahawks'
DeleteRequest:
type: 'object'
required:
- 'sessionKey'
properties:
sessionKey:
type: 'string'
example: 'testUserId_1'
ConcurrencyResponse:
type: 'object'
properties:
sessionKey:
type: 'string'
example: 'testUserId_1'
token:
type: 'string'
example: 'testUserId_1'
status:
type: 'string'
example: 'updated'