Skip to content
Open
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
24 changes: 24 additions & 0 deletions ocp_resources/virtual_machine_template_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,23 +16,41 @@ class VirtualMachineTemplateRequest(NamespacedResource):

def __init__(
self,
template_labels: dict[str, Any] | None = None,
template_name: str | None = None,
ttl_seconds_after_finished: int | None = None,
virtual_machine_ref: dict[str, Any] | None = None,
**kwargs: Any,
) -> None:
r"""
Args:
template_labels (dict[str, Any]): TemplateLabels holds optional labels to apply to the created
VirtualMachineTemplate. Labels with the "template.kubevirt.io/"
prefix are reserved for system use and are not allowed.

template_name (str): TemplateName holds the optional name for the new
VirtualMachineTemplate. If not specified the template will have
the same name as the VirtualMachineTemplateRequest.

ttl_seconds_after_finished (int): TTLSecondsAfterFinished limits the lifetime of a
VirtualMachineTemplateRequest that has finished execution. Failed
VirtualMachineTemplateRequests are never cleaned up by the TTL
controller, so they remain available for debugging. If this field
is unset, the VirtualMachineTemplateRequest is not automatically
deleted and must be removed manually or through the owner
reference cleanup described below. If this field is set to zero,
the VirtualMachineTemplateRequest becomes eligible to be deleted
immediately after it finishes.

virtual_machine_ref (dict[str, Any]): VirtualMachineReference holds a reference to a
VirtualMachine.kubevirt.io

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

self.template_labels = template_labels
self.template_name = template_name
self.ttl_seconds_after_finished = ttl_seconds_after_finished
Comment thread
coderabbitai[bot] marked this conversation as resolved.
self.virtual_machine_ref = virtual_machine_ref

def to_dict(self) -> None:
Expand All @@ -48,7 +66,13 @@ def to_dict(self) -> None:

_spec["virtualMachineRef"] = self.virtual_machine_ref

if self.template_labels is not None:
_spec["templateLabels"] = self.template_labels

if self.template_name is not None:
_spec["templateName"] = self.template_name

if self.ttl_seconds_after_finished is not None:
_spec["ttlSecondsAfterFinished"] = self.ttl_seconds_after_finished

# End of generated code