-
Notifications
You must be signed in to change notification settings - Fork 8
/
generated.proto
894 lines (701 loc) · 32.5 KB
/
generated.proto
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
/*
Copyright AppsCode Inc. and Contributors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// This file was autogenerated by go-to-protobuf. Do not edit it manually!
syntax = "proto2";
package stash.appscode.dev.apimachinery.apis.stash.v1beta1;
import "k8s.io/api/core/v1/generated.proto";
import "k8s.io/apimachinery/pkg/api/resource/generated.proto";
import "k8s.io/apimachinery/pkg/apis/meta/v1/generated.proto";
import "k8s.io/apimachinery/pkg/runtime/generated.proto";
import "k8s.io/apimachinery/pkg/runtime/schema/generated.proto";
import "kmodules.xyz/client-go/api/v1/generated.proto";
import "kmodules.xyz/offshoot-api/api/v1/generated.proto";
import "kmodules.xyz/prober/api/v1/generated.proto";
import "stash.appscode.dev/apimachinery/apis/stash/v1alpha1/generated.proto";
// Package-wide variables from generator "generated".
option go_package = "v1beta1";
// +kubebuilder:object:root=true
// +kubebuilder:resource:path=backupbatches,singular=backupbatch,categories={stash,appscode,all}
// +kubebuilder:subresource:status
// +kubebuilder:printcolumn:name="Schedule",type="string",JSONPath=".spec.schedule"
// +kubebuilder:printcolumn:name="Paused",type="boolean",JSONPath=".spec.paused"
// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp"
message BackupBatch {
optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
optional BackupBatchSpec spec = 2;
optional BackupBatchStatus status = 3;
}
message BackupBatchList {
optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
repeated BackupBatch items = 2;
}
message BackupBatchSpec {
// members is a list of backup configurations that are part of this batch
// +optional
repeated BackupConfigurationTemplateSpec members = 1;
// Schedule specifies the schedule for invoking backup sessions
// +optional
optional string schedule = 2;
// RuntimeSettings allow to specify Resources, NodeSelector, Affinity, Toleration, ReadinessProbe etc,
// and used to create service account for CronJob.
// +optional
optional kmodules.xyz.offshoot_api.api.v1.RuntimeSettings runtimeSettings = 3;
// Driver indicates the name of the agent to use to backup the target.
// Supported values are "Restic", "VolumeSnapshotter".
// Default value is "Restic".
// +optional
// +kubebuilder:default=Restic
optional string driver = 4;
// Repository refer to the Repository crd that holds backend information
// +optional
optional k8s.io.api.core.v1.LocalObjectReference repository = 5;
// RetentionPolicy indicates the policy to follow to clean old backup snapshots
optional .stash.appscode.dev.apimachinery.apis.stash.v1alpha1.RetentionPolicy retentionPolicy = 6;
// Indicates that the BackupConfiguration is paused from taking backup. Default value is 'false'
// +optional
optional bool paused = 7;
// BackupHistoryLimit specifies the number of BackupSession and it's associate resources to keep.
// This is helpful for debugging purpose.
// Default: 1
// +optional
optional int32 backupHistoryLimit = 8;
// Actions that Stash should take in response to backup sessions.
// Cannot be updated.
// +optional
optional BackupHooks hooks = 9;
// ExecutionOrder indicate whether to backup the members in the sequential order as they appear in the members list.
// The default value is "Parallel" which means the members will be backed up in parallel.
// +kubebuilder:default=Parallel
// +optional
optional string executionOrder = 10;
}
message BackupBatchStatus {
// ObservedGeneration is the most recent generation observed for this BackupBatch. It corresponds to the
// BackupBatch's generation, which is updated on mutation by the API Server.
// +optional
optional int64 observedGeneration = 1;
// Conditions shows current backup setup condition of the BackupBatch.
// +optional
repeated kmodules.xyz.client_go.api.v1.Condition conditions = 2;
// MemberConditions shows current backup setup condition of the members of the BackupBatch.
// +optional
repeated MemberConditions memberConditions = 3;
}
// +kubebuilder:object:root=true
// +kubebuilder:resource:path=backupblueprints,singular=backupblueprint,scope=Cluster,shortName=bb,categories={stash,appscode}
// +kubebuilder:printcolumn:name="Task",type="string",JSONPath=".spec.task.name"
// +kubebuilder:printcolumn:name="Schedule",type="string",JSONPath=".spec.schedule"
// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp"
message BackupBlueprint {
optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
optional BackupBlueprintSpec spec = 2;
}
message BackupBlueprintList {
optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
repeated BackupBlueprint items = 2;
}
message BackupBlueprintSpec {
// RepositorySpec is used to create Repository crd for respective workload
optional .stash.appscode.dev.apimachinery.apis.stash.v1alpha1.RepositorySpec repositorySpec = 1;
optional string schedule = 2;
// Task specify the Task crd that specifies steps for backup process
// +optional
optional TaskRef task = 3;
// RetentionPolicy indicates the policy to follow to clean old backup snapshots
optional .stash.appscode.dev.apimachinery.apis.stash.v1alpha1.RetentionPolicy retentionPolicy = 4;
// RuntimeSettings allow to specify Resources, NodeSelector, Affinity, Toleration, ReadinessProbe etc.
// +optional
optional kmodules.xyz.offshoot_api.api.v1.RuntimeSettings runtimeSettings = 5;
// Temp directory configuration for functions/sidecar
// An `EmptyDir` will always be mounted at /tmp with this settings
// +optional
optional EmptyDirSettings tempDir = 6;
// InterimVolumeTemplate specifies a template for a volume to hold targeted data temporarily
// before uploading to backend or inserting into target. It is only usable for job model.
// Don't specify it in sidecar model.
// +optional
optional kmodules.xyz.offshoot_api.api.v1.PersistentVolumeClaim interimVolumeTemplate = 7;
// BackupHistoryLimit specifies the number of BackupSession and it's associate resources to keep.
// This is helpful for debugging purpose.
// Default: 1
// +optional
optional int32 backupHistoryLimit = 8;
}
// +kubebuilder:object:root=true
// +kubebuilder:resource:path=backupconfigurations,singular=backupconfiguration,shortName=bc,categories={stash,appscode,all}
// +kubebuilder:subresource:status
// +kubebuilder:printcolumn:name="Task",type="string",JSONPath=".spec.task.name"
// +kubebuilder:printcolumn:name="Schedule",type="string",JSONPath=".spec.schedule"
// +kubebuilder:printcolumn:name="Paused",type="boolean",JSONPath=".spec.paused"
// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp"
message BackupConfiguration {
optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
optional BackupConfigurationSpec spec = 2;
optional BackupConfigurationStatus status = 3;
}
message BackupConfigurationList {
optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
repeated BackupConfiguration items = 2;
}
message BackupConfigurationSpec {
optional BackupConfigurationTemplateSpec backupConfigurationTemplateSpec = 1;
// Schedule specifies the schedule for invoking backup sessions
// +optional
optional string schedule = 2;
// Driver indicates the name of the agent to use to backup the target.
// Supported values are "Restic", "VolumeSnapshotter".
// Default value is "Restic".
// +optional
// +kubebuilder:default=Restic
optional string driver = 3;
// Repository refer to the Repository crd that holds backend information
// +optional
optional k8s.io.api.core.v1.LocalObjectReference repository = 4;
// RetentionPolicy indicates the policy to follow to clean old backup snapshots
optional .stash.appscode.dev.apimachinery.apis.stash.v1alpha1.RetentionPolicy retentionPolicy = 5;
// Indicates that the BackupConfiguration is paused from taking backup. Default value is 'false'
// +optional
optional bool paused = 6;
// BackupHistoryLimit specifies the number of BackupSession and it's associate resources to keep.
// This is helpful for debugging purpose.
// Default: 1
// +optional
optional int32 backupHistoryLimit = 7;
}
message BackupConfigurationStatus {
// ObservedGeneration is the most recent generation observed for this BackupConfiguration. It corresponds to the
// BackupConfiguration's generation, which is updated on mutation by the API Server.
// +optional
optional int64 observedGeneration = 1;
// Conditions shows current backup setup condition of the BackupConfiguration.
// +optional
repeated kmodules.xyz.client_go.api.v1.Condition conditions = 2;
}
message BackupConfigurationTemplateSpec {
// Task specify the Task crd that specifies the steps to take backup
// +optional
optional TaskRef task = 1;
// Target specify the backup target
// +optional
optional BackupTarget target = 2;
// RuntimeSettings allow to specify Resources, NodeSelector, Affinity, Toleration, ReadinessProbe etc.
// +optional
optional kmodules.xyz.offshoot_api.api.v1.RuntimeSettings runtimeSettings = 3;
// Temp directory configuration for functions/sidecar
// An `EmptyDir` will always be mounted at /tmp with this settings
// +optional
optional EmptyDirSettings tempDir = 4;
// InterimVolumeTemplate specifies a template for a volume to hold targeted data temporarily
// before uploading to backend or inserting into target. It is only usable for job model.
// Don't specify it in sidecar model.
// +optional
optional kmodules.xyz.offshoot_api.api.v1.PersistentVolumeClaim interimVolumeTemplate = 5;
// Actions that Stash should take in response to backup sessions.
// +optional
optional BackupHooks hooks = 6;
}
// Hooks describes actions that Stash should take in response to backup sessions. For the PostBackup
// and PreBackup handlers, backup process blocks until the action is complete,
// unless the container process fails, in which case the handler is aborted.
message BackupHooks {
// PreBackup is called immediately before a backup session is initiated.
// +optional
optional kmodules.xyz.prober.api.v1.Handler preBackup = 1;
// PostBackup is called immediately after a backup session is complete.
// +optional
optional kmodules.xyz.prober.api.v1.Handler postBackup = 2;
}
// BackupInvokerRef contains information that points to the backup configuration or batch being used
message BackupInvokerRef {
// APIGroup is the group for the resource being referenced
// +optional
optional string apiGroup = 1;
// Kind is the type of resource being referenced
optional string kind = 2;
// Name is the name of resource being referenced
optional string name = 3;
}
// +kubebuilder:object:root=true
// +kubebuilder:resource:path=backupsessions,singular=backupsession,categories={stash,appscode,all}
// +kubebuilder:subresource:status
// +kubebuilder:printcolumn:name="Invoker-Type",type="string",JSONPath=".spec.invoker.kind"
// +kubebuilder:printcolumn:name="Invoker-Name",type="string",JSONPath=".spec.invoker.name"
// +kubebuilder:printcolumn:name="Phase",type="string",JSONPath=".status.phase"
// +kubebuilder:printcolumn:name="Duration",type="string",JSONPath=".status.sessionDuration"
// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp"
message BackupSession {
optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
optional BackupSessionSpec spec = 2;
optional BackupSessionStatus status = 3;
}
message BackupSessionList {
optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
repeated BackupSession items = 2;
}
message BackupSessionSpec {
// Invoker refers to the BackupConfiguration or BackupBatch being used to invoke this backup session
// +optional
optional BackupInvokerRef invoker = 1;
}
message BackupSessionStatus {
// Phase indicates the overall phase of the backup process for this BackupSession. Phase will be "Succeeded" only if
// phase of all hosts are "Succeeded". If any of the host fail to complete backup, Phase will be "Failed".
// +optional
optional string phase = 1;
// SessionDuration specify total time taken to complete current backup session (sum of backup duration of all targets)
// +optional
optional string sessionDuration = 2;
// Targets specify the backup status of individual targets
// +optional
repeated BackupTargetStatus targets = 3;
// Conditions shows condition of different operations/steps of the backup process
// +optional
repeated kmodules.xyz.client_go.api.v1.Condition conditions = 4;
}
message BackupTarget {
// Alias represents the identifier of the backed up data in the repository.
// This will be used as `hostname` or will be used to generate the `hostname` for the restic repository.
// +optional
optional string alias = 1;
// Ref refers to the backup target
optional TargetRef ref = 2;
// Paths specify the file paths to backup
// +optional
repeated string paths = 3;
// VolumeMounts specifies the volumes to mount inside stash sidecar/init container
// Specify the volumes that contains the target directories
// +optional
repeated k8s.io.api.core.v1.VolumeMount volumeMounts = 4;
// replicas are the desired number of replicas whose data should be backed up.
// If unspecified, defaults to 1.
// +optional
optional int32 replicas = 5;
// Name of the VolumeSnapshotClass used by the VolumeSnapshot. If not specified, a default snapshot class will be used if it is available.
// Use this field only if the "driver" field is set to "volumeSnapshotter".
// +optional
optional string snapshotClassName = 6;
// Exclude specifies a list of patterns for the files to ignore during backup.
// Stash will ignore those files that match the specified patterns.
// Supported only for "Restic" driver
// +optional
repeated string exclude = 7;
}
message BackupTargetStatus {
// Ref refers to the backup target
// +optional
optional TargetRef ref = 1;
// TotalHosts specifies total number of hosts for this target that will be backed up for a BackupSession
// +optional
optional int32 totalHosts = 2;
// Phase indicates backup phase of this target
// +optional
optional string phase = 3;
// Stats shows statistics of individual hosts for this backup session
// +optional
repeated HostBackupStats stats = 4;
// PreBackupActions specifies a list of actions that the backup process should execute before taking backup
// +optional
repeated string preBackupActions = 5;
// PostBackupActions specifies a list of actions that the backup process should execute after taking backup
// +optional
repeated string postBackupActions = 6;
}
message EmptyDirSettings {
optional string medium = 1;
optional k8s.io.apimachinery.pkg.api.resource.Quantity sizeLimit = 2;
// More info: https://github.com/restic/restic/blob/master/doc/manual_rest.rst#caching
optional bool disableCaching = 3;
}
message FileStats {
// TotalFiles shows total number of files that has been backed up
optional int64 totalFiles = 1;
// NewFiles shows total number of new files that has been created since last backup
optional int64 newFiles = 2;
// ModifiedFiles shows total number of files that has been modified since last backup
optional int64 modifiedFiles = 3;
// UnmodifiedFiles shows total number of files that has not been changed since last backup
optional int64 unmodifiedFiles = 4;
}
// +kubebuilder:object:root=true
// +kubebuilder:resource:path=functions,singular=function,scope=Cluster,shortName=fn,categories={stash,appscode}
// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp"
message Function {
optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
optional FunctionSpec spec = 2;
}
message FunctionList {
optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
repeated Function items = 2;
}
message FunctionRef {
// Name indicates the name of Function crd
optional string name = 1;
// Inputs specifies the inputs of respective Function
// +optional
repeated Param params = 2;
}
message FunctionSpec {
// Docker image name.
// More info: https://kubernetes.io/docs/concepts/containers/images
// This field is optional to allow higher level config management to default or override
// container images in workload controllers like Deployments and StatefulSets.
// +optional
optional string image = 1;
// Entrypoint array. Not executed within a shell.
// The docker image's ENTRYPOINT is used if this is not provided.
// Variable references $(VAR_NAME) are expanded using the container's environment. If a variable
// cannot be resolved, the reference in the input string will be unchanged. The $(VAR_NAME) syntax
// can be escaped with a double $$, ie: $$(VAR_NAME). Escaped references will never be expanded,
// regardless of whether the variable exists or not.
// Cannot be updated.
// More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell
// +optional
repeated string command = 2;
// Arguments to the entrypoint.
// The docker image's CMD is used if this is not provided.
// Variable references $(VAR_NAME) are expanded using the container's environment. If a variable
// cannot be resolved, the reference in the input string will be unchanged. The $(VAR_NAME) syntax
// can be escaped with a double $$, ie: $$(VAR_NAME). Escaped references will never be expanded,
// regardless of whether the variable exists or not.
// Cannot be updated.
// More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell
// +optional
repeated string args = 3;
// Container's working directory.
// If not specified, the container runtime's default will be used, which
// might be configured in the container image.
// Cannot be updated.
// +optional
optional string workingDir = 4;
// List of ports to expose from the container. Exposing a port here gives
// the system additional information about the network connections a
// container uses, but is primarily informational. Not specifying a port here
// DOES NOT prevent that port from being exposed. Any port which is
// listening on the default "0.0.0.0" address inside a container will be
// accessible from the network.
// Cannot be updated.
// +optional
// +patchMergeKey=containerPort
// +patchStrategy=merge
repeated k8s.io.api.core.v1.ContainerPort ports = 5;
// Pod volumes to mount into the container's filesystem.
// Cannot be updated.
// +optional
// +patchMergeKey=mountPath
// +patchStrategy=merge
repeated k8s.io.api.core.v1.VolumeMount volumeMounts = 6;
// volumeDevices is the list of block devices to be used by the container.
// This is an alpha feature and may change in the future.
// +patchMergeKey=devicePath
// +patchStrategy=merge
// +optional
repeated k8s.io.api.core.v1.VolumeDevice volumeDevices = 7;
// RuntimeSettings allow to specify Resources, LivenessProbe, ReadinessProbe, Lifecycle, SecurityContext etc.
// +optional
optional kmodules.xyz.offshoot_api.api.v1.ContainerRuntimeSettings runtimeSettings = 8;
// Name of PodSecurityPolicy(PSP) required by this function
// +optional
optional string podSecurityPolicyName = 9;
}
message HostBackupStats {
// Hostname indicate name of the host that has been backed up
// +optional
optional string hostname = 1;
// Phase indicates backup phase of this host
// +optional
optional string phase = 2;
// Snapshots specifies the stats of individual snapshots that has been taken for this host in current backup session
// +optional
repeated SnapshotStats snapshots = 3;
// Duration indicates total time taken to complete backup for this hosts
// +optional
optional string duration = 4;
// Error indicates string value of error in case of backup failure
// +optional
optional string error = 5;
}
message HostRestoreStats {
// Hostname indicate name of the host that has been restored
// +optional
optional string hostname = 1;
// Phase indicates restore phase of this host
// +optional
optional string phase = 2;
// Duration indicates total time taken to complete restore for this hosts
// +optional
optional string duration = 3;
// Error indicates string value of error in case of restore failure
// +optional
optional string error = 4;
}
message MemberConditions {
// Target is the reference to the respective target whose condition is shown here.
optional TargetRef target = 1;
// Conditions shows current backup setup condition of this member.
// +optional
repeated kmodules.xyz.client_go.api.v1.Condition conditions = 2;
}
// Param declares a value to use for the Param called Name.
message Param {
optional string name = 1;
optional string value = 2;
}
// +kubebuilder:object:root=true
// +kubebuilder:resource:path=restorebatches,singular=restorebatch,categories={stash,appscode,all}
// +kubebuilder:subresource:status
// +kubebuilder:printcolumn:name="Repository",type="string",JSONPath=".spec.repository.name"
// +kubebuilder:printcolumn:name="Phase",type="string",JSONPath=".status.phase"
// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp"
message RestoreBatch {
optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
optional RestoreBatchSpec spec = 2;
optional RestoreBatchStatus status = 3;
}
message RestoreBatchList {
optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
repeated RestoreBatch items = 2;
}
message RestoreBatchSpec {
// Driver indicates the name of the agent to use to restore the target.
// Supported values are "Restic", "VolumeSnapshotter".
// Default value is "Restic".
// +optional
// +kubebuilder:default=Restic
optional string driver = 1;
// Repository refer to the Repository crd that holds backend information
// +optional
optional k8s.io.api.core.v1.LocalObjectReference repository = 2;
// Members is a list of restore targets and their configuration that are part of this batch
// +optional
repeated RestoreTargetSpec members = 3;
// ExecutionOrder indicate whether to restore the members in the sequential order as they appear in the members list.
// The default value is "Parallel" which means the members will be restored in parallel.
// +kubebuilder:default=Parallel
// +optional
optional string executionOrder = 4;
// Hooks specifies the actions that Stash should take before or after restore.
// Cannot be updated.
// +optional
optional RestoreHooks hooks = 5;
}
message RestoreBatchStatus {
// Phase indicates the overall phase of the restore process for this RestoreBatch. Phase will be "Succeeded" only if
// phase of all members are "Succeeded". If the restore process fail for any of the members, Phase will be "Failed".
// +optional
optional string phase = 1;
// SessionDuration specify total time taken to complete restore of all the members.
// +optional
optional string sessionDuration = 2;
// Conditions shows the condition of different steps for the RestoreBatch.
// +optional
repeated kmodules.xyz.client_go.api.v1.Condition conditions = 3;
// Members shows the restore status for the members of the RestoreBatch.
// +optional
repeated RestoreMemberStatus members = 4;
}
// Hooks describes actions that Stash should take in response to restore sessions. For the PostRestore
// and PreRestore handlers, restore process blocks until the action is complete,
// unless the container process fails, in which case the handler is aborted.
message RestoreHooks {
// PreRestore is called immediately before a restore session is initiated.
// +optional
optional kmodules.xyz.prober.api.v1.Handler preRestore = 1;
// PostRestore is called immediately after a restore session is complete.
// +optional
optional kmodules.xyz.prober.api.v1.Handler postRestore = 2;
}
message RestoreMemberStatus {
// Ref is the reference to the respective target whose status is shown here.
optional TargetRef ref = 1;
// Conditions shows the condition of different steps to restore this member.
// +optional
repeated kmodules.xyz.client_go.api.v1.Condition conditions = 2;
// TotalHosts specifies total number of hosts that will be restored for this member.
// +optional
optional int32 totalHosts = 3;
// Phase indicates restore phase of this member
// +optional
optional string phase = 4;
// Stats shows restore statistics of individual hosts for this member
// +optional
repeated HostRestoreStats stats = 5;
}
// +kubebuilder:object:root=true
// +kubebuilder:resource:path=restoresessions,singular=restoresession,shortName=restore,categories={stash,appscode,all}
// +kubebuilder:subresource:status
// +kubebuilder:printcolumn:name="Repository",type="string",JSONPath=".spec.repository.name"
// +kubebuilder:printcolumn:name="Phase",type="string",JSONPath=".status.phase"
// +kubebuilder:printcolumn:name="Duration",type="string",JSONPath=".status.sessionDuration"
// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp"
message RestoreSession {
optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
optional RestoreSessionSpec spec = 2;
optional RestoreSessionStatus status = 3;
}
message RestoreSessionList {
optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
repeated RestoreSession items = 2;
}
message RestoreSessionSpec {
optional RestoreTargetSpec restoreTargetSpec = 1;
// Driver indicates the name of the agent to use to restore the target.
// Supported values are "Restic", "VolumeSnapshotter".
// Default value is "Restic".
// +optional
// +kubebuilder:default=Restic
optional string driver = 2;
// Repository refer to the Repository crd that hold backend information
// +optional
optional k8s.io.api.core.v1.LocalObjectReference repository = 3;
// Rules specifies different restore options for different hosts
// +optional
// Deprecated. Use rules section inside `target`.
repeated Rule rules = 4;
}
message RestoreSessionStatus {
// Phase indicates the overall phase of the restore process for this RestoreSession. Phase will be "Succeeded" only if
// phase of all hosts are "Succeeded". If any of the host fail to complete restore, Phase will be "Failed".
// +optional
optional string phase = 1;
// TotalHosts specifies total number of hosts that will be restored for this RestoreSession
// +optional
optional int32 totalHosts = 2;
// SessionDuration specify total time taken to complete current restore session (sum of restore duration of all hosts)
// +optional
optional string sessionDuration = 3;
// Stats shows statistics of individual hosts for this restore session
// +optional
repeated HostRestoreStats stats = 4;
// Conditions shows current restore condition of the RestoreSession.
// +optional
repeated kmodules.xyz.client_go.api.v1.Condition conditions = 5;
}
message RestoreTarget {
// Alias represents the identifier of the backed up data in the repository.
// This will be used as `sourceHost` and `targetHosts` or will be used to generate them.
// +optional
optional string alias = 1;
// Ref refers to the restore,target
optional TargetRef ref = 2;
// VolumeMounts specifies the volumes to mount inside stash sidecar/init container
// Specify the volumes that contains the target directories
// +optional
repeated k8s.io.api.core.v1.VolumeMount volumeMounts = 3;
// replicas is the desired number of replicas of the given Template.
// These are replicas in the sense that they are instantiations of the
// same Template, but individual replicas also have a consistent identity.
// If unspecified, defaults to 1.
// +optional
optional int32 replicas = 4;
// volumeClaimTemplates is a list of claims that will be created while restore from VolumeSnapshot
// +optional
repeated kmodules.xyz.offshoot_api.api.v1.PersistentVolumeClaim volumeClaimTemplates = 5;
// Rules specifies different restore options for different hosts
// +optional
repeated Rule rules = 6;
}
message RestoreTargetSpec {
// Task specify the Task crd that specifies the steps for recovery process
// +optional
optional TaskRef task = 1;
// Target indicates the target where the recovered data will be stored
// +optional
optional RestoreTarget target = 2;
// RuntimeSettings allow to specify Resources, NodeSelector, Affinity, Toleration, ReadinessProbe etc.
// +optional
optional kmodules.xyz.offshoot_api.api.v1.RuntimeSettings runtimeSettings = 3;
// Temp directory configuration for functions/sidecar
// An `EmptyDir` will always be mounted at /tmp with this settings
// +optional
optional EmptyDirSettings tempDir = 4;
// InterimVolumeTemplate specifies a template for a volume to hold targeted data temporarily
// before uploading to backend or inserting into target. It is only usable for job model.
// Don't specify it in sidecar model.
// +optional
optional kmodules.xyz.offshoot_api.api.v1.PersistentVolumeClaim interimVolumeTemplate = 5;
// Actions that Stash should take in response to restore sessions.
// +optional
optional RestoreHooks hooks = 6;
}
message Rule {
// Subjects specifies the list of hosts that are subject to this rule
// +optional
repeated string targetHosts = 1;
// SourceHost specifies the name of the host whose backed up state we are trying to restore
// By default, it will indicate the workload itself
// +optional
optional string sourceHost = 2;
// Snapshots specifies the list of snapshots that will be restored for the host under this rule.
// Don't specify if you have specified paths field.
// +optional
repeated string snapshots = 3;
// Paths specifies the paths to be restored for the hosts under this rule.
// Don't specify if you have specified snapshots field.
// +optional
repeated string paths = 4;
// Exclude specifies a list of patterns for the files to ignore during restore.
// Stash will only restore the files that does not match those patterns.
// Supported only for "Restic" driver
// +optional
repeated string exclude = 5;
// Include specifies a list of patterns for the files to restore.
// Stash will only restore the files that match those patterns.
// Supported only for "Restic" driver
// +optional
repeated string include = 6;
}
message SnapshotStats {
// Name indicates the name of the backup snapshot created for this host
optional string name = 1;
// Path indicates the directory that has been backed up in this snapshot
optional string path = 2;
// TotalSize indicates the size of data to backup in target directory
optional string totalSize = 7;
// Uploaded indicates size of data uploaded to backend for this snapshot
optional string uploaded = 4;
// ProcessingTime indicates time taken to process the target data
optional string processingTime = 5;
// FileStats shows statistics of files of this snapshot
optional FileStats fileStats = 6;
}
message TargetRef {
optional string apiVersion = 1;
optional string kind = 2;
optional string name = 3;
}
// +kubebuilder:object:root=true
// +kubebuilder:resource:path=tasks,singular=task,scope=Cluster,shortName=task,categories={stash,appscode}
// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp"
message Task {
optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
optional TaskSpec spec = 2;
}
message TaskList {
optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
repeated Task items = 2;
}
message TaskRef {
// Name specifies the name of the Task to use for backup/restore purpose. If your database has been deployed with KubeDB,
// then keep this field empty. Stash will read the Task info from the respective AppBinding.
// +optional
optional string name = 1;
// Params specifies a list of parameter to pass to the Task. Stash will use this parameters to resolve the task.
// +optional
repeated Param params = 2;
}
message TaskSpec {
repeated FunctionRef steps = 1;
// List of volumes that can be mounted by containers belonging to the pod created for this task.
// +optional
repeated k8s.io.api.core.v1.Volume volumes = 2;
}