-
Notifications
You must be signed in to change notification settings - Fork 84
/
Copy pathopenapi.yml
1869 lines (1855 loc) · 66.6 KB
/
openapi.yml
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
openapi: 3.1.0
info:
title: fleet-server API
version: "0000-00-00"
license:
name: Elastic License 2.0
url: https://www.elastic.co/licensing/elastic-license
description: |
The fleet-server API that is used by agents when enrolled with fleet.
Note that the current implementations in the fleet-server and elastic-agent may have some difference specifically when it comes to some objects.
This is most notable when comparing the `Action` implementations. Fleet-server uses a general template for all actions and the elastic-agent will have more specific representations.
The implementation of fleet-server by default also includes a connection count limiter, as well as limiters for request body sizes.
If an agent attempts to make request but there are no remaining connections, the attempt will be blocked and the agent will get an error.
If an agent tries to send a body that is too large the fleet-server will respond with a 400 status code.
components:
headers:
apiVersion:
description: The API version the server is using to respond.
schema:
type: string
examples:
"2023-06-01":
value: 2023-06-01
requestID:
description: The X-Request-Id header used for tracing requests.
schema:
type: string
securitySchemes:
apiKey:
description: API key security will check that the API key exists and is enabled, but will not check additional permissions
type: apiKey
in: header
name: ApiKey
agentApiKey:
description: Agent API key security will check that the API key exists, is enabled, and is assigned to the agent
type: apiKey
in: header
name: ApiKey
schemas:
error:
description: Error processing request.
type: object
required:
- statusCode
- error
properties:
statusCode:
type: integer
description: The HTTP status code of the error.
error:
type: string
description: Error type.
message:
type: string
description: (optional) Error message.
statusResponseVersion:
description: Version information included in the response to an authorized status request.
type: object
properties:
number:
type: string
description: The fleet-server version.
build_hash:
type: string
description: The commit that the fleet-server was built from.
build_time:
type: string
description: The date-time that the fleet-server binary was created.
#format: date-time # not using date-time format at the moment because the currently available objects have plain strings
statusResponse:
x-go-name: StatusAPIResponse
description: Status response information.
type: object
required:
- name
- status
properties:
name:
type: string
description: Service name.
status:
type: string
description: |
A Unit state that fleet-server may report.
Unit state is defined in the elastic-agent-client specification.
enum:
- starting
- configuring
- healthy
- degraded
- failed
- stopping
- stopped
- unknown
version:
$ref: "#/components/schemas/statusResponseVersion"
enrollMetadata:
description: Metadata associated with the agent that is enrolling to fleet.
type: object
required:
- user_provided
- local
- tags
properties:
user_provided:
deprecated: true
description: |
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.
type: string
format: application/json
x-go-type: json.RawMessage
local:
description: |
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.
type: string
format: application/json
x-go-type: json.RawMessage
tags:
description: |
User provided tags for the agent.
fleet-server will pass the tags to the agent record on enrollment.
type: array
items:
type: string
enrollRequest:
description: A request to enroll a new agent into fleet.
type: object
required:
- type
- metadata
properties:
type:
description: |
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: string
enum:
- PERMANENT
enrollment_id:
type: string
description: |
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.
shared_id:
deprecated: true
type: string
description: |
The shared ID of the agent.
To support pre-existing installs.
Never implemented.
metadata:
$ref: "#/components/schemas/enrollMetadata"
enrollResponseItem:
description: Response to a successful enrollment of an agent into fleet.
type: object
required:
- id
- active
- policy_id
- type
- enrolled_at
- user_provided_metadata
- local_metadata
- actions
- access_api_key_id
- access_api_key
- status
- tags
properties:
id:
description: The agent ID
type: string
active:
deprecated: true
description: |
If the agent is active in fleet.
Set to true upon enrollment.
Handling of other values never implemented.
type: boolean
policy_id:
description: The policy ID that the agent is enrolled with. Decoded from the API key used in the request.
type: string
type:
deprecated: true
description: |
The enrollment request type.
Handling of other values never implemented.
type: string
enrolled_at:
description: The RFC3339 timestamp that the agent was enrolled at.
type: string
#format: date-time
user_provided_metadata:
deprecated: true
description: |
A copy of the user provided metadata from the enrollment request.
Currently will be empty.
type: string
format: application/json
x-go-type: json.RawMessage
local_metadata:
deprecated: true
description: |
A copy of the (updated) local metadata provided in the enrollment request.
Never used by agent.
type: string
format: application/json
x-go-type: json.RawMessage
actions:
deprecated: true
description: |
Defined in fleet-server and elastic-agent as `[]interface{}`.
Never used by agent.
type: array
items:
type: object
access_api_key_id:
description: The id of the ApiKey that fleet-server has generated for the enrolling agent.
type: string
access_api_key:
description: The ApiKey token that fleet-server has generated for the enrolling agent.
type: string
format: password
status:
deprecated: true
description: |
Agent status from fleet-server.
fleet-ui may differ.
Never used by agent.
type: string
tags:
description: A copy of the tags that were sent with the enrollment request.
type: array
items:
type: string
enrollResponse:
description: The enrollment action response.
type: object
required:
- action
- item
properties:
action:
description: The action result. Will have the value "created".
type: string
item:
$ref: "#/components/schemas/enrollResponseItem"
upgrade_metadata_scheduled:
description: Upgrade metadata for an upgrade that has been scheduled.
type: object
required:
- scheduled_at
properties:
scheduled_at:
description: The RFC3339 timestamp the upgrade is scheduled to start at.
type: string
format: date-time
upgrade_metadata_downloading:
description: Upgrade metadata for an upgrade that is downloading.
required:
- download_percent
properties:
download_percent:
description: The artifact download progress as a percentage.
type: number
format: double
download_rate:
description: The artifact download rate as bytes per second.
type: number
format: double
retry_error_msg:
description: The error message that is a result of a retryable upgrade download failure.
type: string
retry_until:
description: The RFC3339 timestamp of the deadline the upgrade download is retried until.
type: string
format: date-time
upgrade_metadata_failed:
description: Upgrade metadata for an upgrade that has failed.
required:
- failed_state
- error_msg
properties:
failed_state:
description: The state where the upgrade failed.
type: string
enum:
- UPG_REQUESTED
- UPG_SCHEDULED
- UPG_DOWNLOADING
- UPG_EXTRACTING
- UPG_REPLACING
- UPG_RESTARTING
- UPG_WATCHING
error_msg:
description: The error message associated with a failed state.
type: string
upgrade_details:
description: |
Additional details describing the status of an UPGRADE action delivered by the client (agent) on checkin.
type: object
required:
- target_version
- action_id
- state
properties:
target_version:
description: The version the agent should upgrade to.
type: string
action_id:
description: The upgrade action ID the details are associated with.
type: string
state:
description: The upgrade state.
type: string
enum:
- UPG_REQUESTED
- UPG_SCHEDULED
- UPG_DOWNLOADING
- UPG_EXTRACTING
- UPG_REPLACING
- UPG_RESTARTING
- UPG_WATCHING
- UPG_ROLLBACK
- UPG_FAILED
metadata:
description: Upgrade status metadata. Determined by state.
oneOf:
- $ref: "#/components/schemas/upgrade_metadata_scheduled"
- $ref: "#/components/schemas/upgrade_metadata_downloading"
- $ref: "#/components/schemas/upgrade_metadata_failed"
checkinRequest:
type: object
required:
- status
- message
properties:
status:
description: The agent state, inferred from agent control protocol states.
type: string
enum:
- online
- error
- degraded
- starting
message:
description: State message, may be overridden or use the error message of a failing component.
type: string
ack_token:
description: |
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.
type: string
local_metadata:
description: |
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.
type: string
format: application/json
x-go-type: json.RawMessage
components:
description: |
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.
type: string
format: application/json
x-go-type: json.RawMessage
poll_timeout:
description: |
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)`.
type: string
format: duration
upgrade_details:
$ref: "#/components/schemas/upgrade_details"
actionSignature:
description: Optional action signing data.
type: object
x-go-custom-tag: yaml:"signed" # openapi-generator
x-oapi-codegen-extra-tags: # oapi-codegen tags
yaml: "signed"
required:
- data # NOTE: work around to avoid a pointer
- signature # NOTE: work around to avoid a pointer
properties:
data:
description: The base64 encoded, UTF-8 JSON serialized action bytes that are signed.
type: string
format: base64
x-go-custom-tag: yaml:"data" # openapi-generator
x-oapi-codegen-extra-tags: # oapi-codegen tags
yaml: "data"
json: "data,omitempty"
signature:
description: The base64 encoded signature.
type: string
format: base64
x-go-custom-tag: yaml:"signature" # openapi-generator
x-oapi-codegen-extra-tags: # oapi-codegen tags
yaml: "signature"
json: "signature,omitempty"
action:
description: |
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: object
required:
- agent_id
- created_at
- data
- id
- type
- input_type
properties:
agent_id:
description: The agent ID.
type: string
created_at:
description: Time when the action was created.
type: string
#format: date-time
start_time:
description: The earliest execution time for the action. Agent will not execute the action before this time. Used for scheduled actions.
type: string
#format: date-time
x-go-custom-tag: yaml:"start_time" # openapi-generator
x-oapi-codegen-extra-tags: # oapi-codegen tags
yaml: "start_time"
expiration:
description: 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.
type: string
#format: date-time
x-go-custom-tag: yaml:"expiration" # openapi-generator
x-oapi-codegen-extra-tags: # oapi-codegen tags
yaml: "expiration"
data:
# oapi-codegen type should be: interface{}
description: An embedded action-specific object.
x-go-custom-tag: yaml:"data"
x-oapi-codegen-extra-tags:
yaml: "data"
oneOf:
- $ref: "#/components/schemas/actionPolicyReassign"
- $ref: "#/components/schemas/actionPolicyChange"
- $ref: "#/components/schemas/actionUpgrade"
- $ref: "#/components/schemas/actionUnenroll"
- $ref: "#/components/schemas/actionSettings"
- $ref: "#/components/schemas/actionCancel"
- $ref: "#/components/schemas/actionRequestDiagnostics"
- $ref: "#/components/schemas/actionInputAction"
id:
description: The action ID.
type: string
x-go-custom-tag: yaml:"action_id" # openapi-generator
x-oapi-codegen-extra-tags: # oapi-codegen tags
yaml: "action_id"
traceparent:
description: APM traceparent for the action.
type: string
x-go-custom-tag: yaml:"traceparent" # openapi-generator
x-oapi-codegen-extra-tags: # oapi-codegen tags
yaml: "traceparent"
type:
description: 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: string
enum:
- "UPGRADE"
- "UNENROLL"
- "POLICY_CHANGE"
- "POLICY_REASSIGN"
- "SETTINGS"
- "INPUT_ACTION"
- "CANCEL"
- "REQUEST_DIAGNOSTICS"
x-go-custom-tag: yaml:"type" # openapi-generator
x-oapi-codegen-extra-tags: # oapi-codegen tags
yaml: "type"
input_type:
description: The input type of the action for actions with type `INPUT_ACTION`.
type: string
x-go-custom-tag: yaml:"input_type" # openapi-generator
x-oapi-codegen-extra-tags: # oapi-codegen tags
yaml: "input_type"
timeout:
description: The timeout value (in seconds) for actions with type `INPUT_ACTION`.
type: integer
format: int64
x-go-custom-tag: yaml:"timeout" # openapi-generator
x-oapi-codegen-extra-tags: # oapi-codegen tags
yaml: "timeout"
signed:
$ref: "#/components/schemas/actionSignature"
policyData:
type: object
description: The full policy that an agent should run after combining with local configuration/env vars.
properties:
id:
description: The policy's ID.
type: string
secret_paths:
description: A list of keys that reference secret values that have been injected into the policy.
type: array
items:
type: string
outputs:
description: A map of all outputs that the agent running the policy can use to send data to.
type: object
inputs:
description: A list of all inputs that the agent should run.
type: array
items:
type: object
revision:
description: The revision number of the policy. Should match revision_idx.
type: integer
agent:
description: Agent configuration details associated with the policy. May include configuration toggling monitoring, uninstallation protection, etc.
type: object
signed:
$ref: "#/components/schemas/actionSignature"
output_permissions:
description: Elasticsearch permissions that the agent requires in order to run the policy.
type: object
fleet:
description: Agent configuration to describe how to connect to fleet-server.
type: object
actionUnenroll:
description: The UNENROLL action data.
# unenroll actions have no `data` attribute
actionRequestDiagnostics:
description: The REQUEST_DIAGNOSTICS action data.
properties:
additional_metrics:
description: list optional additional metrics.
type: array
items:
type: string
enum:
- CPU
- CONN
actionPolicyReassign:
description: The POLICY_REASSIGN action data.
type: object
required:
- policy_id
properties:
policy_id:
desription: The policy ID the agent has been reassigned to.
type: string
actionPolicyChange:
description: The POLICY_CHANGE action data.
type: object
required:
- policy
properties:
policy:
$ref: "#/components/schemas/policyData"
actionUpgrade:
description: the UPGRADE action data.
type: object
required:
- version
properties:
version:
description: The version number that the agent should upgrade to.
type: string
source_uri:
description: The source of the upgrade artifact.
type: string
actionSettings:
description: The SETTINGS action data.
type: object
properties:
log_level:
type: string
enum:
- trace
- debug
- info
- warning
- error
actionCancel:
description: The CANCEL action data.
type: object
required:
- target_id
properties:
target_id:
decription: The action to attempt to cancel.
type: string
actionInputAction:
description: The INPUT_ACTION action data.
type: object # FIXME: needs security team to define fields as the action is passed from the agent to their componenets.
checkinResponse:
type: object
required:
- action
properties:
ack_token:
description: The acknowlegment token used to indicate action delivery.
type: string
action:
description: The action result. Set to "checkin".
type: string
actions:
description: A list of actions that the agent must execute.
type: array
items:
$ref: "#/components/schemas/action"
eventType:
deprecated: true
description: |
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: string
enum:
- STATE
- ERROR
- ACTION_RESULT
- ACTION
eventSubtype:
deprecated: true
description: |
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: string
enum:
- RUNNING
- STARTING
- IN_PROGRESS
- CONFIG
- FAILED
- STOPPING
- STOPPED
- DATA_DUMP
- ACKNOWLEDGED
- UNKNOWN
genericEvent:
description: A generic ack event for an action. Includes an optional error attribute.
type: object
required:
- type
- subtype
- agent_id
- action_id
- message
- timestamp
properties:
type:
$ref: "#/components/schemas/eventType"
subtype:
$ref: "#/components/schemas/eventSubtype"
agent_id:
description: The ID of the agent that executed the action.
type: string
action_id:
description: The action ID.
type: string
message:
description: An acknowlegement message. The elastic-agent inserts the action ID and action type into this message.
type: string
timestamp:
description: The timestamp of the acknowledgement event. Has the format of "2006-01-02T15:04:05.99999-07:00"
type: string
format: date-time
error:
description: |
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.
type: string
upgradeEvent:
description: The ack event for an upgrade action
allOf:
- $ref: "#/components/schemas/genericEvent"
- type: object
deprecated: true # replaced by upgrade_details in checkin requests in more recent agent releases.
properties:
payload:
deprecated: true
description: |
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.
type: object
required:
- retry
- retry_attempt
properties:
retry:
description: If the agent will retry the upgrade or not.
type: boolean
retry_attempt:
description: The number of attempts the agent has made so far, -1 indicates no future attempts and that the upgrade has failed.
type: integer
diagnosticsEvent:
description: The ack event for a request diagnostics action.
allOf:
- $ref: "#/components/schemas/genericEvent"
- type: object
properties:
data:
type: object
required:
- upload_id
properties:
upload_id:
description: The upload ID for the diagnostics bundle.
type: string
inputEvent:
description: The ack event for an input action.
allOf:
- $ref: "#/components/schemas/genericEvent"
- type: object
required:
- action_input_type
- action_data
- action_response
- started_at
- completed_at
properties:
action_input_type:
description: The input_type of the action for input actions.
type: string
action_data:
description: The action data for the input action being acknowledged.
type: string
format: application/json
x-go-type: json.RawMessage
action_response:
description: The action response for the input action being acknowledged.
type: string
format: application/json
x-go-type: json.RawMessage
started_at:
description: The time at which the action was started.
type: string
format: date-time
completed_at:
description: The time at which the action was completed.
type: string
format: date-time
ackRequest:
description: The request an elastic-agent sends to fleet-serve to acknowledge the execution of one or more actions.
type: object
required:
- events
properties:
events:
type: array
items:
anyOf:
- $ref: "#/components/schemas/genericEvent"
- $ref: "#/components/schemas/upgradeEvent"
- $ref: "#/components/schemas/diagnosticsEvent"
- $ref: "#/components/schemas/inputEvent"
ackResponseItem:
description: The results of processing an acknowledgement event.
type: object
required:
- status
properties:
status:
description: An HTTP status code that indicates if the event was processed successfully or not.
type: integer
message:
description: HTTP status text.
type: string
ackResponse:
description: Response to processing acknowledgement events.
type: object
required:
- action
- items # NOTE: work around as we don't want a pointer here
- errors # NOTE: work around as we don't want a pointer here
properties:
action:
description: The action result. Will have the value "acks".
type: string
errors:
description: A flag to indicate if one or more errors occured when proccessing events.
type: boolean
x-oapi-codegen-extra-tags:
json: "errors,omitempty"
items:
description: The in-order list of results from processing events.
type: array
items:
$ref: "#/components/schemas/ackResponseItem"
x-oapi-codegen-extra-tags:
json: "items,omitempty"
uploadBeginRequest:
title: "Upload Operation Start request body"
type: object
additionalProperties: true
required:
- file
- action_id
- agent_id
- src
properties:
file:
type: object
additionalProperties: true
properties:
Compression:
description: "The algorithm used to compress the file. Valid values: br,gzip,deflate,none"
type: string
examples:
- deflate
hash:
title: Hash
description: Checksums on the file contents
type: object
properties:
sha256:
description: SHA256 of the contents
type: string
examples:
- 04f81394bababa0fb31e6ad2d703c875eb46dc254527e39ff316564c0dc339e2
name:
description: Name of the file including the extension, without the directory
type: string
examples:
- yankees-stats.zip
mime_type:
description: MIME type of the file
type: string
examples:
- application/zip
size:
description: Size of the file contents, in bytes
type: integer
format: int64
examples:
- 8276748
required:
- name
- size
- mime_type
action_id:
description: ID of the action that requested this file
type: string
examples:
- 2f440d31-2ea4-42f8-b0f2-4b6e98e8dc5e
agent_id:
description: Identifier of the agent uploading. Matches the ID usually found in agent.id
type: string
examples:
- 9347e918-5e00-48b0-b302-a09f9258a46d
src:
description: The source integration sending this file
type: string
enum:
- endpoint
- agent
uploadBeginResponse:
x-go-name: UploadBeginAPIResponse
description: Response to initiating a file upload
type: object
required:
- upload_id
- chunk_size
properties:
upload_id:
description: A unique identifier for the ensuing upload operation
type: string
examples:
- fbc8e23c-055d-461e-87f7-b0d1b57f14b4
chunk_size:
description: The required size (in bytes) that the file must be segmented into for each chunk
type: integer
format: int64
examples:
- 4194304
uploadCompleteRequest:
description: Request to verify and finish an uploaded file
type: object
required:
- transithash
properties:
transithash:
description: the transithash (sha256 of the concatenation of each in-order chunk hash) of the entire file contents
type: object
required:
- sha256
properties:
sha256:
description: SHA256 hash
type: string
examples:
- 83810fdc61c44290778c212d7829d0c3f0232e81bd551d3943998a920025d14f
auditUnenrollRequest:
description: Request to add unenroll audit information to an agent document.
type: object
required:
- reason
- timestamp
properties:
reason:
description: The unenroll reason
type: string
enum:
- uninstall
- orphaned
- key_revoked # here for completeness, fleet-ui should set this reason when a FORCE_UNENROLL action is made.
examples:
- uninstall
timestamp:
description: Agent timestamp of when the uninstall/unenroll action occured; may differ from fleet-server time due to retries.
type: string
format: date-time
parameters:
requestId:
name: X-Request-Id
description: The request tracking ID for APM.
in: header
schema:
type: string
apiVersion:
name: elastic-api-version
description: The API version to use, format should be "YYYY-MM-DD"
in: header
schema:
type: string
examples:
"2023-06-01":
value: 2023-06-01
userAgent:
name: User-Agent
description: |
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.
in: header
required: true
schema:
type: string
examples:
valid:
description: A valid User-Agent header from the elastic-agent.
value: elastic agent 8.6.0
validWithSuffix:
description: A version number may include an optional suffix
value: elastic agent 8.6.0-SNAPSHOT
invalidName:
description: The elastic-agent name is not formatted correctly.
value: elastic-agent 8.6.0
outdatedVersion:
description: The version string given is too old.
value: elastic agent 7.0.0
responses:
badRequest:
description: |
A 400 response for receiving an invalid User-Agent, Elastic-Api-Version header or version number (checkin and enroll endpoints).
In the case where an invalid or unsupported Elastic-Api-Version header is requested, the response will contain the default version number.
Or any other undefined error encounted by the fleet-server. May be returned by any endpoint except /api/fleet/status.
headers:
Elastic-Api-Version:
$ref: "#/components/headers/apiVersion"
X-Request-Id:
$ref: "#/components/headers/requestID"
content:
application/json:
schema:
allOf:
- $ref: "#/components/schemas/error"
examples: