mirror of
https://github.com/chirpstack/chirpstack.git
synced 2025-06-12 20:48:09 +00:00
Show region information in UI.
This commit is contained in:
@ -9,6 +9,7 @@ option java_outer_classname = "InternalProto";
|
||||
|
||||
import "google/protobuf/timestamp.proto";
|
||||
import "google/protobuf/empty.proto";
|
||||
import "chirpstack-api/common/common.proto";
|
||||
import "chirpstack-api/api/user.proto";
|
||||
|
||||
// InternalService is the service providing API endpoints for internal usage.
|
||||
@ -51,6 +52,12 @@ service InternalService {
|
||||
|
||||
// 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) {}
|
||||
}
|
||||
|
||||
message ApiKey {
|
||||
@ -298,3 +305,64 @@ message StreamDeviceEventsRequest {
|
||||
// Device EUI.
|
||||
string dev_eui = 1;
|
||||
}
|
||||
|
||||
message ListRegionsResponse {
|
||||
// Configured regions.
|
||||
repeated RegionListItem regions = 1;
|
||||
}
|
||||
|
||||
message RegionListItem {
|
||||
// Name.
|
||||
string name = 1;
|
||||
|
||||
// Region.
|
||||
common.Region region = 2;
|
||||
}
|
||||
|
||||
message GetRegionRequest {
|
||||
// Region name.
|
||||
string name = 1;
|
||||
}
|
||||
|
||||
message GetRegionResponse {
|
||||
// Name.
|
||||
string name = 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;
|
||||
}
|
||||
|
||||
message RegionChannel {
|
||||
// Frequency (Hz).
|
||||
uint32 frequency = 1;
|
||||
|
||||
// Min DR.
|
||||
uint32 dr_min = 2;
|
||||
|
||||
// Max DR.
|
||||
uint32 dr_max = 3;
|
||||
}
|
||||
|
165
api/python/src/chirpstack_api/api/internal_pb2.py
vendored
165
api/python/src/chirpstack_api/api/internal_pb2.py
vendored
File diff suppressed because one or more lines are too long
@ -81,6 +81,16 @@ class InternalServiceStub(object):
|
||||
request_serializer=chirpstack__api_dot_api_dot_internal__pb2.StreamDeviceEventsRequest.SerializeToString,
|
||||
response_deserializer=chirpstack__api_dot_api_dot_internal__pb2.LogItem.FromString,
|
||||
)
|
||||
self.ListRegions = channel.unary_unary(
|
||||
'/api.InternalService/ListRegions',
|
||||
request_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
|
||||
response_deserializer=chirpstack__api_dot_api_dot_internal__pb2.ListRegionsResponse.FromString,
|
||||
)
|
||||
self.GetRegion = channel.unary_unary(
|
||||
'/api.InternalService/GetRegion',
|
||||
request_serializer=chirpstack__api_dot_api_dot_internal__pb2.GetRegionRequest.SerializeToString,
|
||||
response_deserializer=chirpstack__api_dot_api_dot_internal__pb2.GetRegionResponse.FromString,
|
||||
)
|
||||
|
||||
|
||||
class InternalServiceServicer(object):
|
||||
@ -178,6 +188,20 @@ class InternalServiceServicer(object):
|
||||
context.set_details('Method not implemented!')
|
||||
raise NotImplementedError('Method not implemented!')
|
||||
|
||||
def ListRegions(self, request, context):
|
||||
"""ListRegions lists the available (configured) regions.
|
||||
"""
|
||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
||||
context.set_details('Method not implemented!')
|
||||
raise NotImplementedError('Method not implemented!')
|
||||
|
||||
def GetRegion(self, request, context):
|
||||
"""GetRegion returns the region details for the given region.
|
||||
"""
|
||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
||||
context.set_details('Method not implemented!')
|
||||
raise NotImplementedError('Method not implemented!')
|
||||
|
||||
|
||||
def add_InternalServiceServicer_to_server(servicer, server):
|
||||
rpc_method_handlers = {
|
||||
@ -246,6 +270,16 @@ def add_InternalServiceServicer_to_server(servicer, server):
|
||||
request_deserializer=chirpstack__api_dot_api_dot_internal__pb2.StreamDeviceEventsRequest.FromString,
|
||||
response_serializer=chirpstack__api_dot_api_dot_internal__pb2.LogItem.SerializeToString,
|
||||
),
|
||||
'ListRegions': grpc.unary_unary_rpc_method_handler(
|
||||
servicer.ListRegions,
|
||||
request_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString,
|
||||
response_serializer=chirpstack__api_dot_api_dot_internal__pb2.ListRegionsResponse.SerializeToString,
|
||||
),
|
||||
'GetRegion': grpc.unary_unary_rpc_method_handler(
|
||||
servicer.GetRegion,
|
||||
request_deserializer=chirpstack__api_dot_api_dot_internal__pb2.GetRegionRequest.FromString,
|
||||
response_serializer=chirpstack__api_dot_api_dot_internal__pb2.GetRegionResponse.SerializeToString,
|
||||
),
|
||||
}
|
||||
generic_handler = grpc.method_handlers_generic_handler(
|
||||
'api.InternalService', rpc_method_handlers)
|
||||
@ -477,3 +511,37 @@ class InternalService(object):
|
||||
chirpstack__api_dot_api_dot_internal__pb2.LogItem.FromString,
|
||||
options, channel_credentials,
|
||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
||||
|
||||
@staticmethod
|
||||
def ListRegions(request,
|
||||
target,
|
||||
options=(),
|
||||
channel_credentials=None,
|
||||
call_credentials=None,
|
||||
insecure=False,
|
||||
compression=None,
|
||||
wait_for_ready=None,
|
||||
timeout=None,
|
||||
metadata=None):
|
||||
return grpc.experimental.unary_unary(request, target, '/api.InternalService/ListRegions',
|
||||
google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
|
||||
chirpstack__api_dot_api_dot_internal__pb2.ListRegionsResponse.FromString,
|
||||
options, channel_credentials,
|
||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
||||
|
||||
@staticmethod
|
||||
def GetRegion(request,
|
||||
target,
|
||||
options=(),
|
||||
channel_credentials=None,
|
||||
call_credentials=None,
|
||||
insecure=False,
|
||||
compression=None,
|
||||
wait_for_ready=None,
|
||||
timeout=None,
|
||||
metadata=None):
|
||||
return grpc.experimental.unary_unary(request, target, '/api.InternalService/GetRegion',
|
||||
chirpstack__api_dot_api_dot_internal__pb2.GetRegionRequest.SerializeToString,
|
||||
chirpstack__api_dot_api_dot_internal__pb2.GetRegionResponse.FromString,
|
||||
options, channel_credentials,
|
||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
||||
|
Reference in New Issue
Block a user