kcr_dataprotection_kubeblocks_io 3.20260114.105424

Kubernetes Custom Resource Bindings
Documentation
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
// WARNING: generated by kopium - manual changes will be overwritten
// kopium command: kopium --docs --derive=Default --derive=PartialEq --smart-derive-elision --filename crd-catalog/apecloud/kubeblocks/dataprotection.kubeblocks.io/v1alpha1/actionsets.yaml
// kopium version: 0.22.5

#[allow(unused_imports)]
mod prelude {
    pub use kube::CustomResource;
    pub use serde::{Serialize, Deserialize};
    pub use std::collections::BTreeMap;
    pub use k8s_openapi::apimachinery::pkg::util::intstr::IntOrString;
}
use self::prelude::*;

/// ActionSetSpec defines the desired state of ActionSet
#[derive(CustomResource, Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
#[kube(group = "dataprotection.kubeblocks.io", version = "v1alpha1", kind = "ActionSet", plural = "actionsets")]
#[kube(status = "ActionSetStatus")]
#[kube(schema = "disabled")]
#[kube(derive="Default")]
#[kube(derive="PartialEq")]
pub struct ActionSetSpec {
    /// Specifies the backup action.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub backup: Option<ActionSetBackup>,
    /// Specifies the backup type. Supported values include:
    /// 
    /// 
    /// - `Full` for a full backup.
    /// - `Incremental` back up data that have changed since the last backup (either full or incremental).
    /// - `Differential` back up data that has changed since the last full backup.
    /// - `Continuous` back up transaction logs continuously, such as MySQL binlog, PostgreSQL WAL, etc.
    /// - `Selective` back up data more precisely, use custom parameters, such as specific databases or tables.
    /// 
    /// 
    /// Continuous backup is essential for implementing Point-in-Time Recovery (PITR).
    #[serde(rename = "backupType")]
    pub backup_type: String,
    /// Specifies a list of environment variables to be set in the container.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub env: Option<Vec<ActionSetEnv>>,
    /// Specifies a list of sources to populate environment variables in the container.
    /// The keys within a source must be a C_IDENTIFIER. Any invalid keys will be
    /// reported as an event when the container starts. If a key exists in multiple
    /// sources, the value from the last source will take precedence. Any values
    /// defined by an Env with a duplicate key will take precedence.
    /// 
    /// 
    /// This field cannot be updated.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "envFrom")]
    pub env_from: Option<Vec<ActionSetEnvFrom>>,
    /// Specifies the schema of parameters in backups and restores before their usage.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "parametersSchema")]
    pub parameters_schema: Option<ActionSetParametersSchema>,
    /// Specifies the restore action.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub restore: Option<ActionSetRestore>,
}

/// Specifies the backup action.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct ActionSetBackup {
    /// Represents the action to be performed for backing up data.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "backupData")]
    pub backup_data: Option<ActionSetBackupBackupData>,
    /// Represents a set of actions that should be executed after the backup process has completed.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "postBackup")]
    pub post_backup: Option<Vec<ActionSetBackupPostBackup>>,
    /// Represents a set of actions that should be executed before the backup process begins.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "preBackup")]
    pub pre_backup: Option<Vec<ActionSetBackupPreBackup>>,
    /// Represents a custom deletion action that can be executed before the built-in deletion action.
    /// Note: The preDelete action job will ignore the env/envFrom.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "preDelete")]
    pub pre_delete: Option<ActionSetBackupPreDelete>,
    /// Specifies the parameters used by the backup action
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "withParameters")]
    pub with_parameters: Option<Vec<String>>,
}

/// Represents the action to be performed for backing up data.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct ActionSetBackupBackupData {
    /// Defines the commands to back up the volume data.
    pub command: Vec<String>,
    /// Specifies the image of the backup container.
    pub image: String,
    /// Indicates how to behave if an error is encountered during the execution of this action.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "onError")]
    pub on_error: Option<ActionSetBackupBackupDataOnError>,
    /// Determines whether to run the job workload on the target pod node.
    /// If the backup container needs to mount the target pod's volumes, this field
    /// should be set to true. Otherwise, the target pod's volumes will be ignored.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "runOnTargetPodNode")]
    pub run_on_target_pod_node: Option<bool>,
    /// Determines if the backup progress should be synchronized and the interval
    /// for synchronization in seconds.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "syncProgress")]
    pub sync_progress: Option<ActionSetBackupBackupDataSyncProgress>,
}

/// Represents the action to be performed for backing up data.
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
pub enum ActionSetBackupBackupDataOnError {
    Continue,
    Fail,
}

