Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,25 @@ class MultiNamespaceVirtualMachineStorageMigrationPlan(NamespacedResource):
def __init__(
self,
namespaces: list[Any] | None = None,
retention_policy: str | None = None,
**kwargs: Any,
) -> None:
r"""
Args:
namespaces (list[Any]): The virtual machines to migrate.
namespaces (list[Any]): The virtual machines to migrate per namespace.

retention_policy (str): RetentionPolicy indicates whether to keep or delete the source
DataVolume/PVC after each VM migration completes in each created
namespace plan. When set to "deleteSource", every created
VirtualMachineStorageMigrationPlan will have retentionPolicy set
to deleteSource. When "keepSource" or unset, child plans keep
their per-namespace spec or default to keepSource.

"""
super().__init__(**kwargs)

self.namespaces = namespaces
self.retention_policy = retention_policy

def to_dict(self) -> None:

Expand All @@ -41,4 +50,7 @@ def to_dict(self) -> None:

_spec["namespaces"] = self.namespaces

if self.retention_policy is not None:
_spec["retentionPolicy"] = self.retention_policy

# End of generated code
11 changes: 11 additions & 0 deletions ocp_resources/virtual_machine_storage_migration_plan.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,24 @@ class VirtualMachineStorageMigrationPlan(NamespacedResource):

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:
Expand All @@ -41,4 +49,7 @@ def to_dict(self) -> None:

_spec["virtualMachines"] = self.virtual_machines

if self.retention_policy is not None:
_spec["retentionPolicy"] = self.retention_policy

# End of generated code