forked from elastic/fleet-server
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtypes.gen.go
1644 lines (1337 loc) · 57.2 KB
/
types.gen.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
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
// or more contributor license agreements. Licensed under the Elastic License;
// you may not use this file except in compliance with the Elastic License.
// Package api provides primitives to interact with the openapi HTTP API.
//
// Code generated by github.com/deepmap/oapi-codegen/v2 version v2.0.0 DO NOT EDIT.
package api
import (
"encoding/json"
"fmt"
"time"
"github.com/oapi-codegen/runtime"
)
const (
AgentApiKeyScopes = "agentApiKey.Scopes"
ApiKeyScopes = "apiKey.Scopes"
)
// Defines values for ActionType.
const (
CANCEL ActionType = "CANCEL"
INPUTACTION ActionType = "INPUT_ACTION"
POLICYCHANGE ActionType = "POLICY_CHANGE"
POLICYREASSIGN ActionType = "POLICY_REASSIGN"
REQUESTDIAGNOSTICS ActionType = "REQUEST_DIAGNOSTICS"
SETTINGS ActionType = "SETTINGS"
UNENROLL ActionType = "UNENROLL"
UPGRADE ActionType = "UPGRADE"
)
// Defines values for ActionRequestDiagnosticsAdditionalMetrics.
const (
CONN ActionRequestDiagnosticsAdditionalMetrics = "CONN"
CPU ActionRequestDiagnosticsAdditionalMetrics = "CPU"
)
// Defines values for ActionSettingsLogLevel.
const (
ActionSettingsLogLevelDebug ActionSettingsLogLevel = "debug"
ActionSettingsLogLevelError ActionSettingsLogLevel = "error"
ActionSettingsLogLevelInfo ActionSettingsLogLevel = "info"
ActionSettingsLogLevelTrace ActionSettingsLogLevel = "trace"
ActionSettingsLogLevelWarning ActionSettingsLogLevel = "warning"
)
// Defines values for AuditUnenrollRequestReason.
const (
KeyRevoked AuditUnenrollRequestReason = "key_revoked"
Orphaned AuditUnenrollRequestReason = "orphaned"
Uninstall AuditUnenrollRequestReason = "uninstall"
)
// Defines values for CheckinRequestStatus.
const (
CheckinRequestStatusDegraded CheckinRequestStatus = "degraded"
CheckinRequestStatusError CheckinRequestStatus = "error"
CheckinRequestStatusOnline CheckinRequestStatus = "online"
CheckinRequestStatusStarting CheckinRequestStatus = "starting"
)
// Defines values for EnrollRequestType.
const (
PERMANENT EnrollRequestType = "PERMANENT"
)
// Defines values for EventSubtype.
const (
ACKNOWLEDGED EventSubtype = "ACKNOWLEDGED"
CONFIG EventSubtype = "CONFIG"
DATADUMP EventSubtype = "DATA_DUMP"
FAILED EventSubtype = "FAILED"
INPROGRESS EventSubtype = "IN_PROGRESS"
RUNNING EventSubtype = "RUNNING"
STARTING EventSubtype = "STARTING"
STOPPED EventSubtype = "STOPPED"
STOPPING EventSubtype = "STOPPING"
UNKNOWN EventSubtype = "UNKNOWN"
)
// Defines values for EventType.
const (
ACTION EventType = "ACTION"
ACTIONRESULT EventType = "ACTION_RESULT"
ERROR EventType = "ERROR"
STATE EventType = "STATE"
)
// Defines values for StatusResponseStatus.
const (
Configuring StatusResponseStatus = "configuring"
Degraded StatusResponseStatus = "degraded"
Failed StatusResponseStatus = "failed"
Healthy StatusResponseStatus = "healthy"
Starting StatusResponseStatus = "starting"
Stopped StatusResponseStatus = "stopped"
Stopping StatusResponseStatus = "stopping"
Unknown StatusResponseStatus = "unknown"
)
// Defines values for UpgradeDetailsState.
const (
UpgradeDetailsStateUPGDOWNLOADING UpgradeDetailsState = "UPG_DOWNLOADING"
UpgradeDetailsStateUPGEXTRACTING UpgradeDetailsState = "UPG_EXTRACTING"
UpgradeDetailsStateUPGFAILED UpgradeDetailsState = "UPG_FAILED"
UpgradeDetailsStateUPGREPLACING UpgradeDetailsState = "UPG_REPLACING"
UpgradeDetailsStateUPGREQUESTED UpgradeDetailsState = "UPG_REQUESTED"
UpgradeDetailsStateUPGRESTARTING UpgradeDetailsState = "UPG_RESTARTING"
UpgradeDetailsStateUPGROLLBACK UpgradeDetailsState = "UPG_ROLLBACK"
UpgradeDetailsStateUPGSCHEDULED UpgradeDetailsState = "UPG_SCHEDULED"
UpgradeDetailsStateUPGWATCHING UpgradeDetailsState = "UPG_WATCHING"
)
// Defines values for UpgradeMetadataFailedFailedState.
const (
UpgradeMetadataFailedFailedStateUPGDOWNLOADING UpgradeMetadataFailedFailedState = "UPG_DOWNLOADING"
UpgradeMetadataFailedFailedStateUPGEXTRACTING UpgradeMetadataFailedFailedState = "UPG_EXTRACTING"
UpgradeMetadataFailedFailedStateUPGREPLACING UpgradeMetadataFailedFailedState = "UPG_REPLACING"
UpgradeMetadataFailedFailedStateUPGREQUESTED UpgradeMetadataFailedFailedState = "UPG_REQUESTED"
UpgradeMetadataFailedFailedStateUPGRESTARTING UpgradeMetadataFailedFailedState = "UPG_RESTARTING"
UpgradeMetadataFailedFailedStateUPGSCHEDULED UpgradeMetadataFailedFailedState = "UPG_SCHEDULED"
UpgradeMetadataFailedFailedStateUPGWATCHING UpgradeMetadataFailedFailedState = "UPG_WATCHING"
)
// Defines values for UploadBeginRequestSrc.
const (
Agent UploadBeginRequestSrc = "agent"
Endpoint UploadBeginRequestSrc = "endpoint"
)
// AckRequest The request an elastic-agent sends to fleet-serve to acknowledge the execution of one or more actions.
type AckRequest struct {
Events []AckRequest_Events_Item `json:"events"`
}
// AckRequest_Events_Item defines model for ackRequest.events.Item.
type AckRequest_Events_Item struct {
union json.RawMessage
}
// AckResponse Response to processing acknowledgement events.
type AckResponse struct {
// Action The action result. Will have the value "acks".
Action string `json:"action"`
// Errors A flag to indicate if one or more errors occured when proccessing events.
Errors bool `json:"errors,omitempty"`
// Items The in-order list of results from processing events.
Items []AckResponseItem `json:"items,omitempty"`
}
// AckResponseItem The results of processing an acknowledgement event.
type AckResponseItem struct {
// Message HTTP status text.
Message *string `json:"message,omitempty"`
// Status An HTTP status code that indicates if the event was processed successfully or not.
Status int `json:"status"`
}
// Action An action for an elastic-agent.
// The structure of the `data` attribute will vary between action types.
// model/schema.json has a looser definition of actions and it define's fleet-server's interactions with Elasticsearch when retrieving actions.
type Action struct {
// AgentId The agent ID.
AgentId string `json:"agent_id"`
// CreatedAt Time when the action was created.
CreatedAt string `json:"created_at"`
// Data An embedded action-specific object.
Data Action_Data `json:"data" yaml:"data"`
// Expiration The latest start time for the action. Actions will be dropped by the agent if execution has not started by this time. Used for scheduled actions.
Expiration *string `json:"expiration,omitempty" yaml:"expiration"`
// Id The action ID.
Id string `json:"id" yaml:"action_id"`
// InputType The input type of the action for actions with type `INPUT_ACTION`.
InputType string `json:"input_type" yaml:"input_type"`
// Signed Optional action signing data.
Signed *ActionSignature `json:"signed,omitempty" yaml:"signed"`
// StartTime The earliest execution time for the action. Agent will not execute the action before this time. Used for scheduled actions.
StartTime *string `json:"start_time,omitempty" yaml:"start_time"`
// Timeout The timeout value (in seconds) for actions with type `INPUT_ACTION`.
Timeout *int64 `json:"timeout,omitempty" yaml:"timeout"`
// Traceparent APM traceparent for the action.
Traceparent *string `json:"traceparent,omitempty" yaml:"traceparent"`
// Type The action type. If fleet-server encounters an action that does not have a type listed below it will be filtered out and an error will be logged.
Type ActionType `json:"type" yaml:"type"`
}
// Action_Data An embedded action-specific object.
type Action_Data struct {
union json.RawMessage
}
// ActionType The action type. If fleet-server encounters an action that does not have a type listed below it will be filtered out and an error will be logged.
type ActionType string
// ActionCancel The CANCEL action data.
type ActionCancel struct {
TargetId string `json:"target_id"`
}
// ActionInputAction The INPUT_ACTION action data.
type ActionInputAction = map[string]interface{}
// ActionPolicyChange The POLICY_CHANGE action data.
type ActionPolicyChange struct {
// Policy The full policy that an agent should run after combining with local configuration/env vars.
Policy PolicyData `json:"policy"`
}
// ActionPolicyReassign The POLICY_REASSIGN action data.
type ActionPolicyReassign struct {
PolicyId string `json:"policy_id"`
}
// ActionRequestDiagnostics The REQUEST_DIAGNOSTICS action data.
type ActionRequestDiagnostics struct {
// AdditionalMetrics list optional additional metrics.
AdditionalMetrics *[]ActionRequestDiagnosticsAdditionalMetrics `json:"additional_metrics,omitempty"`
}
// ActionRequestDiagnosticsAdditionalMetrics defines model for ActionRequestDiagnostics.AdditionalMetrics.
type ActionRequestDiagnosticsAdditionalMetrics string
// ActionSettings The SETTINGS action data.
type ActionSettings struct {
LogLevel *ActionSettingsLogLevel `json:"log_level,omitempty"`
}
// ActionSettingsLogLevel defines model for ActionSettings.LogLevel.
type ActionSettingsLogLevel string
// ActionSignature Optional action signing data.
type ActionSignature struct {
// Data The base64 encoded, UTF-8 JSON serialized action bytes that are signed.
Data string `json:"data,omitempty" yaml:"data"`
// Signature The base64 encoded signature.
Signature string `json:"signature,omitempty" yaml:"signature"`
}
// ActionUnenroll The UNENROLL action data.
type ActionUnenroll = interface{}
// ActionUpgrade the UPGRADE action data.
type ActionUpgrade struct {
// SourceUri The source of the upgrade artifact.
SourceUri *string `json:"source_uri,omitempty"`
// Version The version number that the agent should upgrade to.
Version string `json:"version"`
}
// AuditUnenrollRequest Request to add unenroll audit information to an agent document.
type AuditUnenrollRequest struct {
// Reason The unenroll reason
Reason AuditUnenrollRequestReason `json:"reason"`
// Timestamp Agent timestamp of when the uninstall/unenroll action occured; may differ from fleet-server time due to retries.
Timestamp time.Time `json:"timestamp"`
}
// AuditUnenrollRequestReason The unenroll reason
type AuditUnenrollRequestReason string
// CheckinRequest defines model for checkinRequest.
type CheckinRequest struct {
// AckToken The ack_token form a previous response if the agent has checked in before.
// Translated to a sequence number in fleet-server in order to retrieve any new actions for the agent from the last checkin.
AckToken *string `json:"ack_token,omitempty"`
// Components An embedded JSON object that holds component information that the agent is running.
// Defined in fleet-server as a `json.RawMessage`, defined as an object in the elastic-agent.
// fleet-server will update the components in an agent record if they differ from this object.
Components *json.RawMessage `json:"components,omitempty"`
// LocalMetadata An embedded JSON object that holds meta-data values.
// Defined in fleet-server as a `json.RawMessage`, defined as an object in the elastic-agent.
// elastic-agent will populate the object with information from the binary and host/system environment.
// fleet-server will update the agent record if a checkin response contains different data from the record.
LocalMetadata *json.RawMessage `json:"local_metadata,omitempty"`
// Message State message, may be overridden or use the error message of a failing component.
Message string `json:"message"`
// PollTimeout An optional timeout value that informs fleet-server of when a client will time out on it's checkin request.
// If not specified fleet-server will use the timeout values specified in the config (defaults to 5m polling and a 10m write timeout).
// The value, if specified is expected to be a string that is parsable by [time.ParseDuration](https://pkg.go.dev/time#ParseDuration).
// If specified fleet-server will set its poll timeout to `max(1m, poll_timeout-2m)` and its write timeout to `max(2m, poll_timout-1m)`.
PollTimeout *string `json:"poll_timeout,omitempty"`
// Status The agent state, inferred from agent control protocol states.
Status CheckinRequestStatus `json:"status"`
// UpgradeDetails Additional details describing the status of an UPGRADE action delivered by the client (agent) on checkin.
UpgradeDetails *UpgradeDetails `json:"upgrade_details,omitempty"`
}
// CheckinRequestStatus The agent state, inferred from agent control protocol states.
type CheckinRequestStatus string
// CheckinResponse defines model for checkinResponse.
type CheckinResponse struct {
// AckToken The acknowlegment token used to indicate action delivery.
AckToken *string `json:"ack_token,omitempty"`
// Action The action result. Set to "checkin".
Action string `json:"action"`
// Actions A list of actions that the agent must execute.
Actions *[]Action `json:"actions,omitempty"`
}
// DiagnosticsEvent defines model for diagnosticsEvent.
type DiagnosticsEvent struct {
// ActionId The action ID.
ActionId string `json:"action_id"`
// AgentId The ID of the agent that executed the action.
AgentId string `json:"agent_id"`
Data *struct {
// UploadId The upload ID for the diagnostics bundle.
UploadId string `json:"upload_id"`
} `json:"data,omitempty"`
// Error An error message.
// If this is non-empty an error has occured when executing the action.
// For some actions (such as UPGRADE actions) it may result in the action being marked as failed.
Error *string `json:"error,omitempty"`
// Message An acknowlegement message. The elastic-agent inserts the action ID and action type into this message.
Message string `json:"message"`
// Subtype The subtype of the ack event.
// The elastic-agent will only generate ACKNOWLEDGED events.
//
// Not used by fleet-server.
// Actions that have errored should use the error attribute to communicate an error status.
// Additional action status information can be provided in the data attribute.
// Deprecated:
Subtype EventSubtype `json:"subtype"`
// Timestamp The timestamp of the acknowledgement event. Has the format of "2006-01-02T15:04:05.99999-07:00"
Timestamp time.Time `json:"timestamp"`
// Type The event type of the ack.
// Currently the elastic-agent will only generate ACTION_RESULT events.
//
// Not used by fleet-server.
// Actions that have errored should use the error attribute to communicate an error status.
// Additional action status information can be provided in the data attribute.
// Deprecated:
Type EventType `json:"type"`
}
// EnrollMetadata Metadata associated with the agent that is enrolling to fleet.
type EnrollMetadata struct {
// Local An embedded JSON object that holds meta-data values.
// Defined in fleet-server as a `json.RawMessage`, defined as an object in the elastic-agent.
// elastic-agent will populate the object with information from the binary and host/system environment.
// If not empty fleet-server will update the value of `local["elastic"]["agent"]["id"]` to the agent ID (assuming the keys exist).
// The (possibly updated) value is sent by fleet-server when creating the record for a new agent.
Local json.RawMessage `json:"local"`
// Tags User provided tags for the agent.
// fleet-server will pass the tags to the agent record on enrollment.
Tags []string `json:"tags"`
// UserProvided An embedded JSON object that holds user-provided meta-data values.
// Defined in fleet-server as a `json.RawMessage`.
// fleet-server does not use these values on enrollment of an agent.
//
// Defined in the elastic-agent as a `map[string]interface{}` with no way to specify any values.
// Deprecated:
UserProvided json.RawMessage `json:"user_provided"`
}
// EnrollRequest A request to enroll a new agent into fleet.
type EnrollRequest struct {
// EnrollmentId The enrollment ID of the agent.
// To replace an agent on enroll fail.
// The existing agent with a matching enrollment_id will be deleted if it never checked in. The new agent will be enrolled with the enrollment_id.
EnrollmentId *string `json:"enrollment_id,omitempty"`
// Metadata Metadata associated with the agent that is enrolling to fleet.
Metadata EnrollMetadata `json:"metadata"`
// SharedId The shared ID of the agent.
// To support pre-existing installs.
//
// Never implemented.
// Deprecated:
SharedId *string `json:"shared_id,omitempty"`
// Type The enrollment type of the agent.
// The agent only supports the PERMANENT value.
// In the future the enrollment type may be used to indicate agents that use fleet for reporting and monitoring, but do not use policies.
Type EnrollRequestType `json:"type"`
}
// EnrollRequestType The enrollment type of the agent.
// The agent only supports the PERMANENT value.
// In the future the enrollment type may be used to indicate agents that use fleet for reporting and monitoring, but do not use policies.
type EnrollRequestType string
// EnrollResponse The enrollment action response.
type EnrollResponse struct {
// Action The action result. Will have the value "created".
Action string `json:"action"`
// Item Response to a successful enrollment of an agent into fleet.
Item EnrollResponseItem `json:"item"`
}
// EnrollResponseItem Response to a successful enrollment of an agent into fleet.
type EnrollResponseItem struct {
// AccessApiKey The ApiKey token that fleet-server has generated for the enrolling agent.
AccessApiKey string `json:"access_api_key"`
// AccessApiKeyId The id of the ApiKey that fleet-server has generated for the enrolling agent.
AccessApiKeyId string `json:"access_api_key_id"`
// Actions Defined in fleet-server and elastic-agent as `[]interface{}`.
//
// Never used by agent.
// Deprecated:
Actions []map[string]interface{} `json:"actions"`
// Active If the agent is active in fleet.
// Set to true upon enrollment.
//
// Handling of other values never implemented.
// Deprecated:
Active bool `json:"active"`
// EnrolledAt The RFC3339 timestamp that the agent was enrolled at.
EnrolledAt string `json:"enrolled_at"`
// Id The agent ID
Id string `json:"id"`
// LocalMetadata A copy of the (updated) local metadata provided in the enrollment request.
//
// Never used by agent.
// Deprecated:
LocalMetadata json.RawMessage `json:"local_metadata"`
// PolicyId The policy ID that the agent is enrolled with. Decoded from the API key used in the request.
PolicyId string `json:"policy_id"`
// Status Agent status from fleet-server.
// fleet-ui may differ.
//
// Never used by agent.
// Deprecated:
Status string `json:"status"`
// Tags A copy of the tags that were sent with the enrollment request.
Tags []string `json:"tags"`
// Type The enrollment request type.
//
// Handling of other values never implemented.
// Deprecated:
Type string `json:"type"`
// UserProvidedMetadata A copy of the user provided metadata from the enrollment request.
//
// Currently will be empty.
// Deprecated:
UserProvidedMetadata json.RawMessage `json:"user_provided_metadata"`
}
// Error Error processing request.
type Error struct {
// Error Error type.
Error string `json:"error"`
// Message (optional) Error message.
Message *string `json:"message,omitempty"`
// StatusCode The HTTP status code of the error.
StatusCode int `json:"statusCode"`
}
// EventSubtype The subtype of the ack event.
// The elastic-agent will only generate ACKNOWLEDGED events.
//
// Not used by fleet-server.
// Actions that have errored should use the error attribute to communicate an error status.
// Additional action status information can be provided in the data attribute.
type EventSubtype string
// EventType The event type of the ack.
// Currently the elastic-agent will only generate ACTION_RESULT events.
//
// Not used by fleet-server.
// Actions that have errored should use the error attribute to communicate an error status.
// Additional action status information can be provided in the data attribute.
type EventType string
// GenericEvent A generic ack event for an action. Includes an optional error attribute.
type GenericEvent struct {
// ActionId The action ID.
ActionId string `json:"action_id"`
// AgentId The ID of the agent that executed the action.
AgentId string `json:"agent_id"`
// Error An error message.
// If this is non-empty an error has occured when executing the action.
// For some actions (such as UPGRADE actions) it may result in the action being marked as failed.
Error *string `json:"error,omitempty"`
// Message An acknowlegement message. The elastic-agent inserts the action ID and action type into this message.
Message string `json:"message"`
// Subtype The subtype of the ack event.
// The elastic-agent will only generate ACKNOWLEDGED events.
//
// Not used by fleet-server.
// Actions that have errored should use the error attribute to communicate an error status.
// Additional action status information can be provided in the data attribute.
// Deprecated:
Subtype EventSubtype `json:"subtype"`
// Timestamp The timestamp of the acknowledgement event. Has the format of "2006-01-02T15:04:05.99999-07:00"
Timestamp time.Time `json:"timestamp"`
// Type The event type of the ack.
// Currently the elastic-agent will only generate ACTION_RESULT events.
//
// Not used by fleet-server.
// Actions that have errored should use the error attribute to communicate an error status.
// Additional action status information can be provided in the data attribute.
// Deprecated:
Type EventType `json:"type"`
}
// InputEvent defines model for inputEvent.
type InputEvent struct {
// ActionData The action data for the input action being acknowledged.
ActionData json.RawMessage `json:"action_data"`
// ActionId The action ID.
ActionId string `json:"action_id"`
// ActionInputType The input_type of the action for input actions.
ActionInputType string `json:"action_input_type"`
// ActionResponse The action response for the input action being acknowledged.
ActionResponse json.RawMessage `json:"action_response"`
// AgentId The ID of the agent that executed the action.
AgentId string `json:"agent_id"`
// CompletedAt The time at which the action was completed.
CompletedAt time.Time `json:"completed_at"`
// Error An error message.
// If this is non-empty an error has occured when executing the action.
// For some actions (such as UPGRADE actions) it may result in the action being marked as failed.
Error *string `json:"error,omitempty"`
// Message An acknowlegement message. The elastic-agent inserts the action ID and action type into this message.
Message string `json:"message"`
// StartedAt The time at which the action was started.
StartedAt time.Time `json:"started_at"`
// Subtype The subtype of the ack event.
// The elastic-agent will only generate ACKNOWLEDGED events.
//
// Not used by fleet-server.
// Actions that have errored should use the error attribute to communicate an error status.
// Additional action status information can be provided in the data attribute.
// Deprecated:
Subtype EventSubtype `json:"subtype"`
// Timestamp The timestamp of the acknowledgement event. Has the format of "2006-01-02T15:04:05.99999-07:00"
Timestamp time.Time `json:"timestamp"`
// Type The event type of the ack.
// Currently the elastic-agent will only generate ACTION_RESULT events.
//
// Not used by fleet-server.
// Actions that have errored should use the error attribute to communicate an error status.
// Additional action status information can be provided in the data attribute.
// Deprecated:
Type EventType `json:"type"`
}
// PolicyData The full policy that an agent should run after combining with local configuration/env vars.
type PolicyData struct {
// Agent Agent configuration details associated with the policy. May include configuration toggling monitoring, uninstallation protection, etc.
Agent *map[string]interface{} `json:"agent,omitempty"`
// Fleet Agent configuration to describe how to connect to fleet-server.
Fleet *map[string]interface{} `json:"fleet,omitempty"`
// Id The policy's ID.
Id *string `json:"id,omitempty"`
// Inputs A list of all inputs that the agent should run.
Inputs *[]map[string]interface{} `json:"inputs,omitempty"`
// OutputPermissions Elasticsearch permissions that the agent requires in order to run the policy.
OutputPermissions *map[string]interface{} `json:"output_permissions,omitempty"`
// Outputs A map of all outputs that the agent running the policy can use to send data to.
Outputs *map[string]interface{} `json:"outputs,omitempty"`
// Revision The revision number of the policy. Should match revision_idx.
Revision *int `json:"revision,omitempty"`
// SecretPaths A list of keys that reference secret values that have been injected into the policy.
SecretPaths *[]string `json:"secret_paths,omitempty"`
// Signed Optional action signing data.
Signed *ActionSignature `json:"signed,omitempty" yaml:"signed"`
}
// StatusAPIResponse Status response information.
type StatusAPIResponse struct {
// Name Service name.
Name string `json:"name"`
// Status A Unit state that fleet-server may report.
// Unit state is defined in the elastic-agent-client specification.
Status StatusResponseStatus `json:"status"`
// Version Version information included in the response to an authorized status request.
Version *StatusResponseVersion `json:"version,omitempty"`
}
// StatusResponseStatus A Unit state that fleet-server may report.
// Unit state is defined in the elastic-agent-client specification.
type StatusResponseStatus string
// StatusResponseVersion Version information included in the response to an authorized status request.
type StatusResponseVersion struct {
// BuildHash The commit that the fleet-server was built from.
BuildHash *string `json:"build_hash,omitempty"`
// BuildTime The date-time that the fleet-server binary was created.
BuildTime *string `json:"build_time,omitempty"`
// Number The fleet-server version.
Number *string `json:"number,omitempty"`
}
// UpgradeEvent defines model for upgradeEvent.
type UpgradeEvent struct {
// ActionId The action ID.
ActionId string `json:"action_id"`
// AgentId The ID of the agent that executed the action.
AgentId string `json:"agent_id"`
// Error An error message.
// If this is non-empty an error has occured when executing the action.
// For some actions (such as UPGRADE actions) it may result in the action being marked as failed.
Error *string `json:"error,omitempty"`
// Message An acknowlegement message. The elastic-agent inserts the action ID and action type into this message.
Message string `json:"message"`
// Payload If the payload is part of an upgrade event action ack it will include information about if the agent will retry the upgrade.
// Payload is only used by upgrade acks and has been replaced in more recent versions by the checkin's upgrade_details attribute.
// Deprecated:
Payload *struct {
// Retry If the agent will retry the upgrade or not.
Retry bool `json:"retry"`
// RetryAttempt The number of attempts the agent has made so far, -1 indicates no future attempts and that the upgrade has failed.
RetryAttempt int `json:"retry_attempt"`
} `json:"payload,omitempty"`
// Subtype The subtype of the ack event.
// The elastic-agent will only generate ACKNOWLEDGED events.
//
// Not used by fleet-server.
// Actions that have errored should use the error attribute to communicate an error status.
// Additional action status information can be provided in the data attribute.
// Deprecated:
Subtype EventSubtype `json:"subtype"`
// Timestamp The timestamp of the acknowledgement event. Has the format of "2006-01-02T15:04:05.99999-07:00"
Timestamp time.Time `json:"timestamp"`
// Type The event type of the ack.
// Currently the elastic-agent will only generate ACTION_RESULT events.
//
// Not used by fleet-server.
// Actions that have errored should use the error attribute to communicate an error status.
// Additional action status information can be provided in the data attribute.
// Deprecated:
Type EventType `json:"type"`
}
// UpgradeDetails Additional details describing the status of an UPGRADE action delivered by the client (agent) on checkin.
type UpgradeDetails struct {
// ActionId The upgrade action ID the details are associated with.
ActionId string `json:"action_id"`
// Metadata Upgrade status metadata. Determined by state.
Metadata *UpgradeDetails_Metadata `json:"metadata,omitempty"`
// State The upgrade state.
State UpgradeDetailsState `json:"state"`
// TargetVersion The version the agent should upgrade to.
TargetVersion string `json:"target_version"`
}
// UpgradeDetails_Metadata Upgrade status metadata. Determined by state.
type UpgradeDetails_Metadata struct {
union json.RawMessage
}
// UpgradeDetailsState The upgrade state.
type UpgradeDetailsState string
// UpgradeMetadataDownloading Upgrade metadata for an upgrade that is downloading.
type UpgradeMetadataDownloading struct {
// DownloadPercent The artifact download progress as a percentage.
DownloadPercent float64 `json:"download_percent"`
// DownloadRate The artifact download rate as bytes per second.
DownloadRate *float64 `json:"download_rate,omitempty"`
// RetryErrorMsg The error message that is a result of a retryable upgrade download failure.
RetryErrorMsg *string `json:"retry_error_msg,omitempty"`
// RetryUntil The RFC3339 timestamp of the deadline the upgrade download is retried until.
RetryUntil *time.Time `json:"retry_until,omitempty"`
}
// UpgradeMetadataFailed Upgrade metadata for an upgrade that has failed.
type UpgradeMetadataFailed struct {
// ErrorMsg The error message associated with a failed state.
ErrorMsg string `json:"error_msg"`
// FailedState The state where the upgrade failed.
FailedState UpgradeMetadataFailedFailedState `json:"failed_state"`
}
// UpgradeMetadataFailedFailedState The state where the upgrade failed.
type UpgradeMetadataFailedFailedState string
// UpgradeMetadataScheduled Upgrade metadata for an upgrade that has been scheduled.
type UpgradeMetadataScheduled struct {
// ScheduledAt The RFC3339 timestamp the upgrade is scheduled to start at.
ScheduledAt time.Time `json:"scheduled_at"`
}
// UploadBeginRequest defines model for uploadBeginRequest.
type UploadBeginRequest struct {
// ActionId ID of the action that requested this file
ActionId string `json:"action_id"`
// AgentId Identifier of the agent uploading. Matches the ID usually found in agent.id
AgentId string `json:"agent_id"`
File UploadBeginRequest_File `json:"file"`
// Src The source integration sending this file
Src UploadBeginRequestSrc `json:"src"`
AdditionalProperties map[string]interface{} `json:"-"`
}
// UploadBeginRequest_File defines model for UploadBeginRequest.File.
type UploadBeginRequest_File struct {
// Compression The algorithm used to compress the file. Valid values: br,gzip,deflate,none
Compression *string `json:"Compression,omitempty"`
// Hash Checksums on the file contents
Hash *struct {
// Sha256 SHA256 of the contents
Sha256 *string `json:"sha256,omitempty"`
} `json:"hash,omitempty"`
// MimeType MIME type of the file
MimeType string `json:"mime_type"`
// Name Name of the file including the extension, without the directory
Name string `json:"name"`
// Size Size of the file contents, in bytes
Size int64 `json:"size"`
AdditionalProperties map[string]interface{} `json:"-"`
}
// UploadBeginRequestSrc The source integration sending this file
type UploadBeginRequestSrc string
// UploadBeginAPIResponse Response to initiating a file upload
type UploadBeginAPIResponse struct {
// ChunkSize The required size (in bytes) that the file must be segmented into for each chunk
ChunkSize int64 `json:"chunk_size"`
// UploadId A unique identifier for the ensuing upload operation
UploadId string `json:"upload_id"`
}
// UploadCompleteRequest Request to verify and finish an uploaded file
type UploadCompleteRequest struct {
// Transithash the transithash (sha256 of the concatenation of each in-order chunk hash) of the entire file contents
Transithash struct {
// Sha256 SHA256 hash
Sha256 string `json:"sha256"`
} `json:"transithash"`
}
// ApiVersion defines model for apiVersion.
type ApiVersion = string
// RequestId defines model for requestId.
type RequestId = string
// UserAgent defines model for userAgent.
type UserAgent = string
// AgentNotFound Error processing request.
type AgentNotFound = Error
// BadRequest Error processing request.
type BadRequest = Error
// Conflict Error processing request.
type Conflict = Error
// Deadline Error processing request.
type Deadline = Error
// Forbidden Error processing request.
type Forbidden = Error
// InternalServerError Error processing request.
type InternalServerError = Error
// KeyNotEnabled Error processing request.
type KeyNotEnabled = Error
// Throttle Error processing request.
type Throttle = Error
// Unavailable Error processing request.
type Unavailable = Error
// GetPGPKeyParams defines parameters for GetPGPKey.
type GetPGPKeyParams struct {
// ElasticApiVersion The API version to use, format should be "YYYY-MM-DD"
ElasticApiVersion *ApiVersion `json:"elastic-api-version,omitempty"`
// XRequestId The request tracking ID for APM.
XRequestId *RequestId `json:"X-Request-Id,omitempty"`
}
// AgentEnrollParams defines parameters for AgentEnroll.
type AgentEnrollParams struct {
// UserAgent The user-agent header that is sent.
// Must have the format "elastic agent X.Y.Z" where "X.Y.Z" indicates the agent version.
// The agent version must not be greater than the version of the fleet-server.
UserAgent UserAgent `json:"User-Agent"`
// XRequestId The request tracking ID for APM.
XRequestId *RequestId `json:"X-Request-Id,omitempty"`
// ElasticApiVersion The API version to use, format should be "YYYY-MM-DD"
ElasticApiVersion *ApiVersion `json:"elastic-api-version,omitempty"`
}
// AgentAcksParams defines parameters for AgentAcks.
type AgentAcksParams struct {
// XRequestId The request tracking ID for APM.
XRequestId *RequestId `json:"X-Request-Id,omitempty"`
// ElasticApiVersion The API version to use, format should be "YYYY-MM-DD"
ElasticApiVersion *ApiVersion `json:"elastic-api-version,omitempty"`
}
// AuditUnenrollParams defines parameters for AuditUnenroll.
type AuditUnenrollParams struct {
// XRequestId The request tracking ID for APM.
XRequestId *RequestId `json:"X-Request-Id,omitempty"`
// ElasticApiVersion The API version to use, format should be "YYYY-MM-DD"
ElasticApiVersion *ApiVersion `json:"elastic-api-version,omitempty"`
}
// AgentCheckinParams defines parameters for AgentCheckin.
type AgentCheckinParams struct {
// AcceptEncoding If the agent is able to accept encoded responses.
// Used to indicate if GZIP compression may be used by the server.
// The elastic-agent does not use the accept-encoding header.
AcceptEncoding *string `json:"Accept-Encoding,omitempty"`
// UserAgent The user-agent header that is sent.
// Must have the format "elastic agent X.Y.Z" where "X.Y.Z" indicates the agent version.
// The agent version must not be greater than the version of the fleet-server.
UserAgent UserAgent `json:"User-Agent"`
// XRequestId The request tracking ID for APM.
XRequestId *RequestId `json:"X-Request-Id,omitempty"`
// ElasticApiVersion The API version to use, format should be "YYYY-MM-DD"
ElasticApiVersion *ApiVersion `json:"elastic-api-version,omitempty"`
}
// ArtifactParams defines parameters for Artifact.
type ArtifactParams struct {
// XRequestId The request tracking ID for APM.
XRequestId *RequestId `json:"X-Request-Id,omitempty"`
// ElasticApiVersion The API version to use, format should be "YYYY-MM-DD"
ElasticApiVersion *ApiVersion `json:"elastic-api-version,omitempty"`
}
// GetFileParams defines parameters for GetFile.
type GetFileParams struct {
// ElasticApiVersion The API version to use, format should be "YYYY-MM-DD"
ElasticApiVersion *ApiVersion `json:"elastic-api-version,omitempty"`
// XRequestId The request tracking ID for APM.
XRequestId *RequestId `json:"X-Request-Id,omitempty"`
}
// UploadBeginParams defines parameters for UploadBegin.
type UploadBeginParams struct {
// XRequestId The request tracking ID for APM.
XRequestId *RequestId `json:"X-Request-Id,omitempty"`
// ElasticApiVersion The API version to use, format should be "YYYY-MM-DD"
ElasticApiVersion *ApiVersion `json:"elastic-api-version,omitempty"`
}
// UploadCompleteParams defines parameters for UploadComplete.
type UploadCompleteParams struct {
// XRequestId The request tracking ID for APM.
XRequestId *RequestId `json:"X-Request-Id,omitempty"`
// ElasticApiVersion The API version to use, format should be "YYYY-MM-DD"
ElasticApiVersion *ApiVersion `json:"elastic-api-version,omitempty"`
}
// UploadChunkParams defines parameters for UploadChunk.
type UploadChunkParams struct {
// XChunkSHA2 the SHA256 hash of the body contents for this request
XChunkSHA2 string `json:"X-Chunk-SHA2"`
// XRequestId The request tracking ID for APM.
XRequestId *RequestId `json:"X-Request-Id,omitempty"`
// ElasticApiVersion The API version to use, format should be "YYYY-MM-DD"
ElasticApiVersion *ApiVersion `json:"elastic-api-version,omitempty"`
}
// StatusParams defines parameters for Status.
type StatusParams struct {
// XRequestId The request tracking ID for APM.
XRequestId *RequestId `json:"X-Request-Id,omitempty"`
// ElasticApiVersion The API version to use, format should be "YYYY-MM-DD"
ElasticApiVersion *ApiVersion `json:"elastic-api-version,omitempty"`
}
// AgentEnrollJSONRequestBody defines body for AgentEnroll for application/json ContentType.
type AgentEnrollJSONRequestBody = EnrollRequest
// AgentAcksJSONRequestBody defines body for AgentAcks for application/json ContentType.
type AgentAcksJSONRequestBody = AckRequest
// AuditUnenrollJSONRequestBody defines body for AuditUnenroll for application/json ContentType.
type AuditUnenrollJSONRequestBody = AuditUnenrollRequest
// AgentCheckinJSONRequestBody defines body for AgentCheckin for application/json ContentType.
type AgentCheckinJSONRequestBody = CheckinRequest
// UploadBeginJSONRequestBody defines body for UploadBegin for application/json ContentType.
type UploadBeginJSONRequestBody = UploadBeginRequest
// UploadCompleteJSONRequestBody defines body for UploadComplete for application/json ContentType.
type UploadCompleteJSONRequestBody = UploadCompleteRequest
// Getter for additional properties for UploadBeginRequest. Returns the specified
// element and whether it was found