/// Determines if the backup progress should be synchronized and the interval
/// for synchronization in seconds.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct ActionSetBackupBackupDataSyncProgress {
    /// Determines if the backup progress should be synchronized. If set to true,
    /// a sidecar container will be instantiated to synchronize the backup progress with the
    /// Backup Custom Resource (CR) status.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub enabled: Option<bool>,
    /// Defines the interval in seconds for synchronizing the backup progress.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "intervalSeconds")]
    pub interval_seconds: Option<i32>,
}

/// ActionSpec defines an action that should be executed. Only one of the fields may be set.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct ActionSetBackupPostBackup {
    /// Specifies that the action should be executed using the pod's exec API within a container.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub exec: Option<ActionSetBackupPostBackupExec>,
    /// Specifies that the action should be executed by a Kubernetes Job.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub job: Option<ActionSetBackupPostBackupJob>,
}

/// Specifies that the action should be executed using the pod's exec API within a container.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct ActionSetBackupPostBackupExec {
    /// Defines the command and arguments to be executed.
    pub command: Vec<String>,
    /// Specifies the container within the pod where the command should be executed.
    /// If not specified, the first container in the pod is used by default.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub container: Option<String>,
    /// Indicates how to behave if an error is encountered during the execution of this action.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "onError")]
    pub on_error: Option<ActionSetBackupPostBackupExecOnError>,
    /// Specifies the maximum duration to wait for the hook to complete before
    /// considering the execution a failure.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub timeout: Option<String>,
}

/// Specifies that the action should be executed using the pod's exec API within a container.
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
pub enum ActionSetBackupPostBackupExecOnError {
    Continue,
    Fail,
}

/// Specifies that the action should be executed by a Kubernetes Job.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct ActionSetBackupPostBackupJob {
    /// Defines the commands to back up the volume data.
    pub command: Vec<String>,
    /// Specifies the image of the backup container.
    pub image: String,
    /// Indicates how to behave if an error is encountered during the execution of this action.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "onError")]
    pub on_error: Option<ActionSetBackupPostBackupJobOnError>,
    /// Determines whether to run the job workload on the target pod node.
    /// If the backup container needs to mount the target pod's volumes, this field
    /// should be set to true. Otherwise, the target pod's volumes will be ignored.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "runOnTargetPodNode")]
    pub run_on_target_pod_node: Option<bool>,
}

/// Specifies that the action should be executed by a Kubernetes Job.
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
pub enum ActionSetBackupPostBackupJobOnError {
    Continue,
    Fail,
}

/// ActionSpec defines an action that should be executed. Only one of the fields may be set.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct ActionSetBackupPreBackup {
    /// Specifies that the action should be executed using the pod's exec API within a container.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub exec: Option<ActionSetBackupPreBackupExec>,
    /// Specifies that the action should be executed by a Kubernetes Job.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub job: Option<ActionSetBackupPreBackupJob>,
}

/// Specifies that the action should be executed using the pod's exec API within a container.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct ActionSetBackupPreBackupExec {
    /// Defines the command and arguments to be executed.
    pub command: Vec<String>,
    /// Specifies the container within the pod where the command should be executed.
    /// If not specified, the first container in the pod is used by default.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub container: Option<String>,
    /// Indicates how to behave if an error is encountered during the execution of this action.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "onError")]
    pub on_error: Option<ActionSetBackupPreBackupExecOnError>,
    /// Specifies the maximum duration to wait for the hook to complete before
    /// considering the execution a failure.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub timeout: Option<String>,
}

/// Specifies that the action should be executed using the pod's exec API within a container.
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
pub enum ActionSetBackupPreBackupExecOnError {
    Continue,
    Fail,
}

/// Specifies that the action should be executed by a Kubernetes Job.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct ActionSetBackupPreBackupJob {
    /// Defines the commands to back up the volume data.
    pub command: Vec<String>,
    /// Specifies the image of the backup container.
    pub image: String,
    /// Indicates how to behave if an error is encountered during the execution of this action.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "onError")]
    pub on_error: Option<ActionSetBackupPreBackupJobOnError>,
    /// Determines whether to run the job workload on the target pod node.
    /// If the backup container needs to mount the target pod's volumes, this field
    /// should be set to true. Otherwise, the target pod's volumes will be ignored.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "runOnTargetPodNode")]
    pub run_on_target_pod_node: Option<bool>,
}

/// Specifies that the action should be executed by a Kubernetes Job.
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
pub enum ActionSetBackupPreBackupJobOnError {
    Continue,
    Fail,
}

/// Represents a custom deletion action that can be executed before the built-in deletion action.
/// Note: The preDelete action job will ignore the env/envFrom.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct ActionSetBackupPreDelete {
    /// Defines the commands to back up the volume data.
    pub command: Vec<String>,
    /// Specifies the image of the backup container.
    pub image: String,
}

