-
Notifications
You must be signed in to change notification settings - Fork 0
/
agent_api.pb.go
810 lines (710 loc) · 29.9 KB
/
agent_api.pb.go
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
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: agent_api.proto
/*
Package kolide_agent is a generated protocol buffer package.
It is generated from these files:
agent_api.proto
It has these top-level messages:
AgentApiRequest
AgentApiResponse
EnrollmentRequest
EnrollmentResponse
ConfigResponse
LogCollection
QueryCollection
ResultCollection
HealthCheckResponse
*/
package kolide_agent
import proto "github.com/golang/protobuf/proto"
import fmt "fmt"
import math "math"
import (
context "golang.org/x/net/context"
grpc "google.golang.org/grpc"
)
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
// AGENT is added as a new log type, for adding new
// logging capabilities from kolide/agent
type LogCollection_LogType int32
const (
LogCollection_RESULT LogCollection_LogType = 0
LogCollection_STATUS LogCollection_LogType = 1
LogCollection_AGENT LogCollection_LogType = 2
)
var LogCollection_LogType_name = map[int32]string{
0: "RESULT",
1: "STATUS",
2: "AGENT",
}
var LogCollection_LogType_value = map[string]int32{
"RESULT": 0,
"STATUS": 1,
"AGENT": 2,
}
func (x LogCollection_LogType) String() string {
return proto.EnumName(LogCollection_LogType_name, int32(x))
}
func (LogCollection_LogType) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{5, 0} }
type HealthCheckResponse_ServingStatus int32
const (
HealthCheckResponse_UNKNOWN HealthCheckResponse_ServingStatus = 0
HealthCheckResponse_SERVING HealthCheckResponse_ServingStatus = 1
HealthCheckResponse_NOT_SERVING HealthCheckResponse_ServingStatus = 2
)
var HealthCheckResponse_ServingStatus_name = map[int32]string{
0: "UNKNOWN",
1: "SERVING",
2: "NOT_SERVING",
}
var HealthCheckResponse_ServingStatus_value = map[string]int32{
"UNKNOWN": 0,
"SERVING": 1,
"NOT_SERVING": 2,
}
func (x HealthCheckResponse_ServingStatus) String() string {
return proto.EnumName(HealthCheckResponse_ServingStatus_name, int32(x))
}
func (HealthCheckResponse_ServingStatus) EnumDescriptor() ([]byte, []int) {
return fileDescriptor0, []int{8, 0}
}
type AgentApiRequest struct {
NodeKey string `protobuf:"bytes,1,opt,name=node_key,json=nodeKey" json:"node_key,omitempty"`
}
func (m *AgentApiRequest) Reset() { *m = AgentApiRequest{} }
func (m *AgentApiRequest) String() string { return proto.CompactTextString(m) }
func (*AgentApiRequest) ProtoMessage() {}
func (*AgentApiRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} }
func (m *AgentApiRequest) GetNodeKey() string {
if m != nil {
return m.NodeKey
}
return ""
}
type AgentApiResponse struct {
Message string `protobuf:"bytes,1,opt,name=message" json:"message,omitempty"`
ErrorCode string `protobuf:"bytes,2,opt,name=error_code,json=errorCode" json:"error_code,omitempty"`
NodeInvalid bool `protobuf:"varint,3,opt,name=node_invalid,json=nodeInvalid" json:"node_invalid,omitempty"`
}
func (m *AgentApiResponse) Reset() { *m = AgentApiResponse{} }
func (m *AgentApiResponse) String() string { return proto.CompactTextString(m) }
func (*AgentApiResponse) ProtoMessage() {}
func (*AgentApiResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} }
func (m *AgentApiResponse) GetMessage() string {
if m != nil {
return m.Message
}
return ""
}
func (m *AgentApiResponse) GetErrorCode() string {
if m != nil {
return m.ErrorCode
}
return ""
}
func (m *AgentApiResponse) GetNodeInvalid() bool {
if m != nil {
return m.NodeInvalid
}
return false
}
type EnrollmentRequest struct {
EnrollSecret string `protobuf:"bytes,1,opt,name=enroll_secret,json=enrollSecret" json:"enroll_secret,omitempty"`
HostIdentifier string `protobuf:"bytes,2,opt,name=host_identifier,json=hostIdentifier" json:"host_identifier,omitempty"`
}
func (m *EnrollmentRequest) Reset() { *m = EnrollmentRequest{} }
func (m *EnrollmentRequest) String() string { return proto.CompactTextString(m) }
func (*EnrollmentRequest) ProtoMessage() {}
func (*EnrollmentRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} }
func (m *EnrollmentRequest) GetEnrollSecret() string {
if m != nil {
return m.EnrollSecret
}
return ""
}
func (m *EnrollmentRequest) GetHostIdentifier() string {
if m != nil {
return m.HostIdentifier
}
return ""
}
type EnrollmentResponse struct {
NodeKey string `protobuf:"bytes,1,opt,name=node_key,json=nodeKey" json:"node_key,omitempty"`
NodeInvalid bool `protobuf:"varint,2,opt,name=node_invalid,json=nodeInvalid" json:"node_invalid,omitempty"`
ErrorCode string `protobuf:"bytes,3,opt,name=error_code,json=errorCode" json:"error_code,omitempty"`
}
func (m *EnrollmentResponse) Reset() { *m = EnrollmentResponse{} }
func (m *EnrollmentResponse) String() string { return proto.CompactTextString(m) }
func (*EnrollmentResponse) ProtoMessage() {}
func (*EnrollmentResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{3} }
func (m *EnrollmentResponse) GetNodeKey() string {
if m != nil {
return m.NodeKey
}
return ""
}
func (m *EnrollmentResponse) GetNodeInvalid() bool {
if m != nil {
return m.NodeInvalid
}
return false
}
func (m *EnrollmentResponse) GetErrorCode() string {
if m != nil {
return m.ErrorCode
}
return ""
}
// kolide/cloud will be generating well-structured json already, so forward
// it along instead of de/re/de-serializing it as a protobuf too
// this might make sense to convert to full proto later
type ConfigResponse struct {
ConfigJsonBlob string `protobuf:"bytes,1,opt,name=config_json_blob,json=configJsonBlob" json:"config_json_blob,omitempty"`
NodeInvalid bool `protobuf:"varint,2,opt,name=node_invalid,json=nodeInvalid" json:"node_invalid,omitempty"`
ErrorCode string `protobuf:"bytes,3,opt,name=error_code,json=errorCode" json:"error_code,omitempty"`
}
func (m *ConfigResponse) Reset() { *m = ConfigResponse{} }
func (m *ConfigResponse) String() string { return proto.CompactTextString(m) }
func (*ConfigResponse) ProtoMessage() {}
func (*ConfigResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{4} }
func (m *ConfigResponse) GetConfigJsonBlob() string {
if m != nil {
return m.ConfigJsonBlob
}
return ""
}
func (m *ConfigResponse) GetNodeInvalid() bool {
if m != nil {
return m.NodeInvalid
}
return false
}
func (m *ConfigResponse) GetErrorCode() string {
if m != nil {
return m.ErrorCode
}
return ""
}
type LogCollection struct {
NodeKey string `protobuf:"bytes,1,opt,name=node_key,json=nodeKey" json:"node_key,omitempty"`
LogType LogCollection_LogType `protobuf:"varint,2,opt,name=log_type,json=logType,enum=kolide.agent.LogCollection_LogType" json:"log_type,omitempty"`
Logs []*LogCollection_Log `protobuf:"bytes,3,rep,name=logs" json:"logs,omitempty"`
ErrorCode string `protobuf:"bytes,4,opt,name=error_code,json=errorCode" json:"error_code,omitempty"`
}
func (m *LogCollection) Reset() { *m = LogCollection{} }
func (m *LogCollection) String() string { return proto.CompactTextString(m) }
func (*LogCollection) ProtoMessage() {}
func (*LogCollection) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{5} }
func (m *LogCollection) GetNodeKey() string {
if m != nil {
return m.NodeKey
}
return ""
}
func (m *LogCollection) GetLogType() LogCollection_LogType {
if m != nil {
return m.LogType
}
return LogCollection_RESULT
}
func (m *LogCollection) GetLogs() []*LogCollection_Log {
if m != nil {
return m.Logs
}
return nil
}
func (m *LogCollection) GetErrorCode() string {
if m != nil {
return m.ErrorCode
}
return ""
}
type LogCollection_Log struct {
Data string `protobuf:"bytes,1,opt,name=data" json:"data,omitempty"`
}
func (m *LogCollection_Log) Reset() { *m = LogCollection_Log{} }
func (m *LogCollection_Log) String() string { return proto.CompactTextString(m) }
func (*LogCollection_Log) ProtoMessage() {}
func (*LogCollection_Log) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{5, 0} }
func (m *LogCollection_Log) GetData() string {
if m != nil {
return m.Data
}
return ""
}
// a query collection contains many queries
type QueryCollection struct {
Queries []*QueryCollection_Query `protobuf:"bytes,1,rep,name=queries" json:"queries,omitempty"`
NodeInvalid bool `protobuf:"varint,2,opt,name=node_invalid,json=nodeInvalid" json:"node_invalid,omitempty"`
ErrorCode string `protobuf:"bytes,3,opt,name=error_code,json=errorCode" json:"error_code,omitempty"`
}
func (m *QueryCollection) Reset() { *m = QueryCollection{} }
func (m *QueryCollection) String() string { return proto.CompactTextString(m) }
func (*QueryCollection) ProtoMessage() {}
func (*QueryCollection) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{6} }
func (m *QueryCollection) GetQueries() []*QueryCollection_Query {
if m != nil {
return m.Queries
}
return nil
}
func (m *QueryCollection) GetNodeInvalid() bool {
if m != nil {
return m.NodeInvalid
}
return false
}
func (m *QueryCollection) GetErrorCode() string {
if m != nil {
return m.ErrorCode
}
return ""
}
type QueryCollection_Query struct {
Id string `protobuf:"bytes,1,opt,name=id" json:"id,omitempty"`
Query string `protobuf:"bytes,2,opt,name=query" json:"query,omitempty"`
}
func (m *QueryCollection_Query) Reset() { *m = QueryCollection_Query{} }
func (m *QueryCollection_Query) String() string { return proto.CompactTextString(m) }
func (*QueryCollection_Query) ProtoMessage() {}
func (*QueryCollection_Query) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{6, 0} }
func (m *QueryCollection_Query) GetId() string {
if m != nil {
return m.Id
}
return ""
}
func (m *QueryCollection_Query) GetQuery() string {
if m != nil {
return m.Query
}
return ""
}
// a result collection contains many results
type ResultCollection struct {
NodeKey string `protobuf:"bytes,1,opt,name=node_key,json=nodeKey" json:"node_key,omitempty"`
Results []*ResultCollection_Result `protobuf:"bytes,2,rep,name=results" json:"results,omitempty"`
ErrorCode string `protobuf:"bytes,3,opt,name=error_code,json=errorCode" json:"error_code,omitempty"`
}
func (m *ResultCollection) Reset() { *m = ResultCollection{} }
func (m *ResultCollection) String() string { return proto.CompactTextString(m) }
func (*ResultCollection) ProtoMessage() {}
func (*ResultCollection) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{7} }
func (m *ResultCollection) GetNodeKey() string {
if m != nil {
return m.NodeKey
}
return ""
}
func (m *ResultCollection) GetResults() []*ResultCollection_Result {
if m != nil {
return m.Results
}
return nil
}
func (m *ResultCollection) GetErrorCode() string {
if m != nil {
return m.ErrorCode
}
return ""
}
// status is moved here instead of appearing as a map of id[status]
// on the ResultCollection, as it does in the osq docs
type ResultCollection_Result struct {
Id string `protobuf:"bytes,1,opt,name=id" json:"id,omitempty"`
Rows []*ResultCollection_Result_ResultRow `protobuf:"bytes,2,rep,name=rows" json:"rows,omitempty"`
Status int32 `protobuf:"varint,3,opt,name=status" json:"status,omitempty"`
}
func (m *ResultCollection_Result) Reset() { *m = ResultCollection_Result{} }
func (m *ResultCollection_Result) String() string { return proto.CompactTextString(m) }
func (*ResultCollection_Result) ProtoMessage() {}
func (*ResultCollection_Result) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{7, 0} }
func (m *ResultCollection_Result) GetId() string {
if m != nil {
return m.Id
}
return ""
}
func (m *ResultCollection_Result) GetRows() []*ResultCollection_Result_ResultRow {
if m != nil {
return m.Rows
}
return nil
}
func (m *ResultCollection_Result) GetStatus() int32 {
if m != nil {
return m.Status
}
return 0
}
type ResultCollection_Result_ResultRow struct {
Columns []*ResultCollection_Result_ResultRow_Column `protobuf:"bytes,1,rep,name=columns" json:"columns,omitempty"`
}
func (m *ResultCollection_Result_ResultRow) Reset() { *m = ResultCollection_Result_ResultRow{} }
func (m *ResultCollection_Result_ResultRow) String() string { return proto.CompactTextString(m) }
func (*ResultCollection_Result_ResultRow) ProtoMessage() {}
func (*ResultCollection_Result_ResultRow) Descriptor() ([]byte, []int) {
return fileDescriptor0, []int{7, 0, 0}
}
func (m *ResultCollection_Result_ResultRow) GetColumns() []*ResultCollection_Result_ResultRow_Column {
if m != nil {
return m.Columns
}
return nil
}
type ResultCollection_Result_ResultRow_Column struct {
Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"`
Value string `protobuf:"bytes,2,opt,name=value" json:"value,omitempty"`
}
func (m *ResultCollection_Result_ResultRow_Column) Reset() {
*m = ResultCollection_Result_ResultRow_Column{}
}
func (m *ResultCollection_Result_ResultRow_Column) String() string { return proto.CompactTextString(m) }
func (*ResultCollection_Result_ResultRow_Column) ProtoMessage() {}
func (*ResultCollection_Result_ResultRow_Column) Descriptor() ([]byte, []int) {
return fileDescriptor0, []int{7, 0, 0, 0}
}
func (m *ResultCollection_Result_ResultRow_Column) GetName() string {
if m != nil {
return m.Name
}
return ""
}
func (m *ResultCollection_Result_ResultRow_Column) GetValue() string {
if m != nil {
return m.Value
}
return ""
}
type HealthCheckResponse struct {
Status HealthCheckResponse_ServingStatus `protobuf:"varint,1,opt,name=status,enum=kolide.agent.HealthCheckResponse_ServingStatus" json:"status,omitempty"`
}
func (m *HealthCheckResponse) Reset() { *m = HealthCheckResponse{} }
func (m *HealthCheckResponse) String() string { return proto.CompactTextString(m) }
func (*HealthCheckResponse) ProtoMessage() {}
func (*HealthCheckResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{8} }
func (m *HealthCheckResponse) GetStatus() HealthCheckResponse_ServingStatus {
if m != nil {
return m.Status
}
return HealthCheckResponse_UNKNOWN
}
func init() {
proto.RegisterType((*AgentApiRequest)(nil), "kolide.agent.AgentApiRequest")
proto.RegisterType((*AgentApiResponse)(nil), "kolide.agent.AgentApiResponse")
proto.RegisterType((*EnrollmentRequest)(nil), "kolide.agent.EnrollmentRequest")
proto.RegisterType((*EnrollmentResponse)(nil), "kolide.agent.EnrollmentResponse")
proto.RegisterType((*ConfigResponse)(nil), "kolide.agent.ConfigResponse")
proto.RegisterType((*LogCollection)(nil), "kolide.agent.LogCollection")
proto.RegisterType((*LogCollection_Log)(nil), "kolide.agent.LogCollection.Log")
proto.RegisterType((*QueryCollection)(nil), "kolide.agent.QueryCollection")
proto.RegisterType((*QueryCollection_Query)(nil), "kolide.agent.QueryCollection.Query")
proto.RegisterType((*ResultCollection)(nil), "kolide.agent.ResultCollection")
proto.RegisterType((*ResultCollection_Result)(nil), "kolide.agent.ResultCollection.Result")
proto.RegisterType((*ResultCollection_Result_ResultRow)(nil), "kolide.agent.ResultCollection.Result.ResultRow")
proto.RegisterType((*ResultCollection_Result_ResultRow_Column)(nil), "kolide.agent.ResultCollection.Result.ResultRow.Column")
proto.RegisterType((*HealthCheckResponse)(nil), "kolide.agent.HealthCheckResponse")
proto.RegisterEnum("kolide.agent.LogCollection_LogType", LogCollection_LogType_name, LogCollection_LogType_value)
proto.RegisterEnum("kolide.agent.HealthCheckResponse_ServingStatus", HealthCheckResponse_ServingStatus_name, HealthCheckResponse_ServingStatus_value)
}
// Reference imports to suppress errors if they are not otherwise used.
var _ context.Context
var _ grpc.ClientConn
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
const _ = grpc.SupportPackageIsVersion4
// Client API for Api service
type ApiClient interface {
// Attempt to enroll a host with kolide/cloud
RequestEnrollment(ctx context.Context, in *EnrollmentRequest, opts ...grpc.CallOption) (*EnrollmentResponse, error)
// request an updated configuration from kolide/cloud
// a generic request object is sent
RequestConfig(ctx context.Context, in *AgentApiRequest, opts ...grpc.CallOption) (*ConfigResponse, error)
// request/pull Dist queries from kolide/cloud
// a generic request object is sent
RequestQueries(ctx context.Context, in *AgentApiRequest, opts ...grpc.CallOption) (*QueryCollection, error)
// publish logs from osqueryd to kolide/cloud
// a generic response object is returned
PublishLogs(ctx context.Context, in *LogCollection, opts ...grpc.CallOption) (*AgentApiResponse, error)
// publish results from Dist queries to kolide/cloud
// a generic response object is returned
PublishResults(ctx context.Context, in *ResultCollection, opts ...grpc.CallOption) (*AgentApiResponse, error)
// check the health of the GRPC server
// a value indicating healthiness is returned
// if you don't hear from this endpoint assume the worst
CheckHealth(ctx context.Context, in *AgentApiRequest, opts ...grpc.CallOption) (*HealthCheckResponse, error)
}
type apiClient struct {
cc *grpc.ClientConn
}
func NewApiClient(cc *grpc.ClientConn) ApiClient {
return &apiClient{cc}
}
func (c *apiClient) RequestEnrollment(ctx context.Context, in *EnrollmentRequest, opts ...grpc.CallOption) (*EnrollmentResponse, error) {
out := new(EnrollmentResponse)
err := grpc.Invoke(ctx, "/kolide.agent.Api/RequestEnrollment", in, out, c.cc, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *apiClient) RequestConfig(ctx context.Context, in *AgentApiRequest, opts ...grpc.CallOption) (*ConfigResponse, error) {
out := new(ConfigResponse)
err := grpc.Invoke(ctx, "/kolide.agent.Api/RequestConfig", in, out, c.cc, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *apiClient) RequestQueries(ctx context.Context, in *AgentApiRequest, opts ...grpc.CallOption) (*QueryCollection, error) {
out := new(QueryCollection)
err := grpc.Invoke(ctx, "/kolide.agent.Api/RequestQueries", in, out, c.cc, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *apiClient) PublishLogs(ctx context.Context, in *LogCollection, opts ...grpc.CallOption) (*AgentApiResponse, error) {
out := new(AgentApiResponse)
err := grpc.Invoke(ctx, "/kolide.agent.Api/PublishLogs", in, out, c.cc, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *apiClient) PublishResults(ctx context.Context, in *ResultCollection, opts ...grpc.CallOption) (*AgentApiResponse, error) {
out := new(AgentApiResponse)
err := grpc.Invoke(ctx, "/kolide.agent.Api/PublishResults", in, out, c.cc, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *apiClient) CheckHealth(ctx context.Context, in *AgentApiRequest, opts ...grpc.CallOption) (*HealthCheckResponse, error) {
out := new(HealthCheckResponse)
err := grpc.Invoke(ctx, "/kolide.agent.Api/CheckHealth", in, out, c.cc, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// Server API for Api service
type ApiServer interface {
// Attempt to enroll a host with kolide/cloud
RequestEnrollment(context.Context, *EnrollmentRequest) (*EnrollmentResponse, error)
// request an updated configuration from kolide/cloud
// a generic request object is sent
RequestConfig(context.Context, *AgentApiRequest) (*ConfigResponse, error)
// request/pull Dist queries from kolide/cloud
// a generic request object is sent
RequestQueries(context.Context, *AgentApiRequest) (*QueryCollection, error)
// publish logs from osqueryd to kolide/cloud
// a generic response object is returned
PublishLogs(context.Context, *LogCollection) (*AgentApiResponse, error)
// publish results from Dist queries to kolide/cloud
// a generic response object is returned
PublishResults(context.Context, *ResultCollection) (*AgentApiResponse, error)
// check the health of the GRPC server
// a value indicating healthiness is returned
// if you don't hear from this endpoint assume the worst
CheckHealth(context.Context, *AgentApiRequest) (*HealthCheckResponse, error)
}
func RegisterApiServer(s *grpc.Server, srv ApiServer) {
s.RegisterService(&_Api_serviceDesc, srv)
}
func _Api_RequestEnrollment_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(EnrollmentRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ApiServer).RequestEnrollment(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/kolide.agent.Api/RequestEnrollment",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ApiServer).RequestEnrollment(ctx, req.(*EnrollmentRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Api_RequestConfig_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(AgentApiRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ApiServer).RequestConfig(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/kolide.agent.Api/RequestConfig",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ApiServer).RequestConfig(ctx, req.(*AgentApiRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Api_RequestQueries_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(AgentApiRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ApiServer).RequestQueries(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/kolide.agent.Api/RequestQueries",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ApiServer).RequestQueries(ctx, req.(*AgentApiRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Api_PublishLogs_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(LogCollection)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ApiServer).PublishLogs(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/kolide.agent.Api/PublishLogs",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ApiServer).PublishLogs(ctx, req.(*LogCollection))
}
return interceptor(ctx, in, info, handler)
}
func _Api_PublishResults_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ResultCollection)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ApiServer).PublishResults(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/kolide.agent.Api/PublishResults",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ApiServer).PublishResults(ctx, req.(*ResultCollection))
}
return interceptor(ctx, in, info, handler)
}
func _Api_CheckHealth_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(AgentApiRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ApiServer).CheckHealth(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/kolide.agent.Api/CheckHealth",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ApiServer).CheckHealth(ctx, req.(*AgentApiRequest))
}
return interceptor(ctx, in, info, handler)
}
var _Api_serviceDesc = grpc.ServiceDesc{
ServiceName: "kolide.agent.Api",
HandlerType: (*ApiServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "RequestEnrollment",
Handler: _Api_RequestEnrollment_Handler,
},
{
MethodName: "RequestConfig",
Handler: _Api_RequestConfig_Handler,
},
{
MethodName: "RequestQueries",
Handler: _Api_RequestQueries_Handler,
},
{
MethodName: "PublishLogs",
Handler: _Api_PublishLogs_Handler,
},
{
MethodName: "PublishResults",
Handler: _Api_PublishResults_Handler,
},
{
MethodName: "CheckHealth",
Handler: _Api_CheckHealth_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "agent_api.proto",
}
func init() { proto.RegisterFile("agent_api.proto", fileDescriptor0) }
var fileDescriptor0 = []byte{
// 791 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x56, 0x41, 0x6f, 0xea, 0x46,
0x10, 0xc6,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