-
Notifications
You must be signed in to change notification settings - Fork 37
/
api_container_api.rs
2381 lines (2381 loc) · 106 KB
/
api_container_api.rs
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
/// ==============================================================================================
/// Shared Objects (Used By Multiple Endpoints)
/// ==============================================================================================
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Port {
#[prost(uint32, tag = "1")]
pub number: u32,
/// The protocol that the port is listening on
#[prost(enumeration = "port::TransportProtocol", tag = "2")]
pub transport_protocol: i32,
#[prost(string, tag = "3")]
pub maybe_application_protocol: ::prost::alloc::string::String,
/// The wait timeout duration in string
#[prost(string, tag = "4")]
pub maybe_wait_timeout: ::prost::alloc::string::String,
}
/// Nested message and enum types in `Port`.
pub mod port {
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum TransportProtocol {
Tcp = 0,
Sctp = 1,
Udp = 2,
}
impl TransportProtocol {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
TransportProtocol::Tcp => "TCP",
TransportProtocol::Sctp => "SCTP",
TransportProtocol::Udp => "UDP",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"TCP" => Some(Self::Tcp),
"SCTP" => Some(Self::Sctp),
"UDP" => Some(Self::Udp),
_ => None,
}
}
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Container {
#[prost(enumeration = "container::Status", tag = "1")]
pub status: i32,
#[prost(string, tag = "2")]
pub image_name: ::prost::alloc::string::String,
#[prost(string, repeated, tag = "3")]
pub entrypoint_args: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
#[prost(string, repeated, tag = "4")]
pub cmd_args: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
#[prost(map = "string, string", tag = "5")]
pub env_vars: ::std::collections::HashMap<
::prost::alloc::string::String,
::prost::alloc::string::String,
>,
}
/// Nested message and enum types in `Container`.
pub mod container {
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum Status {
Stopped = 0,
Running = 1,
Unknown = 2,
}
impl Status {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
Status::Stopped => "STOPPED",
Status::Running => "RUNNING",
Status::Unknown => "UNKNOWN",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"STOPPED" => Some(Self::Stopped),
"RUNNING" => Some(Self::Running),
"UNKNOWN" => Some(Self::Unknown),
_ => None,
}
}
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ServiceInfo {
/// UUID of the service
#[prost(string, tag = "1")]
pub service_uuid: ::prost::alloc::string::String,
/// The IP address of the service inside the enclave
#[prost(string, tag = "2")]
pub private_ip_addr: ::prost::alloc::string::String,
/// The ports on which the service is reachable inside the enclave, specified in user_specified_port_id -> port_info
/// Will be exactly what was passed in at the time of starting the service
#[prost(map = "string, message", tag = "3")]
pub private_ports: ::std::collections::HashMap<::prost::alloc::string::String, Port>,
/// Public IP address *outside* the enclave where the service is reachable
/// NOTE: Will be empty if the service isn't running, the service didn't define any ports, or the backend doesn't support reporting public service info
#[prost(string, tag = "4")]
pub maybe_public_ip_addr: ::prost::alloc::string::String,
/// Mapping defining the ports that the service can be reached at *outside* the enclave, in the user_defined_port_id -> port_info where user_defined_port_id
/// corresponds to the ID that was passed in in AddServiceArgs
/// NOTE: Will be empty if the service isn't running, the service didn't define any ports, or the backend doesn't support reporting public service info
#[prost(map = "string, message", tag = "5")]
pub maybe_public_ports: ::std::collections::HashMap<
::prost::alloc::string::String,
Port,
>,
/// Name of the service
#[prost(string, tag = "6")]
pub name: ::prost::alloc::string::String,
/// Shortened uuid of the service
#[prost(string, tag = "7")]
pub shortened_uuid: ::prost::alloc::string::String,
/// Service status: stopped, running.
#[prost(enumeration = "ServiceStatus", tag = "8")]
pub service_status: i32,
/// Docker container or Kubernetes pod container
#[prost(message, optional, tag = "9")]
pub container: ::core::option::Option<Container>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RunStarlarkScriptArgs {
#[prost(string, tag = "1")]
pub serialized_script: ::prost::alloc::string::String,
#[prost(string, optional, tag = "2")]
pub serialized_params: ::core::option::Option<::prost::alloc::string::String>,
/// Defaults to false
#[prost(bool, optional, tag = "3")]
pub dry_run: ::core::option::Option<bool>,
/// Defaults to 4
#[prost(int32, optional, tag = "4")]
pub parallelism: ::core::option::Option<i32>,
/// The name of the main function, the default value is "run"
#[prost(string, optional, tag = "5")]
pub main_function_name: ::core::option::Option<::prost::alloc::string::String>,
#[prost(enumeration = "KurtosisFeatureFlag", repeated, tag = "6")]
pub experimental_features: ::prost::alloc::vec::Vec<i32>,
/// Defaults to empty
#[prost(string, optional, tag = "7")]
pub cloud_instance_id: ::core::option::Option<::prost::alloc::string::String>,
/// Defaults to empty
#[prost(string, optional, tag = "8")]
pub cloud_user_id: ::core::option::Option<::prost::alloc::string::String>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RunStarlarkPackageArgs {
#[prost(string, tag = "1")]
pub package_id: ::prost::alloc::string::String,
/// Serialized parameters data for the Starlark package main function
/// This should be a valid JSON string
#[prost(string, optional, tag = "5")]
pub serialized_params: ::core::option::Option<::prost::alloc::string::String>,
/// Defaults to false
#[prost(bool, optional, tag = "6")]
pub dry_run: ::core::option::Option<bool>,
/// Defaults to 4
#[prost(int32, optional, tag = "7")]
pub parallelism: ::core::option::Option<i32>,
/// Whether the package should be cloned or not.
/// If false, then the package will be pulled from the APIC local package store. If it's a local package then is must
/// have been uploaded using UploadStarlarkPackage prior to calling RunStarlarkPackage.
/// If true, then the package will be cloned from GitHub before execution starts
#[prost(bool, optional, tag = "8")]
pub clone_package: ::core::option::Option<bool>,
/// The relative main file filepath, the default value is the "main.star" file in the root of a package
#[prost(string, optional, tag = "9")]
pub relative_path_to_main_file: ::core::option::Option<
::prost::alloc::string::String,
>,
/// The name of the main function, the default value is "run"
#[prost(string, optional, tag = "10")]
pub main_function_name: ::core::option::Option<::prost::alloc::string::String>,
#[prost(enumeration = "KurtosisFeatureFlag", repeated, tag = "11")]
pub experimental_features: ::prost::alloc::vec::Vec<i32>,
/// Defaults to empty
#[prost(string, optional, tag = "12")]
pub cloud_instance_id: ::core::option::Option<::prost::alloc::string::String>,
/// Defaults to empty
#[prost(string, optional, tag = "13")]
pub cloud_user_id: ::core::option::Option<::prost::alloc::string::String>,
/// Deprecated: If the package is local, it should have been uploaded with UploadStarlarkPackage prior to calling
/// RunStarlarkPackage. If the package is remote and must be cloned within the APIC, use the standalone boolean flag
/// clone_package below
#[prost(oneof = "run_starlark_package_args::StarlarkPackageContent", tags = "3, 4")]
pub starlark_package_content: ::core::option::Option<
run_starlark_package_args::StarlarkPackageContent,
>,
}
/// Nested message and enum types in `RunStarlarkPackageArgs`.
pub mod run_starlark_package_args {
/// Deprecated: If the package is local, it should have been uploaded with UploadStarlarkPackage prior to calling
/// RunStarlarkPackage. If the package is remote and must be cloned within the APIC, use the standalone boolean flag
/// clone_package below
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum StarlarkPackageContent {
/// the payload of the local module
#[prost(bytes, tag = "3")]
Local(::prost::alloc::vec::Vec<u8>),
/// just a flag to indicate the module must be cloned inside the API
#[prost(bool, tag = "4")]
Remote(bool),
}
}
/// ==============================================================================================
/// Starlark Execution Response
/// ==============================================================================================
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct StarlarkRunResponseLine {
#[prost(
oneof = "starlark_run_response_line::RunResponseLine",
tags = "1, 2, 3, 4, 5, 6, 7"
)]
pub run_response_line: ::core::option::Option<
starlark_run_response_line::RunResponseLine,
>,
}
/// Nested message and enum types in `StarlarkRunResponseLine`.
pub mod starlark_run_response_line {
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum RunResponseLine {
#[prost(message, tag = "1")]
Instruction(super::StarlarkInstruction),
#[prost(message, tag = "2")]
Error(super::StarlarkError),
#[prost(message, tag = "3")]
ProgressInfo(super::StarlarkRunProgress),
#[prost(message, tag = "4")]
InstructionResult(super::StarlarkInstructionResult),
#[prost(message, tag = "5")]
RunFinishedEvent(super::StarlarkRunFinishedEvent),
#[prost(message, tag = "6")]
Warning(super::StarlarkWarning),
#[prost(message, tag = "7")]
Info(super::StarlarkInfo),
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct StarlarkInfo {
#[prost(string, tag = "1")]
pub info_message: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct StarlarkWarning {
#[prost(string, tag = "1")]
pub warning_message: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct StarlarkInstruction {
#[prost(message, optional, tag = "1")]
pub position: ::core::option::Option<StarlarkInstructionPosition>,
#[prost(string, tag = "2")]
pub instruction_name: ::prost::alloc::string::String,
#[prost(message, repeated, tag = "3")]
pub arguments: ::prost::alloc::vec::Vec<StarlarkInstructionArg>,
#[prost(string, tag = "4")]
pub executable_instruction: ::prost::alloc::string::String,
#[prost(bool, tag = "5")]
pub is_skipped: bool,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct StarlarkInstructionResult {
#[prost(string, tag = "1")]
pub serialized_instruction_result: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct StarlarkInstructionArg {
#[prost(string, tag = "1")]
pub serialized_arg_value: ::prost::alloc::string::String,
#[prost(string, optional, tag = "2")]
pub arg_name: ::core::option::Option<::prost::alloc::string::String>,
#[prost(bool, tag = "3")]
pub is_representative: bool,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct StarlarkInstructionPosition {
#[prost(string, tag = "1")]
pub filename: ::prost::alloc::string::String,
#[prost(int32, tag = "2")]
pub line: i32,
#[prost(int32, tag = "3")]
pub column: i32,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct StarlarkError {
#[prost(oneof = "starlark_error::Error", tags = "1, 2, 3")]
pub error: ::core::option::Option<starlark_error::Error>,
}
/// Nested message and enum types in `StarlarkError`.
pub mod starlark_error {
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Error {
#[prost(message, tag = "1")]
InterpretationError(super::StarlarkInterpretationError),
#[prost(message, tag = "2")]
ValidationError(super::StarlarkValidationError),
#[prost(message, tag = "3")]
ExecutionError(super::StarlarkExecutionError),
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct StarlarkInterpretationError {
#[prost(string, tag = "1")]
pub error_message: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct StarlarkValidationError {
#[prost(string, tag = "1")]
pub error_message: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct StarlarkExecutionError {
#[prost(string, tag = "1")]
pub error_message: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct StarlarkRunProgress {
#[prost(string, repeated, tag = "1")]
pub current_step_info: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
#[prost(uint32, tag = "2")]
pub total_steps: u32,
#[prost(uint32, tag = "3")]
pub current_step_number: u32,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct StarlarkRunFinishedEvent {
#[prost(bool, tag = "1")]
pub is_run_successful: bool,
#[prost(string, optional, tag = "2")]
pub serialized_output: ::core::option::Option<::prost::alloc::string::String>,
}
/// ==============================================================================================
/// Get Services
/// ==============================================================================================
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetServicesArgs {
/// "Set" of identifiers to fetch info for
/// If empty, will fetch info for all services
#[prost(map = "string, bool", tag = "1")]
pub service_identifiers: ::std::collections::HashMap<
::prost::alloc::string::String,
bool,
>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetServicesResponse {
/// "Set" from identifiers -> info about the service
#[prost(map = "string, message", tag = "1")]
pub service_info: ::std::collections::HashMap<
::prost::alloc::string::String,
ServiceInfo,
>,
}
/// An service identifier is a collection of uuid, name and shortened uuid
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ServiceIdentifiers {
/// UUID of the service
#[prost(string, tag = "1")]
pub service_uuid: ::prost::alloc::string::String,
/// Name of the service
#[prost(string, tag = "2")]
pub name: ::prost::alloc::string::String,
/// The shortened uuid of the service
#[prost(string, tag = "3")]
pub shortened_uuid: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetExistingAndHistoricalServiceIdentifiersResponse {
#[prost(message, repeated, tag = "1")]
pub all_identifiers: ::prost::alloc::vec::Vec<ServiceIdentifiers>,
}
/// ==============================================================================================
/// Exec Command
/// ==============================================================================================
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ExecCommandArgs {
/// The service identifier of the container that the command should be executed in
#[prost(string, tag = "1")]
pub service_identifier: ::prost::alloc::string::String,
#[prost(string, repeated, tag = "2")]
pub command_args: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ExecCommandResponse {
#[prost(int32, tag = "1")]
pub exit_code: i32,
/// Assumes UTF-8 encoding
#[prost(string, tag = "2")]
pub log_output: ::prost::alloc::string::String,
}
/// ==============================================================================================
/// Wait For HTTP Get Endpoint Availability
/// ==============================================================================================
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct WaitForHttpGetEndpointAvailabilityArgs {
/// The identifier of the service to check.
#[prost(string, tag = "1")]
pub service_identifier: ::prost::alloc::string::String,
/// The port of the service to check. For instance 8080
#[prost(uint32, tag = "2")]
pub port: u32,
/// The path of the service to check. It mustn't start with the first slash. For instance `service/health`
#[prost(string, optional, tag = "3")]
pub path: ::core::option::Option<::prost::alloc::string::String>,
/// The number of milliseconds to wait until executing the first HTTP call
#[prost(uint32, optional, tag = "4")]
pub initial_delay_milliseconds: ::core::option::Option<u32>,
/// Max number of HTTP call attempts that this will execute until giving up and returning an error
#[prost(uint32, optional, tag = "5")]
pub retries: ::core::option::Option<u32>,
/// Number of milliseconds to wait between retries
#[prost(uint32, optional, tag = "6")]
pub retries_delay_milliseconds: ::core::option::Option<u32>,
/// If the endpoint returns this value, the service will be marked as available (e.g. Hello World).
#[prost(string, optional, tag = "7")]
pub body_text: ::core::option::Option<::prost::alloc::string::String>,
}
/// ==============================================================================================
/// Wait For HTTP Post Endpoint Availability
/// ==============================================================================================
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct WaitForHttpPostEndpointAvailabilityArgs {
/// The identifier of the service to check.
#[prost(string, tag = "1")]
pub service_identifier: ::prost::alloc::string::String,
/// The port of the service to check. For instance 8080
#[prost(uint32, tag = "2")]
pub port: u32,
/// The path of the service to check. It mustn't start with the first slash. For instance `service/health`
#[prost(string, optional, tag = "3")]
pub path: ::core::option::Option<::prost::alloc::string::String>,
/// The content of the request body.
#[prost(string, optional, tag = "4")]
pub request_body: ::core::option::Option<::prost::alloc::string::String>,
/// The number of milliseconds to wait until executing the first HTTP call
#[prost(uint32, optional, tag = "5")]
pub initial_delay_milliseconds: ::core::option::Option<u32>,
/// Max number of HTTP call attempts that this will execute until giving up and returning an error
#[prost(uint32, optional, tag = "6")]
pub retries: ::core::option::Option<u32>,
/// Number of milliseconds to wait between retries
#[prost(uint32, optional, tag = "7")]
pub retries_delay_milliseconds: ::core::option::Option<u32>,
/// If the endpoint returns this value, the service will be marked as available (e.g. Hello World).
#[prost(string, optional, tag = "8")]
pub body_text: ::core::option::Option<::prost::alloc::string::String>,
}
/// ==============================================================================================
/// Streamed Data Chunk
/// ==============================================================================================
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct StreamedDataChunk {
/// Chunk of the overall files artifact bytes
#[prost(bytes = "vec", tag = "1")]
pub data: ::prost::alloc::vec::Vec<u8>,
/// Hash of the PREVIOUS chunk, or empty string is this is the first chunk
/// Referencing the previous chunk via its hash allows Kurtosis to validate
/// the consistency of the data in case some chunk were not received
#[prost(string, tag = "2")]
pub previous_chunk_hash: ::prost::alloc::string::String,
/// Additional metadata about the item being streamed
#[prost(message, optional, tag = "3")]
pub metadata: ::core::option::Option<DataChunkMetadata>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DataChunkMetadata {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
}
/// ==============================================================================================
/// Upload Files Artifact
/// ==============================================================================================
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UploadFilesArtifactResponse {
/// UUID of the files artifact, for use when referencing it in the future
#[prost(string, tag = "1")]
pub uuid: ::prost::alloc::string::String,
/// UUID of the files artifact, for use when referencing it in the future
#[prost(string, tag = "2")]
pub name: ::prost::alloc::string::String,
}
/// ==============================================================================================
/// Download Files Artifact
/// ==============================================================================================
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DownloadFilesArtifactArgs {
/// Files identifier to get bytes for
#[prost(string, tag = "1")]
pub identifier: ::prost::alloc::string::String,
}
/// ==============================================================================================
/// Store Web Files Artifact
/// ==============================================================================================
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct StoreWebFilesArtifactArgs {
/// URL to download the artifact from
#[prost(string, tag = "1")]
pub url: ::prost::alloc::string::String,
/// The name of the files artifact
#[prost(string, tag = "2")]
pub name: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct StoreWebFilesArtifactResponse {
/// UUID of the files artifact, for use when referencing it in the future
#[prost(string, tag = "1")]
pub uuid: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct StoreFilesArtifactFromServiceArgs {
/// Identifier that will be used to identify the service where the source files will be copied from
#[prost(string, tag = "1")]
pub service_identifier: ::prost::alloc::string::String,
/// The absolute source path where the source files will be copied from
#[prost(string, tag = "2")]
pub source_path: ::prost::alloc::string::String,
/// The name of the files artifact
#[prost(string, tag = "3")]
pub name: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct StoreFilesArtifactFromServiceResponse {
/// UUID of the files artifact, for use when referencing it in the future
#[prost(string, tag = "1")]
pub uuid: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct FilesArtifactNameAndUuid {
/// A string representing the name of the file
#[prost(string, tag = "1")]
pub file_name: ::prost::alloc::string::String,
/// A string representing the uuid of the file
#[prost(string, tag = "2")]
pub file_uuid: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListFilesArtifactNamesAndUuidsResponse {
#[prost(message, repeated, tag = "1")]
pub file_names_and_uuids: ::prost::alloc::vec::Vec<FilesArtifactNameAndUuid>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct InspectFilesArtifactContentsRequest {
#[prost(message, optional, tag = "1")]
pub file_names_and_uuid: ::core::option::Option<FilesArtifactNameAndUuid>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct InspectFilesArtifactContentsResponse {
#[prost(message, repeated, tag = "1")]
pub file_descriptions: ::prost::alloc::vec::Vec<FileArtifactContentsFileDescription>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct FileArtifactContentsFileDescription {
/// Path relative to the file artifact
#[prost(string, tag = "1")]
pub path: ::prost::alloc::string::String,
/// Size of the file, in bytes
#[prost(uint64, tag = "2")]
pub size: u64,
/// A bit of text content, if the file allows (similar to UNIX's 'head')
#[prost(string, optional, tag = "3")]
pub text_preview: ::core::option::Option<::prost::alloc::string::String>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ConnectServicesArgs {
#[prost(enumeration = "Connect", tag = "1")]
pub connect: i32,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ConnectServicesResponse {}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetStarlarkRunResponse {
#[prost(string, tag = "1")]
pub package_id: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub serialized_script: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub serialized_params: ::prost::alloc::string::String,
#[prost(int32, tag = "4")]
pub parallelism: i32,
#[prost(string, tag = "5")]
pub relative_path_to_main_file: ::prost::alloc::string::String,
#[prost(string, tag = "6")]
pub main_function_name: ::prost::alloc::string::String,
#[prost(enumeration = "KurtosisFeatureFlag", repeated, tag = "7")]
pub experimental_features: ::prost::alloc::vec::Vec<i32>,
#[prost(enumeration = "RestartPolicy", tag = "8")]
pub restart_policy: i32,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum ServiceStatus {
Stopped = 0,
Running = 1,
Unknown = 2,
}
impl ServiceStatus {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
ServiceStatus::Stopped => "STOPPED",
ServiceStatus::Running => "RUNNING",
ServiceStatus::Unknown => "UNKNOWN",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"STOPPED" => Some(Self::Stopped),
"RUNNING" => Some(Self::Running),
"UNKNOWN" => Some(Self::Unknown),
_ => None,
}
}
}
/// User services port forwarding
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum Connect {
/// Best effort port forwarding
Connect = 0,
/// Port forwarding disabled
///
/// Starlark run fails if the ports cannot be forwarded.
/// MUST_CONNECT = 2;
NoConnect = 1,
}
impl Connect {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
Connect::Connect => "CONNECT",
Connect::NoConnect => "NO_CONNECT",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"CONNECT" => Some(Self::Connect),
"NO_CONNECT" => Some(Self::NoConnect),
_ => None,
}
}
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum KurtosisFeatureFlag {
NoInstructionsCaching = 0,
}
impl KurtosisFeatureFlag {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
KurtosisFeatureFlag::NoInstructionsCaching => "NO_INSTRUCTIONS_CACHING",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"NO_INSTRUCTIONS_CACHING" => Some(Self::NoInstructionsCaching),
_ => None,
}
}
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum RestartPolicy {
Never = 0,
Always = 1,
}
impl RestartPolicy {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
RestartPolicy::Never => "NEVER",
RestartPolicy::Always => "ALWAYS",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"NEVER" => Some(Self::Never),
"ALWAYS" => Some(Self::Always),
_ => None,
}
}
}
/// Generated client implementations.
pub mod api_container_service_client {
#![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
use tonic::codegen::*;
use tonic::codegen::http::Uri;
#[derive(Debug, Clone)]
pub struct ApiContainerServiceClient<T> {
inner: tonic::client::Grpc<T>,
}
impl ApiContainerServiceClient<tonic::transport::Channel> {
/// Attempt to create a new client by connecting to a given endpoint.
pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
where
D: TryInto<tonic::transport::Endpoint>,
D::Error: Into<StdError>,
{
let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
Ok(Self::new(conn))
}
}
impl<T> ApiContainerServiceClient<T>
where
T: tonic::client::GrpcService<tonic::body::BoxBody>,
T::Error: Into<StdError>,
T::ResponseBody: Body<Data = Bytes> + Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + Send,
{
pub fn new(inner: T) -> Self {
let inner = tonic::client::Grpc::new(inner);
Self { inner }
}
pub fn with_origin(inner: T, origin: Uri) -> Self {
let inner = tonic::client::Grpc::with_origin(inner, origin);
Self { inner }
}
pub fn with_interceptor<F>(
inner: T,
interceptor: F,
) -> ApiContainerServiceClient<InterceptedService<T, F>>
where
F: tonic::service::Interceptor,
T::ResponseBody: Default,
T: tonic::codegen::Service<
http::Request<tonic::body::BoxBody>,
Response = http::Response<
<T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
>,
>,
<T as tonic::codegen::Service<
http::Request<tonic::body::BoxBody>,
>>::Error: Into<StdError> + Send + Sync,
{
ApiContainerServiceClient::new(InterceptedService::new(inner, interceptor))
}
/// Compress requests with the given encoding.
///
/// This requires the server to support it otherwise it might respond with an
/// error.
#[must_use]
pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.send_compressed(encoding);
self
}
/// Enable decompressing responses.
#[must_use]
pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.accept_compressed(encoding);
self
}
/// Limits the maximum size of a decoded message.
///
/// Default: `4MB`
#[must_use]
pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_decoding_message_size(limit);
self
}
/// Limits the maximum size of an encoded message.
///
/// Default: `usize::MAX`
#[must_use]
pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_encoding_message_size(limit);
self
}
/// Executes a Starlark script on the user's behalf
pub async fn run_starlark_script(
&mut self,
request: impl tonic::IntoRequest<super::RunStarlarkScriptArgs>,
) -> std::result::Result<
tonic::Response<tonic::codec::Streaming<super::StarlarkRunResponseLine>>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/api_container_api.ApiContainerService/RunStarlarkScript",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"api_container_api.ApiContainerService",
"RunStarlarkScript",
),
);
self.inner.server_streaming(req, path, codec).await
}
/// Uploads a Starlark package. This step is required before the package can be executed with RunStarlarkPackage
pub async fn upload_starlark_package(
&mut self,
request: impl tonic::IntoStreamingRequest<Message = super::StreamedDataChunk>,
) -> std::result::Result<tonic::Response<()>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/api_container_api.ApiContainerService/UploadStarlarkPackage",
);
let mut req = request.into_streaming_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"api_container_api.ApiContainerService",
"UploadStarlarkPackage",
),
);
self.inner.client_streaming(req, path, codec).await
}
/// Executes a Starlark script on the user's behalf
pub async fn run_starlark_package(
&mut self,
request: impl tonic::IntoRequest<super::RunStarlarkPackageArgs>,
) -> std::result::Result<
tonic::Response<tonic::codec::Streaming<super::StarlarkRunResponseLine>>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/api_container_api.ApiContainerService/RunStarlarkPackage",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"api_container_api.ApiContainerService",
"RunStarlarkPackage",
),
);
self.inner.server_streaming(req, path, codec).await
}
/// Returns the IDs of the current services in the enclave
pub async fn get_services(
&mut self,
request: impl tonic::IntoRequest<super::GetServicesArgs>,
) -> std::result::Result<
tonic::Response<super::GetServicesResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/api_container_api.ApiContainerService/GetServices",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"api_container_api.ApiContainerService",
"GetServices",
),
);
self.inner.unary(req, path, codec).await
}
/// Returns information about all existing & historical services
pub async fn get_existing_and_historical_service_identifiers(
&mut self,
request: impl tonic::IntoRequest<()>,
) -> std::result::Result<
tonic::Response<super::GetExistingAndHistoricalServiceIdentifiersResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(