/// EnvVar represents an environment variable present in a Container.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct ActionSetEnv {
    /// Name of the environment variable. Must be a C_IDENTIFIER.
    pub name: String,
    /// Variable references $(VAR_NAME) are expanded
    /// using the previously defined environment variables in the container and
    /// any service environment variables. If a variable cannot be resolved,
    /// the reference in the input string will be unchanged. Double $$ are reduced
    /// to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e.
    /// "$$(VAR_NAME)" will produce the string literal "$(VAR_NAME)".
    /// Escaped references will never be expanded, regardless of whether the variable
    /// exists or not.
    /// Defaults to "".
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub value: Option<String>,
    /// Source for the environment variable's value. Cannot be used if value is not empty.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "valueFrom")]
    pub value_from: Option<ActionSetEnvValueFrom>,
}

/// Source for the environment variable's value. Cannot be used if value is not empty.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct ActionSetEnvValueFrom {
    /// Selects a key of a ConfigMap.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "configMapKeyRef")]
    pub config_map_key_ref: Option<ActionSetEnvValueFromConfigMapKeyRef>,
    /// Selects a field of the pod: supports metadata.name, metadata.namespace, `metadata.labels['<KEY>']`, `metadata.annotations['<KEY>']`,
    /// spec.nodeName, spec.serviceAccountName, status.hostIP, status.podIP, status.podIPs.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "fieldRef")]
    pub field_ref: Option<ActionSetEnvValueFromFieldRef>,
    /// Selects a resource of the container: only resources limits and requests
    /// (limits.cpu, limits.memory, limits.ephemeral-storage, requests.cpu, requests.memory and requests.ephemeral-storage) are currently supported.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "resourceFieldRef")]
    pub resource_field_ref: Option<ActionSetEnvValueFromResourceFieldRef>,
    /// Selects a key of a secret in the pod's namespace
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "secretKeyRef")]
    pub secret_key_ref: Option<ActionSetEnvValueFromSecretKeyRef>,
}

/// Selects a key of a ConfigMap.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct ActionSetEnvValueFromConfigMapKeyRef {
    /// The key to select.
    pub key: String,
    /// Name of the referent.
    /// More info: <https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names>
    /// TODO: Add other useful fields. apiVersion, kind, uid?
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub name: Option<String>,
    /// Specify whether the ConfigMap or its key must be defined
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub optional: Option<bool>,
}

/// Selects a field of the pod: supports metadata.name, metadata.namespace, `metadata.labels['<KEY>']`, `metadata.annotations['<KEY>']`,
/// spec.nodeName, spec.serviceAccountName, status.hostIP, status.podIP, status.podIPs.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct ActionSetEnvValueFromFieldRef {
    /// Version of the schema the FieldPath is written in terms of, defaults to "v1".
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "apiVersion")]
    pub api_version: Option<String>,
    /// Path of the field to select in the specified API version.
    #[serde(rename = "fieldPath")]
    pub field_path: String,
}

/// Selects a resource of the container: only resources limits and requests
/// (limits.cpu, limits.memory, limits.ephemeral-storage, requests.cpu, requests.memory and requests.ephemeral-storage) are currently supported.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct ActionSetEnvValueFromResourceFieldRef {
    /// Container name: required for volumes, optional for env vars
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "containerName")]
    pub container_name: Option<String>,
    /// Specifies the output format of the exposed resources, defaults to "1"
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub divisor: Option<IntOrString>,
    /// Required: resource to select
    pub resource: String,
}

/// Selects a key of a secret in the pod's namespace
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct ActionSetEnvValueFromSecretKeyRef {
    /// The key of the secret to select from.  Must be a valid secret key.
    pub key: String,
    /// Name of the referent.
    /// More info: <https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names>
    /// TODO: Add other useful fields. apiVersion, kind, uid?
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub name: Option<String>,
    /// Specify whether the Secret or its key must be defined
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub optional: Option<bool>,
}

/// EnvFromSource represents the source of a set of ConfigMaps
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct ActionSetEnvFrom {
    /// The ConfigMap to select from
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "configMapRef")]
    pub config_map_ref: Option<ActionSetEnvFromConfigMapRef>,
    /// An optional identifier to prepend to each key in the ConfigMap. Must be a C_IDENTIFIER.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub prefix: Option<String>,
    /// The Secret to select from
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "secretRef")]
    pub secret_ref: Option<ActionSetEnvFromSecretRef>,
}

/// The ConfigMap to select from
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct ActionSetEnvFromConfigMapRef {
    /// Name of the referent.
    /// More info: <https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names>
    /// TODO: Add other useful fields. apiVersion, kind, uid?
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub name: Option<String>,
    /// Specify whether the ConfigMap must be defined
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub optional: Option<bool>,
}

