-
Notifications
You must be signed in to change notification settings - Fork 74
Expand file tree
/
Copy pathvirtual_machine_storage_migration_plan.py
More file actions
55 lines (38 loc) · 1.77 KB
/
virtual_machine_storage_migration_plan.py
File metadata and controls
55 lines (38 loc) · 1.77 KB
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
# Generated using https://github.com/RedHatQE/openshift-python-wrapper/blob/main/scripts/resource/README.md
from typing import Any
from ocp_resources.exceptions import MissingRequiredArgumentError
from ocp_resources.resource import NamespacedResource
class VirtualMachineStorageMigrationPlan(NamespacedResource):
"""
VirtualMachineStorageMigrationPlan is the Schema for the virtualmachinestoragemigrationplans API
"""
api_group: str = NamespacedResource.ApiGroup.MIGRATIONS_KUBEVIRT_IO
def __init__(
self,
retention_policy: str | None = None,
virtual_machines: list[Any] | None = None,
**kwargs: Any,
) -> None:
r"""
Args:
retention_policy (str): RetentionPolicy indicates whether to keep or delete the source
DataVolume/PVC after each VM migration completes. When
"keepSource" (default), the source is preserved. When
"deleteSource", the source DataVolume is deleted if it exists,
otherwise the source PVC is deleted.
virtual_machines (list[Any]): The virtual machines to migrate.
"""
super().__init__(**kwargs)
self.retention_policy = retention_policy
self.virtual_machines = virtual_machines
def to_dict(self) -> None:
super().to_dict()
if not self.kind_dict and not self.yaml_file:
if self.virtual_machines is None:
raise MissingRequiredArgumentError(argument="self.virtual_machines")
self.res["spec"] = {}
_spec = self.res["spec"]
_spec["virtualMachines"] = self.virtual_machines
if self.retention_policy is not None:
_spec["retentionPolicy"] = self.retention_policy
# End of generated code