trisulrp 3.2.13 → 3.2.27
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/README.rdoc +6 -2
- data/Rakefile +1 -0
- data/VERSION +1 -1
- data/lib/trisulrp/protocol.rb +36 -0
- data/lib/trisulrp/trp.pb.rb +105 -1
- data/lib/trisulrp/trp.proto +125 -14
- data/trisulrp.gemspec +28 -28
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 71c5b47d633207231c302542e8735d5a5a907569333dab8da436811cf451174a
|
4
|
+
data.tar.gz: 44c22ab4987836e91017194f01735909e80d5ec0665fec2e45daa0ba2f8beb32
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5f521b245139593bf1339c3d59049c16162bc1df790f3d0790eba484d2501cd19018759c90c4323075886d8c35ef98ccd6d7118c215eb9c4cbc45f18322b0a22
|
7
|
+
data.tar.gz: 652d8c13e1d4ce1e8c4fd4e9bc632a961db575adb32267143b89c6aecebc2668c2287b5689efd3f5fe9d15b9039bfcd112d64915cdac9c77d464f06dd7ebcecb
|
data/README.rdoc
CHANGED
@@ -16,9 +16,12 @@ Key Features :
|
|
16
16
|
|
17
17
|
* TRP Documentation and Tutorials http://trisul.org/docs/trp/index.html
|
18
18
|
* Getting started tutorial http://trisul.org/docs/trp/trpgemsteps.html
|
19
|
-
* Github repo of sample scripts https://github.com/
|
19
|
+
* Github repo of sample scripts https://github.com/trisulnsm/trisul-scripts/trp
|
20
20
|
|
21
21
|
|
22
|
+
== Generating the ruby protobuf definitions
|
23
|
+
protoc --ruby_out=. trp.proto
|
24
|
+
|
22
25
|
== Contributing to trisulrp
|
23
26
|
|
24
27
|
* Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet
|
@@ -31,5 +34,6 @@ Key Features :
|
|
31
34
|
|
32
35
|
== Copyright
|
33
36
|
|
34
|
-
|
37
|
+
License MIT
|
38
|
+
Copyright (c) 2010-2021 Unleash Networks. See LICENSE.txt for further details.
|
35
39
|
|
data/Rakefile
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
3.2.
|
1
|
+
3.2.27
|
data/lib/trisulrp/protocol.rb
CHANGED
@@ -335,6 +335,32 @@ module TrisulRP::Protocol
|
|
335
335
|
return tint
|
336
336
|
end
|
337
337
|
|
338
|
+
|
339
|
+
# Helper iterate through each time interval in reverse order
|
340
|
+
#
|
341
|
+
# [endpoint] - the ZMQ endpoint
|
342
|
+
#
|
343
|
+
# ==== Returns
|
344
|
+
# ==== Yields
|
345
|
+
# [time_interval, id, total_intervals] A TRP::TimeInterval object which can be attached to any :time_interval field of a TRP request
|
346
|
+
#
|
347
|
+
#
|
348
|
+
def each_time_interval(zmq_endpt)
|
349
|
+
|
350
|
+
req=mk_request(TRP::Message::Command::TIMESLICES_REQUEST )
|
351
|
+
get_response_zmq(zmq_endpt,req) do |resp|
|
352
|
+
|
353
|
+
slice_id = 0
|
354
|
+
total_slices = resp.slices.size
|
355
|
+
|
356
|
+
resp.slices.reverse_each do | slc |
|
357
|
+
yield slc.time_interval, slice_id, total_slices
|
358
|
+
slice_id=slice_id+1
|
359
|
+
end
|
360
|
+
end
|
361
|
+
end
|
362
|
+
|
363
|
+
|
338
364
|
# Helper to allow assinging string to KeyT field
|
339
365
|
#
|
340
366
|
# instead of
|
@@ -520,6 +546,12 @@ module TrisulRP::Protocol
|
|
520
546
|
when TRP::Message::Command::GRAPH_REQUEST
|
521
547
|
fix_TRP_Fields( TRP::GraphRequest, params)
|
522
548
|
req.graph_request = TRP::GraphRequest.new(params)
|
549
|
+
when TRP::Message::Command::RUNTOOL_REQUEST
|
550
|
+
fix_TRP_Fields( TRP::RunToolRequest, params)
|
551
|
+
req.run_tool_request = TRP::RunToolRequest.new(params)
|
552
|
+
when TRP::Message::Command::TOOL_INFO_REQUEST
|
553
|
+
fix_TRP_Fields( TRP::ToolInfoRequest, params)
|
554
|
+
req.tool_info_request = TRP::ToolInfoRequest.new(params)
|
523
555
|
else
|
524
556
|
raise "Unknown TRP command ID"
|
525
557
|
end
|
@@ -619,6 +651,10 @@ module TrisulRP::Protocol
|
|
619
651
|
resp.file_response
|
620
652
|
when TRP::Message::Command::GRAPH_RESPONSE
|
621
653
|
resp.graph_response
|
654
|
+
when TRP::Message::Command::RUNTOOL_RESPONSE
|
655
|
+
resp.run_tool_response
|
656
|
+
when TRP::Message::Command::TOOL_INFO_RESPONSE
|
657
|
+
resp.tool_info_response
|
622
658
|
else
|
623
659
|
raise "#{resp.trp_command.to_i} Unknown TRP command ID"
|
624
660
|
end
|
data/lib/trisulrp/trp.pb.rb
CHANGED
@@ -165,6 +165,13 @@ module TRP
|
|
165
165
|
define :GRAPH_RESPONSE, 131
|
166
166
|
define :AGGREGATE_SESSIONS_REQUEST, 132
|
167
167
|
define :AGGREGATE_SESSIONS_RESPONSE, 133
|
168
|
+
define :RUNTOOL_REQUEST, 134
|
169
|
+
define :RUNTOOL_RESPONSE, 135
|
170
|
+
define :HA_CONTROL_REQUEST, 140
|
171
|
+
define :HA_CONTROL_RESPONSE, 141
|
172
|
+
define :DOMAIN_PING, 142
|
173
|
+
define :TOOL_INFO_REQUEST, 143
|
174
|
+
define :TOOL_INFO_RESPONSE, 144
|
168
175
|
end
|
169
176
|
|
170
177
|
end
|
@@ -186,6 +193,7 @@ module TRP
|
|
186
193
|
class AggregateSessionsRequest < ::Protobuf::Message; end
|
187
194
|
class AggregateSessionsResponse < ::Protobuf::Message
|
188
195
|
class KeyTCount < ::Protobuf::Message; end
|
196
|
+
class TagGroup < ::Protobuf::Message; end
|
189
197
|
|
190
198
|
end
|
191
199
|
|
@@ -245,6 +253,18 @@ module TRP
|
|
245
253
|
|
246
254
|
end
|
247
255
|
|
256
|
+
class HAControlRequest < ::Protobuf::Message
|
257
|
+
class HAOperation < ::Protobuf::Enum
|
258
|
+
define :HA_TEST_REACHABILITY, 0
|
259
|
+
define :HA_SWITCH_BACKUP, 1
|
260
|
+
define :HA_SWITCH_PRIMARY, 2
|
261
|
+
end
|
262
|
+
|
263
|
+
end
|
264
|
+
|
265
|
+
class HAControlResponse < ::Protobuf::Message; end
|
266
|
+
class ToolInfoRequest < ::Protobuf::Message; end
|
267
|
+
class ToolInfoResponse < ::Protobuf::Message; end
|
248
268
|
class NodeConfigRequest < ::Protobuf::Message
|
249
269
|
class IntelFeed < ::Protobuf::Message; end
|
250
270
|
|
@@ -283,6 +303,18 @@ module TRP
|
|
283
303
|
class FileResponse < ::Protobuf::Message; end
|
284
304
|
class GraphRequest < ::Protobuf::Message; end
|
285
305
|
class GraphResponse < ::Protobuf::Message; end
|
306
|
+
class RunToolRequest < ::Protobuf::Message
|
307
|
+
class NodeTool < ::Protobuf::Enum
|
308
|
+
define :PING, 1
|
309
|
+
define :DF, 2
|
310
|
+
define :GEOQUERY, 3
|
311
|
+
define :TOP, 4
|
312
|
+
define :BGPQUERY, 5
|
313
|
+
end
|
314
|
+
|
315
|
+
end
|
316
|
+
|
317
|
+
class RunToolResponse < ::Protobuf::Message; end
|
286
318
|
|
287
319
|
|
288
320
|
##
|
@@ -348,6 +380,9 @@ module TRP
|
|
348
380
|
optional :string, :description, 4
|
349
381
|
optional :int64, :metric, 5
|
350
382
|
repeated ::TRP::KeyT::NameValueT, :attributes, 6
|
383
|
+
optional :int64, :metric_max, 7
|
384
|
+
optional :int64, :metric_min, 8
|
385
|
+
optional :int64, :metric_avg, 9
|
351
386
|
end
|
352
387
|
|
353
388
|
class CounterGroupT
|
@@ -520,6 +555,12 @@ module TRP
|
|
520
555
|
optional ::TRP::AggregateSessionsResponse, :aggregate_sessions_response, 141
|
521
556
|
optional ::TRP::AggregateResourcesRequest, :aggregate_resources_request, 142
|
522
557
|
optional ::TRP::AggregateResourcesResponse, :aggregate_resources_response, 143
|
558
|
+
optional ::TRP::RunToolRequest, :run_tool_request, 144
|
559
|
+
optional ::TRP::RunToolResponse, :run_tool_response, 145
|
560
|
+
optional ::TRP::HAControlRequest, :ha_control_request, 150
|
561
|
+
optional ::TRP::HAControlResponse, :ha_control_response, 151
|
562
|
+
optional ::TRP::ToolInfoRequest, :tool_info_request, 152
|
563
|
+
optional ::TRP::ToolInfoResponse, :tool_info_response, 153
|
523
564
|
optional :string, :destination_node, 200
|
524
565
|
optional :string, :probe_id, 201
|
525
566
|
optional :bool, :run_async, 202
|
@@ -535,6 +576,8 @@ module TRP
|
|
535
576
|
optional :string, :station_id_request, 2
|
536
577
|
optional :string, :message, 3
|
537
578
|
optional :int64, :local_timestamp, 4
|
579
|
+
optional :string, :local_timestamp_string, 5
|
580
|
+
optional :bool, :is_primary, 6
|
538
581
|
end
|
539
582
|
|
540
583
|
class ErrorResponse
|
@@ -554,6 +597,7 @@ module TRP
|
|
554
597
|
required ::TRP::KeyT, :key, 4
|
555
598
|
required ::TRP::TimeInterval, :time_interval, 5
|
556
599
|
optional :int64, :volumes_only, 6, :default => 0
|
600
|
+
optional :bool, :get_key_attributes, 7, :default => false
|
557
601
|
end
|
558
602
|
|
559
603
|
class CounterItemResponse
|
@@ -561,6 +605,9 @@ module TRP
|
|
561
605
|
required ::TRP::KeyT, :key, 2
|
562
606
|
optional ::TRP::StatsArray, :totals, 3
|
563
607
|
repeated ::TRP::StatsArray, :stats, 4
|
608
|
+
optional ::TRP::StatsArray, :maximums, 5
|
609
|
+
optional ::TRP::StatsArray, :minimums, 6
|
610
|
+
optional ::TRP::StatsArray, :samples, 8
|
564
611
|
end
|
565
612
|
|
566
613
|
class CounterGroupTopperRequest
|
@@ -571,6 +618,9 @@ module TRP
|
|
571
618
|
optional ::TRP::Timestamp, :time_instant, 6
|
572
619
|
optional :int64, :flags, 7
|
573
620
|
optional :bool, :resolve_keys, 8, :default => true
|
621
|
+
optional :string, :key_filter, 9
|
622
|
+
optional :string, :inverse_key_filter, 10
|
623
|
+
optional :bool, :get_key_attributes, 11, :default => false
|
574
624
|
end
|
575
625
|
|
576
626
|
class CounterGroupTopperResponse
|
@@ -629,6 +679,7 @@ module TRP
|
|
629
679
|
optional :bool, :resolve_keys, 21, :default => true
|
630
680
|
optional :string, :outputpath, 22
|
631
681
|
repeated :string, :idlist, 23
|
682
|
+
optional ::TRP::KeyT, :any_nf_ifindex, 24
|
632
683
|
end
|
633
684
|
|
634
685
|
class QuerySessionsResponse
|
@@ -655,7 +706,8 @@ module TRP
|
|
655
706
|
optional :string, :subnet_24, 17
|
656
707
|
optional :string, :subnet_16, 18
|
657
708
|
optional :int64, :aggregate_topcount, 19, :default => 100
|
658
|
-
|
709
|
+
repeated :string, :group_by_fields, 20
|
710
|
+
optional ::TRP::KeyT, :any_nf_ifindex, 21
|
659
711
|
end
|
660
712
|
|
661
713
|
class AggregateSessionsResponse
|
@@ -665,6 +717,11 @@ module TRP
|
|
665
717
|
required :int64, :metric, 3
|
666
718
|
end
|
667
719
|
|
720
|
+
class TagGroup
|
721
|
+
required :string, :group_name, 1
|
722
|
+
repeated ::TRP::AggregateSessionsResponse::KeyTCount, :tag_metrics, 2
|
723
|
+
end
|
724
|
+
|
668
725
|
required :string, :session_group, 2
|
669
726
|
optional ::TRP::TimeInterval, :time_interval, 3
|
670
727
|
repeated ::TRP::AggregateSessionsResponse::KeyTCount, :source_ip, 5
|
@@ -683,11 +740,14 @@ module TRP
|
|
683
740
|
repeated ::TRP::AggregateSessionsResponse::KeyTCount, :internal_port, 18
|
684
741
|
repeated ::TRP::AggregateSessionsResponse::KeyTCount, :internal_ip, 19
|
685
742
|
repeated ::TRP::AggregateSessionsResponse::KeyTCount, :external_ip, 20
|
743
|
+
repeated ::TRP::AggregateSessionsResponse::TagGroup, :tag_group, 21
|
686
744
|
end
|
687
745
|
|
688
746
|
class UpdateKeyRequest
|
689
747
|
required :string, :counter_group, 2
|
690
748
|
repeated ::TRP::KeyT, :keys, 4
|
749
|
+
optional :bool, :remove_all_attributes, 5
|
750
|
+
repeated :string, :remove_attributes, 6
|
691
751
|
end
|
692
752
|
|
693
753
|
class SessionTrackerRequest
|
@@ -805,6 +865,8 @@ module TRP
|
|
805
865
|
optional :int64, :meter, 3, :default => 0
|
806
866
|
optional :int64, :maxitems, 4, :default => 100
|
807
867
|
optional ::TRP::TimeInterval, :time_interval, 5
|
868
|
+
optional :string, :key_filter, 6
|
869
|
+
optional :string, :inverse_key_filter, 7
|
808
870
|
end
|
809
871
|
|
810
872
|
class TopperTrendResponse
|
@@ -920,6 +982,7 @@ module TRP
|
|
920
982
|
optional :string, :extra_info, 4
|
921
983
|
optional ::TRP::Timestamp, :register_time, 5
|
922
984
|
optional ::TRP::Timestamp, :heartbeat_time, 6
|
985
|
+
optional :bool, :is_primary, 7, :default => true
|
923
986
|
end
|
924
987
|
|
925
988
|
required ::TRP::DomainOperation, :cmd, 1
|
@@ -929,12 +992,39 @@ module TRP
|
|
929
992
|
optional :bool, :need_reconnect, 5, :default => false
|
930
993
|
end
|
931
994
|
|
995
|
+
class HAControlRequest
|
996
|
+
required ::TRP::HAControlRequest::HAOperation, :cmd, 1
|
997
|
+
optional :string, :station_id, 2
|
998
|
+
optional :string, :params, 3
|
999
|
+
end
|
1000
|
+
|
1001
|
+
class HAControlResponse
|
1002
|
+
optional :bool, :control_success, 1
|
1003
|
+
optional :string, :station_id, 2
|
1004
|
+
optional :string, :status_message, 3
|
1005
|
+
optional :bool, :primary_reachable, 4
|
1006
|
+
optional :bool, :backup_reachable, 5
|
1007
|
+
end
|
1008
|
+
|
1009
|
+
class ToolInfoRequest
|
1010
|
+
optional :string, :context_name, 1
|
1011
|
+
optional :string, :tool_name, 2
|
1012
|
+
repeated :string, :tool_info_requested, 3
|
1013
|
+
end
|
1014
|
+
|
1015
|
+
class ToolInfoResponse
|
1016
|
+
repeated ::TRP::NameValue, :tool_info, 1
|
1017
|
+
end
|
1018
|
+
|
932
1019
|
class NodeConfigRequest
|
933
1020
|
class IntelFeed
|
934
1021
|
required :string, :guid, 1
|
935
1022
|
optional :string, :name, 2
|
936
1023
|
optional :string, :download_rules, 3
|
937
1024
|
repeated :string, :uri, 4
|
1025
|
+
repeated :string, :usernodes, 5
|
1026
|
+
optional :int64, :sub_feed_id, 6, :default => -1
|
1027
|
+
optional :bool, :restore_mode, 7, :default => false
|
938
1028
|
end
|
939
1029
|
|
940
1030
|
optional :string, :message, 1
|
@@ -942,6 +1032,7 @@ module TRP
|
|
942
1032
|
optional ::TRP::NodeConfigRequest::IntelFeed, :process_new_feed, 3
|
943
1033
|
optional :bool, :get_all_nodes, 4, :default => true
|
944
1034
|
repeated ::TRP::NameValue, :query_config, 5
|
1035
|
+
optional ::TRP::NodeConfigRequest::IntelFeed, :remove_feed, 6
|
945
1036
|
end
|
946
1037
|
|
947
1038
|
class NodeConfigResponse
|
@@ -967,6 +1058,7 @@ module TRP
|
|
967
1058
|
class ContextInfoRequest
|
968
1059
|
optional :string, :context_name, 1
|
969
1060
|
optional :bool, :get_size_on_disk, 2, :default => false
|
1061
|
+
optional :string, :tool_name, 3
|
970
1062
|
end
|
971
1063
|
|
972
1064
|
class ContextInfoResponse
|
@@ -1144,5 +1236,17 @@ module TRP
|
|
1144
1236
|
repeated ::TRP::EdgeGraphT, :graphs, 3
|
1145
1237
|
end
|
1146
1238
|
|
1239
|
+
class RunToolRequest
|
1240
|
+
required :string, :context_name, 1
|
1241
|
+
required ::TRP::RunToolRequest::NodeTool, :tool, 2
|
1242
|
+
optional :string, :tool_input, 3
|
1243
|
+
optional :string, :tool_input_file_data, 4
|
1244
|
+
end
|
1245
|
+
|
1246
|
+
class RunToolResponse
|
1247
|
+
required :string, :context_name, 1
|
1248
|
+
optional :string, :tool_output, 2
|
1249
|
+
end
|
1250
|
+
|
1147
1251
|
end
|
1148
1252
|
|
data/lib/trisulrp/trp.proto
CHANGED
@@ -107,6 +107,9 @@ message KeyT {
|
|
107
107
|
required string attr_value=2;
|
108
108
|
}
|
109
109
|
repeated NameValueT attributes=6; /// New: Attributes are NVP for keys
|
110
|
+
optional int64 metric_max=7; /// optional : max observed value for metric in context
|
111
|
+
optional int64 metric_min=8; /// optional : max observed value for metric
|
112
|
+
optional int64 metric_avg=9; /// optional : max observed value for metric
|
110
113
|
}
|
111
114
|
|
112
115
|
|
@@ -350,6 +353,14 @@ message Message {
|
|
350
353
|
GRAPH_RESPONSE=131;
|
351
354
|
AGGREGATE_SESSIONS_REQUEST=132;
|
352
355
|
AGGREGATE_SESSIONS_RESPONSE=133;
|
356
|
+
RUNTOOL_REQUEST=134;
|
357
|
+
RUNTOOL_RESPONSE=135;
|
358
|
+
HA_CONTROL_REQUEST=140;
|
359
|
+
HA_CONTROL_RESPONSE=141;
|
360
|
+
DOMAIN_PING=142;
|
361
|
+
TOOL_INFO_REQUEST=143;
|
362
|
+
TOOL_INFO_RESPONSE=144;
|
363
|
+
|
353
364
|
}
|
354
365
|
|
355
366
|
required Command trp_command=1;
|
@@ -417,6 +428,12 @@ message Message {
|
|
417
428
|
optional AggregateSessionsResponse aggregate_sessions_response=141;
|
418
429
|
optional AggregateResourcesRequest aggregate_resources_request=142;
|
419
430
|
optional AggregateResourcesResponse aggregate_resources_response=143;
|
431
|
+
optional RunToolRequest run_tool_request=144;
|
432
|
+
optional RunToolResponse run_tool_response=145;
|
433
|
+
optional HAControlRequest ha_control_request=150;
|
434
|
+
optional HAControlResponse ha_control_response=151;
|
435
|
+
optional ToolInfoRequest tool_info_request=152;
|
436
|
+
optional ToolInfoResponse tool_info_response=153;
|
420
437
|
optional string destination_node=200; // todo move 2nd
|
421
438
|
optional string probe_id=201; // todo move 3rd
|
422
439
|
optional bool run_async=202; /// if run_async = true, then you will immediately get a AsynResponse with a token you can poll
|
@@ -443,6 +460,8 @@ message HelloResponse{
|
|
443
460
|
optional string station_id_request=2; /// station id found in the request
|
444
461
|
optional string message=3; /// message found in the request
|
445
462
|
optional int64 local_timestamp=4; /// local timestamp at server, used to detect drifts
|
463
|
+
optional string local_timestamp_string=5; /// on server with time zone, use this
|
464
|
+
optional bool is_primary=6; /// is this a primary or HA node
|
446
465
|
}
|
447
466
|
|
448
467
|
/// ErrorResponse
|
@@ -469,6 +488,7 @@ message CounterItemRequest{
|
|
469
488
|
required KeyT key=4; /// key (can specify key.key, key.label, etc too
|
470
489
|
required TimeInterval time_interval=5; /// Time interval for query
|
471
490
|
optional int64 volumes_only=6 [default=0]; /// if '1' ; then only retrieves totals for each meter
|
491
|
+
optional bool get_key_attributes=7 [default=false]; /// if true, response keys get key_attributes as well
|
472
492
|
}
|
473
493
|
|
474
494
|
/// CounterItemResponse -
|
@@ -477,6 +497,9 @@ message CounterItemResponse{
|
|
477
497
|
required KeyT key=2; /// key : filled up with readable,label automatically
|
478
498
|
optional StatsArray totals=3; /// if volumes_only = 1 in request, this contains totals for each metric
|
479
499
|
repeated StatsArray stats=4; /// time series stats - can use to draw charts etc
|
500
|
+
optional StatsArray maximums=5; /// if volumes_only = 1 this contains MAX(..)
|
501
|
+
optional StatsArray minimums=6; /// if volumes_only = 1 this contains MIN(..)
|
502
|
+
optional StatsArray samples=8; /// if volumes_only = 1 this contains SAMPLES(..)
|
480
503
|
}
|
481
504
|
|
482
505
|
|
@@ -489,6 +512,11 @@ message CounterGroupTopperRequest{
|
|
489
512
|
optional Timestamp time_instant=6; ///
|
490
513
|
optional int64 flags=7;
|
491
514
|
optional bool resolve_keys=8 [default=true]; /// retrieve labels as set in the response for each key
|
515
|
+
optional string key_filter=9; /// only get keys with this pattern and SYS:GROUP
|
516
|
+
optional string inverse_key_filter=10; /// only get keys without this pattern NOT
|
517
|
+
optional bool get_key_attributes=11 [default=false];
|
518
|
+
/// if true, response keys get key_attributes as well
|
519
|
+
|
492
520
|
}
|
493
521
|
|
494
522
|
/// CounterGroupTopperResponse
|
@@ -543,7 +571,7 @@ message QuerySessionsRequest {
|
|
543
571
|
optional KeyT dest_ip=7;
|
544
572
|
optional KeyT dest_port=8;
|
545
573
|
optional KeyT any_ip=9; /// source or dest match
|
546
|
-
optional KeyT any_port=10;
|
574
|
+
optional KeyT any_port=10; /// source or dest match
|
547
575
|
repeated KeyT ip_pair=11; /// array of 2 ips
|
548
576
|
optional KeyT protocol=12;
|
549
577
|
optional string flowtag=13; /// string flow tagger text
|
@@ -557,6 +585,7 @@ message QuerySessionsRequest {
|
|
557
585
|
optional bool resolve_keys=21[default=true];
|
558
586
|
optional string outputpath=22; /// write results to a file (CSV) on trisul-hub (for very large dumps)
|
559
587
|
repeated string idlist=23; /// array of flow ids , usually from SessionTracker response
|
588
|
+
optional KeyT any_nf_ifindex=24; /// composite query for both ifindex
|
560
589
|
}
|
561
590
|
|
562
591
|
|
@@ -590,7 +619,8 @@ message AggregateSessionsRequest {
|
|
590
619
|
optional string subnet_24=17; /// ip /24 subnet matching
|
591
620
|
optional string subnet_16=18; /// ip /16 subnet
|
592
621
|
optional int64 aggregate_topcount=19[default=100]; /// number of count-star per field
|
593
|
-
|
622
|
+
repeated string group_by_fields=20; /// list of field names
|
623
|
+
optional KeyT any_nf_ifindex=21; /// matches either gen2 or gen3
|
594
624
|
}
|
595
625
|
|
596
626
|
/// AggregateSessionsResponse
|
@@ -603,6 +633,11 @@ message AggregateSessionsResponse {
|
|
603
633
|
required int64 metric=3; /// aggregated metrics, eg total bytes
|
604
634
|
}
|
605
635
|
|
636
|
+
message TagGroup {
|
637
|
+
required string group_name=1;
|
638
|
+
repeated KeyTCount tag_metrics=2;
|
639
|
+
}
|
640
|
+
|
606
641
|
required string session_group=2;
|
607
642
|
optional TimeInterval time_interval=3;
|
608
643
|
repeated KeyTCount source_ip=5; /// top IPs
|
@@ -621,13 +656,17 @@ message AggregateSessionsResponse {
|
|
621
656
|
repeated KeyTCount internal_port=18; /// internal IP ports
|
622
657
|
repeated KeyTCount internal_ip=19; /// internal IPs
|
623
658
|
repeated KeyTCount external_ip=20; /// external IPs
|
659
|
+
repeated TagGroup tag_group=21; /// tag groups
|
624
660
|
}
|
625
661
|
|
662
|
+
|
626
663
|
/// UpdatekeysRequest
|
627
664
|
/// Response = OKResponse or ErrorResponse
|
628
665
|
message UpdateKeyRequest{
|
629
666
|
required string counter_group=2;
|
630
|
-
repeated KeyT keys=4;
|
667
|
+
repeated KeyT keys=4; /// key : if you set both key and label, the DB label will be updated
|
668
|
+
optional bool remove_all_attributes=5; /// remove all key attributes from keys
|
669
|
+
repeated string remove_attributes=6; /// remove these attributes only from keys
|
631
670
|
}
|
632
671
|
|
633
672
|
/// SessionTrackerRequest - query session trackers
|
@@ -775,6 +814,8 @@ message TopperTrendRequest {
|
|
775
814
|
optional int64 meter=3 [default=0];
|
776
815
|
optional int64 maxitems=4 [default=100];
|
777
816
|
optional TimeInterval time_interval=5;
|
817
|
+
optional string key_filter=6; /// only get keys with this pattern and SYS:GROUP
|
818
|
+
optional string inverse_key_filter=7; /// only get keys without this pattern NOT
|
778
819
|
}
|
779
820
|
|
780
821
|
/// TopperTrendResponse
|
@@ -841,9 +882,16 @@ message QueryFTSResponse {
|
|
841
882
|
/// get the METERS METASLICE info
|
842
883
|
/// .. response = TimeSlicesResponse
|
843
884
|
message TimeSlicesRequest {
|
844
|
-
optional bool get_disk_usage=1[default=false];
|
845
|
-
|
846
|
-
optional bool
|
885
|
+
optional bool get_disk_usage=1[default=false]; /// get disk usage per SLICE
|
886
|
+
|
887
|
+
optional bool get_all_engines=2[default=false]; /// by default (set to false) we only get instance-0
|
888
|
+
/// because are interested in iterating over
|
889
|
+
/// the time interval rather then each slice
|
890
|
+
/// inside the time interval. set this to true
|
891
|
+
/// if you want each slice to be reported
|
892
|
+
|
893
|
+
optional bool get_total_window=3[default=false]; /// just get the total time window in the
|
894
|
+
/// trisul database
|
847
895
|
}
|
848
896
|
|
849
897
|
/// .. response = TimeSlicesResponse
|
@@ -943,6 +991,7 @@ message DomainResponse {
|
|
943
991
|
optional string extra_info=4;
|
944
992
|
optional Timestamp register_time=5;
|
945
993
|
optional Timestamp heartbeat_time=6;
|
994
|
+
optional bool is_primary=7[default=true]; /// primary or backup HA mode
|
946
995
|
|
947
996
|
}
|
948
997
|
|
@@ -953,22 +1002,62 @@ message DomainResponse {
|
|
953
1002
|
optional bool need_reconnect=5[default=false];
|
954
1003
|
}
|
955
1004
|
|
1005
|
+
/// messages to HAControl
|
1006
|
+
message HAControlRequest {
|
1007
|
+
enum HAOperation
|
1008
|
+
{
|
1009
|
+
HA_TEST_REACHABILITY=0; /// test if primary or backup is reachable (test the other side)
|
1010
|
+
HA_SWITCH_BACKUP=1; /// switch all nodes to backup HA
|
1011
|
+
HA_SWITCH_PRIMARY=2; /// switch to primary HA
|
1012
|
+
}
|
1013
|
+
|
1014
|
+
|
1015
|
+
required HAOperation cmd=1;
|
1016
|
+
optional string station_id=2;
|
1017
|
+
optional string params=3;
|
1018
|
+
}
|
1019
|
+
|
1020
|
+
message HAControlResponse {
|
1021
|
+
optional bool control_success=1;
|
1022
|
+
optional string station_id=2;
|
1023
|
+
optional string status_message=3;
|
1024
|
+
optional bool primary_reachable=4;
|
1025
|
+
optional bool backup_reachable=5;
|
1026
|
+
}
|
1027
|
+
|
1028
|
+
/// tool info
|
1029
|
+
/// general purpose probe information gathering tool
|
1030
|
+
/// use cases : get BGP route receiver peer status
|
1031
|
+
message ToolInfoRequest {
|
1032
|
+
optional string context_name=1;
|
1033
|
+
optional string tool_name=2;
|
1034
|
+
repeated string tool_info_requested=3; /// array of information elements requested
|
1035
|
+
}
|
1036
|
+
|
1037
|
+
message ToolInfoResponse {
|
1038
|
+
repeated NameValue tool_info=1; /// info elements Name=Value
|
1039
|
+
}
|
1040
|
+
|
956
1041
|
|
957
1042
|
message NodeConfigRequest {
|
958
1043
|
optional string message=1;
|
959
1044
|
|
960
1045
|
message IntelFeed {
|
961
|
-
required string guid=1;
|
962
|
-
optional string name=2;
|
963
|
-
optional string download_rules=3;
|
964
|
-
repeated string uri=4;
|
1046
|
+
required string guid=1; /// identifying feed group (eg Geo, Badfellas)
|
1047
|
+
optional string name=2; /// feed name (eg badfellas)
|
1048
|
+
optional string download_rules=3; /// xml file with feed update instructions
|
1049
|
+
repeated string uri=4; /// individual files in config//.. for FileRequest download
|
1050
|
+
repeated string usernodes=5; /// user requesting the feed, the probe0, probe1, etc
|
1051
|
+
optional int64 sub_feed_id=6[default=-1];/// sub feed ID, when a feed consists of several sub-feeds
|
1052
|
+
optional bool restore_mode=7[default=false]; /// restore mode will backup and restore, used with add,remove
|
1053
|
+
|
965
1054
|
}
|
966
1055
|
|
967
1056
|
optional IntelFeed add_feed=2;
|
968
1057
|
optional IntelFeed process_new_feed=3;
|
969
1058
|
optional bool get_all_nodes=4[default=true];
|
970
1059
|
repeated NameValue query_config=5;
|
971
|
-
|
1060
|
+
optional IntelFeed remove_feed=6;
|
972
1061
|
}
|
973
1062
|
|
974
1063
|
message NodeConfigResponse {
|
@@ -999,8 +1088,9 @@ message ContextCreateRequest {
|
|
999
1088
|
/// ContextInfo : one or all contexts
|
1000
1089
|
/// use is_init to prime with config
|
1001
1090
|
message ContextInfoRequest {
|
1002
|
-
optional string context_name=1;
|
1091
|
+
optional string context_name=1; /// if not set all context get in
|
1003
1092
|
optional bool get_size_on_disk=2[default=false]; /// get size on disk (expensive)
|
1093
|
+
optional string tool_name=3; /// get status of this tool, freeform bgp, suricata, snort, udpsink etc..
|
1004
1094
|
}
|
1005
1095
|
|
1006
1096
|
message ContextInfoResponse {
|
@@ -1010,11 +1100,11 @@ message ContextInfoResponse {
|
|
1010
1100
|
{
|
1011
1101
|
required string context_name=1;
|
1012
1102
|
required bool is_initialized=2;
|
1013
|
-
required bool is_running=3;
|
1103
|
+
required bool is_running=3; /// trisul processes runs
|
1014
1104
|
optional int64 size_on_disk=4;
|
1015
1105
|
optional TimeInterval time_interval=5;
|
1016
1106
|
optional bool is_clean=6;
|
1017
|
-
optional string extrainfo=7;
|
1107
|
+
optional string extrainfo=7; /// freeform text output when tool is specified , can be long string
|
1018
1108
|
repeated TimeInterval run_history=8;
|
1019
1109
|
optional string profile=9;
|
1020
1110
|
optional string runmode=10;
|
@@ -1231,3 +1321,24 @@ message GraphResponse {
|
|
1231
1321
|
/// repeated because returned in time chunks
|
1232
1322
|
}
|
1233
1323
|
|
1324
|
+
/// RunToolRequest : run set of named tools
|
1325
|
+
message RunToolRequest {
|
1326
|
+
required string context_name=1; /// if not set all context get in
|
1327
|
+
enum NodeTool {
|
1328
|
+
PING=1;
|
1329
|
+
DF=2;
|
1330
|
+
GEOQUERY=3;
|
1331
|
+
TOP=4;
|
1332
|
+
BGPQUERY=5;
|
1333
|
+
}
|
1334
|
+
required NodeTool tool=2; /// which of these tools you want to run on node
|
1335
|
+
optional string tool_input=3; /// input
|
1336
|
+
optional string tool_input_file_data=4;/// data that goes into a tool input file
|
1337
|
+
}
|
1338
|
+
|
1339
|
+
/// RunToolResponse : ouput
|
1340
|
+
message RunToolResponse {
|
1341
|
+
required string context_name=1; /// if not set all context get in
|
1342
|
+
optional string tool_output=2; /// cmd lines
|
1343
|
+
}
|
1344
|
+
|
data/trisulrp.gemspec
CHANGED
@@ -2,18 +2,18 @@
|
|
2
2
|
# DO NOT EDIT THIS FILE DIRECTLY
|
3
3
|
# Instead, edit Juwelier::Tasks in Rakefile, and run 'rake gemspec'
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
|
-
# stub: trisulrp 3.2.
|
5
|
+
# stub: trisulrp 3.2.27 ruby lib
|
6
6
|
|
7
7
|
Gem::Specification.new do |s|
|
8
|
-
s.name = "trisulrp"
|
9
|
-
s.version = "3.2.
|
8
|
+
s.name = "trisulrp".freeze
|
9
|
+
s.version = "3.2.27"
|
10
10
|
|
11
|
-
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
12
|
-
s.require_paths = ["lib"]
|
13
|
-
s.authors = ["vivek"]
|
14
|
-
s.date = "
|
15
|
-
s.description = "This gem deals about the trisul remote protocol"
|
16
|
-
s.email = "vivek_rajagopal@yahoo.com"
|
11
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
|
12
|
+
s.require_paths = ["lib".freeze]
|
13
|
+
s.authors = ["vivek".freeze]
|
14
|
+
s.date = "2021-04-20"
|
15
|
+
s.description = "This gem deals about the trisul remote protocol".freeze
|
16
|
+
s.email = "vivek_rajagopal@yahoo.com".freeze
|
17
17
|
s.extra_rdoc_files = [
|
18
18
|
"LICENSE.txt",
|
19
19
|
"README.rdoc"
|
@@ -47,33 +47,33 @@ Gem::Specification.new do |s|
|
|
47
47
|
"test/test_trisulrp.rb",
|
48
48
|
"trisulrp.gemspec"
|
49
49
|
]
|
50
|
-
s.homepage = "http://github.com/vivekrajan/trisulrp"
|
51
|
-
s.licenses = ["MIT"]
|
52
|
-
s.rubygems_version = "
|
53
|
-
s.summary = "trisul trp"
|
50
|
+
s.homepage = "http://github.com/vivekrajan/trisulrp".freeze
|
51
|
+
s.licenses = ["MIT".freeze]
|
52
|
+
s.rubygems_version = "3.0.3".freeze
|
53
|
+
s.summary = "trisul trp".freeze
|
54
54
|
|
55
55
|
if s.respond_to? :specification_version then
|
56
56
|
s.specification_version = 4
|
57
57
|
|
58
58
|
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
59
|
-
s.add_runtime_dependency(%q<protobuf
|
60
|
-
s.add_development_dependency(%q<shoulda
|
61
|
-
s.add_development_dependency(%q<bundler
|
62
|
-
s.add_development_dependency(%q<juwelier
|
63
|
-
s.add_development_dependency(%q<simplecov
|
59
|
+
s.add_runtime_dependency(%q<protobuf>.freeze, [">= 0"])
|
60
|
+
s.add_development_dependency(%q<shoulda>.freeze, [">= 0"])
|
61
|
+
s.add_development_dependency(%q<bundler>.freeze, [">= 0"])
|
62
|
+
s.add_development_dependency(%q<juwelier>.freeze, [">= 0"])
|
63
|
+
s.add_development_dependency(%q<simplecov>.freeze, [">= 0"])
|
64
64
|
else
|
65
|
-
s.add_dependency(%q<protobuf
|
66
|
-
s.add_dependency(%q<shoulda
|
67
|
-
s.add_dependency(%q<bundler
|
68
|
-
s.add_dependency(%q<juwelier
|
69
|
-
s.add_dependency(%q<simplecov
|
65
|
+
s.add_dependency(%q<protobuf>.freeze, [">= 0"])
|
66
|
+
s.add_dependency(%q<shoulda>.freeze, [">= 0"])
|
67
|
+
s.add_dependency(%q<bundler>.freeze, [">= 0"])
|
68
|
+
s.add_dependency(%q<juwelier>.freeze, [">= 0"])
|
69
|
+
s.add_dependency(%q<simplecov>.freeze, [">= 0"])
|
70
70
|
end
|
71
71
|
else
|
72
|
-
s.add_dependency(%q<protobuf
|
73
|
-
s.add_dependency(%q<shoulda
|
74
|
-
s.add_dependency(%q<bundler
|
75
|
-
s.add_dependency(%q<juwelier
|
76
|
-
s.add_dependency(%q<simplecov
|
72
|
+
s.add_dependency(%q<protobuf>.freeze, [">= 0"])
|
73
|
+
s.add_dependency(%q<shoulda>.freeze, [">= 0"])
|
74
|
+
s.add_dependency(%q<bundler>.freeze, [">= 0"])
|
75
|
+
s.add_dependency(%q<juwelier>.freeze, [">= 0"])
|
76
|
+
s.add_dependency(%q<simplecov>.freeze, [">= 0"])
|
77
77
|
end
|
78
78
|
end
|
79
79
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: trisulrp
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.2.
|
4
|
+
version: 3.2.27
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- vivek
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-04-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: protobuf
|
@@ -134,8 +134,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
134
134
|
- !ruby/object:Gem::Version
|
135
135
|
version: '0'
|
136
136
|
requirements: []
|
137
|
-
|
138
|
-
rubygems_version: 2.5.1
|
137
|
+
rubygems_version: 3.0.3
|
139
138
|
signing_key:
|
140
139
|
specification_version: 4
|
141
140
|
summary: trisul trp
|