Repository navigation
Expand file tree
/
Copy pathserver-api.http
More file actions
190 lines (148 loc) · 5.89 KB
/
Copy pathserver-api.http
File metadata and controls
190 lines (148 loc) · 5.89 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
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
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
@url = http://localhost:3000
@access_token = eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJqdGkiOiI4YmYyY2FmNS04MTgwLTQ1YzItOGZmMy1kOWJhNWJiZjE0OWUiLCJpc3MiOiJpZ2d5LnJzIiwiYXVkIjoiaWdneS5ycyIsInN1YiI6MSwiaWF0IjoxNzAxMTA5MTg4LCJleHAiOjE3MDExMTI3ODgsIm5iZiI6MTcwMTEwOTE4OH0.i1kkVUCGOzLUR3tiDuD5xwOLS3AKGKLsMu_5QbFfhRY
###
GET {{url}}
###
POST {{url}}/users/login
Content-Type: application/json
{
"username":"iggy",
"password":"iggy"
}
###
POST {{url}}/users/refresh-token
Content-Type: application/json
{
"token": "bhVdVpdPM29AZGbKLIqqoCailFnkO2Xq6fwEWZPxL%2B5k3hT%2Fp%2FteEfZM0OHWDCtiKJY%3D"
}
###
POST {{url}}/users
Content-Type: application/json
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJqdGkiOiIwMzg5Y2RlNS1lZGRlLTQzZDItOWIyZS0zMDNkODc3ZGRmM2EiLCJpc3MiOiJpZ2d5LnJzIiwiYXVkIjoiaWdneS5ycyIsInN1YiI6MSwiaWF0IjoxNzAwNTk4NDYwLCJleHAiOjE3MDA2MDIwNjAsIm5iZiI6MTcwMDU5ODQ2MH0.x-KgfXp-3arpZy-FA9j5V85M88eHVa5Q1AERYjo3Pow
{
"username":"asf2sdssdfafa2edad14dd22",
"password":"asdasd",
"status":"inactive",
"permissions":null
}
###
GET {{url}}/users
Content-Type: application/json
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJqdGkiOiI5NmJlY2QwNy03ZTYyLTRiYTktYTcyZS02NzgwOThmMjE1MmMiLCJpc3MiOiJpZ2d5LnJzIiwiYXVkIjoiaWdneS5ycyIsInN1YiI6MSwiaWF0IjoxNzAwNTk4NTI5LCJleHAiOjE3MDA2MDIxMjksIm5iZiI6MTcwMDU5ODUyOX0.IYaIwFA1VajunF_P2KLQWOnnEzCYHJT31QuIQa__TS0
### Metadata changes from the oldest retained operation (root or manage_servers)
GET {{url}}/metadata/changes?from=earliest&limit=100
Authorization: Bearer {{access_token}}
### Metadata changes: a cursor at the newest record, no records
GET {{url}}/metadata/changes?from=latest&groups=streams,topics
Authorization: Bearer {{access_token}}
### Metadata changes after a cursor from an earlier page
GET {{url}}/metadata/changes?after=mc1_AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA&limit=100
Authorization: Bearer {{access_token}}
### Current state pages, continued with the current_page_token of the previous answer
GET {{url}}/metadata/changes?from=current&groups=streams,topics&limit=100
Authorization: Bearer {{access_token}}
### Create stream
POST {{url}}/streams
Content-Type: application/json
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJqdGkiOiJjMmQ5ZWZmNS03OTQ5LTQ1MTEtYmM2YS1hZGY3MmQwN2VjNDkiLCJpc3MiOiJpZ2d5LnJzIiwiYXVkIjoiaWdneS5ycyIsInN1YiI6MSwiaWF0IjoxNjk5OTg0MzU4LCJleHAiOjE2OTk5ODc5NTgsIm5iZiI6MTY5OTk4NDM1OH0.-C96N0kTHKnjxkUXobGnfkejkvUIHrQa8yEKHD-N5cU
{
"name":"stream29"
}
### Create stream with its own encryption key, 32 random bytes as standard base64 (never reuse this sample)
POST {{url}}/streams
Content-Type: application/json
Authorization: Bearer {{access_token}}
{
"name": "payments",
"options": {
"encryption_key": "AAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8="
}
}
### Update stream
PUT {{url}}/streams/29
Content-Type: application/json
Authorization: Bearer {{access_token}}
{
"name": "stream29-renamed"
}
### Create topic
POST {{url}}/streams/11/topics
Content-Type: application/json
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJqdGkiOiJmODM0NTI5MC05NzBlLTQ3YzAtOTMwOS02YWM5MmZiMWEyYTYiLCJpc3MiOiJpZ2d5LnJzIiwiYXVkIjoiaWdneS5ycyIsInN1YiI6MSwiaWF0IjoxNjk5OTgxMTU4LCJleHAiOjE2OTk5ODQ3NTgsIm5iZiI6MTY5OTk4MTE1OH0.6WxgKsOAZQfeAPciwHOcE1oR3iJXM0VORX-RtsvT2hU
{
"name": "topic16",
"partitions_count": 10,
"options": {
"message_expiry": "7 days",
"compression_algorithm": "none",
"max_topic_size": "1000000000"
}
}
### Update topic
# A value sets a key, an absent key or null keeps it, a key in reset returns to its default.
# compression_algorithm and the other create-only keys are refused here.
PUT {{url}}/streams/11/topics/16
Content-Type: application/json
Authorization: Bearer {{access_token}}
{
"name": "topic16-renamed",
"message_expiry": "1 day",
"reset": ["max_topic_size"]
}
### Describe the topic option catalog (scope: stream, topic or user)
GET {{url}}/options/topic
Authorization: Bearer {{access_token}}
### Create partitions
POST {{url}}/streams/3/topics/3/partitions
Content-Type: application/json
{
"partitions_count": 45
}
### Delete segments
DELETE {{url}}/streams/1/topics/1/partitions/1?segments_count=3
Authorization: Bearer {{access_token}}
# Path params: stream_id, topic_id, partition_id
# Query param: segments_count
###
GET {{url}}/users/13
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJqdGkiOiI5NmJlY2QwNy03ZTYyLTRiYTktYTcyZS02NzgwOThmMjE1MmMiLCJpc3MiOiJpZ2d5LnJzIiwiYXVkIjoiaWdneS5ycyIsInN1YiI6MSwiaWF0IjoxNzAwNTk4NTI5LCJleHAiOjE3MDA2MDIxMjksIm5iZiI6MTcwMDU5ODUyOX0.IYaIwFA1VajunF_P2KLQWOnnEzCYHJT31QuIQa__TS0
###Create User
POST {{url}}/users
Authorization: Bearer {{access_token}}
Content-Type: application/json
{
"username": "airport.security.logs",
"password": "test",
"status": "active",
"permissions": null
}
###GET User
GET {{url}}/users/37
Authorization: Bearer {{access_token}}
Content-Type: application/json
### Update User
PUT {{url}}/users/37
Authorization: Bearer {{access_token}}
Content-Type: application/json
{
"status": "inactive"
}
### Delete User
DELETE {{url}}/users/2
Authorization: Bearer {{access_token}}