This repository has been archived by the owner on May 11, 2022. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
rest.http
194 lines (140 loc) Β· 5.03 KB
/
rest.http
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
### API v1
POST http://localhost:8093/api/v1/license/register
Authorization: Bearer 10000000-2000-4000-8000-160000000003
Content-Type: application/json
X-Request-ID: 10000000-2000-4000-8000-160000000000
{
"id": "10000000-2000-4000-8000-160000000004",
"contract": {
"since": "2018-09-29T17:11:43.264Z",
"until": "2018-09-29T17:11:43.264Z",
"rate": { "value": 10, "unit": "rph" },
"requests": 1000,
"workplaces": 10
}
}
###
PUT http://localhost:8093/api/v1/license/10000000-2000-4000-8000-160000000004
Authorization: Bearer 10000000-2000-4000-8000-160000000003
Content-Type: application/json
X-Request-ID: 10000000-2000-4000-8000-160000000000
{
"contract": {
"since": "2018-09-29T17:11:43.264Z",
"until": null,
"rate": { "value": 10, "unit": "rpd" },
"requests": 1000,
"workplaces": 10
}
}
###
DELETE http://localhost:8093/api/v1/license/10000000-2000-4000-8000-160000000004
Authorization: Bearer 10000000-2000-4000-8000-160000000003
X-Request-ID: 10000000-2000-4000-8000-160000000000
###
PATCH http://localhost:8093/api/v1/license/10000000-2000-4000-8000-160000000004
Authorization: Bearer 10000000-2000-4000-8000-160000000003
X-Request-ID: 10000000-2000-4000-8000-160000000000
###
GET http://localhost:8093/api/v1/license/10000000-2000-4000-8000-160000000004
Authorization: Bearer 10000000-2000-4000-8000-160000000003
X-Request-ID: 10000000-2000-4000-8000-160000000000
###
POST http://localhost:8093/api/v1/license/10000000-2000-4000-8000-160000000004/employee/10000000-2000-4000-8000-160000000005
Authorization: Bearer 10000000-2000-4000-8000-160000000003
X-Request-ID: 10000000-2000-4000-8000-160000000000
###
DELETE http://localhost:8093/api/v1/license/10000000-2000-4000-8000-160000000004/employee/10000000-2000-4000-8000-160000000005
Authorization: Bearer 10000000-2000-4000-8000-160000000003
X-Request-ID: 10000000-2000-4000-8000-160000000000
###
GET http://localhost:8093/api/v1/license/10000000-2000-4000-8000-160000000004/employees
Authorization: Bearer 10000000-2000-4000-8000-160000000003
X-Request-ID: 10000000-2000-4000-8000-160000000000
###
POST http://localhost:8093/api/v1/license/10000000-2000-4000-8000-160000000004/workplace/10000000-2000-4000-8000-160000000006
Authorization: Bearer 10000000-2000-4000-8000-160000000003
X-Request-ID: 10000000-2000-4000-8000-160000000000
###
PUT http://localhost:8093/api/v1/license/10000000-2000-4000-8000-160000000004/workplace/10000000-2000-4000-8000-160000000006
Authorization: Bearer 10000000-2000-4000-8000-160000000003
X-Request-ID: 10000000-2000-4000-8000-160000000000
###
GET http://localhost:8093/api/v1/license/10000000-2000-4000-8000-160000000004/workplaces
Authorization: Bearer 10000000-2000-4000-8000-160000000003
X-Request-ID: 10000000-2000-4000-8000-160000000000
###
DELETE http://localhost:8093/api/v1/license/10000000-2000-4000-8000-160000000004/workplace/10000000-2000-4000-8000-160000000006
Authorization: Bearer 10000000-2000-4000-8000-160000000003
X-Request-ID: 10000000-2000-4000-8000-160000000000
###
POST http://localhost:8093/api/v1/license
Authorization: Bearer 10000000-2000-4000-8000-160000000003
Content-Type: application/json
X-Request-ID: 10000000-2000-4000-8000-160000000000
{
"contract": {
"since": "2018-09-29T17:11:43.264Z",
"until": null,
"rate": { "value": 10, "unit": "rph" },
"requests": 1000,
"workplaces": 10
}
}
### Protect Legacy
POST http://localhost/legacy/protected
X-Token: 10000000-2000-4000-8000-160000000005
X-UDID: 10000000-2000-4000-8000-160000000006
X-Request-ID: 10000000-2000-4000-8000-160000000000
### - the same effect request
POST http://localhost/legacy/protected
X-Employee: 10000000-2000-4000-8000-160000000005
X-Workplace: 10000000-2000-4000-8000-160000000006
X-Request-ID: 10000000-2000-4000-8000-160000000000
### - the same effect request
POST http://localhost/legacy/protected
X-License: 10000000-2000-4000-8000-160000000004
X-Workplace: 10000000-2000-4000-8000-160000000006
X-Request-ID: 10000000-2000-4000-8000-160000000000
### - under the hood
POST http://localhost:8080/api/v1/license/check
X-Employee: 10000000-2000-4000-8000-160000000005
X-Workplace: 10000000-2000-4000-8000-160000000006
X-Request-ID: 10000000-2000-4000-8000-160000000000
### Maintenance
POST http://localhost:8093/api/v1/install
Content-Type: application/json
X-Request-ID: 10000000-2000-4000-8000-160000000000
{
"account": {
"id": "10000000-2000-4000-8000-160000000001",
"name": "Demo Account",
"users": [
{
"id": "10000000-2000-4000-8000-160000000002",
"name": "Demo User",
"tokens": [
{
"id": "10000000-2000-4000-8000-160000000003",
"expired_at": null
}
]
}
]
}
}
### Profiling
GET http://localhost:8090/pprof/cmdline
###
GET http://localhost:8090/pprof/profile
###
GET http://localhost:8090/pprof/symbol
###
GET http://localhost:8090/pprof/trace
###
GET http://localhost:8090/debug/pprof/
### Monitoring
GET http://localhost:8091/metrics
###
GET http://localhost:8091/vars
###