/// The Secret to select from
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct ActionSetEnvFromSecretRef {
    /// Name of the referent.
    /// More info: <https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names>
    /// TODO: Add other useful fields. apiVersion, kind, uid?
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub name: Option<String>,
    /// Specify whether the Secret must be defined
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub optional: Option<bool>,
}

/// Specifies the schema of parameters in backups and restores before their usage.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct ActionSetParametersSchema {
    /// Defines the schema for parameters using the OpenAPI v3.
    /// The supported property types include:
    /// - string
    /// - number
    /// - integer
    /// - array: Note that only items of string type are supported.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "openAPIV3Schema")]
    pub open_apiv3_schema: Option<BTreeMap<String, serde_json::Value>>,
}

/// Specifies the restore action.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct ActionSetRestore {
    /// Determines if a base backup is required during restoration.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "baseBackupRequired")]
    pub base_backup_required: Option<bool>,
    /// Specifies the actions that should be executed after the data has been prepared and is ready for restoration.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "postReady")]
    pub post_ready: Option<Vec<ActionSetRestorePostReady>>,
    /// Specifies the action required to prepare data for restoration.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "prepareData")]
    pub prepare_data: Option<ActionSetRestorePrepareData>,
    /// Specifies the parameters used by the restore action
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "withParameters")]
    pub with_parameters: Option<Vec<String>>,
}

/// ActionSpec defines an action that should be executed. Only one of the fields may be set.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct ActionSetRestorePostReady {
    /// Specifies that the action should be executed using the pod's exec API within a container.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub exec: Option<ActionSetRestorePostReadyExec>,
    /// Specifies that the action should be executed by a Kubernetes Job.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub job: Option<ActionSetRestorePostReadyJob>,
}

/// Specifies that the action should be executed using the pod's exec API within a container.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct ActionSetRestorePostReadyExec {
    /// Defines the command and arguments to be executed.
    pub command: Vec<String>,
    /// Specifies the container within the pod where the command should be executed.
    /// If not specified, the first container in the pod is used by default.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub container: Option<String>,
    /// Indicates how to behave if an error is encountered during the execution of this action.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "onError")]
    pub on_error: Option<ActionSetRestorePostReadyExecOnError>,
    /// Specifies the maximum duration to wait for the hook to complete before
    /// considering the execution a failure.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub timeout: Option<String>,
}

/// Specifies that the action should be executed using the pod's exec API within a container.
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
pub enum ActionSetRestorePostReadyExecOnError {
    Continue,
    Fail,
}

/// Specifies that the action should be executed by a Kubernetes Job.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct ActionSetRestorePostReadyJob {
    /// Defines the commands to back up the volume data.
    pub command: Vec<String>,
    /// Specifies the image of the backup container.
    pub image: String,
    /// Indicates how to behave if an error is encountered during the execution of this action.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "onError")]
    pub on_error: Option<ActionSetRestorePostReadyJobOnError>,
    /// Determines whether to run the job workload on the target pod node.
    /// If the backup container needs to mount the target pod's volumes, this field
    /// should be set to true. Otherwise, the target pod's volumes will be ignored.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "runOnTargetPodNode")]
    pub run_on_target_pod_node: Option<bool>,
}

/// Specifies that the action should be executed by a Kubernetes Job.
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
pub enum ActionSetRestorePostReadyJobOnError {
    Continue,
    Fail,
}

/// Specifies the action required to prepare data for restoration.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct ActionSetRestorePrepareData {
    /// Defines the commands to back up the volume data.
    pub command: Vec<String>,
    /// Specifies the image of the backup container.
    pub image: String,
    /// Indicates how to behave if an error is encountered during the execution of this action.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "onError")]
    pub on_error: Option<ActionSetRestorePrepareDataOnError>,
    /// Determines whether to run the job workload on the target pod node.
    /// If the backup container needs to mount the target pod's volumes, this field
    /// should be set to true. Otherwise, the target pod's volumes will be ignored.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "runOnTargetPodNode")]
    pub run_on_target_pod_node: Option<bool>,
}

/// Specifies the action required to prepare data for restoration.
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
pub enum ActionSetRestorePrepareDataOnError {
    Continue,
    Fail,
}

/// ActionSetStatus defines the observed state of ActionSet
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct ActionSetStatus {
    /// Provides a human-readable explanation detailing the reason for the current phase of the ActionSet.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub message: Option<String>,
    /// Represents the generation number that has been observed by the controller.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "observedGeneration")]
    pub observed_generation: Option<i64>,
    /// Indicates the phase of the ActionSet. This can be either 'Available' or 'Unavailable'.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub phase: Option<ActionSetStatusPhase>,
}

/// ActionSetStatus defines the observed state of ActionSet
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
pub enum ActionSetStatusPhase {
    Available,
    Unavailable,
}