Coverage for ocp_resources/virtual_machine_instance_migration.py: 0%

14 statements  

« prev     ^ index     » next       coverage.py v7.6.10, created at 2025-01-30 10:48 +0200

1# Generated using https://github.com/RedHatQE/openshift-python-wrapper/blob/main/scripts/resource/README.md 

2 

3from typing import Any, Optional 

4from ocp_resources.resource import NamespacedResource 

5 

6 

7class VirtualMachineInstanceMigration(NamespacedResource): 

8 """ 

9 VirtualMachineInstanceMigration represents the object tracking a VMI's migration 

10 to another host in the cluster 

11 """ 

12 

13 api_group: str = NamespacedResource.ApiGroup.KUBEVIRT_IO 

14 

15 def __init__( 

16 self, 

17 vmi_name: Optional[str] = "", 

18 **kwargs: Any, 

19 ) -> None: 

20 """ 

21 Args: 

22 vmi_name (str): The name of the VMI to perform the migration on. VMI must exist in the 

23 migration objects namespace 

24 

25 """ 

26 super().__init__(**kwargs) 

27 

28 self.vmi_name = vmi_name 

29 

30 def to_dict(self) -> None: 

31 super().to_dict() 

32 

33 if not self.kind_dict and not self.yaml_file: 

34 self.res["spec"] = {} 

35 _spec = self.res["spec"] 

36 

37 if self.vmi_name: 

38 _spec["vmiName"] = self.vmi_name 

39 

40 # End of generated code