mirror of
https://github.com/chirpstack/chirpstack.git
synced 2025-06-12 20:48:09 +00:00
Implement api request logging to Redis Streams.
This makes it possible for external services to subscribe (through Redis) for realtime events. E.g. a create, update or delete device event could trigger an external synchronization.
This commit is contained in:
1
api/python/Makefile
vendored
1
api/python/Makefile
vendored
@ -37,6 +37,7 @@ api:
|
||||
$(PROTOC) ${PROTOC_ARGS} chirpstack-api/api/gateway.proto
|
||||
$(PROTOC) ${PROTOC_ARGS} chirpstack-api/api/frame_log.proto
|
||||
$(PROTOC) ${PROTOC_ARGS} chirpstack-api/api/multicast_group.proto
|
||||
$(PROTOC) ${PROTOC_ARGS} chirpstack-api/api/request_log.proto
|
||||
|
||||
integration:
|
||||
$(PROTOC) ${PROTOC_ARGS} chirpstack-api/integration/integration.proto
|
||||
|
23
api/python/proto/chirpstack-api/api/request_log.proto
vendored
Normal file
23
api/python/proto/chirpstack-api/api/request_log.proto
vendored
Normal file
@ -0,0 +1,23 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package api;
|
||||
|
||||
option go_package = "github.com/chirpstack/chirpstack/api/go/v4/api";
|
||||
option java_package = "io.chirpstack.api";
|
||||
option java_multiple_files = true;
|
||||
option java_outer_classname = "RequestLog";
|
||||
|
||||
import "google/protobuf/timestamp.proto";
|
||||
import "chirpstack-api/common/common.proto";
|
||||
import "chirpstack-api/gw/gw.proto";
|
||||
|
||||
message RequestLog {
|
||||
// API service name.
|
||||
string service = 1;
|
||||
|
||||
// API method name.
|
||||
string method = 2;
|
||||
|
||||
// Metadata.
|
||||
map<string, string> metadata = 3;
|
||||
}
|
@ -18,3 +18,4 @@ from .tenant_pb2 import *
|
||||
from .tenant_pb2_grpc import *
|
||||
from .user_pb2 import *
|
||||
from .user_pb2_grpc import *
|
||||
from .request_log_pb2 import *
|
||||
|
33
api/python/src/chirpstack_api/api/request_log_pb2.py
vendored
Normal file
33
api/python/src/chirpstack_api/api/request_log_pb2.py
vendored
Normal file
@ -0,0 +1,33 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
||||
# source: chirpstack-api/api/request_log.proto
|
||||
"""Generated protocol buffer code."""
|
||||
from google.protobuf.internal import builder as _builder
|
||||
from google.protobuf import descriptor as _descriptor
|
||||
from google.protobuf import descriptor_pool as _descriptor_pool
|
||||
from google.protobuf import symbol_database as _symbol_database
|
||||
# @@protoc_insertion_point(imports)
|
||||
|
||||
_sym_db = _symbol_database.Default()
|
||||
|
||||
|
||||
from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2
|
||||
from chirpstack_api.common import common_pb2 as chirpstack__api_dot_common_dot_common__pb2
|
||||
from chirpstack_api.gw import gw_pb2 as chirpstack__api_dot_gw_dot_gw__pb2
|
||||
|
||||
|
||||
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n$chirpstack-api/api/request_log.proto\x12\x03\x61pi\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\"chirpstack-api/common/common.proto\x1a\x1a\x63hirpstack-api/gw/gw.proto\"\x8f\x01\n\nRequestLog\x12\x0f\n\x07service\x18\x01 \x01(\t\x12\x0e\n\x06method\x18\x02 \x01(\t\x12/\n\x08metadata\x18\x03 \x03(\x0b\x32\x1d.api.RequestLog.MetadataEntry\x1a/\n\rMetadataEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x42Q\n\x11io.chirpstack.apiB\nRequestLogP\x01Z.github.com/chirpstack/chirpstack/api/go/v4/apib\x06proto3')
|
||||
|
||||
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals())
|
||||
_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'chirpstack_api.api.request_log_pb2', globals())
|
||||
if _descriptor._USE_C_DESCRIPTORS == False:
|
||||
|
||||
DESCRIPTOR._options = None
|
||||
DESCRIPTOR._serialized_options = b'\n\021io.chirpstack.apiB\nRequestLogP\001Z.github.com/chirpstack/chirpstack/api/go/v4/api'
|
||||
_REQUESTLOG_METADATAENTRY._options = None
|
||||
_REQUESTLOG_METADATAENTRY._serialized_options = b'8\001'
|
||||
_REQUESTLOG._serialized_start=143
|
||||
_REQUESTLOG._serialized_end=286
|
||||
_REQUESTLOG_METADATAENTRY._serialized_start=239
|
||||
_REQUESTLOG_METADATAENTRY._serialized_end=286
|
||||
# @@protoc_insertion_point(module_scope)
|
4
api/python/src/chirpstack_api/api/request_log_pb2_grpc.py
vendored
Normal file
4
api/python/src/chirpstack_api/api/request_log_pb2_grpc.py
vendored
Normal file
@ -0,0 +1,4 @@
|
||||
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
|
||||
"""Client and server classes corresponding to protobuf-defined services."""
|
||||
import grpc
|
||||
|
Reference in New Issue
Block a user