chirpstack_api 4.17.0

ChirpStack Protobuf / gRPC API definitions.
Documentation
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
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
syntax = "proto3";

package api;

import "api/user.proto";
import "common/common.proto";
import "google/protobuf/empty.proto";
import "google/protobuf/timestamp.proto";

option csharp_namespace = "Chirpstack.Api";
option go_package = "github.com/chirpstack/chirpstack/api/go/v4/api";
option java_multiple_files = true;
option java_outer_classname = "InternalProto";
option java_package = "io.chirpstack.api";
option php_metadata_namespace = "GPBMetadata\\Chirpstack\\Api";
option php_namespace = "Chirpstack\\Api";

// InternalService is the service providing API endpoints for internal usage.
service InternalService {
  // Log in a user
  rpc Login(LoginRequest) returns (LoginResponse) {}

  // Get the current user's profile
  rpc Profile(google.protobuf.Empty) returns (ProfileResponse) {}

  // Perform a global search.
  rpc GlobalSearch(GlobalSearchRequest) returns (GlobalSearchResponse) {}

  // CreateApiKey creates the given API key.
  rpc CreateApiKey(CreateApiKeyRequest) returns (CreateApiKeyResponse) {}

  // DeleteApiKey deletes the API key.
  rpc DeleteApiKey(DeleteApiKeyRequest) returns (google.protobuf.Empty) {}

  // ListApiKeys lists the available API keys.
  rpc ListApiKeys(ListApiKeysRequest) returns (ListApiKeysResponse) {}

  // Get the global settings.
  rpc Settings(google.protobuf.Empty) returns (SettingsResponse) {}

  // OpenId Connect login.
  rpc OpenIdConnectLogin(OpenIdConnectLoginRequest) returns (OpenIdConnectLoginResponse) {}

  // OAuth2 login.
  rpc OAuth2Login(OAuth2LoginRequest) returns (OAuth2LoginResponse) {}

  // GetDevicesSummary returns an aggregated summary of the devices.
  rpc GetDevicesSummary(GetDevicesSummaryRequest) returns (GetDevicesSummaryResponse) {}

  // GetGatewaysSummary returns an aggregated summary of the gateways.
  rpc GetGatewaysSummary(GetGatewaysSummaryRequest) returns (GetGatewaysSummaryResponse) {}

  // Stream frame for the given Gateway ID.
  rpc StreamGatewayFrames(StreamGatewayFramesRequest) returns (stream LogItem) {}

  // Stream frames for the given Device EUI.
  rpc StreamDeviceFrames(StreamDeviceFramesRequest) returns (stream LogItem) {}

  // Stream events for the given Device EUI.
  rpc StreamDeviceEvents(StreamDeviceEventsRequest) returns (stream LogItem) {}

  // ListRegions lists the available (configured) regions.
  rpc ListRegions(google.protobuf.Empty) returns (ListRegionsResponse) {}

  // GetRegion returns the region details for the given region.
  rpc GetRegion(GetRegionRequest) returns (GetRegionResponse) {}

  // GetVersion returns the ChirpStack version.
  rpc GetVersion(google.protobuf.Empty) returns (GetVersionResponse) {}
}

message ApiKey {
  // API key ID.
  // This value will be automatically generated on create.
  string id = 1;

  // Name.
  string name = 2;

  // Is global admin key.
  bool is_admin = 3;

  // Tenant ID.
  // In case the API key is intended to manage resources under a single tenant.
  string tenant_id = 4;

  // Is read-only.
  bool is_read_only = 5;
}

message CreateApiKeyRequest {
  // The API key to create.
  ApiKey api_key = 1;
}

message CreateApiKeyResponse {
  // API key ID.
  string id = 1;

  // API token for authentication API requests.
  string token = 2;
}

message DeleteApiKeyRequest {
  // API key ID.
  string id = 1;
}

message ListApiKeysRequest {
  // Max number of items to return.
  // If not set, it will be treated as 0, and the response will only return the total_count.
  uint32 limit = 1;

  // Offset in the result-set (for pagination).
  uint32 offset = 2;

  // Return only admin keys.
  bool is_admin = 3;

  // Filter on tenant ID.
  string tenant_id = 4;
}

message ListApiKeysResponse {
  // Total number of API keys.
  uint32 total_count = 1;

  repeated ApiKey result = 2;
}

// Defines a tenant to which the user is associated.
message UserTenantLink {
  // Created at timestamp.
  google.protobuf.Timestamp created_at = 1;

  // Last update timestamp.
  google.protobuf.Timestamp updated_at = 2;

  // Tenant ID.
  string tenant_id = 3;

  // User is admin within the context of this tenant.
  // There is no need to set the is_device_admin and is_gateway_admin flags.
  bool is_admin = 4;

  // User is able to modify device related resources (applications,
  // device-profiles, devices, multicast-groups).
  bool is_device_admin = 5;

  // User is able to modify gateways.
  bool is_gateway_admin = 6;
}

message LoginRequest {
  // Email of the user.
  string email = 1;

  // Password of the user.
  string password = 2;
}

