Coverage for ocp_resources/virtual_machine_instance_replica_set.py: 0%
25 statements
« prev ^ index » next coverage.py v7.6.10, created at 2025-01-30 10:48 +0200
« 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
3from typing import Any, Dict, Optional
4from ocp_resources.resource import NamespacedResource, MissingRequiredArgumentError
7class VirtualMachineInstanceReplicaSet(NamespacedResource):
8 """
9 VirtualMachineInstance is *the* VirtualMachineInstance Definition. It represents a virtual machine in the runtime environment of kubernetes.
10 """
12 api_group: str = NamespacedResource.ApiGroup.KUBEVIRT_IO
14 def __init__(
15 self,
16 paused: Optional[bool] = None,
17 replicas: Optional[int] = None,
18 selector: Optional[Dict[str, Any]] = None,
19 template: Optional[Dict[str, Any]] = None,
20 **kwargs: Any,
21 ) -> None:
22 """
23 Args:
24 paused (bool): Indicates that the replica set is paused.
26 replicas (int): Number of desired pods. This is a pointer to distinguish between
27 explicit zero and not specified. Defaults to 1.
29 selector (Dict[str, Any]): Label selector for pods. Existing ReplicaSets whose pods are selected
30 by this will be the ones affected by this deployment.
32 template (Dict[str, Any]): Template describes the pods that will be created.
34 """
35 super().__init__(**kwargs)
37 self.paused = paused
38 self.replicas = replicas
39 self.selector = selector
40 self.template = template
42 def to_dict(self) -> None:
43 super().to_dict()
45 if not self.kind_dict and not self.yaml_file:
46 if not self.selector:
47 raise MissingRequiredArgumentError(argument="self.selector")
49 if not self.template:
50 raise MissingRequiredArgumentError(argument="self.template")
52 self.res["spec"] = {}
53 _spec = self.res["spec"]
55 _spec["selector"] = self.selector
56 _spec["template"] = self.template
58 if self.paused is not None:
59 _spec["paused"] = self.paused
61 if self.replicas:
62 _spec["replicas"] = self.replicas
64 # End of generated code