message LoginResponse {
  // The JWT tag to be used to access chirpstack-application-server interfaces.
  string jwt = 1;
}

message ProfileResponse {
  // User object.
  User user = 1;

  // Tenants to which the user is associated.
  repeated UserTenantLink tenants = 3;
}

message GlobalSearchRequest {
  // Search query.
  string search = 1;

  // Max number of results to return.
  // If not set, it will be treated as 0, and the response will only return the total_count.
  int64 limit = 2;

  // Offset offset of the result-set (for pagination).
  int64 offset = 3;
}

message GlobalSearchResponse {
  repeated GlobalSearchResult result = 1;
}

message GlobalSearchResult {
  // Record kind.
  string kind = 1;

  // Search score.
  float score = 2;

  // Organization id.
  string tenant_id = 3;

  // Organization name.
  string tenant_name = 4;

  // Application id.
  string application_id = 5;

  // Application name.
  string application_name = 6;

  // Device DevEUI (hex encoded).
  string device_dev_eui = 7;

  // Device name.
  string device_name = 8;

  // Gateway MAC (hex encoded).
  string gateway_id = 9;

  // Gateway name.
  string gateway_name = 10;
}

message SettingsResponse {
  // OpenId Connect settings.
  OpenIdConnect openid_connect = 1;

  // OAuth2 settings.
  OAuth2 oauth2 = 2;

  // Tileserver URL.
  string tileserver_url = 3;

  // Map attribution.
  string map_attribution = 4;
}

message OpenIdConnect {
  // Enable OpenId Connect authentication.
  bool enabled = 1;

  // Login url.
  string login_url = 2;

  // Login label.
  string login_label = 3;

  // Logout url.
  string logout_url = 4;

  // Login redirect.
  bool login_redirect = 5;
}

message OAuth2 {
  // OAuth2 is enabled.
  bool enabled = 1;

  // Login url.
  string login_url = 2;

  // Login label.
  string login_label = 3;

  // Logout url.
  string logout_url = 4;

  // Login redirect.
  bool login_redirect = 5;
}

message OpenIdConnectLoginRequest {
  // OpenId Connect callback code.
  string code = 1;

  // OpenId Connect callback state.
  string state = 2;
}

message OpenIdConnectLoginResponse {
  // Token to use for authentication.
  string token = 1;
}

message OAuth2LoginRequest {
  // OAuth2 callback code.
  string code = 1;

  // OAuth2 callback state.
  string state = 2;
}

message OAuth2LoginResponse {
  // Token to use for authentication.
  string token = 1;
}

message GetDevicesSummaryRequest {
  // Tenant ID (UUID).
  string tenant_id = 1;
}

message GetDevicesSummaryResponse {
  // Active count.
  uint32 active_count = 1;

  // Inactive count.
  uint32 inactive_count = 2;

  // per data-rate count.
  // Devices that have never been seen are excluded.
  map<uint32, uint32> dr_count = 3;

  // Never seen count.
  uint32 never_seen_count = 4;
}

message GetGatewaysSummaryRequest {
  // Tenant ID (UUID).
  string tenant_id = 1;
}

message GetGatewaysSummaryResponse {
  // Online count.
  uint32 online_count = 1;

  // Offline count.
  uint32 offline_count = 2;

  // Never seen count.
  uint32 never_seen_count = 3;
}

message LogItem {
  // ID.
  string id = 1;

  // Timestamp.
  google.protobuf.Timestamp time = 2;

  // Message.
  string description = 3;

  // Body.
  string body = 4;

  // Properties.
  map<string, string> properties = 5;
}

message StreamGatewayFramesRequest {
  // Gateway ID (EUI64).
  string gateway_id = 1;
}

message StreamDeviceFramesRequest {
  // Device EUI.
  string dev_eui = 1;
}

message StreamDeviceEventsRequest {
  // Device EUI.
  string dev_eui = 1;
}

message ListRegionsResponse {
  // Configured regions.
  repeated RegionListItem regions = 1;
}

message RegionListItem {
  // ID.
  string id = 1;

  // Region.
  common.Region region = 2;

  // Description.
  string description = 3;
}

message GetRegionRequest {
  // Region ID.
  string id = 1;
}

message GetRegionResponse {
  // ID.
  string id = 1;

  // Region.
  common.Region region = 2;

  // User information.
  string user_info = 3;

  // Uplink channels.
  repeated RegionChannel uplink_channels = 4;

  // RX1 delay.
  uint32 rx1_delay = 5;

  // RX1 data-rate offset.
  uint32 rx1_dr_offset = 6;

  // RX2 DR.
  uint32 rx2_dr = 7;

  // RX2 frequency.
  uint32 rx2_frequency = 8;

  // Class-B ping-slot DR.
  uint32 class_b_ping_slot_dr = 9;

  // Class-B ping-slot frequency.
  uint32 class_b_ping_slot_frequency = 10;

  // Region description.
  string description = 11;
}

message RegionChannel {
  // Frequency (Hz).
  uint32 frequency = 1;

  // Data-rates.
  repeated uint32 data_rates = 4;
}

message GetVersionResponse {
  // version
  string version = 1;
}