mirror of
https://github.com/hanzo-ml/trainer.git
synced 2026-09-24 00:31:34 +00:00
Move generated Python models into kubeflow_trainer_api package (#2632)
Signed-off-by: kramaranya <[email protected]>
This commit is contained in:
@@ -0,0 +1,3 @@
|
||||
# Kubeflow Trainer API
|
||||
|
||||
Python package containing Kubeflow Trainer API models.
|
||||
@@ -0,0 +1,16 @@
|
||||
# Copyright 2025 The Kubeflow Authors.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
|
||||
__version__ = "2.0.0"
|
||||
@@ -0,0 +1,374 @@
|
||||
# coding: utf-8
|
||||
|
||||
# flake8: noqa
|
||||
"""
|
||||
Kubeflow Trainer OpenAPI Spec
|
||||
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
|
||||
The version of the OpenAPI document: unversioned
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
|
||||
Do not edit the class manually.
|
||||
""" # noqa: E501
|
||||
|
||||
|
||||
# import models into model package
|
||||
from kubeflow_trainer_api.models.io_k8s_api_autoscaling_v2_container_resource_metric_source import IoK8sApiAutoscalingV2ContainerResourceMetricSource
|
||||
from kubeflow_trainer_api.models.io_k8s_api_autoscaling_v2_container_resource_metric_status import IoK8sApiAutoscalingV2ContainerResourceMetricStatus
|
||||
from kubeflow_trainer_api.models.io_k8s_api_autoscaling_v2_cross_version_object_reference import IoK8sApiAutoscalingV2CrossVersionObjectReference
|
||||
from kubeflow_trainer_api.models.io_k8s_api_autoscaling_v2_external_metric_source import IoK8sApiAutoscalingV2ExternalMetricSource
|
||||
from kubeflow_trainer_api.models.io_k8s_api_autoscaling_v2_external_metric_status import IoK8sApiAutoscalingV2ExternalMetricStatus
|
||||
from kubeflow_trainer_api.models.io_k8s_api_autoscaling_v2_hpa_scaling_policy import IoK8sApiAutoscalingV2HPAScalingPolicy
|
||||
from kubeflow_trainer_api.models.io_k8s_api_autoscaling_v2_hpa_scaling_rules import IoK8sApiAutoscalingV2HPAScalingRules
|
||||
from kubeflow_trainer_api.models.io_k8s_api_autoscaling_v2_horizontal_pod_autoscaler import IoK8sApiAutoscalingV2HorizontalPodAutoscaler
|
||||
from kubeflow_trainer_api.models.io_k8s_api_autoscaling_v2_horizontal_pod_autoscaler_behavior import IoK8sApiAutoscalingV2HorizontalPodAutoscalerBehavior
|
||||
from kubeflow_trainer_api.models.io_k8s_api_autoscaling_v2_horizontal_pod_autoscaler_condition import IoK8sApiAutoscalingV2HorizontalPodAutoscalerCondition
|
||||
from kubeflow_trainer_api.models.io_k8s_api_autoscaling_v2_horizontal_pod_autoscaler_list import IoK8sApiAutoscalingV2HorizontalPodAutoscalerList
|
||||
from kubeflow_trainer_api.models.io_k8s_api_autoscaling_v2_horizontal_pod_autoscaler_spec import IoK8sApiAutoscalingV2HorizontalPodAutoscalerSpec
|
||||
from kubeflow_trainer_api.models.io_k8s_api_autoscaling_v2_horizontal_pod_autoscaler_status import IoK8sApiAutoscalingV2HorizontalPodAutoscalerStatus
|
||||
from kubeflow_trainer_api.models.io_k8s_api_autoscaling_v2_metric_identifier import IoK8sApiAutoscalingV2MetricIdentifier
|
||||
from kubeflow_trainer_api.models.io_k8s_api_autoscaling_v2_metric_spec import IoK8sApiAutoscalingV2MetricSpec
|
||||
from kubeflow_trainer_api.models.io_k8s_api_autoscaling_v2_metric_status import IoK8sApiAutoscalingV2MetricStatus
|
||||
from kubeflow_trainer_api.models.io_k8s_api_autoscaling_v2_metric_target import IoK8sApiAutoscalingV2MetricTarget
|
||||
from kubeflow_trainer_api.models.io_k8s_api_autoscaling_v2_metric_value_status import IoK8sApiAutoscalingV2MetricValueStatus
|
||||
from kubeflow_trainer_api.models.io_k8s_api_autoscaling_v2_object_metric_source import IoK8sApiAutoscalingV2ObjectMetricSource
|
||||
from kubeflow_trainer_api.models.io_k8s_api_autoscaling_v2_object_metric_status import IoK8sApiAutoscalingV2ObjectMetricStatus
|
||||
from kubeflow_trainer_api.models.io_k8s_api_autoscaling_v2_pods_metric_source import IoK8sApiAutoscalingV2PodsMetricSource
|
||||
from kubeflow_trainer_api.models.io_k8s_api_autoscaling_v2_pods_metric_status import IoK8sApiAutoscalingV2PodsMetricStatus
|
||||
from kubeflow_trainer_api.models.io_k8s_api_autoscaling_v2_resource_metric_source import IoK8sApiAutoscalingV2ResourceMetricSource
|
||||
from kubeflow_trainer_api.models.io_k8s_api_autoscaling_v2_resource_metric_status import IoK8sApiAutoscalingV2ResourceMetricStatus
|
||||
from kubeflow_trainer_api.models.io_k8s_api_batch_v1_cron_job import IoK8sApiBatchV1CronJob
|
||||
from kubeflow_trainer_api.models.io_k8s_api_batch_v1_cron_job_list import IoK8sApiBatchV1CronJobList
|
||||
from kubeflow_trainer_api.models.io_k8s_api_batch_v1_cron_job_spec import IoK8sApiBatchV1CronJobSpec
|
||||
from kubeflow_trainer_api.models.io_k8s_api_batch_v1_cron_job_status import IoK8sApiBatchV1CronJobStatus
|
||||
from kubeflow_trainer_api.models.io_k8s_api_batch_v1_job import IoK8sApiBatchV1Job
|
||||
from kubeflow_trainer_api.models.io_k8s_api_batch_v1_job_condition import IoK8sApiBatchV1JobCondition
|
||||
from kubeflow_trainer_api.models.io_k8s_api_batch_v1_job_list import IoK8sApiBatchV1JobList
|
||||
from kubeflow_trainer_api.models.io_k8s_api_batch_v1_job_spec import IoK8sApiBatchV1JobSpec
|
||||
from kubeflow_trainer_api.models.io_k8s_api_batch_v1_job_status import IoK8sApiBatchV1JobStatus
|
||||
from kubeflow_trainer_api.models.io_k8s_api_batch_v1_job_template_spec import IoK8sApiBatchV1JobTemplateSpec
|
||||
from kubeflow_trainer_api.models.io_k8s_api_batch_v1_pod_failure_policy import IoK8sApiBatchV1PodFailurePolicy
|
||||
from kubeflow_trainer_api.models.io_k8s_api_batch_v1_pod_failure_policy_on_exit_codes_requirement import IoK8sApiBatchV1PodFailurePolicyOnExitCodesRequirement
|
||||
from kubeflow_trainer_api.models.io_k8s_api_batch_v1_pod_failure_policy_on_pod_conditions_pattern import IoK8sApiBatchV1PodFailurePolicyOnPodConditionsPattern
|
||||
from kubeflow_trainer_api.models.io_k8s_api_batch_v1_pod_failure_policy_rule import IoK8sApiBatchV1PodFailurePolicyRule
|
||||
from kubeflow_trainer_api.models.io_k8s_api_batch_v1_success_policy import IoK8sApiBatchV1SuccessPolicy
|
||||
from kubeflow_trainer_api.models.io_k8s_api_batch_v1_success_policy_rule import IoK8sApiBatchV1SuccessPolicyRule
|
||||
from kubeflow_trainer_api.models.io_k8s_api_batch_v1_uncounted_terminated_pods import IoK8sApiBatchV1UncountedTerminatedPods
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_aws_elastic_block_store_volume_source import IoK8sApiCoreV1AWSElasticBlockStoreVolumeSource
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_affinity import IoK8sApiCoreV1Affinity
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_app_armor_profile import IoK8sApiCoreV1AppArmorProfile
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_attached_volume import IoK8sApiCoreV1AttachedVolume
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_avoid_pods import IoK8sApiCoreV1AvoidPods
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_azure_disk_volume_source import IoK8sApiCoreV1AzureDiskVolumeSource
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_azure_file_persistent_volume_source import IoK8sApiCoreV1AzureFilePersistentVolumeSource
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_azure_file_volume_source import IoK8sApiCoreV1AzureFileVolumeSource
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_binding import IoK8sApiCoreV1Binding
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_csi_persistent_volume_source import IoK8sApiCoreV1CSIPersistentVolumeSource
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_csi_volume_source import IoK8sApiCoreV1CSIVolumeSource
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_capabilities import IoK8sApiCoreV1Capabilities
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_ceph_fs_persistent_volume_source import IoK8sApiCoreV1CephFSPersistentVolumeSource
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_ceph_fs_volume_source import IoK8sApiCoreV1CephFSVolumeSource
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_cinder_persistent_volume_source import IoK8sApiCoreV1CinderPersistentVolumeSource
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_cinder_volume_source import IoK8sApiCoreV1CinderVolumeSource
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_client_ip_config import IoK8sApiCoreV1ClientIPConfig
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_cluster_trust_bundle_projection import IoK8sApiCoreV1ClusterTrustBundleProjection
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_component_condition import IoK8sApiCoreV1ComponentCondition
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_component_status import IoK8sApiCoreV1ComponentStatus
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_component_status_list import IoK8sApiCoreV1ComponentStatusList
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_config_map import IoK8sApiCoreV1ConfigMap
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_config_map_env_source import IoK8sApiCoreV1ConfigMapEnvSource
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_config_map_key_selector import IoK8sApiCoreV1ConfigMapKeySelector
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_config_map_list import IoK8sApiCoreV1ConfigMapList
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_config_map_node_config_source import IoK8sApiCoreV1ConfigMapNodeConfigSource
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_config_map_projection import IoK8sApiCoreV1ConfigMapProjection
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_config_map_volume_source import IoK8sApiCoreV1ConfigMapVolumeSource
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_container import IoK8sApiCoreV1Container
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_container_image import IoK8sApiCoreV1ContainerImage
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_container_port import IoK8sApiCoreV1ContainerPort
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_container_resize_policy import IoK8sApiCoreV1ContainerResizePolicy
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_container_state import IoK8sApiCoreV1ContainerState
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_container_state_running import IoK8sApiCoreV1ContainerStateRunning
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_container_state_terminated import IoK8sApiCoreV1ContainerStateTerminated
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_container_state_waiting import IoK8sApiCoreV1ContainerStateWaiting
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_container_status import IoK8sApiCoreV1ContainerStatus
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_container_user import IoK8sApiCoreV1ContainerUser
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_daemon_endpoint import IoK8sApiCoreV1DaemonEndpoint
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_downward_api_projection import IoK8sApiCoreV1DownwardAPIProjection
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_downward_api_volume_file import IoK8sApiCoreV1DownwardAPIVolumeFile
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_downward_api_volume_source import IoK8sApiCoreV1DownwardAPIVolumeSource
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_empty_dir_volume_source import IoK8sApiCoreV1EmptyDirVolumeSource
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_endpoint_address import IoK8sApiCoreV1EndpointAddress
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_endpoint_port import IoK8sApiCoreV1EndpointPort
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_endpoint_subset import IoK8sApiCoreV1EndpointSubset
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_endpoints import IoK8sApiCoreV1Endpoints
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_endpoints_list import IoK8sApiCoreV1EndpointsList
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_env_from_source import IoK8sApiCoreV1EnvFromSource
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_env_var import IoK8sApiCoreV1EnvVar
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_env_var_source import IoK8sApiCoreV1EnvVarSource
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_ephemeral_container import IoK8sApiCoreV1EphemeralContainer
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_ephemeral_container_common import IoK8sApiCoreV1EphemeralContainerCommon
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_ephemeral_volume_source import IoK8sApiCoreV1EphemeralVolumeSource
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_event import IoK8sApiCoreV1Event
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_event_list import IoK8sApiCoreV1EventList
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_event_series import IoK8sApiCoreV1EventSeries
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_event_source import IoK8sApiCoreV1EventSource
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_exec_action import IoK8sApiCoreV1ExecAction
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_fc_volume_source import IoK8sApiCoreV1FCVolumeSource
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_flex_persistent_volume_source import IoK8sApiCoreV1FlexPersistentVolumeSource
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_flex_volume_source import IoK8sApiCoreV1FlexVolumeSource
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_flocker_volume_source import IoK8sApiCoreV1FlockerVolumeSource
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_gce_persistent_disk_volume_source import IoK8sApiCoreV1GCEPersistentDiskVolumeSource
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_grpc_action import IoK8sApiCoreV1GRPCAction
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_git_repo_volume_source import IoK8sApiCoreV1GitRepoVolumeSource
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_glusterfs_persistent_volume_source import IoK8sApiCoreV1GlusterfsPersistentVolumeSource
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_glusterfs_volume_source import IoK8sApiCoreV1GlusterfsVolumeSource
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_http_get_action import IoK8sApiCoreV1HTTPGetAction
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_http_header import IoK8sApiCoreV1HTTPHeader
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_host_alias import IoK8sApiCoreV1HostAlias
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_host_ip import IoK8sApiCoreV1HostIP
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_host_path_volume_source import IoK8sApiCoreV1HostPathVolumeSource
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_iscsi_persistent_volume_source import IoK8sApiCoreV1ISCSIPersistentVolumeSource
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_iscsi_volume_source import IoK8sApiCoreV1ISCSIVolumeSource
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_image_volume_source import IoK8sApiCoreV1ImageVolumeSource
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_key_to_path import IoK8sApiCoreV1KeyToPath
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_lifecycle import IoK8sApiCoreV1Lifecycle
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_lifecycle_handler import IoK8sApiCoreV1LifecycleHandler
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_limit_range import IoK8sApiCoreV1LimitRange
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_limit_range_item import IoK8sApiCoreV1LimitRangeItem
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_limit_range_list import IoK8sApiCoreV1LimitRangeList
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_limit_range_spec import IoK8sApiCoreV1LimitRangeSpec
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_linux_container_user import IoK8sApiCoreV1LinuxContainerUser
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_list import IoK8sApiCoreV1List
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_load_balancer_ingress import IoK8sApiCoreV1LoadBalancerIngress
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_load_balancer_status import IoK8sApiCoreV1LoadBalancerStatus
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_local_object_reference import IoK8sApiCoreV1LocalObjectReference
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_local_volume_source import IoK8sApiCoreV1LocalVolumeSource
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_modify_volume_status import IoK8sApiCoreV1ModifyVolumeStatus
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_nfs_volume_source import IoK8sApiCoreV1NFSVolumeSource
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_namespace import IoK8sApiCoreV1Namespace
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_namespace_condition import IoK8sApiCoreV1NamespaceCondition
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_namespace_list import IoK8sApiCoreV1NamespaceList
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_namespace_spec import IoK8sApiCoreV1NamespaceSpec
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_namespace_status import IoK8sApiCoreV1NamespaceStatus
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_node import IoK8sApiCoreV1Node
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_node_address import IoK8sApiCoreV1NodeAddress
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_node_affinity import IoK8sApiCoreV1NodeAffinity
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_node_condition import IoK8sApiCoreV1NodeCondition
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_node_config_source import IoK8sApiCoreV1NodeConfigSource
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_node_config_status import IoK8sApiCoreV1NodeConfigStatus
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_node_daemon_endpoints import IoK8sApiCoreV1NodeDaemonEndpoints
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_node_features import IoK8sApiCoreV1NodeFeatures
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_node_list import IoK8sApiCoreV1NodeList
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_node_proxy_options import IoK8sApiCoreV1NodeProxyOptions
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_node_runtime_handler import IoK8sApiCoreV1NodeRuntimeHandler
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_node_runtime_handler_features import IoK8sApiCoreV1NodeRuntimeHandlerFeatures
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_node_selector import IoK8sApiCoreV1NodeSelector
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_node_selector_requirement import IoK8sApiCoreV1NodeSelectorRequirement
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_node_selector_term import IoK8sApiCoreV1NodeSelectorTerm
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_node_spec import IoK8sApiCoreV1NodeSpec
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_node_status import IoK8sApiCoreV1NodeStatus
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_node_system_info import IoK8sApiCoreV1NodeSystemInfo
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_object_field_selector import IoK8sApiCoreV1ObjectFieldSelector
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_object_reference import IoK8sApiCoreV1ObjectReference
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_persistent_volume import IoK8sApiCoreV1PersistentVolume
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_persistent_volume_claim import IoK8sApiCoreV1PersistentVolumeClaim
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_persistent_volume_claim_condition import IoK8sApiCoreV1PersistentVolumeClaimCondition
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_persistent_volume_claim_list import IoK8sApiCoreV1PersistentVolumeClaimList
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_persistent_volume_claim_spec import IoK8sApiCoreV1PersistentVolumeClaimSpec
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_persistent_volume_claim_status import IoK8sApiCoreV1PersistentVolumeClaimStatus
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_persistent_volume_claim_template import IoK8sApiCoreV1PersistentVolumeClaimTemplate
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_persistent_volume_claim_volume_source import IoK8sApiCoreV1PersistentVolumeClaimVolumeSource
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_persistent_volume_list import IoK8sApiCoreV1PersistentVolumeList
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_persistent_volume_source import IoK8sApiCoreV1PersistentVolumeSource
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_persistent_volume_spec import IoK8sApiCoreV1PersistentVolumeSpec
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_persistent_volume_status import IoK8sApiCoreV1PersistentVolumeStatus
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_photon_persistent_disk_volume_source import IoK8sApiCoreV1PhotonPersistentDiskVolumeSource
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_pod import IoK8sApiCoreV1Pod
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_pod_affinity import IoK8sApiCoreV1PodAffinity
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_pod_affinity_term import IoK8sApiCoreV1PodAffinityTerm
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_pod_anti_affinity import IoK8sApiCoreV1PodAntiAffinity
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_pod_attach_options import IoK8sApiCoreV1PodAttachOptions
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_pod_condition import IoK8sApiCoreV1PodCondition
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_pod_dns_config import IoK8sApiCoreV1PodDNSConfig
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_pod_dns_config_option import IoK8sApiCoreV1PodDNSConfigOption
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_pod_exec_options import IoK8sApiCoreV1PodExecOptions
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_pod_ip import IoK8sApiCoreV1PodIP
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_pod_list import IoK8sApiCoreV1PodList
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_pod_log_options import IoK8sApiCoreV1PodLogOptions
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_pod_os import IoK8sApiCoreV1PodOS
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_pod_port_forward_options import IoK8sApiCoreV1PodPortForwardOptions
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_pod_proxy_options import IoK8sApiCoreV1PodProxyOptions
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_pod_readiness_gate import IoK8sApiCoreV1PodReadinessGate
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_pod_resource_claim import IoK8sApiCoreV1PodResourceClaim
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_pod_resource_claim_status import IoK8sApiCoreV1PodResourceClaimStatus
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_pod_scheduling_gate import IoK8sApiCoreV1PodSchedulingGate
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_pod_security_context import IoK8sApiCoreV1PodSecurityContext
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_pod_signature import IoK8sApiCoreV1PodSignature
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_pod_spec import IoK8sApiCoreV1PodSpec
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_pod_status import IoK8sApiCoreV1PodStatus
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_pod_status_result import IoK8sApiCoreV1PodStatusResult
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_pod_template import IoK8sApiCoreV1PodTemplate
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_pod_template_list import IoK8sApiCoreV1PodTemplateList
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_pod_template_spec import IoK8sApiCoreV1PodTemplateSpec
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_port_status import IoK8sApiCoreV1PortStatus
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_portworx_volume_source import IoK8sApiCoreV1PortworxVolumeSource
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_prefer_avoid_pods_entry import IoK8sApiCoreV1PreferAvoidPodsEntry
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_preferred_scheduling_term import IoK8sApiCoreV1PreferredSchedulingTerm
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_probe import IoK8sApiCoreV1Probe
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_probe_handler import IoK8sApiCoreV1ProbeHandler
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_projected_volume_source import IoK8sApiCoreV1ProjectedVolumeSource
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_quobyte_volume_source import IoK8sApiCoreV1QuobyteVolumeSource
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_rbd_persistent_volume_source import IoK8sApiCoreV1RBDPersistentVolumeSource
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_rbd_volume_source import IoK8sApiCoreV1RBDVolumeSource
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_range_allocation import IoK8sApiCoreV1RangeAllocation
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_replication_controller import IoK8sApiCoreV1ReplicationController
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_replication_controller_condition import IoK8sApiCoreV1ReplicationControllerCondition
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_replication_controller_list import IoK8sApiCoreV1ReplicationControllerList
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_replication_controller_spec import IoK8sApiCoreV1ReplicationControllerSpec
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_replication_controller_status import IoK8sApiCoreV1ReplicationControllerStatus
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_resource_claim import IoK8sApiCoreV1ResourceClaim
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_resource_field_selector import IoK8sApiCoreV1ResourceFieldSelector
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_resource_health import IoK8sApiCoreV1ResourceHealth
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_resource_quota import IoK8sApiCoreV1ResourceQuota
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_resource_quota_list import IoK8sApiCoreV1ResourceQuotaList
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_resource_quota_spec import IoK8sApiCoreV1ResourceQuotaSpec
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_resource_quota_status import IoK8sApiCoreV1ResourceQuotaStatus
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_resource_requirements import IoK8sApiCoreV1ResourceRequirements
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_resource_status import IoK8sApiCoreV1ResourceStatus
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_se_linux_options import IoK8sApiCoreV1SELinuxOptions
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_scale_io_persistent_volume_source import IoK8sApiCoreV1ScaleIOPersistentVolumeSource
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_scale_io_volume_source import IoK8sApiCoreV1ScaleIOVolumeSource
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_scope_selector import IoK8sApiCoreV1ScopeSelector
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_scoped_resource_selector_requirement import IoK8sApiCoreV1ScopedResourceSelectorRequirement
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_seccomp_profile import IoK8sApiCoreV1SeccompProfile
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_secret import IoK8sApiCoreV1Secret
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_secret_env_source import IoK8sApiCoreV1SecretEnvSource
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_secret_key_selector import IoK8sApiCoreV1SecretKeySelector
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_secret_list import IoK8sApiCoreV1SecretList
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_secret_projection import IoK8sApiCoreV1SecretProjection
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_secret_reference import IoK8sApiCoreV1SecretReference
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_secret_volume_source import IoK8sApiCoreV1SecretVolumeSource
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_security_context import IoK8sApiCoreV1SecurityContext
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_serialized_reference import IoK8sApiCoreV1SerializedReference
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_service import IoK8sApiCoreV1Service
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_service_account import IoK8sApiCoreV1ServiceAccount
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_service_account_list import IoK8sApiCoreV1ServiceAccountList
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_service_account_token_projection import IoK8sApiCoreV1ServiceAccountTokenProjection
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_service_list import IoK8sApiCoreV1ServiceList
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_service_port import IoK8sApiCoreV1ServicePort
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_service_proxy_options import IoK8sApiCoreV1ServiceProxyOptions
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_service_spec import IoK8sApiCoreV1ServiceSpec
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_service_status import IoK8sApiCoreV1ServiceStatus
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_session_affinity_config import IoK8sApiCoreV1SessionAffinityConfig
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_sleep_action import IoK8sApiCoreV1SleepAction
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_storage_os_persistent_volume_source import IoK8sApiCoreV1StorageOSPersistentVolumeSource
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_storage_os_volume_source import IoK8sApiCoreV1StorageOSVolumeSource
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_sysctl import IoK8sApiCoreV1Sysctl
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_tcp_socket_action import IoK8sApiCoreV1TCPSocketAction
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_taint import IoK8sApiCoreV1Taint
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_toleration import IoK8sApiCoreV1Toleration
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_topology_selector_label_requirement import IoK8sApiCoreV1TopologySelectorLabelRequirement
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_topology_selector_term import IoK8sApiCoreV1TopologySelectorTerm
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_topology_spread_constraint import IoK8sApiCoreV1TopologySpreadConstraint
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_typed_local_object_reference import IoK8sApiCoreV1TypedLocalObjectReference
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_typed_object_reference import IoK8sApiCoreV1TypedObjectReference
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_volume import IoK8sApiCoreV1Volume
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_volume_device import IoK8sApiCoreV1VolumeDevice
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_volume_mount import IoK8sApiCoreV1VolumeMount
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_volume_mount_status import IoK8sApiCoreV1VolumeMountStatus
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_volume_node_affinity import IoK8sApiCoreV1VolumeNodeAffinity
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_volume_projection import IoK8sApiCoreV1VolumeProjection
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_volume_resource_requirements import IoK8sApiCoreV1VolumeResourceRequirements
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_volume_source import IoK8sApiCoreV1VolumeSource
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_vsphere_virtual_disk_volume_source import IoK8sApiCoreV1VsphereVirtualDiskVolumeSource
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_weighted_pod_affinity_term import IoK8sApiCoreV1WeightedPodAffinityTerm
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_windows_security_context_options import IoK8sApiCoreV1WindowsSecurityContextOptions
|
||||
from kubeflow_trainer_api.models.io_k8s_apimachinery_pkg_api_resource_int64_amount import IoK8sApimachineryPkgApiResourceInt64Amount
|
||||
from kubeflow_trainer_api.models.io_k8s_apimachinery_pkg_api_resource_quantity import IoK8sApimachineryPkgApiResourceQuantity
|
||||
from kubeflow_trainer_api.models.io_k8s_apimachinery_pkg_apis_meta_v1_api_group import IoK8sApimachineryPkgApisMetaV1APIGroup
|
||||
from kubeflow_trainer_api.models.io_k8s_apimachinery_pkg_apis_meta_v1_api_group_list import IoK8sApimachineryPkgApisMetaV1APIGroupList
|
||||
from kubeflow_trainer_api.models.io_k8s_apimachinery_pkg_apis_meta_v1_api_resource import IoK8sApimachineryPkgApisMetaV1APIResource
|
||||
from kubeflow_trainer_api.models.io_k8s_apimachinery_pkg_apis_meta_v1_api_resource_list import IoK8sApimachineryPkgApisMetaV1APIResourceList
|
||||
from kubeflow_trainer_api.models.io_k8s_apimachinery_pkg_apis_meta_v1_api_versions import IoK8sApimachineryPkgApisMetaV1APIVersions
|
||||
from kubeflow_trainer_api.models.io_k8s_apimachinery_pkg_apis_meta_v1_apply_options import IoK8sApimachineryPkgApisMetaV1ApplyOptions
|
||||
from kubeflow_trainer_api.models.io_k8s_apimachinery_pkg_apis_meta_v1_condition import IoK8sApimachineryPkgApisMetaV1Condition
|
||||
from kubeflow_trainer_api.models.io_k8s_apimachinery_pkg_apis_meta_v1_create_options import IoK8sApimachineryPkgApisMetaV1CreateOptions
|
||||
from kubeflow_trainer_api.models.io_k8s_apimachinery_pkg_apis_meta_v1_delete_options import IoK8sApimachineryPkgApisMetaV1DeleteOptions
|
||||
from kubeflow_trainer_api.models.io_k8s_apimachinery_pkg_apis_meta_v1_field_selector_requirement import IoK8sApimachineryPkgApisMetaV1FieldSelectorRequirement
|
||||
from kubeflow_trainer_api.models.io_k8s_apimachinery_pkg_apis_meta_v1_get_options import IoK8sApimachineryPkgApisMetaV1GetOptions
|
||||
from kubeflow_trainer_api.models.io_k8s_apimachinery_pkg_apis_meta_v1_group_kind import IoK8sApimachineryPkgApisMetaV1GroupKind
|
||||
from kubeflow_trainer_api.models.io_k8s_apimachinery_pkg_apis_meta_v1_group_resource import IoK8sApimachineryPkgApisMetaV1GroupResource
|
||||
from kubeflow_trainer_api.models.io_k8s_apimachinery_pkg_apis_meta_v1_group_version import IoK8sApimachineryPkgApisMetaV1GroupVersion
|
||||
from kubeflow_trainer_api.models.io_k8s_apimachinery_pkg_apis_meta_v1_group_version_for_discovery import IoK8sApimachineryPkgApisMetaV1GroupVersionForDiscovery
|
||||
from kubeflow_trainer_api.models.io_k8s_apimachinery_pkg_apis_meta_v1_group_version_kind import IoK8sApimachineryPkgApisMetaV1GroupVersionKind
|
||||
from kubeflow_trainer_api.models.io_k8s_apimachinery_pkg_apis_meta_v1_group_version_resource import IoK8sApimachineryPkgApisMetaV1GroupVersionResource
|
||||
from kubeflow_trainer_api.models.io_k8s_apimachinery_pkg_apis_meta_v1_label_selector import IoK8sApimachineryPkgApisMetaV1LabelSelector
|
||||
from kubeflow_trainer_api.models.io_k8s_apimachinery_pkg_apis_meta_v1_label_selector_requirement import IoK8sApimachineryPkgApisMetaV1LabelSelectorRequirement
|
||||
from kubeflow_trainer_api.models.io_k8s_apimachinery_pkg_apis_meta_v1_list import IoK8sApimachineryPkgApisMetaV1List
|
||||
from kubeflow_trainer_api.models.io_k8s_apimachinery_pkg_apis_meta_v1_list_meta import IoK8sApimachineryPkgApisMetaV1ListMeta
|
||||
from kubeflow_trainer_api.models.io_k8s_apimachinery_pkg_apis_meta_v1_list_options import IoK8sApimachineryPkgApisMetaV1ListOptions
|
||||
from kubeflow_trainer_api.models.io_k8s_apimachinery_pkg_apis_meta_v1_managed_fields_entry import IoK8sApimachineryPkgApisMetaV1ManagedFieldsEntry
|
||||
from kubeflow_trainer_api.models.io_k8s_apimachinery_pkg_apis_meta_v1_object_meta import IoK8sApimachineryPkgApisMetaV1ObjectMeta
|
||||
from kubeflow_trainer_api.models.io_k8s_apimachinery_pkg_apis_meta_v1_owner_reference import IoK8sApimachineryPkgApisMetaV1OwnerReference
|
||||
from kubeflow_trainer_api.models.io_k8s_apimachinery_pkg_apis_meta_v1_partial_object_metadata import IoK8sApimachineryPkgApisMetaV1PartialObjectMetadata
|
||||
from kubeflow_trainer_api.models.io_k8s_apimachinery_pkg_apis_meta_v1_partial_object_metadata_list import IoK8sApimachineryPkgApisMetaV1PartialObjectMetadataList
|
||||
from kubeflow_trainer_api.models.io_k8s_apimachinery_pkg_apis_meta_v1_patch_options import IoK8sApimachineryPkgApisMetaV1PatchOptions
|
||||
from kubeflow_trainer_api.models.io_k8s_apimachinery_pkg_apis_meta_v1_preconditions import IoK8sApimachineryPkgApisMetaV1Preconditions
|
||||
from kubeflow_trainer_api.models.io_k8s_apimachinery_pkg_apis_meta_v1_root_paths import IoK8sApimachineryPkgApisMetaV1RootPaths
|
||||
from kubeflow_trainer_api.models.io_k8s_apimachinery_pkg_apis_meta_v1_server_address_by_client_cidr import IoK8sApimachineryPkgApisMetaV1ServerAddressByClientCIDR
|
||||
from kubeflow_trainer_api.models.io_k8s_apimachinery_pkg_apis_meta_v1_status import IoK8sApimachineryPkgApisMetaV1Status
|
||||
from kubeflow_trainer_api.models.io_k8s_apimachinery_pkg_apis_meta_v1_status_cause import IoK8sApimachineryPkgApisMetaV1StatusCause
|
||||
from kubeflow_trainer_api.models.io_k8s_apimachinery_pkg_apis_meta_v1_status_details import IoK8sApimachineryPkgApisMetaV1StatusDetails
|
||||
from kubeflow_trainer_api.models.io_k8s_apimachinery_pkg_apis_meta_v1_table import IoK8sApimachineryPkgApisMetaV1Table
|
||||
from kubeflow_trainer_api.models.io_k8s_apimachinery_pkg_apis_meta_v1_table_column_definition import IoK8sApimachineryPkgApisMetaV1TableColumnDefinition
|
||||
from kubeflow_trainer_api.models.io_k8s_apimachinery_pkg_apis_meta_v1_table_options import IoK8sApimachineryPkgApisMetaV1TableOptions
|
||||
from kubeflow_trainer_api.models.io_k8s_apimachinery_pkg_apis_meta_v1_table_row import IoK8sApimachineryPkgApisMetaV1TableRow
|
||||
from kubeflow_trainer_api.models.io_k8s_apimachinery_pkg_apis_meta_v1_table_row_condition import IoK8sApimachineryPkgApisMetaV1TableRowCondition
|
||||
from kubeflow_trainer_api.models.io_k8s_apimachinery_pkg_apis_meta_v1_timestamp import IoK8sApimachineryPkgApisMetaV1Timestamp
|
||||
from kubeflow_trainer_api.models.io_k8s_apimachinery_pkg_apis_meta_v1_type_meta import IoK8sApimachineryPkgApisMetaV1TypeMeta
|
||||
from kubeflow_trainer_api.models.io_k8s_apimachinery_pkg_apis_meta_v1_update_options import IoK8sApimachineryPkgApisMetaV1UpdateOptions
|
||||
from kubeflow_trainer_api.models.io_k8s_apimachinery_pkg_apis_meta_v1_watch_event import IoK8sApimachineryPkgApisMetaV1WatchEvent
|
||||
from kubeflow_trainer_api.models.io_k8s_apimachinery_pkg_runtime_type_meta import IoK8sApimachineryPkgRuntimeTypeMeta
|
||||
from kubeflow_trainer_api.models.io_k8s_apimachinery_pkg_runtime_unknown import IoK8sApimachineryPkgRuntimeUnknown
|
||||
from kubeflow_trainer_api.models.io_k8s_apimachinery_pkg_util_intstr_int_or_string import IoK8sApimachineryPkgUtilIntstrIntOrString
|
||||
from kubeflow_trainer_api.models.jobset_v1alpha2_coordinator import JobsetV1alpha2Coordinator
|
||||
from kubeflow_trainer_api.models.jobset_v1alpha2_depends_on import JobsetV1alpha2DependsOn
|
||||
from kubeflow_trainer_api.models.jobset_v1alpha2_failure_policy import JobsetV1alpha2FailurePolicy
|
||||
from kubeflow_trainer_api.models.jobset_v1alpha2_failure_policy_rule import JobsetV1alpha2FailurePolicyRule
|
||||
from kubeflow_trainer_api.models.jobset_v1alpha2_job_set import JobsetV1alpha2JobSet
|
||||
from kubeflow_trainer_api.models.jobset_v1alpha2_job_set_list import JobsetV1alpha2JobSetList
|
||||
from kubeflow_trainer_api.models.jobset_v1alpha2_job_set_spec import JobsetV1alpha2JobSetSpec
|
||||
from kubeflow_trainer_api.models.jobset_v1alpha2_job_set_status import JobsetV1alpha2JobSetStatus
|
||||
from kubeflow_trainer_api.models.jobset_v1alpha2_network import JobsetV1alpha2Network
|
||||
from kubeflow_trainer_api.models.jobset_v1alpha2_replicated_job import JobsetV1alpha2ReplicatedJob
|
||||
from kubeflow_trainer_api.models.jobset_v1alpha2_replicated_job_status import JobsetV1alpha2ReplicatedJobStatus
|
||||
from kubeflow_trainer_api.models.jobset_v1alpha2_startup_policy import JobsetV1alpha2StartupPolicy
|
||||
from kubeflow_trainer_api.models.jobset_v1alpha2_success_policy import JobsetV1alpha2SuccessPolicy
|
||||
from kubeflow_trainer_api.models.trainer_v1alpha1_cluster_training_runtime import TrainerV1alpha1ClusterTrainingRuntime
|
||||
from kubeflow_trainer_api.models.trainer_v1alpha1_cluster_training_runtime_list import TrainerV1alpha1ClusterTrainingRuntimeList
|
||||
from kubeflow_trainer_api.models.trainer_v1alpha1_container_override import TrainerV1alpha1ContainerOverride
|
||||
from kubeflow_trainer_api.models.trainer_v1alpha1_coscheduling_pod_group_policy_source import TrainerV1alpha1CoschedulingPodGroupPolicySource
|
||||
from kubeflow_trainer_api.models.trainer_v1alpha1_dataset_initializer import TrainerV1alpha1DatasetInitializer
|
||||
from kubeflow_trainer_api.models.trainer_v1alpha1_initializer import TrainerV1alpha1Initializer
|
||||
from kubeflow_trainer_api.models.trainer_v1alpha1_job_set_template_spec import TrainerV1alpha1JobSetTemplateSpec
|
||||
from kubeflow_trainer_api.models.trainer_v1alpha1_job_status import TrainerV1alpha1JobStatus
|
||||
from kubeflow_trainer_api.models.trainer_v1alpha1_ml_policy import TrainerV1alpha1MLPolicy
|
||||
from kubeflow_trainer_api.models.trainer_v1alpha1_ml_policy_source import TrainerV1alpha1MLPolicySource
|
||||
from kubeflow_trainer_api.models.trainer_v1alpha1_mpiml_policy_source import TrainerV1alpha1MPIMLPolicySource
|
||||
from kubeflow_trainer_api.models.trainer_v1alpha1_model_initializer import TrainerV1alpha1ModelInitializer
|
||||
from kubeflow_trainer_api.models.trainer_v1alpha1_pod_group_policy import TrainerV1alpha1PodGroupPolicy
|
||||
from kubeflow_trainer_api.models.trainer_v1alpha1_pod_group_policy_source import TrainerV1alpha1PodGroupPolicySource
|
||||
from kubeflow_trainer_api.models.trainer_v1alpha1_pod_spec_override import TrainerV1alpha1PodSpecOverride
|
||||
from kubeflow_trainer_api.models.trainer_v1alpha1_pod_spec_override_target_job import TrainerV1alpha1PodSpecOverrideTargetJob
|
||||
from kubeflow_trainer_api.models.trainer_v1alpha1_runtime_ref import TrainerV1alpha1RuntimeRef
|
||||
from kubeflow_trainer_api.models.trainer_v1alpha1_torch_elastic_policy import TrainerV1alpha1TorchElasticPolicy
|
||||
from kubeflow_trainer_api.models.trainer_v1alpha1_torch_ml_policy_source import TrainerV1alpha1TorchMLPolicySource
|
||||
from kubeflow_trainer_api.models.trainer_v1alpha1_train_job import TrainerV1alpha1TrainJob
|
||||
from kubeflow_trainer_api.models.trainer_v1alpha1_train_job_list import TrainerV1alpha1TrainJobList
|
||||
from kubeflow_trainer_api.models.trainer_v1alpha1_train_job_spec import TrainerV1alpha1TrainJobSpec
|
||||
from kubeflow_trainer_api.models.trainer_v1alpha1_train_job_status import TrainerV1alpha1TrainJobStatus
|
||||
from kubeflow_trainer_api.models.trainer_v1alpha1_trainer import TrainerV1alpha1Trainer
|
||||
from kubeflow_trainer_api.models.trainer_v1alpha1_training_runtime import TrainerV1alpha1TrainingRuntime
|
||||
from kubeflow_trainer_api.models.trainer_v1alpha1_training_runtime_list import TrainerV1alpha1TrainingRuntimeList
|
||||
from kubeflow_trainer_api.models.trainer_v1alpha1_training_runtime_spec import TrainerV1alpha1TrainingRuntimeSpec
|
||||
+95
@@ -0,0 +1,95 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
Kubeflow Trainer OpenAPI Spec
|
||||
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
|
||||
The version of the OpenAPI document: unversioned
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
|
||||
Do not edit the class manually.
|
||||
""" # noqa: E501
|
||||
|
||||
|
||||
from __future__ import annotations
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
import json
|
||||
|
||||
from pydantic import BaseModel, ConfigDict, Field, StrictStr
|
||||
from typing import Any, ClassVar, Dict, List
|
||||
from kubeflow_trainer_api.models.io_k8s_api_autoscaling_v2_metric_target import IoK8sApiAutoscalingV2MetricTarget
|
||||
from typing import Optional, Set
|
||||
from typing_extensions import Self
|
||||
|
||||
class IoK8sApiAutoscalingV2ContainerResourceMetricSource(BaseModel):
|
||||
"""
|
||||
ContainerResourceMetricSource indicates how to scale on a resource metric known to Kubernetes, as specified in requests and limits, describing each pod in the current scale target (e.g. CPU or memory). The values will be averaged together before being compared to the target. Such metrics are built in to Kubernetes, and have special scaling options on top of those available to normal per-pod metrics using the \"pods\" source. Only one \"target\" type should be set.
|
||||
""" # noqa: E501
|
||||
container: StrictStr = Field(description="container is the name of the container in the pods of the scaling target")
|
||||
name: StrictStr = Field(description="name is the name of the resource in question.")
|
||||
target: IoK8sApiAutoscalingV2MetricTarget = Field(description="target specifies the target value for the given metric")
|
||||
__properties: ClassVar[List[str]] = ["container", "name", "target"]
|
||||
|
||||
model_config = ConfigDict(
|
||||
populate_by_name=True,
|
||||
validate_assignment=True,
|
||||
protected_namespaces=(),
|
||||
)
|
||||
|
||||
|
||||
def to_str(self) -> str:
|
||||
"""Returns the string representation of the model using alias"""
|
||||
return pprint.pformat(self.model_dump(by_alias=True))
|
||||
|
||||
def to_json(self) -> str:
|
||||
"""Returns the JSON representation of the model using alias"""
|
||||
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
||||
return json.dumps(self.to_dict())
|
||||
|
||||
@classmethod
|
||||
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||
"""Create an instance of IoK8sApiAutoscalingV2ContainerResourceMetricSource from a JSON string"""
|
||||
return cls.from_dict(json.loads(json_str))
|
||||
|
||||
def to_dict(self) -> Dict[str, Any]:
|
||||
"""Return the dictionary representation of the model using alias.
|
||||
|
||||
This has the following differences from calling pydantic's
|
||||
`self.model_dump(by_alias=True)`:
|
||||
|
||||
* `None` is only added to the output dict for nullable fields that
|
||||
were set at model initialization. Other fields with value `None`
|
||||
are ignored.
|
||||
"""
|
||||
excluded_fields: Set[str] = set([
|
||||
])
|
||||
|
||||
_dict = self.model_dump(
|
||||
by_alias=True,
|
||||
exclude=excluded_fields,
|
||||
exclude_none=True,
|
||||
)
|
||||
# override the default output from pydantic by calling `to_dict()` of target
|
||||
if self.target:
|
||||
_dict['target'] = self.target.to_dict()
|
||||
return _dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||
"""Create an instance of IoK8sApiAutoscalingV2ContainerResourceMetricSource from a dict"""
|
||||
if obj is None:
|
||||
return None
|
||||
|
||||
if not isinstance(obj, dict):
|
||||
return cls.model_validate(obj)
|
||||
|
||||
_obj = cls.model_validate({
|
||||
"container": obj.get("container") if obj.get("container") is not None else '',
|
||||
"name": obj.get("name") if obj.get("name") is not None else '',
|
||||
"target": IoK8sApiAutoscalingV2MetricTarget.from_dict(obj["target"]) if obj.get("target") is not None else None
|
||||
})
|
||||
return _obj
|
||||
|
||||
|
||||
+95
@@ -0,0 +1,95 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
Kubeflow Trainer OpenAPI Spec
|
||||
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
|
||||
The version of the OpenAPI document: unversioned
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
|
||||
Do not edit the class manually.
|
||||
""" # noqa: E501
|
||||
|
||||
|
||||
from __future__ import annotations
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
import json
|
||||
|
||||
from pydantic import BaseModel, ConfigDict, Field, StrictStr
|
||||
from typing import Any, ClassVar, Dict, List
|
||||
from kubeflow_trainer_api.models.io_k8s_api_autoscaling_v2_metric_value_status import IoK8sApiAutoscalingV2MetricValueStatus
|
||||
from typing import Optional, Set
|
||||
from typing_extensions import Self
|
||||
|
||||
class IoK8sApiAutoscalingV2ContainerResourceMetricStatus(BaseModel):
|
||||
"""
|
||||
ContainerResourceMetricStatus indicates the current value of a resource metric known to Kubernetes, as specified in requests and limits, describing a single container in each pod in the current scale target (e.g. CPU or memory). Such metrics are built in to Kubernetes, and have special scaling options on top of those available to normal per-pod metrics using the \"pods\" source.
|
||||
""" # noqa: E501
|
||||
container: StrictStr = Field(description="container is the name of the container in the pods of the scaling target")
|
||||
current: IoK8sApiAutoscalingV2MetricValueStatus = Field(description="current contains the current value for the given metric")
|
||||
name: StrictStr = Field(description="name is the name of the resource in question.")
|
||||
__properties: ClassVar[List[str]] = ["container", "current", "name"]
|
||||
|
||||
model_config = ConfigDict(
|
||||
populate_by_name=True,
|
||||
validate_assignment=True,
|
||||
protected_namespaces=(),
|
||||
)
|
||||
|
||||
|
||||
def to_str(self) -> str:
|
||||
"""Returns the string representation of the model using alias"""
|
||||
return pprint.pformat(self.model_dump(by_alias=True))
|
||||
|
||||
def to_json(self) -> str:
|
||||
"""Returns the JSON representation of the model using alias"""
|
||||
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
||||
return json.dumps(self.to_dict())
|
||||
|
||||
@classmethod
|
||||
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||
"""Create an instance of IoK8sApiAutoscalingV2ContainerResourceMetricStatus from a JSON string"""
|
||||
return cls.from_dict(json.loads(json_str))
|
||||
|
||||
def to_dict(self) -> Dict[str, Any]:
|
||||
"""Return the dictionary representation of the model using alias.
|
||||
|
||||
This has the following differences from calling pydantic's
|
||||
`self.model_dump(by_alias=True)`:
|
||||
|
||||
* `None` is only added to the output dict for nullable fields that
|
||||
were set at model initialization. Other fields with value `None`
|
||||
are ignored.
|
||||
"""
|
||||
excluded_fields: Set[str] = set([
|
||||
])
|
||||
|
||||
_dict = self.model_dump(
|
||||
by_alias=True,
|
||||
exclude=excluded_fields,
|
||||
exclude_none=True,
|
||||
)
|
||||
# override the default output from pydantic by calling `to_dict()` of current
|
||||
if self.current:
|
||||
_dict['current'] = self.current.to_dict()
|
||||
return _dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||
"""Create an instance of IoK8sApiAutoscalingV2ContainerResourceMetricStatus from a dict"""
|
||||
if obj is None:
|
||||
return None
|
||||
|
||||
if not isinstance(obj, dict):
|
||||
return cls.model_validate(obj)
|
||||
|
||||
_obj = cls.model_validate({
|
||||
"container": obj.get("container") if obj.get("container") is not None else '',
|
||||
"current": IoK8sApiAutoscalingV2MetricValueStatus.from_dict(obj["current"]) if obj.get("current") is not None else None,
|
||||
"name": obj.get("name") if obj.get("name") is not None else ''
|
||||
})
|
||||
return _obj
|
||||
|
||||
|
||||
+91
@@ -0,0 +1,91 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
Kubeflow Trainer OpenAPI Spec
|
||||
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
|
||||
The version of the OpenAPI document: unversioned
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
|
||||
Do not edit the class manually.
|
||||
""" # noqa: E501
|
||||
|
||||
|
||||
from __future__ import annotations
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
import json
|
||||
|
||||
from pydantic import BaseModel, ConfigDict, Field, StrictStr
|
||||
from typing import Any, ClassVar, Dict, List, Optional
|
||||
from typing import Optional, Set
|
||||
from typing_extensions import Self
|
||||
|
||||
class IoK8sApiAutoscalingV2CrossVersionObjectReference(BaseModel):
|
||||
"""
|
||||
CrossVersionObjectReference contains enough information to let you identify the referred resource.
|
||||
""" # noqa: E501
|
||||
api_version: Optional[StrictStr] = Field(default=None, description="apiVersion is the API version of the referent", alias="apiVersion")
|
||||
kind: StrictStr = Field(description="kind is the kind of the referent; More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds")
|
||||
name: StrictStr = Field(description="name is the name of the referent; More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names")
|
||||
__properties: ClassVar[List[str]] = ["apiVersion", "kind", "name"]
|
||||
|
||||
model_config = ConfigDict(
|
||||
populate_by_name=True,
|
||||
validate_assignment=True,
|
||||
protected_namespaces=(),
|
||||
)
|
||||
|
||||
|
||||
def to_str(self) -> str:
|
||||
"""Returns the string representation of the model using alias"""
|
||||
return pprint.pformat(self.model_dump(by_alias=True))
|
||||
|
||||
def to_json(self) -> str:
|
||||
"""Returns the JSON representation of the model using alias"""
|
||||
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
||||
return json.dumps(self.to_dict())
|
||||
|
||||
@classmethod
|
||||
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||
"""Create an instance of IoK8sApiAutoscalingV2CrossVersionObjectReference from a JSON string"""
|
||||
return cls.from_dict(json.loads(json_str))
|
||||
|
||||
def to_dict(self) -> Dict[str, Any]:
|
||||
"""Return the dictionary representation of the model using alias.
|
||||
|
||||
This has the following differences from calling pydantic's
|
||||
`self.model_dump(by_alias=True)`:
|
||||
|
||||
* `None` is only added to the output dict for nullable fields that
|
||||
were set at model initialization. Other fields with value `None`
|
||||
are ignored.
|
||||
"""
|
||||
excluded_fields: Set[str] = set([
|
||||
])
|
||||
|
||||
_dict = self.model_dump(
|
||||
by_alias=True,
|
||||
exclude=excluded_fields,
|
||||
exclude_none=True,
|
||||
)
|
||||
return _dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||
"""Create an instance of IoK8sApiAutoscalingV2CrossVersionObjectReference from a dict"""
|
||||
if obj is None:
|
||||
return None
|
||||
|
||||
if not isinstance(obj, dict):
|
||||
return cls.model_validate(obj)
|
||||
|
||||
_obj = cls.model_validate({
|
||||
"apiVersion": obj.get("apiVersion"),
|
||||
"kind": obj.get("kind") if obj.get("kind") is not None else '',
|
||||
"name": obj.get("name") if obj.get("name") is not None else ''
|
||||
})
|
||||
return _obj
|
||||
|
||||
|
||||
+97
@@ -0,0 +1,97 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
Kubeflow Trainer OpenAPI Spec
|
||||
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
|
||||
The version of the OpenAPI document: unversioned
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
|
||||
Do not edit the class manually.
|
||||
""" # noqa: E501
|
||||
|
||||
|
||||
from __future__ import annotations
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
import json
|
||||
|
||||
from pydantic import BaseModel, ConfigDict, Field
|
||||
from typing import Any, ClassVar, Dict, List
|
||||
from kubeflow_trainer_api.models.io_k8s_api_autoscaling_v2_metric_identifier import IoK8sApiAutoscalingV2MetricIdentifier
|
||||
from kubeflow_trainer_api.models.io_k8s_api_autoscaling_v2_metric_target import IoK8sApiAutoscalingV2MetricTarget
|
||||
from typing import Optional, Set
|
||||
from typing_extensions import Self
|
||||
|
||||
class IoK8sApiAutoscalingV2ExternalMetricSource(BaseModel):
|
||||
"""
|
||||
ExternalMetricSource indicates how to scale on a metric not associated with any Kubernetes object (for example length of queue in cloud messaging service, or QPS from loadbalancer running outside of cluster).
|
||||
""" # noqa: E501
|
||||
metric: IoK8sApiAutoscalingV2MetricIdentifier = Field(description="metric identifies the target metric by name and selector")
|
||||
target: IoK8sApiAutoscalingV2MetricTarget = Field(description="target specifies the target value for the given metric")
|
||||
__properties: ClassVar[List[str]] = ["metric", "target"]
|
||||
|
||||
model_config = ConfigDict(
|
||||
populate_by_name=True,
|
||||
validate_assignment=True,
|
||||
protected_namespaces=(),
|
||||
)
|
||||
|
||||
|
||||
def to_str(self) -> str:
|
||||
"""Returns the string representation of the model using alias"""
|
||||
return pprint.pformat(self.model_dump(by_alias=True))
|
||||
|
||||
def to_json(self) -> str:
|
||||
"""Returns the JSON representation of the model using alias"""
|
||||
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
||||
return json.dumps(self.to_dict())
|
||||
|
||||
@classmethod
|
||||
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||
"""Create an instance of IoK8sApiAutoscalingV2ExternalMetricSource from a JSON string"""
|
||||
return cls.from_dict(json.loads(json_str))
|
||||
|
||||
def to_dict(self) -> Dict[str, Any]:
|
||||
"""Return the dictionary representation of the model using alias.
|
||||
|
||||
This has the following differences from calling pydantic's
|
||||
`self.model_dump(by_alias=True)`:
|
||||
|
||||
* `None` is only added to the output dict for nullable fields that
|
||||
were set at model initialization. Other fields with value `None`
|
||||
are ignored.
|
||||
"""
|
||||
excluded_fields: Set[str] = set([
|
||||
])
|
||||
|
||||
_dict = self.model_dump(
|
||||
by_alias=True,
|
||||
exclude=excluded_fields,
|
||||
exclude_none=True,
|
||||
)
|
||||
# override the default output from pydantic by calling `to_dict()` of metric
|
||||
if self.metric:
|
||||
_dict['metric'] = self.metric.to_dict()
|
||||
# override the default output from pydantic by calling `to_dict()` of target
|
||||
if self.target:
|
||||
_dict['target'] = self.target.to_dict()
|
||||
return _dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||
"""Create an instance of IoK8sApiAutoscalingV2ExternalMetricSource from a dict"""
|
||||
if obj is None:
|
||||
return None
|
||||
|
||||
if not isinstance(obj, dict):
|
||||
return cls.model_validate(obj)
|
||||
|
||||
_obj = cls.model_validate({
|
||||
"metric": IoK8sApiAutoscalingV2MetricIdentifier.from_dict(obj["metric"]) if obj.get("metric") is not None else None,
|
||||
"target": IoK8sApiAutoscalingV2MetricTarget.from_dict(obj["target"]) if obj.get("target") is not None else None
|
||||
})
|
||||
return _obj
|
||||
|
||||
|
||||
+97
@@ -0,0 +1,97 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
Kubeflow Trainer OpenAPI Spec
|
||||
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
|
||||
The version of the OpenAPI document: unversioned
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
|
||||
Do not edit the class manually.
|
||||
""" # noqa: E501
|
||||
|
||||
|
||||
from __future__ import annotations
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
import json
|
||||
|
||||
from pydantic import BaseModel, ConfigDict, Field
|
||||
from typing import Any, ClassVar, Dict, List
|
||||
from kubeflow_trainer_api.models.io_k8s_api_autoscaling_v2_metric_identifier import IoK8sApiAutoscalingV2MetricIdentifier
|
||||
from kubeflow_trainer_api.models.io_k8s_api_autoscaling_v2_metric_value_status import IoK8sApiAutoscalingV2MetricValueStatus
|
||||
from typing import Optional, Set
|
||||
from typing_extensions import Self
|
||||
|
||||
class IoK8sApiAutoscalingV2ExternalMetricStatus(BaseModel):
|
||||
"""
|
||||
ExternalMetricStatus indicates the current value of a global metric not associated with any Kubernetes object.
|
||||
""" # noqa: E501
|
||||
current: IoK8sApiAutoscalingV2MetricValueStatus = Field(description="current contains the current value for the given metric")
|
||||
metric: IoK8sApiAutoscalingV2MetricIdentifier = Field(description="metric identifies the target metric by name and selector")
|
||||
__properties: ClassVar[List[str]] = ["current", "metric"]
|
||||
|
||||
model_config = ConfigDict(
|
||||
populate_by_name=True,
|
||||
validate_assignment=True,
|
||||
protected_namespaces=(),
|
||||
)
|
||||
|
||||
|
||||
def to_str(self) -> str:
|
||||
"""Returns the string representation of the model using alias"""
|
||||
return pprint.pformat(self.model_dump(by_alias=True))
|
||||
|
||||
def to_json(self) -> str:
|
||||
"""Returns the JSON representation of the model using alias"""
|
||||
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
||||
return json.dumps(self.to_dict())
|
||||
|
||||
@classmethod
|
||||
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||
"""Create an instance of IoK8sApiAutoscalingV2ExternalMetricStatus from a JSON string"""
|
||||
return cls.from_dict(json.loads(json_str))
|
||||
|
||||
def to_dict(self) -> Dict[str, Any]:
|
||||
"""Return the dictionary representation of the model using alias.
|
||||
|
||||
This has the following differences from calling pydantic's
|
||||
`self.model_dump(by_alias=True)`:
|
||||
|
||||
* `None` is only added to the output dict for nullable fields that
|
||||
were set at model initialization. Other fields with value `None`
|
||||
are ignored.
|
||||
"""
|
||||
excluded_fields: Set[str] = set([
|
||||
])
|
||||
|
||||
_dict = self.model_dump(
|
||||
by_alias=True,
|
||||
exclude=excluded_fields,
|
||||
exclude_none=True,
|
||||
)
|
||||
# override the default output from pydantic by calling `to_dict()` of current
|
||||
if self.current:
|
||||
_dict['current'] = self.current.to_dict()
|
||||
# override the default output from pydantic by calling `to_dict()` of metric
|
||||
if self.metric:
|
||||
_dict['metric'] = self.metric.to_dict()
|
||||
return _dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||
"""Create an instance of IoK8sApiAutoscalingV2ExternalMetricStatus from a dict"""
|
||||
if obj is None:
|
||||
return None
|
||||
|
||||
if not isinstance(obj, dict):
|
||||
return cls.model_validate(obj)
|
||||
|
||||
_obj = cls.model_validate({
|
||||
"current": IoK8sApiAutoscalingV2MetricValueStatus.from_dict(obj["current"]) if obj.get("current") is not None else None,
|
||||
"metric": IoK8sApiAutoscalingV2MetricIdentifier.from_dict(obj["metric"]) if obj.get("metric") is not None else None
|
||||
})
|
||||
return _obj
|
||||
|
||||
|
||||
+107
@@ -0,0 +1,107 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
Kubeflow Trainer OpenAPI Spec
|
||||
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
|
||||
The version of the OpenAPI document: unversioned
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
|
||||
Do not edit the class manually.
|
||||
""" # noqa: E501
|
||||
|
||||
|
||||
from __future__ import annotations
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
import json
|
||||
|
||||
from pydantic import BaseModel, ConfigDict, Field, StrictStr
|
||||
from typing import Any, ClassVar, Dict, List, Optional
|
||||
from kubeflow_trainer_api.models.io_k8s_api_autoscaling_v2_horizontal_pod_autoscaler_spec import IoK8sApiAutoscalingV2HorizontalPodAutoscalerSpec
|
||||
from kubeflow_trainer_api.models.io_k8s_api_autoscaling_v2_horizontal_pod_autoscaler_status import IoK8sApiAutoscalingV2HorizontalPodAutoscalerStatus
|
||||
from kubeflow_trainer_api.models.io_k8s_apimachinery_pkg_apis_meta_v1_object_meta import IoK8sApimachineryPkgApisMetaV1ObjectMeta
|
||||
from typing import Optional, Set
|
||||
from typing_extensions import Self
|
||||
|
||||
class IoK8sApiAutoscalingV2HorizontalPodAutoscaler(BaseModel):
|
||||
"""
|
||||
HorizontalPodAutoscaler is the configuration for a horizontal pod autoscaler, which automatically manages the replica count of any resource implementing the scale subresource based on the metrics specified.
|
||||
""" # noqa: E501
|
||||
api_version: Optional[StrictStr] = Field(default=None, description="APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", alias="apiVersion")
|
||||
kind: Optional[StrictStr] = Field(default=None, description="Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds")
|
||||
metadata: Optional[IoK8sApimachineryPkgApisMetaV1ObjectMeta] = Field(default=None, description="metadata is the standard object metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata")
|
||||
spec: Optional[IoK8sApiAutoscalingV2HorizontalPodAutoscalerSpec] = Field(default=None, description="spec is the specification for the behaviour of the autoscaler. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status.")
|
||||
status: Optional[IoK8sApiAutoscalingV2HorizontalPodAutoscalerStatus] = Field(default=None, description="status is the current information about the autoscaler.")
|
||||
__properties: ClassVar[List[str]] = ["apiVersion", "kind", "metadata", "spec", "status"]
|
||||
|
||||
model_config = ConfigDict(
|
||||
populate_by_name=True,
|
||||
validate_assignment=True,
|
||||
protected_namespaces=(),
|
||||
)
|
||||
|
||||
|
||||
def to_str(self) -> str:
|
||||
"""Returns the string representation of the model using alias"""
|
||||
return pprint.pformat(self.model_dump(by_alias=True))
|
||||
|
||||
def to_json(self) -> str:
|
||||
"""Returns the JSON representation of the model using alias"""
|
||||
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
||||
return json.dumps(self.to_dict())
|
||||
|
||||
@classmethod
|
||||
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||
"""Create an instance of IoK8sApiAutoscalingV2HorizontalPodAutoscaler from a JSON string"""
|
||||
return cls.from_dict(json.loads(json_str))
|
||||
|
||||
def to_dict(self) -> Dict[str, Any]:
|
||||
"""Return the dictionary representation of the model using alias.
|
||||
|
||||
This has the following differences from calling pydantic's
|
||||
`self.model_dump(by_alias=True)`:
|
||||
|
||||
* `None` is only added to the output dict for nullable fields that
|
||||
were set at model initialization. Other fields with value `None`
|
||||
are ignored.
|
||||
"""
|
||||
excluded_fields: Set[str] = set([
|
||||
])
|
||||
|
||||
_dict = self.model_dump(
|
||||
by_alias=True,
|
||||
exclude=excluded_fields,
|
||||
exclude_none=True,
|
||||
)
|
||||
# override the default output from pydantic by calling `to_dict()` of metadata
|
||||
if self.metadata:
|
||||
_dict['metadata'] = self.metadata.to_dict()
|
||||
# override the default output from pydantic by calling `to_dict()` of spec
|
||||
if self.spec:
|
||||
_dict['spec'] = self.spec.to_dict()
|
||||
# override the default output from pydantic by calling `to_dict()` of status
|
||||
if self.status:
|
||||
_dict['status'] = self.status.to_dict()
|
||||
return _dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||
"""Create an instance of IoK8sApiAutoscalingV2HorizontalPodAutoscaler from a dict"""
|
||||
if obj is None:
|
||||
return None
|
||||
|
||||
if not isinstance(obj, dict):
|
||||
return cls.model_validate(obj)
|
||||
|
||||
_obj = cls.model_validate({
|
||||
"apiVersion": obj.get("apiVersion"),
|
||||
"kind": obj.get("kind"),
|
||||
"metadata": IoK8sApimachineryPkgApisMetaV1ObjectMeta.from_dict(obj["metadata"]) if obj.get("metadata") is not None else None,
|
||||
"spec": IoK8sApiAutoscalingV2HorizontalPodAutoscalerSpec.from_dict(obj["spec"]) if obj.get("spec") is not None else None,
|
||||
"status": IoK8sApiAutoscalingV2HorizontalPodAutoscalerStatus.from_dict(obj["status"]) if obj.get("status") is not None else None
|
||||
})
|
||||
return _obj
|
||||
|
||||
|
||||
+96
@@ -0,0 +1,96 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
Kubeflow Trainer OpenAPI Spec
|
||||
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
|
||||
The version of the OpenAPI document: unversioned
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
|
||||
Do not edit the class manually.
|
||||
""" # noqa: E501
|
||||
|
||||
|
||||
from __future__ import annotations
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
import json
|
||||
|
||||
from pydantic import BaseModel, ConfigDict, Field
|
||||
from typing import Any, ClassVar, Dict, List, Optional
|
||||
from kubeflow_trainer_api.models.io_k8s_api_autoscaling_v2_hpa_scaling_rules import IoK8sApiAutoscalingV2HPAScalingRules
|
||||
from typing import Optional, Set
|
||||
from typing_extensions import Self
|
||||
|
||||
class IoK8sApiAutoscalingV2HorizontalPodAutoscalerBehavior(BaseModel):
|
||||
"""
|
||||
HorizontalPodAutoscalerBehavior configures the scaling behavior of the target in both Up and Down directions (scaleUp and scaleDown fields respectively).
|
||||
""" # noqa: E501
|
||||
scale_down: Optional[IoK8sApiAutoscalingV2HPAScalingRules] = Field(default=None, description="scaleDown is scaling policy for scaling Down. If not set, the default value is to allow to scale down to minReplicas pods, with a 300 second stabilization window (i.e., the highest recommendation for the last 300sec is used).", alias="scaleDown")
|
||||
scale_up: Optional[IoK8sApiAutoscalingV2HPAScalingRules] = Field(default=None, description="scaleUp is scaling policy for scaling Up. If not set, the default value is the higher of: * increase no more than 4 pods per 60 seconds * double the number of pods per 60 seconds No stabilization is used.", alias="scaleUp")
|
||||
__properties: ClassVar[List[str]] = ["scaleDown", "scaleUp"]
|
||||
|
||||
model_config = ConfigDict(
|
||||
populate_by_name=True,
|
||||
validate_assignment=True,
|
||||
protected_namespaces=(),
|
||||
)
|
||||
|
||||
|
||||
def to_str(self) -> str:
|
||||
"""Returns the string representation of the model using alias"""
|
||||
return pprint.pformat(self.model_dump(by_alias=True))
|
||||
|
||||
def to_json(self) -> str:
|
||||
"""Returns the JSON representation of the model using alias"""
|
||||
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
||||
return json.dumps(self.to_dict())
|
||||
|
||||
@classmethod
|
||||
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||
"""Create an instance of IoK8sApiAutoscalingV2HorizontalPodAutoscalerBehavior from a JSON string"""
|
||||
return cls.from_dict(json.loads(json_str))
|
||||
|
||||
def to_dict(self) -> Dict[str, Any]:
|
||||
"""Return the dictionary representation of the model using alias.
|
||||
|
||||
This has the following differences from calling pydantic's
|
||||
`self.model_dump(by_alias=True)`:
|
||||
|
||||
* `None` is only added to the output dict for nullable fields that
|
||||
were set at model initialization. Other fields with value `None`
|
||||
are ignored.
|
||||
"""
|
||||
excluded_fields: Set[str] = set([
|
||||
])
|
||||
|
||||
_dict = self.model_dump(
|
||||
by_alias=True,
|
||||
exclude=excluded_fields,
|
||||
exclude_none=True,
|
||||
)
|
||||
# override the default output from pydantic by calling `to_dict()` of scale_down
|
||||
if self.scale_down:
|
||||
_dict['scaleDown'] = self.scale_down.to_dict()
|
||||
# override the default output from pydantic by calling `to_dict()` of scale_up
|
||||
if self.scale_up:
|
||||
_dict['scaleUp'] = self.scale_up.to_dict()
|
||||
return _dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||
"""Create an instance of IoK8sApiAutoscalingV2HorizontalPodAutoscalerBehavior from a dict"""
|
||||
if obj is None:
|
||||
return None
|
||||
|
||||
if not isinstance(obj, dict):
|
||||
return cls.model_validate(obj)
|
||||
|
||||
_obj = cls.model_validate({
|
||||
"scaleDown": IoK8sApiAutoscalingV2HPAScalingRules.from_dict(obj["scaleDown"]) if obj.get("scaleDown") is not None else None,
|
||||
"scaleUp": IoK8sApiAutoscalingV2HPAScalingRules.from_dict(obj["scaleUp"]) if obj.get("scaleUp") is not None else None
|
||||
})
|
||||
return _obj
|
||||
|
||||
|
||||
+96
@@ -0,0 +1,96 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
Kubeflow Trainer OpenAPI Spec
|
||||
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
|
||||
The version of the OpenAPI document: unversioned
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
|
||||
Do not edit the class manually.
|
||||
""" # noqa: E501
|
||||
|
||||
|
||||
from __future__ import annotations
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
import json
|
||||
|
||||
from datetime import datetime
|
||||
from pydantic import BaseModel, ConfigDict, Field, StrictStr
|
||||
from typing import Any, ClassVar, Dict, List, Optional
|
||||
from typing import Optional, Set
|
||||
from typing_extensions import Self
|
||||
|
||||
class IoK8sApiAutoscalingV2HorizontalPodAutoscalerCondition(BaseModel):
|
||||
"""
|
||||
HorizontalPodAutoscalerCondition describes the state of a HorizontalPodAutoscaler at a certain point.
|
||||
""" # noqa: E501
|
||||
last_transition_time: Optional[datetime] = Field(default=None, description="lastTransitionTime is the last time the condition transitioned from one status to another", alias="lastTransitionTime")
|
||||
message: Optional[StrictStr] = Field(default=None, description="message is a human-readable explanation containing details about the transition")
|
||||
reason: Optional[StrictStr] = Field(default=None, description="reason is the reason for the condition's last transition.")
|
||||
status: StrictStr = Field(description="status is the status of the condition (True, False, Unknown)")
|
||||
type: StrictStr = Field(description="type describes the current condition")
|
||||
__properties: ClassVar[List[str]] = ["lastTransitionTime", "message", "reason", "status", "type"]
|
||||
|
||||
model_config = ConfigDict(
|
||||
populate_by_name=True,
|
||||
validate_assignment=True,
|
||||
protected_namespaces=(),
|
||||
)
|
||||
|
||||
|
||||
def to_str(self) -> str:
|
||||
"""Returns the string representation of the model using alias"""
|
||||
return pprint.pformat(self.model_dump(by_alias=True))
|
||||
|
||||
def to_json(self) -> str:
|
||||
"""Returns the JSON representation of the model using alias"""
|
||||
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
||||
return json.dumps(self.to_dict())
|
||||
|
||||
@classmethod
|
||||
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||
"""Create an instance of IoK8sApiAutoscalingV2HorizontalPodAutoscalerCondition from a JSON string"""
|
||||
return cls.from_dict(json.loads(json_str))
|
||||
|
||||
def to_dict(self) -> Dict[str, Any]:
|
||||
"""Return the dictionary representation of the model using alias.
|
||||
|
||||
This has the following differences from calling pydantic's
|
||||
`self.model_dump(by_alias=True)`:
|
||||
|
||||
* `None` is only added to the output dict for nullable fields that
|
||||
were set at model initialization. Other fields with value `None`
|
||||
are ignored.
|
||||
"""
|
||||
excluded_fields: Set[str] = set([
|
||||
])
|
||||
|
||||
_dict = self.model_dump(
|
||||
by_alias=True,
|
||||
exclude=excluded_fields,
|
||||
exclude_none=True,
|
||||
)
|
||||
return _dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||
"""Create an instance of IoK8sApiAutoscalingV2HorizontalPodAutoscalerCondition from a dict"""
|
||||
if obj is None:
|
||||
return None
|
||||
|
||||
if not isinstance(obj, dict):
|
||||
return cls.model_validate(obj)
|
||||
|
||||
_obj = cls.model_validate({
|
||||
"lastTransitionTime": obj.get("lastTransitionTime"),
|
||||
"message": obj.get("message"),
|
||||
"reason": obj.get("reason"),
|
||||
"status": obj.get("status") if obj.get("status") is not None else '',
|
||||
"type": obj.get("type") if obj.get("type") is not None else ''
|
||||
})
|
||||
return _obj
|
||||
|
||||
|
||||
+105
@@ -0,0 +1,105 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
Kubeflow Trainer OpenAPI Spec
|
||||
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
|
||||
The version of the OpenAPI document: unversioned
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
|
||||
Do not edit the class manually.
|
||||
""" # noqa: E501
|
||||
|
||||
|
||||
from __future__ import annotations
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
import json
|
||||
|
||||
from pydantic import BaseModel, ConfigDict, Field, StrictStr
|
||||
from typing import Any, ClassVar, Dict, List, Optional
|
||||
from kubeflow_trainer_api.models.io_k8s_api_autoscaling_v2_horizontal_pod_autoscaler import IoK8sApiAutoscalingV2HorizontalPodAutoscaler
|
||||
from kubeflow_trainer_api.models.io_k8s_apimachinery_pkg_apis_meta_v1_list_meta import IoK8sApimachineryPkgApisMetaV1ListMeta
|
||||
from typing import Optional, Set
|
||||
from typing_extensions import Self
|
||||
|
||||
class IoK8sApiAutoscalingV2HorizontalPodAutoscalerList(BaseModel):
|
||||
"""
|
||||
HorizontalPodAutoscalerList is a list of horizontal pod autoscaler objects.
|
||||
""" # noqa: E501
|
||||
api_version: Optional[StrictStr] = Field(default=None, description="APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", alias="apiVersion")
|
||||
items: List[IoK8sApiAutoscalingV2HorizontalPodAutoscaler] = Field(description="items is the list of horizontal pod autoscaler objects.")
|
||||
kind: Optional[StrictStr] = Field(default=None, description="Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds")
|
||||
metadata: Optional[IoK8sApimachineryPkgApisMetaV1ListMeta] = Field(default=None, description="metadata is the standard list metadata.")
|
||||
__properties: ClassVar[List[str]] = ["apiVersion", "items", "kind", "metadata"]
|
||||
|
||||
model_config = ConfigDict(
|
||||
populate_by_name=True,
|
||||
validate_assignment=True,
|
||||
protected_namespaces=(),
|
||||
)
|
||||
|
||||
|
||||
def to_str(self) -> str:
|
||||
"""Returns the string representation of the model using alias"""
|
||||
return pprint.pformat(self.model_dump(by_alias=True))
|
||||
|
||||
def to_json(self) -> str:
|
||||
"""Returns the JSON representation of the model using alias"""
|
||||
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
||||
return json.dumps(self.to_dict())
|
||||
|
||||
@classmethod
|
||||
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||
"""Create an instance of IoK8sApiAutoscalingV2HorizontalPodAutoscalerList from a JSON string"""
|
||||
return cls.from_dict(json.loads(json_str))
|
||||
|
||||
def to_dict(self) -> Dict[str, Any]:
|
||||
"""Return the dictionary representation of the model using alias.
|
||||
|
||||
This has the following differences from calling pydantic's
|
||||
`self.model_dump(by_alias=True)`:
|
||||
|
||||
* `None` is only added to the output dict for nullable fields that
|
||||
were set at model initialization. Other fields with value `None`
|
||||
are ignored.
|
||||
"""
|
||||
excluded_fields: Set[str] = set([
|
||||
])
|
||||
|
||||
_dict = self.model_dump(
|
||||
by_alias=True,
|
||||
exclude=excluded_fields,
|
||||
exclude_none=True,
|
||||
)
|
||||
# override the default output from pydantic by calling `to_dict()` of each item in items (list)
|
||||
_items = []
|
||||
if self.items:
|
||||
for _item_items in self.items:
|
||||
if _item_items:
|
||||
_items.append(_item_items.to_dict())
|
||||
_dict['items'] = _items
|
||||
# override the default output from pydantic by calling `to_dict()` of metadata
|
||||
if self.metadata:
|
||||
_dict['metadata'] = self.metadata.to_dict()
|
||||
return _dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||
"""Create an instance of IoK8sApiAutoscalingV2HorizontalPodAutoscalerList from a dict"""
|
||||
if obj is None:
|
||||
return None
|
||||
|
||||
if not isinstance(obj, dict):
|
||||
return cls.model_validate(obj)
|
||||
|
||||
_obj = cls.model_validate({
|
||||
"apiVersion": obj.get("apiVersion"),
|
||||
"items": [IoK8sApiAutoscalingV2HorizontalPodAutoscaler.from_dict(_item) for _item in obj["items"]] if obj.get("items") is not None else None,
|
||||
"kind": obj.get("kind"),
|
||||
"metadata": IoK8sApimachineryPkgApisMetaV1ListMeta.from_dict(obj["metadata"]) if obj.get("metadata") is not None else None
|
||||
})
|
||||
return _obj
|
||||
|
||||
|
||||
+111
@@ -0,0 +1,111 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
Kubeflow Trainer OpenAPI Spec
|
||||
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
|
||||
The version of the OpenAPI document: unversioned
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
|
||||
Do not edit the class manually.
|
||||
""" # noqa: E501
|
||||
|
||||
|
||||
from __future__ import annotations
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
import json
|
||||
|
||||
from pydantic import BaseModel, ConfigDict, Field, StrictInt
|
||||
from typing import Any, ClassVar, Dict, List, Optional
|
||||
from kubeflow_trainer_api.models.io_k8s_api_autoscaling_v2_cross_version_object_reference import IoK8sApiAutoscalingV2CrossVersionObjectReference
|
||||
from kubeflow_trainer_api.models.io_k8s_api_autoscaling_v2_horizontal_pod_autoscaler_behavior import IoK8sApiAutoscalingV2HorizontalPodAutoscalerBehavior
|
||||
from kubeflow_trainer_api.models.io_k8s_api_autoscaling_v2_metric_spec import IoK8sApiAutoscalingV2MetricSpec
|
||||
from typing import Optional, Set
|
||||
from typing_extensions import Self
|
||||
|
||||
class IoK8sApiAutoscalingV2HorizontalPodAutoscalerSpec(BaseModel):
|
||||
"""
|
||||
HorizontalPodAutoscalerSpec describes the desired functionality of the HorizontalPodAutoscaler.
|
||||
""" # noqa: E501
|
||||
behavior: Optional[IoK8sApiAutoscalingV2HorizontalPodAutoscalerBehavior] = Field(default=None, description="behavior configures the scaling behavior of the target in both Up and Down directions (scaleUp and scaleDown fields respectively). If not set, the default HPAScalingRules for scale up and scale down are used.")
|
||||
max_replicas: StrictInt = Field(description="maxReplicas is the upper limit for the number of replicas to which the autoscaler can scale up. It cannot be less that minReplicas.", alias="maxReplicas")
|
||||
metrics: Optional[List[IoK8sApiAutoscalingV2MetricSpec]] = Field(default=None, description="metrics contains the specifications for which to use to calculate the desired replica count (the maximum replica count across all metrics will be used). The desired replica count is calculated multiplying the ratio between the target value and the current value by the current number of pods. Ergo, metrics used must decrease as the pod count is increased, and vice-versa. See the individual metric source types for more information about how each type of metric must respond. If not set, the default metric will be set to 80% average CPU utilization.")
|
||||
min_replicas: Optional[StrictInt] = Field(default=None, description="minReplicas is the lower limit for the number of replicas to which the autoscaler can scale down. It defaults to 1 pod. minReplicas is allowed to be 0 if the alpha feature gate HPAScaleToZero is enabled and at least one Object or External metric is configured. Scaling is active as long as at least one metric value is available.", alias="minReplicas")
|
||||
scale_target_ref: IoK8sApiAutoscalingV2CrossVersionObjectReference = Field(description="scaleTargetRef points to the target resource to scale, and is used to the pods for which metrics should be collected, as well as to actually change the replica count.", alias="scaleTargetRef")
|
||||
__properties: ClassVar[List[str]] = ["behavior", "maxReplicas", "metrics", "minReplicas", "scaleTargetRef"]
|
||||
|
||||
model_config = ConfigDict(
|
||||
populate_by_name=True,
|
||||
validate_assignment=True,
|
||||
protected_namespaces=(),
|
||||
)
|
||||
|
||||
|
||||
def to_str(self) -> str:
|
||||
"""Returns the string representation of the model using alias"""
|
||||
return pprint.pformat(self.model_dump(by_alias=True))
|
||||
|
||||
def to_json(self) -> str:
|
||||
"""Returns the JSON representation of the model using alias"""
|
||||
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
||||
return json.dumps(self.to_dict())
|
||||
|
||||
@classmethod
|
||||
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||
"""Create an instance of IoK8sApiAutoscalingV2HorizontalPodAutoscalerSpec from a JSON string"""
|
||||
return cls.from_dict(json.loads(json_str))
|
||||
|
||||
def to_dict(self) -> Dict[str, Any]:
|
||||
"""Return the dictionary representation of the model using alias.
|
||||
|
||||
This has the following differences from calling pydantic's
|
||||
`self.model_dump(by_alias=True)`:
|
||||
|
||||
* `None` is only added to the output dict for nullable fields that
|
||||
were set at model initialization. Other fields with value `None`
|
||||
are ignored.
|
||||
"""
|
||||
excluded_fields: Set[str] = set([
|
||||
])
|
||||
|
||||
_dict = self.model_dump(
|
||||
by_alias=True,
|
||||
exclude=excluded_fields,
|
||||
exclude_none=True,
|
||||
)
|
||||
# override the default output from pydantic by calling `to_dict()` of behavior
|
||||
if self.behavior:
|
||||
_dict['behavior'] = self.behavior.to_dict()
|
||||
# override the default output from pydantic by calling `to_dict()` of each item in metrics (list)
|
||||
_items = []
|
||||
if self.metrics:
|
||||
for _item_metrics in self.metrics:
|
||||
if _item_metrics:
|
||||
_items.append(_item_metrics.to_dict())
|
||||
_dict['metrics'] = _items
|
||||
# override the default output from pydantic by calling `to_dict()` of scale_target_ref
|
||||
if self.scale_target_ref:
|
||||
_dict['scaleTargetRef'] = self.scale_target_ref.to_dict()
|
||||
return _dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||
"""Create an instance of IoK8sApiAutoscalingV2HorizontalPodAutoscalerSpec from a dict"""
|
||||
if obj is None:
|
||||
return None
|
||||
|
||||
if not isinstance(obj, dict):
|
||||
return cls.model_validate(obj)
|
||||
|
||||
_obj = cls.model_validate({
|
||||
"behavior": IoK8sApiAutoscalingV2HorizontalPodAutoscalerBehavior.from_dict(obj["behavior"]) if obj.get("behavior") is not None else None,
|
||||
"maxReplicas": obj.get("maxReplicas") if obj.get("maxReplicas") is not None else 0,
|
||||
"metrics": [IoK8sApiAutoscalingV2MetricSpec.from_dict(_item) for _item in obj["metrics"]] if obj.get("metrics") is not None else None,
|
||||
"minReplicas": obj.get("minReplicas"),
|
||||
"scaleTargetRef": IoK8sApiAutoscalingV2CrossVersionObjectReference.from_dict(obj["scaleTargetRef"]) if obj.get("scaleTargetRef") is not None else None
|
||||
})
|
||||
return _obj
|
||||
|
||||
|
||||
+114
@@ -0,0 +1,114 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
Kubeflow Trainer OpenAPI Spec
|
||||
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
|
||||
The version of the OpenAPI document: unversioned
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
|
||||
Do not edit the class manually.
|
||||
""" # noqa: E501
|
||||
|
||||
|
||||
from __future__ import annotations
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
import json
|
||||
|
||||
from datetime import datetime
|
||||
from pydantic import BaseModel, ConfigDict, Field, StrictInt
|
||||
from typing import Any, ClassVar, Dict, List, Optional
|
||||
from kubeflow_trainer_api.models.io_k8s_api_autoscaling_v2_horizontal_pod_autoscaler_condition import IoK8sApiAutoscalingV2HorizontalPodAutoscalerCondition
|
||||
from kubeflow_trainer_api.models.io_k8s_api_autoscaling_v2_metric_status import IoK8sApiAutoscalingV2MetricStatus
|
||||
from typing import Optional, Set
|
||||
from typing_extensions import Self
|
||||
|
||||
class IoK8sApiAutoscalingV2HorizontalPodAutoscalerStatus(BaseModel):
|
||||
"""
|
||||
HorizontalPodAutoscalerStatus describes the current status of a horizontal pod autoscaler.
|
||||
""" # noqa: E501
|
||||
conditions: Optional[List[IoK8sApiAutoscalingV2HorizontalPodAutoscalerCondition]] = Field(default=None, description="conditions is the set of conditions required for this autoscaler to scale its target, and indicates whether or not those conditions are met.")
|
||||
current_metrics: Optional[List[IoK8sApiAutoscalingV2MetricStatus]] = Field(default=None, description="currentMetrics is the last read state of the metrics used by this autoscaler.", alias="currentMetrics")
|
||||
current_replicas: Optional[StrictInt] = Field(default=None, description="currentReplicas is current number of replicas of pods managed by this autoscaler, as last seen by the autoscaler.", alias="currentReplicas")
|
||||
desired_replicas: StrictInt = Field(description="desiredReplicas is the desired number of replicas of pods managed by this autoscaler, as last calculated by the autoscaler.", alias="desiredReplicas")
|
||||
last_scale_time: Optional[datetime] = Field(default=None, description="lastScaleTime is the last time the HorizontalPodAutoscaler scaled the number of pods, used by the autoscaler to control how often the number of pods is changed.", alias="lastScaleTime")
|
||||
observed_generation: Optional[StrictInt] = Field(default=None, description="observedGeneration is the most recent generation observed by this autoscaler.", alias="observedGeneration")
|
||||
__properties: ClassVar[List[str]] = ["conditions", "currentMetrics", "currentReplicas", "desiredReplicas", "lastScaleTime", "observedGeneration"]
|
||||
|
||||
model_config = ConfigDict(
|
||||
populate_by_name=True,
|
||||
validate_assignment=True,
|
||||
protected_namespaces=(),
|
||||
)
|
||||
|
||||
|
||||
def to_str(self) -> str:
|
||||
"""Returns the string representation of the model using alias"""
|
||||
return pprint.pformat(self.model_dump(by_alias=True))
|
||||
|
||||
def to_json(self) -> str:
|
||||
"""Returns the JSON representation of the model using alias"""
|
||||
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
||||
return json.dumps(self.to_dict())
|
||||
|
||||
@classmethod
|
||||
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||
"""Create an instance of IoK8sApiAutoscalingV2HorizontalPodAutoscalerStatus from a JSON string"""
|
||||
return cls.from_dict(json.loads(json_str))
|
||||
|
||||
def to_dict(self) -> Dict[str, Any]:
|
||||
"""Return the dictionary representation of the model using alias.
|
||||
|
||||
This has the following differences from calling pydantic's
|
||||
`self.model_dump(by_alias=True)`:
|
||||
|
||||
* `None` is only added to the output dict for nullable fields that
|
||||
were set at model initialization. Other fields with value `None`
|
||||
are ignored.
|
||||
"""
|
||||
excluded_fields: Set[str] = set([
|
||||
])
|
||||
|
||||
_dict = self.model_dump(
|
||||
by_alias=True,
|
||||
exclude=excluded_fields,
|
||||
exclude_none=True,
|
||||
)
|
||||
# override the default output from pydantic by calling `to_dict()` of each item in conditions (list)
|
||||
_items = []
|
||||
if self.conditions:
|
||||
for _item_conditions in self.conditions:
|
||||
if _item_conditions:
|
||||
_items.append(_item_conditions.to_dict())
|
||||
_dict['conditions'] = _items
|
||||
# override the default output from pydantic by calling `to_dict()` of each item in current_metrics (list)
|
||||
_items = []
|
||||
if self.current_metrics:
|
||||
for _item_current_metrics in self.current_metrics:
|
||||
if _item_current_metrics:
|
||||
_items.append(_item_current_metrics.to_dict())
|
||||
_dict['currentMetrics'] = _items
|
||||
return _dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||
"""Create an instance of IoK8sApiAutoscalingV2HorizontalPodAutoscalerStatus from a dict"""
|
||||
if obj is None:
|
||||
return None
|
||||
|
||||
if not isinstance(obj, dict):
|
||||
return cls.model_validate(obj)
|
||||
|
||||
_obj = cls.model_validate({
|
||||
"conditions": [IoK8sApiAutoscalingV2HorizontalPodAutoscalerCondition.from_dict(_item) for _item in obj["conditions"]] if obj.get("conditions") is not None else None,
|
||||
"currentMetrics": [IoK8sApiAutoscalingV2MetricStatus.from_dict(_item) for _item in obj["currentMetrics"]] if obj.get("currentMetrics") is not None else None,
|
||||
"currentReplicas": obj.get("currentReplicas"),
|
||||
"desiredReplicas": obj.get("desiredReplicas") if obj.get("desiredReplicas") is not None else 0,
|
||||
"lastScaleTime": obj.get("lastScaleTime"),
|
||||
"observedGeneration": obj.get("observedGeneration")
|
||||
})
|
||||
return _obj
|
||||
|
||||
|
||||
+91
@@ -0,0 +1,91 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
Kubeflow Trainer OpenAPI Spec
|
||||
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
|
||||
The version of the OpenAPI document: unversioned
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
|
||||
Do not edit the class manually.
|
||||
""" # noqa: E501
|
||||
|
||||
|
||||
from __future__ import annotations
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
import json
|
||||
|
||||
from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr
|
||||
from typing import Any, ClassVar, Dict, List
|
||||
from typing import Optional, Set
|
||||
from typing_extensions import Self
|
||||
|
||||
class IoK8sApiAutoscalingV2HPAScalingPolicy(BaseModel):
|
||||
"""
|
||||
HPAScalingPolicy is a single policy which must hold true for a specified past interval.
|
||||
""" # noqa: E501
|
||||
period_seconds: StrictInt = Field(description="periodSeconds specifies the window of time for which the policy should hold true. PeriodSeconds must be greater than zero and less than or equal to 1800 (30 min).", alias="periodSeconds")
|
||||
type: StrictStr = Field(description="type is used to specify the scaling policy.")
|
||||
value: StrictInt = Field(description="value contains the amount of change which is permitted by the policy. It must be greater than zero")
|
||||
__properties: ClassVar[List[str]] = ["periodSeconds", "type", "value"]
|
||||
|
||||
model_config = ConfigDict(
|
||||
populate_by_name=True,
|
||||
validate_assignment=True,
|
||||
protected_namespaces=(),
|
||||
)
|
||||
|
||||
|
||||
def to_str(self) -> str:
|
||||
"""Returns the string representation of the model using alias"""
|
||||
return pprint.pformat(self.model_dump(by_alias=True))
|
||||
|
||||
def to_json(self) -> str:
|
||||
"""Returns the JSON representation of the model using alias"""
|
||||
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
||||
return json.dumps(self.to_dict())
|
||||
|
||||
@classmethod
|
||||
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||
"""Create an instance of IoK8sApiAutoscalingV2HPAScalingPolicy from a JSON string"""
|
||||
return cls.from_dict(json.loads(json_str))
|
||||
|
||||
def to_dict(self) -> Dict[str, Any]:
|
||||
"""Return the dictionary representation of the model using alias.
|
||||
|
||||
This has the following differences from calling pydantic's
|
||||
`self.model_dump(by_alias=True)`:
|
||||
|
||||
* `None` is only added to the output dict for nullable fields that
|
||||
were set at model initialization. Other fields with value `None`
|
||||
are ignored.
|
||||
"""
|
||||
excluded_fields: Set[str] = set([
|
||||
])
|
||||
|
||||
_dict = self.model_dump(
|
||||
by_alias=True,
|
||||
exclude=excluded_fields,
|
||||
exclude_none=True,
|
||||
)
|
||||
return _dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||
"""Create an instance of IoK8sApiAutoscalingV2HPAScalingPolicy from a dict"""
|
||||
if obj is None:
|
||||
return None
|
||||
|
||||
if not isinstance(obj, dict):
|
||||
return cls.model_validate(obj)
|
||||
|
||||
_obj = cls.model_validate({
|
||||
"periodSeconds": obj.get("periodSeconds") if obj.get("periodSeconds") is not None else 0,
|
||||
"type": obj.get("type") if obj.get("type") is not None else '',
|
||||
"value": obj.get("value") if obj.get("value") is not None else 0
|
||||
})
|
||||
return _obj
|
||||
|
||||
|
||||
+99
@@ -0,0 +1,99 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
Kubeflow Trainer OpenAPI Spec
|
||||
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
|
||||
The version of the OpenAPI document: unversioned
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
|
||||
Do not edit the class manually.
|
||||
""" # noqa: E501
|
||||
|
||||
|
||||
from __future__ import annotations
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
import json
|
||||
|
||||
from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr
|
||||
from typing import Any, ClassVar, Dict, List, Optional
|
||||
from kubeflow_trainer_api.models.io_k8s_api_autoscaling_v2_hpa_scaling_policy import IoK8sApiAutoscalingV2HPAScalingPolicy
|
||||
from typing import Optional, Set
|
||||
from typing_extensions import Self
|
||||
|
||||
class IoK8sApiAutoscalingV2HPAScalingRules(BaseModel):
|
||||
"""
|
||||
HPAScalingRules configures the scaling behavior for one direction. These Rules are applied after calculating DesiredReplicas from metrics for the HPA. They can limit the scaling velocity by specifying scaling policies. They can prevent flapping by specifying the stabilization window, so that the number of replicas is not set instantly, instead, the safest value from the stabilization window is chosen.
|
||||
""" # noqa: E501
|
||||
policies: Optional[List[IoK8sApiAutoscalingV2HPAScalingPolicy]] = Field(default=None, description="policies is a list of potential scaling polices which can be used during scaling. At least one policy must be specified, otherwise the HPAScalingRules will be discarded as invalid")
|
||||
select_policy: Optional[StrictStr] = Field(default=None, description="selectPolicy is used to specify which policy should be used. If not set, the default value Max is used.", alias="selectPolicy")
|
||||
stabilization_window_seconds: Optional[StrictInt] = Field(default=None, description="stabilizationWindowSeconds is the number of seconds for which past recommendations should be considered while scaling up or scaling down. StabilizationWindowSeconds must be greater than or equal to zero and less than or equal to 3600 (one hour). If not set, use the default values: - For scale up: 0 (i.e. no stabilization is done). - For scale down: 300 (i.e. the stabilization window is 300 seconds long).", alias="stabilizationWindowSeconds")
|
||||
__properties: ClassVar[List[str]] = ["policies", "selectPolicy", "stabilizationWindowSeconds"]
|
||||
|
||||
model_config = ConfigDict(
|
||||
populate_by_name=True,
|
||||
validate_assignment=True,
|
||||
protected_namespaces=(),
|
||||
)
|
||||
|
||||
|
||||
def to_str(self) -> str:
|
||||
"""Returns the string representation of the model using alias"""
|
||||
return pprint.pformat(self.model_dump(by_alias=True))
|
||||
|
||||
def to_json(self) -> str:
|
||||
"""Returns the JSON representation of the model using alias"""
|
||||
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
||||
return json.dumps(self.to_dict())
|
||||
|
||||
@classmethod
|
||||
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||
"""Create an instance of IoK8sApiAutoscalingV2HPAScalingRules from a JSON string"""
|
||||
return cls.from_dict(json.loads(json_str))
|
||||
|
||||
def to_dict(self) -> Dict[str, Any]:
|
||||
"""Return the dictionary representation of the model using alias.
|
||||
|
||||
This has the following differences from calling pydantic's
|
||||
`self.model_dump(by_alias=True)`:
|
||||
|
||||
* `None` is only added to the output dict for nullable fields that
|
||||
were set at model initialization. Other fields with value `None`
|
||||
are ignored.
|
||||
"""
|
||||
excluded_fields: Set[str] = set([
|
||||
])
|
||||
|
||||
_dict = self.model_dump(
|
||||
by_alias=True,
|
||||
exclude=excluded_fields,
|
||||
exclude_none=True,
|
||||
)
|
||||
# override the default output from pydantic by calling `to_dict()` of each item in policies (list)
|
||||
_items = []
|
||||
if self.policies:
|
||||
for _item_policies in self.policies:
|
||||
if _item_policies:
|
||||
_items.append(_item_policies.to_dict())
|
||||
_dict['policies'] = _items
|
||||
return _dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||
"""Create an instance of IoK8sApiAutoscalingV2HPAScalingRules from a dict"""
|
||||
if obj is None:
|
||||
return None
|
||||
|
||||
if not isinstance(obj, dict):
|
||||
return cls.model_validate(obj)
|
||||
|
||||
_obj = cls.model_validate({
|
||||
"policies": [IoK8sApiAutoscalingV2HPAScalingPolicy.from_dict(_item) for _item in obj["policies"]] if obj.get("policies") is not None else None,
|
||||
"selectPolicy": obj.get("selectPolicy"),
|
||||
"stabilizationWindowSeconds": obj.get("stabilizationWindowSeconds")
|
||||
})
|
||||
return _obj
|
||||
|
||||
|
||||
+93
@@ -0,0 +1,93 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
Kubeflow Trainer OpenAPI Spec
|
||||
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
|
||||
The version of the OpenAPI document: unversioned
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
|
||||
Do not edit the class manually.
|
||||
""" # noqa: E501
|
||||
|
||||
|
||||
from __future__ import annotations
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
import json
|
||||
|
||||
from pydantic import BaseModel, ConfigDict, Field, StrictStr
|
||||
from typing import Any, ClassVar, Dict, List, Optional
|
||||
from kubeflow_trainer_api.models.io_k8s_apimachinery_pkg_apis_meta_v1_label_selector import IoK8sApimachineryPkgApisMetaV1LabelSelector
|
||||
from typing import Optional, Set
|
||||
from typing_extensions import Self
|
||||
|
||||
class IoK8sApiAutoscalingV2MetricIdentifier(BaseModel):
|
||||
"""
|
||||
MetricIdentifier defines the name and optionally selector for a metric
|
||||
""" # noqa: E501
|
||||
name: StrictStr = Field(description="name is the name of the given metric")
|
||||
selector: Optional[IoK8sApimachineryPkgApisMetaV1LabelSelector] = Field(default=None, description="selector is the string-encoded form of a standard kubernetes label selector for the given metric When set, it is passed as an additional parameter to the metrics server for more specific metrics scoping. When unset, just the metricName will be used to gather metrics.")
|
||||
__properties: ClassVar[List[str]] = ["name", "selector"]
|
||||
|
||||
model_config = ConfigDict(
|
||||
populate_by_name=True,
|
||||
validate_assignment=True,
|
||||
protected_namespaces=(),
|
||||
)
|
||||
|
||||
|
||||
def to_str(self) -> str:
|
||||
"""Returns the string representation of the model using alias"""
|
||||
return pprint.pformat(self.model_dump(by_alias=True))
|
||||
|
||||
def to_json(self) -> str:
|
||||
"""Returns the JSON representation of the model using alias"""
|
||||
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
||||
return json.dumps(self.to_dict())
|
||||
|
||||
@classmethod
|
||||
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||
"""Create an instance of IoK8sApiAutoscalingV2MetricIdentifier from a JSON string"""
|
||||
return cls.from_dict(json.loads(json_str))
|
||||
|
||||
def to_dict(self) -> Dict[str, Any]:
|
||||
"""Return the dictionary representation of the model using alias.
|
||||
|
||||
This has the following differences from calling pydantic's
|
||||
`self.model_dump(by_alias=True)`:
|
||||
|
||||
* `None` is only added to the output dict for nullable fields that
|
||||
were set at model initialization. Other fields with value `None`
|
||||
are ignored.
|
||||
"""
|
||||
excluded_fields: Set[str] = set([
|
||||
])
|
||||
|
||||
_dict = self.model_dump(
|
||||
by_alias=True,
|
||||
exclude=excluded_fields,
|
||||
exclude_none=True,
|
||||
)
|
||||
# override the default output from pydantic by calling `to_dict()` of selector
|
||||
if self.selector:
|
||||
_dict['selector'] = self.selector.to_dict()
|
||||
return _dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||
"""Create an instance of IoK8sApiAutoscalingV2MetricIdentifier from a dict"""
|
||||
if obj is None:
|
||||
return None
|
||||
|
||||
if not isinstance(obj, dict):
|
||||
return cls.model_validate(obj)
|
||||
|
||||
_obj = cls.model_validate({
|
||||
"name": obj.get("name") if obj.get("name") is not None else '',
|
||||
"selector": IoK8sApimachineryPkgApisMetaV1LabelSelector.from_dict(obj["selector"]) if obj.get("selector") is not None else None
|
||||
})
|
||||
return _obj
|
||||
|
||||
|
||||
@@ -0,0 +1,117 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
Kubeflow Trainer OpenAPI Spec
|
||||
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
|
||||
The version of the OpenAPI document: unversioned
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
|
||||
Do not edit the class manually.
|
||||
""" # noqa: E501
|
||||
|
||||
|
||||
from __future__ import annotations
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
import json
|
||||
|
||||
from pydantic import BaseModel, ConfigDict, Field, StrictStr
|
||||
from typing import Any, ClassVar, Dict, List, Optional
|
||||
from kubeflow_trainer_api.models.io_k8s_api_autoscaling_v2_container_resource_metric_source import IoK8sApiAutoscalingV2ContainerResourceMetricSource
|
||||
from kubeflow_trainer_api.models.io_k8s_api_autoscaling_v2_external_metric_source import IoK8sApiAutoscalingV2ExternalMetricSource
|
||||
from kubeflow_trainer_api.models.io_k8s_api_autoscaling_v2_object_metric_source import IoK8sApiAutoscalingV2ObjectMetricSource
|
||||
from kubeflow_trainer_api.models.io_k8s_api_autoscaling_v2_pods_metric_source import IoK8sApiAutoscalingV2PodsMetricSource
|
||||
from kubeflow_trainer_api.models.io_k8s_api_autoscaling_v2_resource_metric_source import IoK8sApiAutoscalingV2ResourceMetricSource
|
||||
from typing import Optional, Set
|
||||
from typing_extensions import Self
|
||||
|
||||
class IoK8sApiAutoscalingV2MetricSpec(BaseModel):
|
||||
"""
|
||||
MetricSpec specifies how to scale based on a single metric (only `type` and one other matching field should be set at once).
|
||||
""" # noqa: E501
|
||||
container_resource: Optional[IoK8sApiAutoscalingV2ContainerResourceMetricSource] = Field(default=None, description="containerResource refers to a resource metric (such as those specified in requests and limits) known to Kubernetes describing a single container in each pod of the current scale target (e.g. CPU or memory). Such metrics are built in to Kubernetes, and have special scaling options on top of those available to normal per-pod metrics using the \"pods\" source.", alias="containerResource")
|
||||
external: Optional[IoK8sApiAutoscalingV2ExternalMetricSource] = Field(default=None, description="external refers to a global metric that is not associated with any Kubernetes object. It allows autoscaling based on information coming from components running outside of cluster (for example length of queue in cloud messaging service, or QPS from loadbalancer running outside of cluster).")
|
||||
object: Optional[IoK8sApiAutoscalingV2ObjectMetricSource] = Field(default=None, description="object refers to a metric describing a single kubernetes object (for example, hits-per-second on an Ingress object).")
|
||||
pods: Optional[IoK8sApiAutoscalingV2PodsMetricSource] = Field(default=None, description="pods refers to a metric describing each pod in the current scale target (for example, transactions-processed-per-second). The values will be averaged together before being compared to the target value.")
|
||||
resource: Optional[IoK8sApiAutoscalingV2ResourceMetricSource] = Field(default=None, description="resource refers to a resource metric (such as those specified in requests and limits) known to Kubernetes describing each pod in the current scale target (e.g. CPU or memory). Such metrics are built in to Kubernetes, and have special scaling options on top of those available to normal per-pod metrics using the \"pods\" source.")
|
||||
type: StrictStr = Field(description="type is the type of metric source. It should be one of \"ContainerResource\", \"External\", \"Object\", \"Pods\" or \"Resource\", each mapping to a matching field in the object.")
|
||||
__properties: ClassVar[List[str]] = ["containerResource", "external", "object", "pods", "resource", "type"]
|
||||
|
||||
model_config = ConfigDict(
|
||||
populate_by_name=True,
|
||||
validate_assignment=True,
|
||||
protected_namespaces=(),
|
||||
)
|
||||
|
||||
|
||||
def to_str(self) -> str:
|
||||
"""Returns the string representation of the model using alias"""
|
||||
return pprint.pformat(self.model_dump(by_alias=True))
|
||||
|
||||
def to_json(self) -> str:
|
||||
"""Returns the JSON representation of the model using alias"""
|
||||
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
||||
return json.dumps(self.to_dict())
|
||||
|
||||
@classmethod
|
||||
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||
"""Create an instance of IoK8sApiAutoscalingV2MetricSpec from a JSON string"""
|
||||
return cls.from_dict(json.loads(json_str))
|
||||
|
||||
def to_dict(self) -> Dict[str, Any]:
|
||||
"""Return the dictionary representation of the model using alias.
|
||||
|
||||
This has the following differences from calling pydantic's
|
||||
`self.model_dump(by_alias=True)`:
|
||||
|
||||
* `None` is only added to the output dict for nullable fields that
|
||||
were set at model initialization. Other fields with value `None`
|
||||
are ignored.
|
||||
"""
|
||||
excluded_fields: Set[str] = set([
|
||||
])
|
||||
|
||||
_dict = self.model_dump(
|
||||
by_alias=True,
|
||||
exclude=excluded_fields,
|
||||
exclude_none=True,
|
||||
)
|
||||
# override the default output from pydantic by calling `to_dict()` of container_resource
|
||||
if self.container_resource:
|
||||
_dict['containerResource'] = self.container_resource.to_dict()
|
||||
# override the default output from pydantic by calling `to_dict()` of external
|
||||
if self.external:
|
||||
_dict['external'] = self.external.to_dict()
|
||||
# override the default output from pydantic by calling `to_dict()` of object
|
||||
if self.object:
|
||||
_dict['object'] = self.object.to_dict()
|
||||
# override the default output from pydantic by calling `to_dict()` of pods
|
||||
if self.pods:
|
||||
_dict['pods'] = self.pods.to_dict()
|
||||
# override the default output from pydantic by calling `to_dict()` of resource
|
||||
if self.resource:
|
||||
_dict['resource'] = self.resource.to_dict()
|
||||
return _dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||
"""Create an instance of IoK8sApiAutoscalingV2MetricSpec from a dict"""
|
||||
if obj is None:
|
||||
return None
|
||||
|
||||
if not isinstance(obj, dict):
|
||||
return cls.model_validate(obj)
|
||||
|
||||
_obj = cls.model_validate({
|
||||
"containerResource": IoK8sApiAutoscalingV2ContainerResourceMetricSource.from_dict(obj["containerResource"]) if obj.get("containerResource") is not None else None,
|
||||
"external": IoK8sApiAutoscalingV2ExternalMetricSource.from_dict(obj["external"]) if obj.get("external") is not None else None,
|
||||
"object": IoK8sApiAutoscalingV2ObjectMetricSource.from_dict(obj["object"]) if obj.get("object") is not None else None,
|
||||
"pods": IoK8sApiAutoscalingV2PodsMetricSource.from_dict(obj["pods"]) if obj.get("pods") is not None else None,
|
||||
"resource": IoK8sApiAutoscalingV2ResourceMetricSource.from_dict(obj["resource"]) if obj.get("resource") is not None else None,
|
||||
"type": obj.get("type") if obj.get("type") is not None else ''
|
||||
})
|
||||
return _obj
|
||||
|
||||
|
||||
+117
@@ -0,0 +1,117 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
Kubeflow Trainer OpenAPI Spec
|
||||
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
|
||||
The version of the OpenAPI document: unversioned
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
|
||||
Do not edit the class manually.
|
||||
""" # noqa: E501
|
||||
|
||||
|
||||
from __future__ import annotations
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
import json
|
||||
|
||||
from pydantic import BaseModel, ConfigDict, Field, StrictStr
|
||||
from typing import Any, ClassVar, Dict, List, Optional
|
||||
from kubeflow_trainer_api.models.io_k8s_api_autoscaling_v2_container_resource_metric_status import IoK8sApiAutoscalingV2ContainerResourceMetricStatus
|
||||
from kubeflow_trainer_api.models.io_k8s_api_autoscaling_v2_external_metric_status import IoK8sApiAutoscalingV2ExternalMetricStatus
|
||||
from kubeflow_trainer_api.models.io_k8s_api_autoscaling_v2_object_metric_status import IoK8sApiAutoscalingV2ObjectMetricStatus
|
||||
from kubeflow_trainer_api.models.io_k8s_api_autoscaling_v2_pods_metric_status import IoK8sApiAutoscalingV2PodsMetricStatus
|
||||
from kubeflow_trainer_api.models.io_k8s_api_autoscaling_v2_resource_metric_status import IoK8sApiAutoscalingV2ResourceMetricStatus
|
||||
from typing import Optional, Set
|
||||
from typing_extensions import Self
|
||||
|
||||
class IoK8sApiAutoscalingV2MetricStatus(BaseModel):
|
||||
"""
|
||||
MetricStatus describes the last-read state of a single metric.
|
||||
""" # noqa: E501
|
||||
container_resource: Optional[IoK8sApiAutoscalingV2ContainerResourceMetricStatus] = Field(default=None, description="container resource refers to a resource metric (such as those specified in requests and limits) known to Kubernetes describing a single container in each pod in the current scale target (e.g. CPU or memory). Such metrics are built in to Kubernetes, and have special scaling options on top of those available to normal per-pod metrics using the \"pods\" source.", alias="containerResource")
|
||||
external: Optional[IoK8sApiAutoscalingV2ExternalMetricStatus] = Field(default=None, description="external refers to a global metric that is not associated with any Kubernetes object. It allows autoscaling based on information coming from components running outside of cluster (for example length of queue in cloud messaging service, or QPS from loadbalancer running outside of cluster).")
|
||||
object: Optional[IoK8sApiAutoscalingV2ObjectMetricStatus] = Field(default=None, description="object refers to a metric describing a single kubernetes object (for example, hits-per-second on an Ingress object).")
|
||||
pods: Optional[IoK8sApiAutoscalingV2PodsMetricStatus] = Field(default=None, description="pods refers to a metric describing each pod in the current scale target (for example, transactions-processed-per-second). The values will be averaged together before being compared to the target value.")
|
||||
resource: Optional[IoK8sApiAutoscalingV2ResourceMetricStatus] = Field(default=None, description="resource refers to a resource metric (such as those specified in requests and limits) known to Kubernetes describing each pod in the current scale target (e.g. CPU or memory). Such metrics are built in to Kubernetes, and have special scaling options on top of those available to normal per-pod metrics using the \"pods\" source.")
|
||||
type: StrictStr = Field(description="type is the type of metric source. It will be one of \"ContainerResource\", \"External\", \"Object\", \"Pods\" or \"Resource\", each corresponds to a matching field in the object.")
|
||||
__properties: ClassVar[List[str]] = ["containerResource", "external", "object", "pods", "resource", "type"]
|
||||
|
||||
model_config = ConfigDict(
|
||||
populate_by_name=True,
|
||||
validate_assignment=True,
|
||||
protected_namespaces=(),
|
||||
)
|
||||
|
||||
|
||||
def to_str(self) -> str:
|
||||
"""Returns the string representation of the model using alias"""
|
||||
return pprint.pformat(self.model_dump(by_alias=True))
|
||||
|
||||
def to_json(self) -> str:
|
||||
"""Returns the JSON representation of the model using alias"""
|
||||
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
||||
return json.dumps(self.to_dict())
|
||||
|
||||
@classmethod
|
||||
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||
"""Create an instance of IoK8sApiAutoscalingV2MetricStatus from a JSON string"""
|
||||
return cls.from_dict(json.loads(json_str))
|
||||
|
||||
def to_dict(self) -> Dict[str, Any]:
|
||||
"""Return the dictionary representation of the model using alias.
|
||||
|
||||
This has the following differences from calling pydantic's
|
||||
`self.model_dump(by_alias=True)`:
|
||||
|
||||
* `None` is only added to the output dict for nullable fields that
|
||||
were set at model initialization. Other fields with value `None`
|
||||
are ignored.
|
||||
"""
|
||||
excluded_fields: Set[str] = set([
|
||||
])
|
||||
|
||||
_dict = self.model_dump(
|
||||
by_alias=True,
|
||||
exclude=excluded_fields,
|
||||
exclude_none=True,
|
||||
)
|
||||
# override the default output from pydantic by calling `to_dict()` of container_resource
|
||||
if self.container_resource:
|
||||
_dict['containerResource'] = self.container_resource.to_dict()
|
||||
# override the default output from pydantic by calling `to_dict()` of external
|
||||
if self.external:
|
||||
_dict['external'] = self.external.to_dict()
|
||||
# override the default output from pydantic by calling `to_dict()` of object
|
||||
if self.object:
|
||||
_dict['object'] = self.object.to_dict()
|
||||
# override the default output from pydantic by calling `to_dict()` of pods
|
||||
if self.pods:
|
||||
_dict['pods'] = self.pods.to_dict()
|
||||
# override the default output from pydantic by calling `to_dict()` of resource
|
||||
if self.resource:
|
||||
_dict['resource'] = self.resource.to_dict()
|
||||
return _dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||
"""Create an instance of IoK8sApiAutoscalingV2MetricStatus from a dict"""
|
||||
if obj is None:
|
||||
return None
|
||||
|
||||
if not isinstance(obj, dict):
|
||||
return cls.model_validate(obj)
|
||||
|
||||
_obj = cls.model_validate({
|
||||
"containerResource": IoK8sApiAutoscalingV2ContainerResourceMetricStatus.from_dict(obj["containerResource"]) if obj.get("containerResource") is not None else None,
|
||||
"external": IoK8sApiAutoscalingV2ExternalMetricStatus.from_dict(obj["external"]) if obj.get("external") is not None else None,
|
||||
"object": IoK8sApiAutoscalingV2ObjectMetricStatus.from_dict(obj["object"]) if obj.get("object") is not None else None,
|
||||
"pods": IoK8sApiAutoscalingV2PodsMetricStatus.from_dict(obj["pods"]) if obj.get("pods") is not None else None,
|
||||
"resource": IoK8sApiAutoscalingV2ResourceMetricStatus.from_dict(obj["resource"]) if obj.get("resource") is not None else None,
|
||||
"type": obj.get("type") if obj.get("type") is not None else ''
|
||||
})
|
||||
return _obj
|
||||
|
||||
|
||||
+100
@@ -0,0 +1,100 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
Kubeflow Trainer OpenAPI Spec
|
||||
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
|
||||
The version of the OpenAPI document: unversioned
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
|
||||
Do not edit the class manually.
|
||||
""" # noqa: E501
|
||||
|
||||
|
||||
from __future__ import annotations
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
import json
|
||||
|
||||
from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr
|
||||
from typing import Any, ClassVar, Dict, List, Optional
|
||||
from kubeflow_trainer_api.models.io_k8s_apimachinery_pkg_api_resource_quantity import IoK8sApimachineryPkgApiResourceQuantity
|
||||
from typing import Optional, Set
|
||||
from typing_extensions import Self
|
||||
|
||||
class IoK8sApiAutoscalingV2MetricTarget(BaseModel):
|
||||
"""
|
||||
MetricTarget defines the target value, average value, or average utilization of a specific metric
|
||||
""" # noqa: E501
|
||||
average_utilization: Optional[StrictInt] = Field(default=None, description="averageUtilization is the target value of the average of the resource metric across all relevant pods, represented as a percentage of the requested value of the resource for the pods. Currently only valid for Resource metric source type", alias="averageUtilization")
|
||||
average_value: Optional[IoK8sApimachineryPkgApiResourceQuantity] = Field(default=None, description="averageValue is the target value of the average of the metric across all relevant pods (as a quantity)", alias="averageValue")
|
||||
type: StrictStr = Field(description="type represents whether the metric type is Utilization, Value, or AverageValue")
|
||||
value: Optional[IoK8sApimachineryPkgApiResourceQuantity] = Field(default=None, description="value is the target value of the metric (as a quantity).")
|
||||
__properties: ClassVar[List[str]] = ["averageUtilization", "averageValue", "type", "value"]
|
||||
|
||||
model_config = ConfigDict(
|
||||
populate_by_name=True,
|
||||
validate_assignment=True,
|
||||
protected_namespaces=(),
|
||||
)
|
||||
|
||||
|
||||
def to_str(self) -> str:
|
||||
"""Returns the string representation of the model using alias"""
|
||||
return pprint.pformat(self.model_dump(by_alias=True))
|
||||
|
||||
def to_json(self) -> str:
|
||||
"""Returns the JSON representation of the model using alias"""
|
||||
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
||||
return json.dumps(self.to_dict())
|
||||
|
||||
@classmethod
|
||||
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||
"""Create an instance of IoK8sApiAutoscalingV2MetricTarget from a JSON string"""
|
||||
return cls.from_dict(json.loads(json_str))
|
||||
|
||||
def to_dict(self) -> Dict[str, Any]:
|
||||
"""Return the dictionary representation of the model using alias.
|
||||
|
||||
This has the following differences from calling pydantic's
|
||||
`self.model_dump(by_alias=True)`:
|
||||
|
||||
* `None` is only added to the output dict for nullable fields that
|
||||
were set at model initialization. Other fields with value `None`
|
||||
are ignored.
|
||||
"""
|
||||
excluded_fields: Set[str] = set([
|
||||
])
|
||||
|
||||
_dict = self.model_dump(
|
||||
by_alias=True,
|
||||
exclude=excluded_fields,
|
||||
exclude_none=True,
|
||||
)
|
||||
# override the default output from pydantic by calling `to_dict()` of average_value
|
||||
if self.average_value:
|
||||
_dict['averageValue'] = self.average_value.to_dict()
|
||||
# override the default output from pydantic by calling `to_dict()` of value
|
||||
if self.value:
|
||||
_dict['value'] = self.value.to_dict()
|
||||
return _dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||
"""Create an instance of IoK8sApiAutoscalingV2MetricTarget from a dict"""
|
||||
if obj is None:
|
||||
return None
|
||||
|
||||
if not isinstance(obj, dict):
|
||||
return cls.model_validate(obj)
|
||||
|
||||
_obj = cls.model_validate({
|
||||
"averageUtilization": obj.get("averageUtilization"),
|
||||
"averageValue": IoK8sApimachineryPkgApiResourceQuantity.from_dict(obj["averageValue"]) if obj.get("averageValue") is not None else None,
|
||||
"type": obj.get("type") if obj.get("type") is not None else '',
|
||||
"value": IoK8sApimachineryPkgApiResourceQuantity.from_dict(obj["value"]) if obj.get("value") is not None else None
|
||||
})
|
||||
return _obj
|
||||
|
||||
|
||||
+98
@@ -0,0 +1,98 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
Kubeflow Trainer OpenAPI Spec
|
||||
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
|
||||
The version of the OpenAPI document: unversioned
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
|
||||
Do not edit the class manually.
|
||||
""" # noqa: E501
|
||||
|
||||
|
||||
from __future__ import annotations
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
import json
|
||||
|
||||
from pydantic import BaseModel, ConfigDict, Field, StrictInt
|
||||
from typing import Any, ClassVar, Dict, List, Optional
|
||||
from kubeflow_trainer_api.models.io_k8s_apimachinery_pkg_api_resource_quantity import IoK8sApimachineryPkgApiResourceQuantity
|
||||
from typing import Optional, Set
|
||||
from typing_extensions import Self
|
||||
|
||||
class IoK8sApiAutoscalingV2MetricValueStatus(BaseModel):
|
||||
"""
|
||||
MetricValueStatus holds the current value for a metric
|
||||
""" # noqa: E501
|
||||
average_utilization: Optional[StrictInt] = Field(default=None, description="currentAverageUtilization is the current value of the average of the resource metric across all relevant pods, represented as a percentage of the requested value of the resource for the pods.", alias="averageUtilization")
|
||||
average_value: Optional[IoK8sApimachineryPkgApiResourceQuantity] = Field(default=None, description="averageValue is the current value of the average of the metric across all relevant pods (as a quantity)", alias="averageValue")
|
||||
value: Optional[IoK8sApimachineryPkgApiResourceQuantity] = Field(default=None, description="value is the current value of the metric (as a quantity).")
|
||||
__properties: ClassVar[List[str]] = ["averageUtilization", "averageValue", "value"]
|
||||
|
||||
model_config = ConfigDict(
|
||||
populate_by_name=True,
|
||||
validate_assignment=True,
|
||||
protected_namespaces=(),
|
||||
)
|
||||
|
||||
|
||||
def to_str(self) -> str:
|
||||
"""Returns the string representation of the model using alias"""
|
||||
return pprint.pformat(self.model_dump(by_alias=True))
|
||||
|
||||
def to_json(self) -> str:
|
||||
"""Returns the JSON representation of the model using alias"""
|
||||
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
||||
return json.dumps(self.to_dict())
|
||||
|
||||
@classmethod
|
||||
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||
"""Create an instance of IoK8sApiAutoscalingV2MetricValueStatus from a JSON string"""
|
||||
return cls.from_dict(json.loads(json_str))
|
||||
|
||||
def to_dict(self) -> Dict[str, Any]:
|
||||
"""Return the dictionary representation of the model using alias.
|
||||
|
||||
This has the following differences from calling pydantic's
|
||||
`self.model_dump(by_alias=True)`:
|
||||
|
||||
* `None` is only added to the output dict for nullable fields that
|
||||
were set at model initialization. Other fields with value `None`
|
||||
are ignored.
|
||||
"""
|
||||
excluded_fields: Set[str] = set([
|
||||
])
|
||||
|
||||
_dict = self.model_dump(
|
||||
by_alias=True,
|
||||
exclude=excluded_fields,
|
||||
exclude_none=True,
|
||||
)
|
||||
# override the default output from pydantic by calling `to_dict()` of average_value
|
||||
if self.average_value:
|
||||
_dict['averageValue'] = self.average_value.to_dict()
|
||||
# override the default output from pydantic by calling `to_dict()` of value
|
||||
if self.value:
|
||||
_dict['value'] = self.value.to_dict()
|
||||
return _dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||
"""Create an instance of IoK8sApiAutoscalingV2MetricValueStatus from a dict"""
|
||||
if obj is None:
|
||||
return None
|
||||
|
||||
if not isinstance(obj, dict):
|
||||
return cls.model_validate(obj)
|
||||
|
||||
_obj = cls.model_validate({
|
||||
"averageUtilization": obj.get("averageUtilization"),
|
||||
"averageValue": IoK8sApimachineryPkgApiResourceQuantity.from_dict(obj["averageValue"]) if obj.get("averageValue") is not None else None,
|
||||
"value": IoK8sApimachineryPkgApiResourceQuantity.from_dict(obj["value"]) if obj.get("value") is not None else None
|
||||
})
|
||||
return _obj
|
||||
|
||||
|
||||
+103
@@ -0,0 +1,103 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
Kubeflow Trainer OpenAPI Spec
|
||||
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
|
||||
The version of the OpenAPI document: unversioned
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
|
||||
Do not edit the class manually.
|
||||
""" # noqa: E501
|
||||
|
||||
|
||||
from __future__ import annotations
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
import json
|
||||
|
||||
from pydantic import BaseModel, ConfigDict, Field
|
||||
from typing import Any, ClassVar, Dict, List
|
||||
from kubeflow_trainer_api.models.io_k8s_api_autoscaling_v2_cross_version_object_reference import IoK8sApiAutoscalingV2CrossVersionObjectReference
|
||||
from kubeflow_trainer_api.models.io_k8s_api_autoscaling_v2_metric_identifier import IoK8sApiAutoscalingV2MetricIdentifier
|
||||
from kubeflow_trainer_api.models.io_k8s_api_autoscaling_v2_metric_target import IoK8sApiAutoscalingV2MetricTarget
|
||||
from typing import Optional, Set
|
||||
from typing_extensions import Self
|
||||
|
||||
class IoK8sApiAutoscalingV2ObjectMetricSource(BaseModel):
|
||||
"""
|
||||
ObjectMetricSource indicates how to scale on a metric describing a kubernetes object (for example, hits-per-second on an Ingress object).
|
||||
""" # noqa: E501
|
||||
described_object: IoK8sApiAutoscalingV2CrossVersionObjectReference = Field(description="describedObject specifies the descriptions of a object,such as kind,name apiVersion", alias="describedObject")
|
||||
metric: IoK8sApiAutoscalingV2MetricIdentifier = Field(description="metric identifies the target metric by name and selector")
|
||||
target: IoK8sApiAutoscalingV2MetricTarget = Field(description="target specifies the target value for the given metric")
|
||||
__properties: ClassVar[List[str]] = ["describedObject", "metric", "target"]
|
||||
|
||||
model_config = ConfigDict(
|
||||
populate_by_name=True,
|
||||
validate_assignment=True,
|
||||
protected_namespaces=(),
|
||||
)
|
||||
|
||||
|
||||
def to_str(self) -> str:
|
||||
"""Returns the string representation of the model using alias"""
|
||||
return pprint.pformat(self.model_dump(by_alias=True))
|
||||
|
||||
def to_json(self) -> str:
|
||||
"""Returns the JSON representation of the model using alias"""
|
||||
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
||||
return json.dumps(self.to_dict())
|
||||
|
||||
@classmethod
|
||||
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||
"""Create an instance of IoK8sApiAutoscalingV2ObjectMetricSource from a JSON string"""
|
||||
return cls.from_dict(json.loads(json_str))
|
||||
|
||||
def to_dict(self) -> Dict[str, Any]:
|
||||
"""Return the dictionary representation of the model using alias.
|
||||
|
||||
This has the following differences from calling pydantic's
|
||||
`self.model_dump(by_alias=True)`:
|
||||
|
||||
* `None` is only added to the output dict for nullable fields that
|
||||
were set at model initialization. Other fields with value `None`
|
||||
are ignored.
|
||||
"""
|
||||
excluded_fields: Set[str] = set([
|
||||
])
|
||||
|
||||
_dict = self.model_dump(
|
||||
by_alias=True,
|
||||
exclude=excluded_fields,
|
||||
exclude_none=True,
|
||||
)
|
||||
# override the default output from pydantic by calling `to_dict()` of described_object
|
||||
if self.described_object:
|
||||
_dict['describedObject'] = self.described_object.to_dict()
|
||||
# override the default output from pydantic by calling `to_dict()` of metric
|
||||
if self.metric:
|
||||
_dict['metric'] = self.metric.to_dict()
|
||||
# override the default output from pydantic by calling `to_dict()` of target
|
||||
if self.target:
|
||||
_dict['target'] = self.target.to_dict()
|
||||
return _dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||
"""Create an instance of IoK8sApiAutoscalingV2ObjectMetricSource from a dict"""
|
||||
if obj is None:
|
||||
return None
|
||||
|
||||
if not isinstance(obj, dict):
|
||||
return cls.model_validate(obj)
|
||||
|
||||
_obj = cls.model_validate({
|
||||
"describedObject": IoK8sApiAutoscalingV2CrossVersionObjectReference.from_dict(obj["describedObject"]) if obj.get("describedObject") is not None else None,
|
||||
"metric": IoK8sApiAutoscalingV2MetricIdentifier.from_dict(obj["metric"]) if obj.get("metric") is not None else None,
|
||||
"target": IoK8sApiAutoscalingV2MetricTarget.from_dict(obj["target"]) if obj.get("target") is not None else None
|
||||
})
|
||||
return _obj
|
||||
|
||||
|
||||
+103
@@ -0,0 +1,103 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
Kubeflow Trainer OpenAPI Spec
|
||||
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
|
||||
The version of the OpenAPI document: unversioned
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
|
||||
Do not edit the class manually.
|
||||
""" # noqa: E501
|
||||
|
||||
|
||||
from __future__ import annotations
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
import json
|
||||
|
||||
from pydantic import BaseModel, ConfigDict, Field
|
||||
from typing import Any, ClassVar, Dict, List
|
||||
from kubeflow_trainer_api.models.io_k8s_api_autoscaling_v2_cross_version_object_reference import IoK8sApiAutoscalingV2CrossVersionObjectReference
|
||||
from kubeflow_trainer_api.models.io_k8s_api_autoscaling_v2_metric_identifier import IoK8sApiAutoscalingV2MetricIdentifier
|
||||
from kubeflow_trainer_api.models.io_k8s_api_autoscaling_v2_metric_value_status import IoK8sApiAutoscalingV2MetricValueStatus
|
||||
from typing import Optional, Set
|
||||
from typing_extensions import Self
|
||||
|
||||
class IoK8sApiAutoscalingV2ObjectMetricStatus(BaseModel):
|
||||
"""
|
||||
ObjectMetricStatus indicates the current value of a metric describing a kubernetes object (for example, hits-per-second on an Ingress object).
|
||||
""" # noqa: E501
|
||||
current: IoK8sApiAutoscalingV2MetricValueStatus = Field(description="current contains the current value for the given metric")
|
||||
described_object: IoK8sApiAutoscalingV2CrossVersionObjectReference = Field(description="DescribedObject specifies the descriptions of a object,such as kind,name apiVersion", alias="describedObject")
|
||||
metric: IoK8sApiAutoscalingV2MetricIdentifier = Field(description="metric identifies the target metric by name and selector")
|
||||
__properties: ClassVar[List[str]] = ["current", "describedObject", "metric"]
|
||||
|
||||
model_config = ConfigDict(
|
||||
populate_by_name=True,
|
||||
validate_assignment=True,
|
||||
protected_namespaces=(),
|
||||
)
|
||||
|
||||
|
||||
def to_str(self) -> str:
|
||||
"""Returns the string representation of the model using alias"""
|
||||
return pprint.pformat(self.model_dump(by_alias=True))
|
||||
|
||||
def to_json(self) -> str:
|
||||
"""Returns the JSON representation of the model using alias"""
|
||||
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
||||
return json.dumps(self.to_dict())
|
||||
|
||||
@classmethod
|
||||
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||
"""Create an instance of IoK8sApiAutoscalingV2ObjectMetricStatus from a JSON string"""
|
||||
return cls.from_dict(json.loads(json_str))
|
||||
|
||||
def to_dict(self) -> Dict[str, Any]:
|
||||
"""Return the dictionary representation of the model using alias.
|
||||
|
||||
This has the following differences from calling pydantic's
|
||||
`self.model_dump(by_alias=True)`:
|
||||
|
||||
* `None` is only added to the output dict for nullable fields that
|
||||
were set at model initialization. Other fields with value `None`
|
||||
are ignored.
|
||||
"""
|
||||
excluded_fields: Set[str] = set([
|
||||
])
|
||||
|
||||
_dict = self.model_dump(
|
||||
by_alias=True,
|
||||
exclude=excluded_fields,
|
||||
exclude_none=True,
|
||||
)
|
||||
# override the default output from pydantic by calling `to_dict()` of current
|
||||
if self.current:
|
||||
_dict['current'] = self.current.to_dict()
|
||||
# override the default output from pydantic by calling `to_dict()` of described_object
|
||||
if self.described_object:
|
||||
_dict['describedObject'] = self.described_object.to_dict()
|
||||
# override the default output from pydantic by calling `to_dict()` of metric
|
||||
if self.metric:
|
||||
_dict['metric'] = self.metric.to_dict()
|
||||
return _dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||
"""Create an instance of IoK8sApiAutoscalingV2ObjectMetricStatus from a dict"""
|
||||
if obj is None:
|
||||
return None
|
||||
|
||||
if not isinstance(obj, dict):
|
||||
return cls.model_validate(obj)
|
||||
|
||||
_obj = cls.model_validate({
|
||||
"current": IoK8sApiAutoscalingV2MetricValueStatus.from_dict(obj["current"]) if obj.get("current") is not None else None,
|
||||
"describedObject": IoK8sApiAutoscalingV2CrossVersionObjectReference.from_dict(obj["describedObject"]) if obj.get("describedObject") is not None else None,
|
||||
"metric": IoK8sApiAutoscalingV2MetricIdentifier.from_dict(obj["metric"]) if obj.get("metric") is not None else None
|
||||
})
|
||||
return _obj
|
||||
|
||||
|
||||
+97
@@ -0,0 +1,97 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
Kubeflow Trainer OpenAPI Spec
|
||||
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
|
||||
The version of the OpenAPI document: unversioned
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
|
||||
Do not edit the class manually.
|
||||
""" # noqa: E501
|
||||
|
||||
|
||||
from __future__ import annotations
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
import json
|
||||
|
||||
from pydantic import BaseModel, ConfigDict, Field
|
||||
from typing import Any, ClassVar, Dict, List
|
||||
from kubeflow_trainer_api.models.io_k8s_api_autoscaling_v2_metric_identifier import IoK8sApiAutoscalingV2MetricIdentifier
|
||||
from kubeflow_trainer_api.models.io_k8s_api_autoscaling_v2_metric_target import IoK8sApiAutoscalingV2MetricTarget
|
||||
from typing import Optional, Set
|
||||
from typing_extensions import Self
|
||||
|
||||
class IoK8sApiAutoscalingV2PodsMetricSource(BaseModel):
|
||||
"""
|
||||
PodsMetricSource indicates how to scale on a metric describing each pod in the current scale target (for example, transactions-processed-per-second). The values will be averaged together before being compared to the target value.
|
||||
""" # noqa: E501
|
||||
metric: IoK8sApiAutoscalingV2MetricIdentifier = Field(description="metric identifies the target metric by name and selector")
|
||||
target: IoK8sApiAutoscalingV2MetricTarget = Field(description="target specifies the target value for the given metric")
|
||||
__properties: ClassVar[List[str]] = ["metric", "target"]
|
||||
|
||||
model_config = ConfigDict(
|
||||
populate_by_name=True,
|
||||
validate_assignment=True,
|
||||
protected_namespaces=(),
|
||||
)
|
||||
|
||||
|
||||
def to_str(self) -> str:
|
||||
"""Returns the string representation of the model using alias"""
|
||||
return pprint.pformat(self.model_dump(by_alias=True))
|
||||
|
||||
def to_json(self) -> str:
|
||||
"""Returns the JSON representation of the model using alias"""
|
||||
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
||||
return json.dumps(self.to_dict())
|
||||
|
||||
@classmethod
|
||||
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||
"""Create an instance of IoK8sApiAutoscalingV2PodsMetricSource from a JSON string"""
|
||||
return cls.from_dict(json.loads(json_str))
|
||||
|
||||
def to_dict(self) -> Dict[str, Any]:
|
||||
"""Return the dictionary representation of the model using alias.
|
||||
|
||||
This has the following differences from calling pydantic's
|
||||
`self.model_dump(by_alias=True)`:
|
||||
|
||||
* `None` is only added to the output dict for nullable fields that
|
||||
were set at model initialization. Other fields with value `None`
|
||||
are ignored.
|
||||
"""
|
||||
excluded_fields: Set[str] = set([
|
||||
])
|
||||
|
||||
_dict = self.model_dump(
|
||||
by_alias=True,
|
||||
exclude=excluded_fields,
|
||||
exclude_none=True,
|
||||
)
|
||||
# override the default output from pydantic by calling `to_dict()` of metric
|
||||
if self.metric:
|
||||
_dict['metric'] = self.metric.to_dict()
|
||||
# override the default output from pydantic by calling `to_dict()` of target
|
||||
if self.target:
|
||||
_dict['target'] = self.target.to_dict()
|
||||
return _dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||
"""Create an instance of IoK8sApiAutoscalingV2PodsMetricSource from a dict"""
|
||||
if obj is None:
|
||||
return None
|
||||
|
||||
if not isinstance(obj, dict):
|
||||
return cls.model_validate(obj)
|
||||
|
||||
_obj = cls.model_validate({
|
||||
"metric": IoK8sApiAutoscalingV2MetricIdentifier.from_dict(obj["metric"]) if obj.get("metric") is not None else None,
|
||||
"target": IoK8sApiAutoscalingV2MetricTarget.from_dict(obj["target"]) if obj.get("target") is not None else None
|
||||
})
|
||||
return _obj
|
||||
|
||||
|
||||
+97
@@ -0,0 +1,97 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
Kubeflow Trainer OpenAPI Spec
|
||||
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
|
||||
The version of the OpenAPI document: unversioned
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
|
||||
Do not edit the class manually.
|
||||
""" # noqa: E501
|
||||
|
||||
|
||||
from __future__ import annotations
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
import json
|
||||
|
||||
from pydantic import BaseModel, ConfigDict, Field
|
||||
from typing import Any, ClassVar, Dict, List
|
||||
from kubeflow_trainer_api.models.io_k8s_api_autoscaling_v2_metric_identifier import IoK8sApiAutoscalingV2MetricIdentifier
|
||||
from kubeflow_trainer_api.models.io_k8s_api_autoscaling_v2_metric_value_status import IoK8sApiAutoscalingV2MetricValueStatus
|
||||
from typing import Optional, Set
|
||||
from typing_extensions import Self
|
||||
|
||||
class IoK8sApiAutoscalingV2PodsMetricStatus(BaseModel):
|
||||
"""
|
||||
PodsMetricStatus indicates the current value of a metric describing each pod in the current scale target (for example, transactions-processed-per-second).
|
||||
""" # noqa: E501
|
||||
current: IoK8sApiAutoscalingV2MetricValueStatus = Field(description="current contains the current value for the given metric")
|
||||
metric: IoK8sApiAutoscalingV2MetricIdentifier = Field(description="metric identifies the target metric by name and selector")
|
||||
__properties: ClassVar[List[str]] = ["current", "metric"]
|
||||
|
||||
model_config = ConfigDict(
|
||||
populate_by_name=True,
|
||||
validate_assignment=True,
|
||||
protected_namespaces=(),
|
||||
)
|
||||
|
||||
|
||||
def to_str(self) -> str:
|
||||
"""Returns the string representation of the model using alias"""
|
||||
return pprint.pformat(self.model_dump(by_alias=True))
|
||||
|
||||
def to_json(self) -> str:
|
||||
"""Returns the JSON representation of the model using alias"""
|
||||
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
||||
return json.dumps(self.to_dict())
|
||||
|
||||
@classmethod
|
||||
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||
"""Create an instance of IoK8sApiAutoscalingV2PodsMetricStatus from a JSON string"""
|
||||
return cls.from_dict(json.loads(json_str))
|
||||
|
||||
def to_dict(self) -> Dict[str, Any]:
|
||||
"""Return the dictionary representation of the model using alias.
|
||||
|
||||
This has the following differences from calling pydantic's
|
||||
`self.model_dump(by_alias=True)`:
|
||||
|
||||
* `None` is only added to the output dict for nullable fields that
|
||||
were set at model initialization. Other fields with value `None`
|
||||
are ignored.
|
||||
"""
|
||||
excluded_fields: Set[str] = set([
|
||||
])
|
||||
|
||||
_dict = self.model_dump(
|
||||
by_alias=True,
|
||||
exclude=excluded_fields,
|
||||
exclude_none=True,
|
||||
)
|
||||
# override the default output from pydantic by calling `to_dict()` of current
|
||||
if self.current:
|
||||
_dict['current'] = self.current.to_dict()
|
||||
# override the default output from pydantic by calling `to_dict()` of metric
|
||||
if self.metric:
|
||||
_dict['metric'] = self.metric.to_dict()
|
||||
return _dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||
"""Create an instance of IoK8sApiAutoscalingV2PodsMetricStatus from a dict"""
|
||||
if obj is None:
|
||||
return None
|
||||
|
||||
if not isinstance(obj, dict):
|
||||
return cls.model_validate(obj)
|
||||
|
||||
_obj = cls.model_validate({
|
||||
"current": IoK8sApiAutoscalingV2MetricValueStatus.from_dict(obj["current"]) if obj.get("current") is not None else None,
|
||||
"metric": IoK8sApiAutoscalingV2MetricIdentifier.from_dict(obj["metric"]) if obj.get("metric") is not None else None
|
||||
})
|
||||
return _obj
|
||||
|
||||
|
||||
+93
@@ -0,0 +1,93 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
Kubeflow Trainer OpenAPI Spec
|
||||
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
|
||||
The version of the OpenAPI document: unversioned
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
|
||||
Do not edit the class manually.
|
||||
""" # noqa: E501
|
||||
|
||||
|
||||
from __future__ import annotations
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
import json
|
||||
|
||||
from pydantic import BaseModel, ConfigDict, Field, StrictStr
|
||||
from typing import Any, ClassVar, Dict, List
|
||||
from kubeflow_trainer_api.models.io_k8s_api_autoscaling_v2_metric_target import IoK8sApiAutoscalingV2MetricTarget
|
||||
from typing import Optional, Set
|
||||
from typing_extensions import Self
|
||||
|
||||
class IoK8sApiAutoscalingV2ResourceMetricSource(BaseModel):
|
||||
"""
|
||||
ResourceMetricSource indicates how to scale on a resource metric known to Kubernetes, as specified in requests and limits, describing each pod in the current scale target (e.g. CPU or memory). The values will be averaged together before being compared to the target. Such metrics are built in to Kubernetes, and have special scaling options on top of those available to normal per-pod metrics using the \"pods\" source. Only one \"target\" type should be set.
|
||||
""" # noqa: E501
|
||||
name: StrictStr = Field(description="name is the name of the resource in question.")
|
||||
target: IoK8sApiAutoscalingV2MetricTarget = Field(description="target specifies the target value for the given metric")
|
||||
__properties: ClassVar[List[str]] = ["name", "target"]
|
||||
|
||||
model_config = ConfigDict(
|
||||
populate_by_name=True,
|
||||
validate_assignment=True,
|
||||
protected_namespaces=(),
|
||||
)
|
||||
|
||||
|
||||
def to_str(self) -> str:
|
||||
"""Returns the string representation of the model using alias"""
|
||||
return pprint.pformat(self.model_dump(by_alias=True))
|
||||
|
||||
def to_json(self) -> str:
|
||||
"""Returns the JSON representation of the model using alias"""
|
||||
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
||||
return json.dumps(self.to_dict())
|
||||
|
||||
@classmethod
|
||||
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||
"""Create an instance of IoK8sApiAutoscalingV2ResourceMetricSource from a JSON string"""
|
||||
return cls.from_dict(json.loads(json_str))
|
||||
|
||||
def to_dict(self) -> Dict[str, Any]:
|
||||
"""Return the dictionary representation of the model using alias.
|
||||
|
||||
This has the following differences from calling pydantic's
|
||||
`self.model_dump(by_alias=True)`:
|
||||
|
||||
* `None` is only added to the output dict for nullable fields that
|
||||
were set at model initialization. Other fields with value `None`
|
||||
are ignored.
|
||||
"""
|
||||
excluded_fields: Set[str] = set([
|
||||
])
|
||||
|
||||
_dict = self.model_dump(
|
||||
by_alias=True,
|
||||
exclude=excluded_fields,
|
||||
exclude_none=True,
|
||||
)
|
||||
# override the default output from pydantic by calling `to_dict()` of target
|
||||
if self.target:
|
||||
_dict['target'] = self.target.to_dict()
|
||||
return _dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||
"""Create an instance of IoK8sApiAutoscalingV2ResourceMetricSource from a dict"""
|
||||
if obj is None:
|
||||
return None
|
||||
|
||||
if not isinstance(obj, dict):
|
||||
return cls.model_validate(obj)
|
||||
|
||||
_obj = cls.model_validate({
|
||||
"name": obj.get("name") if obj.get("name") is not None else '',
|
||||
"target": IoK8sApiAutoscalingV2MetricTarget.from_dict(obj["target"]) if obj.get("target") is not None else None
|
||||
})
|
||||
return _obj
|
||||
|
||||
|
||||
+93
@@ -0,0 +1,93 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
Kubeflow Trainer OpenAPI Spec
|
||||
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
|
||||
The version of the OpenAPI document: unversioned
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
|
||||
Do not edit the class manually.
|
||||
""" # noqa: E501
|
||||
|
||||
|
||||
from __future__ import annotations
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
import json
|
||||
|
||||
from pydantic import BaseModel, ConfigDict, Field, StrictStr
|
||||
from typing import Any, ClassVar, Dict, List
|
||||
from kubeflow_trainer_api.models.io_k8s_api_autoscaling_v2_metric_value_status import IoK8sApiAutoscalingV2MetricValueStatus
|
||||
from typing import Optional, Set
|
||||
from typing_extensions import Self
|
||||
|
||||
class IoK8sApiAutoscalingV2ResourceMetricStatus(BaseModel):
|
||||
"""
|
||||
ResourceMetricStatus indicates the current value of a resource metric known to Kubernetes, as specified in requests and limits, describing each pod in the current scale target (e.g. CPU or memory). Such metrics are built in to Kubernetes, and have special scaling options on top of those available to normal per-pod metrics using the \"pods\" source.
|
||||
""" # noqa: E501
|
||||
current: IoK8sApiAutoscalingV2MetricValueStatus = Field(description="current contains the current value for the given metric")
|
||||
name: StrictStr = Field(description="name is the name of the resource in question.")
|
||||
__properties: ClassVar[List[str]] = ["current", "name"]
|
||||
|
||||
model_config = ConfigDict(
|
||||
populate_by_name=True,
|
||||
validate_assignment=True,
|
||||
protected_namespaces=(),
|
||||
)
|
||||
|
||||
|
||||
def to_str(self) -> str:
|
||||
"""Returns the string representation of the model using alias"""
|
||||
return pprint.pformat(self.model_dump(by_alias=True))
|
||||
|
||||
def to_json(self) -> str:
|
||||
"""Returns the JSON representation of the model using alias"""
|
||||
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
||||
return json.dumps(self.to_dict())
|
||||
|
||||
@classmethod
|
||||
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||
"""Create an instance of IoK8sApiAutoscalingV2ResourceMetricStatus from a JSON string"""
|
||||
return cls.from_dict(json.loads(json_str))
|
||||
|
||||
def to_dict(self) -> Dict[str, Any]:
|
||||
"""Return the dictionary representation of the model using alias.
|
||||
|
||||
This has the following differences from calling pydantic's
|
||||
`self.model_dump(by_alias=True)`:
|
||||
|
||||
* `None` is only added to the output dict for nullable fields that
|
||||
were set at model initialization. Other fields with value `None`
|
||||
are ignored.
|
||||
"""
|
||||
excluded_fields: Set[str] = set([
|
||||
])
|
||||
|
||||
_dict = self.model_dump(
|
||||
by_alias=True,
|
||||
exclude=excluded_fields,
|
||||
exclude_none=True,
|
||||
)
|
||||
# override the default output from pydantic by calling `to_dict()` of current
|
||||
if self.current:
|
||||
_dict['current'] = self.current.to_dict()
|
||||
return _dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||
"""Create an instance of IoK8sApiAutoscalingV2ResourceMetricStatus from a dict"""
|
||||
if obj is None:
|
||||
return None
|
||||
|
||||
if not isinstance(obj, dict):
|
||||
return cls.model_validate(obj)
|
||||
|
||||
_obj = cls.model_validate({
|
||||
"current": IoK8sApiAutoscalingV2MetricValueStatus.from_dict(obj["current"]) if obj.get("current") is not None else None,
|
||||
"name": obj.get("name") if obj.get("name") is not None else ''
|
||||
})
|
||||
return _obj
|
||||
|
||||
|
||||
@@ -0,0 +1,107 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
Kubeflow Trainer OpenAPI Spec
|
||||
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
|
||||
The version of the OpenAPI document: unversioned
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
|
||||
Do not edit the class manually.
|
||||
""" # noqa: E501
|
||||
|
||||
|
||||
from __future__ import annotations
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
import json
|
||||
|
||||
from pydantic import BaseModel, ConfigDict, Field, StrictStr
|
||||
from typing import Any, ClassVar, Dict, List, Optional
|
||||
from kubeflow_trainer_api.models.io_k8s_api_batch_v1_cron_job_spec import IoK8sApiBatchV1CronJobSpec
|
||||
from kubeflow_trainer_api.models.io_k8s_api_batch_v1_cron_job_status import IoK8sApiBatchV1CronJobStatus
|
||||
from kubeflow_trainer_api.models.io_k8s_apimachinery_pkg_apis_meta_v1_object_meta import IoK8sApimachineryPkgApisMetaV1ObjectMeta
|
||||
from typing import Optional, Set
|
||||
from typing_extensions import Self
|
||||
|
||||
class IoK8sApiBatchV1CronJob(BaseModel):
|
||||
"""
|
||||
CronJob represents the configuration of a single cron job.
|
||||
""" # noqa: E501
|
||||
api_version: Optional[StrictStr] = Field(default=None, description="APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", alias="apiVersion")
|
||||
kind: Optional[StrictStr] = Field(default=None, description="Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds")
|
||||
metadata: Optional[IoK8sApimachineryPkgApisMetaV1ObjectMeta] = Field(default=None, description="Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata")
|
||||
spec: Optional[IoK8sApiBatchV1CronJobSpec] = Field(default=None, description="Specification of the desired behavior of a cron job, including the schedule. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status")
|
||||
status: Optional[IoK8sApiBatchV1CronJobStatus] = Field(default=None, description="Current status of a cron job. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status")
|
||||
__properties: ClassVar[List[str]] = ["apiVersion", "kind", "metadata", "spec", "status"]
|
||||
|
||||
model_config = ConfigDict(
|
||||
populate_by_name=True,
|
||||
validate_assignment=True,
|
||||
protected_namespaces=(),
|
||||
)
|
||||
|
||||
|
||||
def to_str(self) -> str:
|
||||
"""Returns the string representation of the model using alias"""
|
||||
return pprint.pformat(self.model_dump(by_alias=True))
|
||||
|
||||
def to_json(self) -> str:
|
||||
"""Returns the JSON representation of the model using alias"""
|
||||
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
||||
return json.dumps(self.to_dict())
|
||||
|
||||
@classmethod
|
||||
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||
"""Create an instance of IoK8sApiBatchV1CronJob from a JSON string"""
|
||||
return cls.from_dict(json.loads(json_str))
|
||||
|
||||
def to_dict(self) -> Dict[str, Any]:
|
||||
"""Return the dictionary representation of the model using alias.
|
||||
|
||||
This has the following differences from calling pydantic's
|
||||
`self.model_dump(by_alias=True)`:
|
||||
|
||||
* `None` is only added to the output dict for nullable fields that
|
||||
were set at model initialization. Other fields with value `None`
|
||||
are ignored.
|
||||
"""
|
||||
excluded_fields: Set[str] = set([
|
||||
])
|
||||
|
||||
_dict = self.model_dump(
|
||||
by_alias=True,
|
||||
exclude=excluded_fields,
|
||||
exclude_none=True,
|
||||
)
|
||||
# override the default output from pydantic by calling `to_dict()` of metadata
|
||||
if self.metadata:
|
||||
_dict['metadata'] = self.metadata.to_dict()
|
||||
# override the default output from pydantic by calling `to_dict()` of spec
|
||||
if self.spec:
|
||||
_dict['spec'] = self.spec.to_dict()
|
||||
# override the default output from pydantic by calling `to_dict()` of status
|
||||
if self.status:
|
||||
_dict['status'] = self.status.to_dict()
|
||||
return _dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||
"""Create an instance of IoK8sApiBatchV1CronJob from a dict"""
|
||||
if obj is None:
|
||||
return None
|
||||
|
||||
if not isinstance(obj, dict):
|
||||
return cls.model_validate(obj)
|
||||
|
||||
_obj = cls.model_validate({
|
||||
"apiVersion": obj.get("apiVersion"),
|
||||
"kind": obj.get("kind"),
|
||||
"metadata": IoK8sApimachineryPkgApisMetaV1ObjectMeta.from_dict(obj["metadata"]) if obj.get("metadata") is not None else None,
|
||||
"spec": IoK8sApiBatchV1CronJobSpec.from_dict(obj["spec"]) if obj.get("spec") is not None else None,
|
||||
"status": IoK8sApiBatchV1CronJobStatus.from_dict(obj["status"]) if obj.get("status") is not None else None
|
||||
})
|
||||
return _obj
|
||||
|
||||
|
||||
@@ -0,0 +1,105 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
Kubeflow Trainer OpenAPI Spec
|
||||
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
|
||||
The version of the OpenAPI document: unversioned
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
|
||||
Do not edit the class manually.
|
||||
""" # noqa: E501
|
||||
|
||||
|
||||
from __future__ import annotations
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
import json
|
||||
|
||||
from pydantic import BaseModel, ConfigDict, Field, StrictStr
|
||||
from typing import Any, ClassVar, Dict, List, Optional
|
||||
from kubeflow_trainer_api.models.io_k8s_api_batch_v1_cron_job import IoK8sApiBatchV1CronJob
|
||||
from kubeflow_trainer_api.models.io_k8s_apimachinery_pkg_apis_meta_v1_list_meta import IoK8sApimachineryPkgApisMetaV1ListMeta
|
||||
from typing import Optional, Set
|
||||
from typing_extensions import Self
|
||||
|
||||
class IoK8sApiBatchV1CronJobList(BaseModel):
|
||||
"""
|
||||
CronJobList is a collection of cron jobs.
|
||||
""" # noqa: E501
|
||||
api_version: Optional[StrictStr] = Field(default=None, description="APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", alias="apiVersion")
|
||||
items: List[IoK8sApiBatchV1CronJob] = Field(description="items is the list of CronJobs.")
|
||||
kind: Optional[StrictStr] = Field(default=None, description="Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds")
|
||||
metadata: Optional[IoK8sApimachineryPkgApisMetaV1ListMeta] = Field(default=None, description="Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata")
|
||||
__properties: ClassVar[List[str]] = ["apiVersion", "items", "kind", "metadata"]
|
||||
|
||||
model_config = ConfigDict(
|
||||
populate_by_name=True,
|
||||
validate_assignment=True,
|
||||
protected_namespaces=(),
|
||||
)
|
||||
|
||||
|
||||
def to_str(self) -> str:
|
||||
"""Returns the string representation of the model using alias"""
|
||||
return pprint.pformat(self.model_dump(by_alias=True))
|
||||
|
||||
def to_json(self) -> str:
|
||||
"""Returns the JSON representation of the model using alias"""
|
||||
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
||||
return json.dumps(self.to_dict())
|
||||
|
||||
@classmethod
|
||||
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||
"""Create an instance of IoK8sApiBatchV1CronJobList from a JSON string"""
|
||||
return cls.from_dict(json.loads(json_str))
|
||||
|
||||
def to_dict(self) -> Dict[str, Any]:
|
||||
"""Return the dictionary representation of the model using alias.
|
||||
|
||||
This has the following differences from calling pydantic's
|
||||
`self.model_dump(by_alias=True)`:
|
||||
|
||||
* `None` is only added to the output dict for nullable fields that
|
||||
were set at model initialization. Other fields with value `None`
|
||||
are ignored.
|
||||
"""
|
||||
excluded_fields: Set[str] = set([
|
||||
])
|
||||
|
||||
_dict = self.model_dump(
|
||||
by_alias=True,
|
||||
exclude=excluded_fields,
|
||||
exclude_none=True,
|
||||
)
|
||||
# override the default output from pydantic by calling `to_dict()` of each item in items (list)
|
||||
_items = []
|
||||
if self.items:
|
||||
for _item_items in self.items:
|
||||
if _item_items:
|
||||
_items.append(_item_items.to_dict())
|
||||
_dict['items'] = _items
|
||||
# override the default output from pydantic by calling `to_dict()` of metadata
|
||||
if self.metadata:
|
||||
_dict['metadata'] = self.metadata.to_dict()
|
||||
return _dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||
"""Create an instance of IoK8sApiBatchV1CronJobList from a dict"""
|
||||
if obj is None:
|
||||
return None
|
||||
|
||||
if not isinstance(obj, dict):
|
||||
return cls.model_validate(obj)
|
||||
|
||||
_obj = cls.model_validate({
|
||||
"apiVersion": obj.get("apiVersion"),
|
||||
"items": [IoK8sApiBatchV1CronJob.from_dict(_item) for _item in obj["items"]] if obj.get("items") is not None else None,
|
||||
"kind": obj.get("kind"),
|
||||
"metadata": IoK8sApimachineryPkgApisMetaV1ListMeta.from_dict(obj["metadata"]) if obj.get("metadata") is not None else None
|
||||
})
|
||||
return _obj
|
||||
|
||||
|
||||
@@ -0,0 +1,115 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
Kubeflow Trainer OpenAPI Spec
|
||||
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
|
||||
The version of the OpenAPI document: unversioned
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
|
||||
Do not edit the class manually.
|
||||
""" # noqa: E501
|
||||
|
||||
|
||||
from __future__ import annotations
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
import json
|
||||
|
||||
from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr, field_validator
|
||||
from typing import Any, ClassVar, Dict, List, Optional
|
||||
from kubeflow_trainer_api.models.io_k8s_api_batch_v1_job_template_spec import IoK8sApiBatchV1JobTemplateSpec
|
||||
from typing import Optional, Set
|
||||
from typing_extensions import Self
|
||||
|
||||
class IoK8sApiBatchV1CronJobSpec(BaseModel):
|
||||
"""
|
||||
CronJobSpec describes how the job execution will look like and when it will actually run.
|
||||
""" # noqa: E501
|
||||
concurrency_policy: Optional[StrictStr] = Field(default=None, description="Specifies how to treat concurrent executions of a Job. Valid values are: - \"Allow\" (default): allows CronJobs to run concurrently; - \"Forbid\": forbids concurrent runs, skipping next run if previous run hasn't finished yet; - \"Replace\": cancels currently running job and replaces it with a new one Possible enum values: - `\"Allow\"` allows CronJobs to run concurrently. - `\"Forbid\"` forbids concurrent runs, skipping next run if previous hasn't finished yet. - `\"Replace\"` cancels currently running job and replaces it with a new one.", alias="concurrencyPolicy")
|
||||
failed_jobs_history_limit: Optional[StrictInt] = Field(default=None, description="The number of failed finished jobs to retain. Value must be non-negative integer. Defaults to 1.", alias="failedJobsHistoryLimit")
|
||||
job_template: IoK8sApiBatchV1JobTemplateSpec = Field(description="Specifies the job that will be created when executing a CronJob.", alias="jobTemplate")
|
||||
schedule: StrictStr = Field(description="The schedule in Cron format, see https://en.wikipedia.org/wiki/Cron.")
|
||||
starting_deadline_seconds: Optional[StrictInt] = Field(default=None, description="Optional deadline in seconds for starting the job if it misses scheduled time for any reason. Missed jobs executions will be counted as failed ones.", alias="startingDeadlineSeconds")
|
||||
successful_jobs_history_limit: Optional[StrictInt] = Field(default=None, description="The number of successful finished jobs to retain. Value must be non-negative integer. Defaults to 3.", alias="successfulJobsHistoryLimit")
|
||||
suspend: Optional[StrictBool] = Field(default=None, description="This flag tells the controller to suspend subsequent executions, it does not apply to already started executions. Defaults to false.")
|
||||
time_zone: Optional[StrictStr] = Field(default=None, description="The time zone name for the given schedule, see https://en.wikipedia.org/wiki/List_of_tz_database_time_zones. If not specified, this will default to the time zone of the kube-controller-manager process. The set of valid time zone names and the time zone offset is loaded from the system-wide time zone database by the API server during CronJob validation and the controller manager during execution. If no system-wide time zone database can be found a bundled version of the database is used instead. If the time zone name becomes invalid during the lifetime of a CronJob or due to a change in host configuration, the controller will stop creating new new Jobs and will create a system event with the reason UnknownTimeZone. More information can be found in https://kubernetes.io/docs/concepts/workloads/controllers/cron-jobs/#time-zones", alias="timeZone")
|
||||
__properties: ClassVar[List[str]] = ["concurrencyPolicy", "failedJobsHistoryLimit", "jobTemplate", "schedule", "startingDeadlineSeconds", "successfulJobsHistoryLimit", "suspend", "timeZone"]
|
||||
|
||||
@field_validator('concurrency_policy')
|
||||
def concurrency_policy_validate_enum(cls, value):
|
||||
"""Validates the enum"""
|
||||
if value is None:
|
||||
return value
|
||||
|
||||
if value not in set(['Allow', 'Forbid', 'Replace']):
|
||||
raise ValueError("must be one of enum values ('Allow', 'Forbid', 'Replace')")
|
||||
return value
|
||||
|
||||
model_config = ConfigDict(
|
||||
populate_by_name=True,
|
||||
validate_assignment=True,
|
||||
protected_namespaces=(),
|
||||
)
|
||||
|
||||
|
||||
def to_str(self) -> str:
|
||||
"""Returns the string representation of the model using alias"""
|
||||
return pprint.pformat(self.model_dump(by_alias=True))
|
||||
|
||||
def to_json(self) -> str:
|
||||
"""Returns the JSON representation of the model using alias"""
|
||||
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
||||
return json.dumps(self.to_dict())
|
||||
|
||||
@classmethod
|
||||
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||
"""Create an instance of IoK8sApiBatchV1CronJobSpec from a JSON string"""
|
||||
return cls.from_dict(json.loads(json_str))
|
||||
|
||||
def to_dict(self) -> Dict[str, Any]:
|
||||
"""Return the dictionary representation of the model using alias.
|
||||
|
||||
This has the following differences from calling pydantic's
|
||||
`self.model_dump(by_alias=True)`:
|
||||
|
||||
* `None` is only added to the output dict for nullable fields that
|
||||
were set at model initialization. Other fields with value `None`
|
||||
are ignored.
|
||||
"""
|
||||
excluded_fields: Set[str] = set([
|
||||
])
|
||||
|
||||
_dict = self.model_dump(
|
||||
by_alias=True,
|
||||
exclude=excluded_fields,
|
||||
exclude_none=True,
|
||||
)
|
||||
# override the default output from pydantic by calling `to_dict()` of job_template
|
||||
if self.job_template:
|
||||
_dict['jobTemplate'] = self.job_template.to_dict()
|
||||
return _dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||
"""Create an instance of IoK8sApiBatchV1CronJobSpec from a dict"""
|
||||
if obj is None:
|
||||
return None
|
||||
|
||||
if not isinstance(obj, dict):
|
||||
return cls.model_validate(obj)
|
||||
|
||||
_obj = cls.model_validate({
|
||||
"concurrencyPolicy": obj.get("concurrencyPolicy"),
|
||||
"failedJobsHistoryLimit": obj.get("failedJobsHistoryLimit"),
|
||||
"jobTemplate": IoK8sApiBatchV1JobTemplateSpec.from_dict(obj["jobTemplate"]) if obj.get("jobTemplate") is not None else None,
|
||||
"schedule": obj.get("schedule") if obj.get("schedule") is not None else '',
|
||||
"startingDeadlineSeconds": obj.get("startingDeadlineSeconds"),
|
||||
"successfulJobsHistoryLimit": obj.get("successfulJobsHistoryLimit"),
|
||||
"suspend": obj.get("suspend"),
|
||||
"timeZone": obj.get("timeZone")
|
||||
})
|
||||
return _obj
|
||||
|
||||
|
||||
@@ -0,0 +1,100 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
Kubeflow Trainer OpenAPI Spec
|
||||
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
|
||||
The version of the OpenAPI document: unversioned
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
|
||||
Do not edit the class manually.
|
||||
""" # noqa: E501
|
||||
|
||||
|
||||
from __future__ import annotations
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
import json
|
||||
|
||||
from datetime import datetime
|
||||
from pydantic import BaseModel, ConfigDict, Field
|
||||
from typing import Any, ClassVar, Dict, List, Optional
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_object_reference import IoK8sApiCoreV1ObjectReference
|
||||
from typing import Optional, Set
|
||||
from typing_extensions import Self
|
||||
|
||||
class IoK8sApiBatchV1CronJobStatus(BaseModel):
|
||||
"""
|
||||
CronJobStatus represents the current state of a cron job.
|
||||
""" # noqa: E501
|
||||
active: Optional[List[IoK8sApiCoreV1ObjectReference]] = Field(default=None, description="A list of pointers to currently running jobs.")
|
||||
last_schedule_time: Optional[datetime] = Field(default=None, description="Information when was the last time the job was successfully scheduled.", alias="lastScheduleTime")
|
||||
last_successful_time: Optional[datetime] = Field(default=None, description="Information when was the last time the job successfully completed.", alias="lastSuccessfulTime")
|
||||
__properties: ClassVar[List[str]] = ["active", "lastScheduleTime", "lastSuccessfulTime"]
|
||||
|
||||
model_config = ConfigDict(
|
||||
populate_by_name=True,
|
||||
validate_assignment=True,
|
||||
protected_namespaces=(),
|
||||
)
|
||||
|
||||
|
||||
def to_str(self) -> str:
|
||||
"""Returns the string representation of the model using alias"""
|
||||
return pprint.pformat(self.model_dump(by_alias=True))
|
||||
|
||||
def to_json(self) -> str:
|
||||
"""Returns the JSON representation of the model using alias"""
|
||||
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
||||
return json.dumps(self.to_dict())
|
||||
|
||||
@classmethod
|
||||
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||
"""Create an instance of IoK8sApiBatchV1CronJobStatus from a JSON string"""
|
||||
return cls.from_dict(json.loads(json_str))
|
||||
|
||||
def to_dict(self) -> Dict[str, Any]:
|
||||
"""Return the dictionary representation of the model using alias.
|
||||
|
||||
This has the following differences from calling pydantic's
|
||||
`self.model_dump(by_alias=True)`:
|
||||
|
||||
* `None` is only added to the output dict for nullable fields that
|
||||
were set at model initialization. Other fields with value `None`
|
||||
are ignored.
|
||||
"""
|
||||
excluded_fields: Set[str] = set([
|
||||
])
|
||||
|
||||
_dict = self.model_dump(
|
||||
by_alias=True,
|
||||
exclude=excluded_fields,
|
||||
exclude_none=True,
|
||||
)
|
||||
# override the default output from pydantic by calling `to_dict()` of each item in active (list)
|
||||
_items = []
|
||||
if self.active:
|
||||
for _item_active in self.active:
|
||||
if _item_active:
|
||||
_items.append(_item_active.to_dict())
|
||||
_dict['active'] = _items
|
||||
return _dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||
"""Create an instance of IoK8sApiBatchV1CronJobStatus from a dict"""
|
||||
if obj is None:
|
||||
return None
|
||||
|
||||
if not isinstance(obj, dict):
|
||||
return cls.model_validate(obj)
|
||||
|
||||
_obj = cls.model_validate({
|
||||
"active": [IoK8sApiCoreV1ObjectReference.from_dict(_item) for _item in obj["active"]] if obj.get("active") is not None else None,
|
||||
"lastScheduleTime": obj.get("lastScheduleTime"),
|
||||
"lastSuccessfulTime": obj.get("lastSuccessfulTime")
|
||||
})
|
||||
return _obj
|
||||
|
||||
|
||||
@@ -0,0 +1,107 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
Kubeflow Trainer OpenAPI Spec
|
||||
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
|
||||
The version of the OpenAPI document: unversioned
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
|
||||
Do not edit the class manually.
|
||||
""" # noqa: E501
|
||||
|
||||
|
||||
from __future__ import annotations
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
import json
|
||||
|
||||
from pydantic import BaseModel, ConfigDict, Field, StrictStr
|
||||
from typing import Any, ClassVar, Dict, List, Optional
|
||||
from kubeflow_trainer_api.models.io_k8s_api_batch_v1_job_spec import IoK8sApiBatchV1JobSpec
|
||||
from kubeflow_trainer_api.models.io_k8s_api_batch_v1_job_status import IoK8sApiBatchV1JobStatus
|
||||
from kubeflow_trainer_api.models.io_k8s_apimachinery_pkg_apis_meta_v1_object_meta import IoK8sApimachineryPkgApisMetaV1ObjectMeta
|
||||
from typing import Optional, Set
|
||||
from typing_extensions import Self
|
||||
|
||||
class IoK8sApiBatchV1Job(BaseModel):
|
||||
"""
|
||||
Job represents the configuration of a single job.
|
||||
""" # noqa: E501
|
||||
api_version: Optional[StrictStr] = Field(default=None, description="APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", alias="apiVersion")
|
||||
kind: Optional[StrictStr] = Field(default=None, description="Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds")
|
||||
metadata: Optional[IoK8sApimachineryPkgApisMetaV1ObjectMeta] = Field(default=None, description="Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata")
|
||||
spec: Optional[IoK8sApiBatchV1JobSpec] = Field(default=None, description="Specification of the desired behavior of a job. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status")
|
||||
status: Optional[IoK8sApiBatchV1JobStatus] = Field(default=None, description="Current status of a job. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status")
|
||||
__properties: ClassVar[List[str]] = ["apiVersion", "kind", "metadata", "spec", "status"]
|
||||
|
||||
model_config = ConfigDict(
|
||||
populate_by_name=True,
|
||||
validate_assignment=True,
|
||||
protected_namespaces=(),
|
||||
)
|
||||
|
||||
|
||||
def to_str(self) -> str:
|
||||
"""Returns the string representation of the model using alias"""
|
||||
return pprint.pformat(self.model_dump(by_alias=True))
|
||||
|
||||
def to_json(self) -> str:
|
||||
"""Returns the JSON representation of the model using alias"""
|
||||
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
||||
return json.dumps(self.to_dict())
|
||||
|
||||
@classmethod
|
||||
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||
"""Create an instance of IoK8sApiBatchV1Job from a JSON string"""
|
||||
return cls.from_dict(json.loads(json_str))
|
||||
|
||||
def to_dict(self) -> Dict[str, Any]:
|
||||
"""Return the dictionary representation of the model using alias.
|
||||
|
||||
This has the following differences from calling pydantic's
|
||||
`self.model_dump(by_alias=True)`:
|
||||
|
||||
* `None` is only added to the output dict for nullable fields that
|
||||
were set at model initialization. Other fields with value `None`
|
||||
are ignored.
|
||||
"""
|
||||
excluded_fields: Set[str] = set([
|
||||
])
|
||||
|
||||
_dict = self.model_dump(
|
||||
by_alias=True,
|
||||
exclude=excluded_fields,
|
||||
exclude_none=True,
|
||||
)
|
||||
# override the default output from pydantic by calling `to_dict()` of metadata
|
||||
if self.metadata:
|
||||
_dict['metadata'] = self.metadata.to_dict()
|
||||
# override the default output from pydantic by calling `to_dict()` of spec
|
||||
if self.spec:
|
||||
_dict['spec'] = self.spec.to_dict()
|
||||
# override the default output from pydantic by calling `to_dict()` of status
|
||||
if self.status:
|
||||
_dict['status'] = self.status.to_dict()
|
||||
return _dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||
"""Create an instance of IoK8sApiBatchV1Job from a dict"""
|
||||
if obj is None:
|
||||
return None
|
||||
|
||||
if not isinstance(obj, dict):
|
||||
return cls.model_validate(obj)
|
||||
|
||||
_obj = cls.model_validate({
|
||||
"apiVersion": obj.get("apiVersion"),
|
||||
"kind": obj.get("kind"),
|
||||
"metadata": IoK8sApimachineryPkgApisMetaV1ObjectMeta.from_dict(obj["metadata"]) if obj.get("metadata") is not None else None,
|
||||
"spec": IoK8sApiBatchV1JobSpec.from_dict(obj["spec"]) if obj.get("spec") is not None else None,
|
||||
"status": IoK8sApiBatchV1JobStatus.from_dict(obj["status"]) if obj.get("status") is not None else None
|
||||
})
|
||||
return _obj
|
||||
|
||||
|
||||
@@ -0,0 +1,98 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
Kubeflow Trainer OpenAPI Spec
|
||||
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
|
||||
The version of the OpenAPI document: unversioned
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
|
||||
Do not edit the class manually.
|
||||
""" # noqa: E501
|
||||
|
||||
|
||||
from __future__ import annotations
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
import json
|
||||
|
||||
from datetime import datetime
|
||||
from pydantic import BaseModel, ConfigDict, Field, StrictStr
|
||||
from typing import Any, ClassVar, Dict, List, Optional
|
||||
from typing import Optional, Set
|
||||
from typing_extensions import Self
|
||||
|
||||
class IoK8sApiBatchV1JobCondition(BaseModel):
|
||||
"""
|
||||
JobCondition describes current state of a job.
|
||||
""" # noqa: E501
|
||||
last_probe_time: Optional[datetime] = Field(default=None, description="Last time the condition was checked.", alias="lastProbeTime")
|
||||
last_transition_time: Optional[datetime] = Field(default=None, description="Last time the condition transit from one status to another.", alias="lastTransitionTime")
|
||||
message: Optional[StrictStr] = Field(default=None, description="Human readable message indicating details about last transition.")
|
||||
reason: Optional[StrictStr] = Field(default=None, description="(brief) reason for the condition's last transition.")
|
||||
status: StrictStr = Field(description="Status of the condition, one of True, False, Unknown.")
|
||||
type: StrictStr = Field(description="Type of job condition, Complete or Failed.")
|
||||
__properties: ClassVar[List[str]] = ["lastProbeTime", "lastTransitionTime", "message", "reason", "status", "type"]
|
||||
|
||||
model_config = ConfigDict(
|
||||
populate_by_name=True,
|
||||
validate_assignment=True,
|
||||
protected_namespaces=(),
|
||||
)
|
||||
|
||||
|
||||
def to_str(self) -> str:
|
||||
"""Returns the string representation of the model using alias"""
|
||||
return pprint.pformat(self.model_dump(by_alias=True))
|
||||
|
||||
def to_json(self) -> str:
|
||||
"""Returns the JSON representation of the model using alias"""
|
||||
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
||||
return json.dumps(self.to_dict())
|
||||
|
||||
@classmethod
|
||||
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||
"""Create an instance of IoK8sApiBatchV1JobCondition from a JSON string"""
|
||||
return cls.from_dict(json.loads(json_str))
|
||||
|
||||
def to_dict(self) -> Dict[str, Any]:
|
||||
"""Return the dictionary representation of the model using alias.
|
||||
|
||||
This has the following differences from calling pydantic's
|
||||
`self.model_dump(by_alias=True)`:
|
||||
|
||||
* `None` is only added to the output dict for nullable fields that
|
||||
were set at model initialization. Other fields with value `None`
|
||||
are ignored.
|
||||
"""
|
||||
excluded_fields: Set[str] = set([
|
||||
])
|
||||
|
||||
_dict = self.model_dump(
|
||||
by_alias=True,
|
||||
exclude=excluded_fields,
|
||||
exclude_none=True,
|
||||
)
|
||||
return _dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||
"""Create an instance of IoK8sApiBatchV1JobCondition from a dict"""
|
||||
if obj is None:
|
||||
return None
|
||||
|
||||
if not isinstance(obj, dict):
|
||||
return cls.model_validate(obj)
|
||||
|
||||
_obj = cls.model_validate({
|
||||
"lastProbeTime": obj.get("lastProbeTime"),
|
||||
"lastTransitionTime": obj.get("lastTransitionTime"),
|
||||
"message": obj.get("message"),
|
||||
"reason": obj.get("reason"),
|
||||
"status": obj.get("status") if obj.get("status") is not None else '',
|
||||
"type": obj.get("type") if obj.get("type") is not None else ''
|
||||
})
|
||||
return _obj
|
||||
|
||||
|
||||
@@ -0,0 +1,105 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
Kubeflow Trainer OpenAPI Spec
|
||||
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
|
||||
The version of the OpenAPI document: unversioned
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
|
||||
Do not edit the class manually.
|
||||
""" # noqa: E501
|
||||
|
||||
|
||||
from __future__ import annotations
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
import json
|
||||
|
||||
from pydantic import BaseModel, ConfigDict, Field, StrictStr
|
||||
from typing import Any, ClassVar, Dict, List, Optional
|
||||
from kubeflow_trainer_api.models.io_k8s_api_batch_v1_job import IoK8sApiBatchV1Job
|
||||
from kubeflow_trainer_api.models.io_k8s_apimachinery_pkg_apis_meta_v1_list_meta import IoK8sApimachineryPkgApisMetaV1ListMeta
|
||||
from typing import Optional, Set
|
||||
from typing_extensions import Self
|
||||
|
||||
class IoK8sApiBatchV1JobList(BaseModel):
|
||||
"""
|
||||
JobList is a collection of jobs.
|
||||
""" # noqa: E501
|
||||
api_version: Optional[StrictStr] = Field(default=None, description="APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", alias="apiVersion")
|
||||
items: List[IoK8sApiBatchV1Job] = Field(description="items is the list of Jobs.")
|
||||
kind: Optional[StrictStr] = Field(default=None, description="Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds")
|
||||
metadata: Optional[IoK8sApimachineryPkgApisMetaV1ListMeta] = Field(default=None, description="Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata")
|
||||
__properties: ClassVar[List[str]] = ["apiVersion", "items", "kind", "metadata"]
|
||||
|
||||
model_config = ConfigDict(
|
||||
populate_by_name=True,
|
||||
validate_assignment=True,
|
||||
protected_namespaces=(),
|
||||
)
|
||||
|
||||
|
||||
def to_str(self) -> str:
|
||||
"""Returns the string representation of the model using alias"""
|
||||
return pprint.pformat(self.model_dump(by_alias=True))
|
||||
|
||||
def to_json(self) -> str:
|
||||
"""Returns the JSON representation of the model using alias"""
|
||||
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
||||
return json.dumps(self.to_dict())
|
||||
|
||||
@classmethod
|
||||
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||
"""Create an instance of IoK8sApiBatchV1JobList from a JSON string"""
|
||||
return cls.from_dict(json.loads(json_str))
|
||||
|
||||
def to_dict(self) -> Dict[str, Any]:
|
||||
"""Return the dictionary representation of the model using alias.
|
||||
|
||||
This has the following differences from calling pydantic's
|
||||
`self.model_dump(by_alias=True)`:
|
||||
|
||||
* `None` is only added to the output dict for nullable fields that
|
||||
were set at model initialization. Other fields with value `None`
|
||||
are ignored.
|
||||
"""
|
||||
excluded_fields: Set[str] = set([
|
||||
])
|
||||
|
||||
_dict = self.model_dump(
|
||||
by_alias=True,
|
||||
exclude=excluded_fields,
|
||||
exclude_none=True,
|
||||
)
|
||||
# override the default output from pydantic by calling `to_dict()` of each item in items (list)
|
||||
_items = []
|
||||
if self.items:
|
||||
for _item_items in self.items:
|
||||
if _item_items:
|
||||
_items.append(_item_items.to_dict())
|
||||
_dict['items'] = _items
|
||||
# override the default output from pydantic by calling `to_dict()` of metadata
|
||||
if self.metadata:
|
||||
_dict['metadata'] = self.metadata.to_dict()
|
||||
return _dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||
"""Create an instance of IoK8sApiBatchV1JobList from a dict"""
|
||||
if obj is None:
|
||||
return None
|
||||
|
||||
if not isinstance(obj, dict):
|
||||
return cls.model_validate(obj)
|
||||
|
||||
_obj = cls.model_validate({
|
||||
"apiVersion": obj.get("apiVersion"),
|
||||
"items": [IoK8sApiBatchV1Job.from_dict(_item) for _item in obj["items"]] if obj.get("items") is not None else None,
|
||||
"kind": obj.get("kind"),
|
||||
"metadata": IoK8sApimachineryPkgApisMetaV1ListMeta.from_dict(obj["metadata"]) if obj.get("metadata") is not None else None
|
||||
})
|
||||
return _obj
|
||||
|
||||
|
||||
@@ -0,0 +1,153 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
Kubeflow Trainer OpenAPI Spec
|
||||
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
|
||||
The version of the OpenAPI document: unversioned
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
|
||||
Do not edit the class manually.
|
||||
""" # noqa: E501
|
||||
|
||||
|
||||
from __future__ import annotations
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
import json
|
||||
|
||||
from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr, field_validator
|
||||
from typing import Any, ClassVar, Dict, List, Optional
|
||||
from kubeflow_trainer_api.models.io_k8s_api_batch_v1_pod_failure_policy import IoK8sApiBatchV1PodFailurePolicy
|
||||
from kubeflow_trainer_api.models.io_k8s_api_batch_v1_success_policy import IoK8sApiBatchV1SuccessPolicy
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_pod_template_spec import IoK8sApiCoreV1PodTemplateSpec
|
||||
from kubeflow_trainer_api.models.io_k8s_apimachinery_pkg_apis_meta_v1_label_selector import IoK8sApimachineryPkgApisMetaV1LabelSelector
|
||||
from typing import Optional, Set
|
||||
from typing_extensions import Self
|
||||
|
||||
class IoK8sApiBatchV1JobSpec(BaseModel):
|
||||
"""
|
||||
JobSpec describes how the job execution will look like.
|
||||
""" # noqa: E501
|
||||
active_deadline_seconds: Optional[StrictInt] = Field(default=None, description="Specifies the duration in seconds relative to the startTime that the job may be continuously active before the system tries to terminate it; value must be positive integer. If a Job is suspended (at creation or through an update), this timer will effectively be stopped and reset when the Job is resumed again.", alias="activeDeadlineSeconds")
|
||||
backoff_limit: Optional[StrictInt] = Field(default=None, description="Specifies the number of retries before marking this job failed. Defaults to 6", alias="backoffLimit")
|
||||
backoff_limit_per_index: Optional[StrictInt] = Field(default=None, description="Specifies the limit for the number of retries within an index before marking this index as failed. When enabled the number of failures per index is kept in the pod's batch.kubernetes.io/job-index-failure-count annotation. It can only be set when Job's completionMode=Indexed, and the Pod's restart policy is Never. The field is immutable. This field is beta-level. It can be used when the `JobBackoffLimitPerIndex` feature gate is enabled (enabled by default).", alias="backoffLimitPerIndex")
|
||||
completion_mode: Optional[StrictStr] = Field(default=None, description="completionMode specifies how Pod completions are tracked. It can be `NonIndexed` (default) or `Indexed`. `NonIndexed` means that the Job is considered complete when there have been .spec.completions successfully completed Pods. Each Pod completion is homologous to each other. `Indexed` means that the Pods of a Job get an associated completion index from 0 to (.spec.completions - 1), available in the annotation batch.kubernetes.io/job-completion-index. The Job is considered complete when there is one successfully completed Pod for each index. When value is `Indexed`, .spec.completions must be specified and `.spec.parallelism` must be less than or equal to 10^5. In addition, The Pod name takes the form `$(job-name)-$(index)-$(random-string)`, the Pod hostname takes the form `$(job-name)-$(index)`. More completion modes can be added in the future. If the Job controller observes a mode that it doesn't recognize, which is possible during upgrades due to version skew, the controller skips updates for the Job. Possible enum values: - `\"Indexed\"` is a Job completion mode. In this mode, the Pods of a Job get an associated completion index from 0 to (.spec.completions - 1). The Job is considered complete when a Pod completes for each completion index. - `\"NonIndexed\"` is a Job completion mode. In this mode, the Job is considered complete when there have been .spec.completions successfully completed Pods. Pod completions are homologous to each other.", alias="completionMode")
|
||||
completions: Optional[StrictInt] = Field(default=None, description="Specifies the desired number of successfully finished pods the job should be run with. Setting to null means that the success of any pod signals the success of all pods, and allows parallelism to have any positive value. Setting to 1 means that parallelism is limited to 1 and the success of that pod signals the success of the job. More info: https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/")
|
||||
managed_by: Optional[StrictStr] = Field(default=None, description="ManagedBy field indicates the controller that manages a Job. The k8s Job controller reconciles jobs which don't have this field at all or the field value is the reserved string `kubernetes.io/job-controller`, but skips reconciling Jobs with a custom value for this field. The value must be a valid domain-prefixed path (e.g. acme.io/foo) - all characters before the first \"/\" must be a valid subdomain as defined by RFC 1123. All characters trailing the first \"/\" must be valid HTTP Path characters as defined by RFC 3986. The value cannot exceed 63 characters. This field is immutable. This field is beta-level. The job controller accepts setting the field when the feature gate JobManagedBy is enabled (enabled by default).", alias="managedBy")
|
||||
manual_selector: Optional[StrictBool] = Field(default=None, description="manualSelector controls generation of pod labels and pod selectors. Leave `manualSelector` unset unless you are certain what you are doing. When false or unset, the system pick labels unique to this job and appends those labels to the pod template. When true, the user is responsible for picking unique labels and specifying the selector. Failure to pick a unique label may cause this and other jobs to not function correctly. However, You may see `manualSelector=true` in jobs that were created with the old `extensions/v1beta1` API. More info: https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/#specifying-your-own-pod-selector", alias="manualSelector")
|
||||
max_failed_indexes: Optional[StrictInt] = Field(default=None, description="Specifies the maximal number of failed indexes before marking the Job as failed, when backoffLimitPerIndex is set. Once the number of failed indexes exceeds this number the entire Job is marked as Failed and its execution is terminated. When left as null the job continues execution of all of its indexes and is marked with the `Complete` Job condition. It can only be specified when backoffLimitPerIndex is set. It can be null or up to completions. It is required and must be less than or equal to 10^4 when is completions greater than 10^5. This field is beta-level. It can be used when the `JobBackoffLimitPerIndex` feature gate is enabled (enabled by default).", alias="maxFailedIndexes")
|
||||
parallelism: Optional[StrictInt] = Field(default=None, description="Specifies the maximum desired number of pods the job should run at any given time. The actual number of pods running in steady state will be less than this number when ((.spec.completions - .status.successful) < .spec.parallelism), i.e. when the work left to do is less than max parallelism. More info: https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/")
|
||||
pod_failure_policy: Optional[IoK8sApiBatchV1PodFailurePolicy] = Field(default=None, description="Specifies the policy of handling failed pods. In particular, it allows to specify the set of actions and conditions which need to be satisfied to take the associated action. If empty, the default behaviour applies - the counter of failed pods, represented by the jobs's .status.failed field, is incremented and it is checked against the backoffLimit. This field cannot be used in combination with restartPolicy=OnFailure.", alias="podFailurePolicy")
|
||||
pod_replacement_policy: Optional[StrictStr] = Field(default=None, description="podReplacementPolicy specifies when to create replacement Pods. Possible values are: - TerminatingOrFailed means that we recreate pods when they are terminating (has a metadata.deletionTimestamp) or failed. - Failed means to wait until a previously created Pod is fully terminated (has phase Failed or Succeeded) before creating a replacement Pod. When using podFailurePolicy, Failed is the the only allowed value. TerminatingOrFailed and Failed are allowed values when podFailurePolicy is not in use. This is an beta field. To use this, enable the JobPodReplacementPolicy feature toggle. This is on by default. Possible enum values: - `\"Failed\"` means to wait until a previously created Pod is fully terminated (has phase Failed or Succeeded) before creating a replacement Pod. - `\"TerminatingOrFailed\"` means that we recreate pods when they are terminating (has a metadata.deletionTimestamp) or failed.", alias="podReplacementPolicy")
|
||||
selector: Optional[IoK8sApimachineryPkgApisMetaV1LabelSelector] = Field(default=None, description="A label query over pods that should match the pod count. Normally, the system sets this field for you. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors")
|
||||
success_policy: Optional[IoK8sApiBatchV1SuccessPolicy] = Field(default=None, description="successPolicy specifies the policy when the Job can be declared as succeeded. If empty, the default behavior applies - the Job is declared as succeeded only when the number of succeeded pods equals to the completions. When the field is specified, it must be immutable and works only for the Indexed Jobs. Once the Job meets the SuccessPolicy, the lingering pods are terminated. This field is beta-level. To use this field, you must enable the `JobSuccessPolicy` feature gate (enabled by default).", alias="successPolicy")
|
||||
suspend: Optional[StrictBool] = Field(default=None, description="suspend specifies whether the Job controller should create Pods or not. If a Job is created with suspend set to true, no Pods are created by the Job controller. If a Job is suspended after creation (i.e. the flag goes from false to true), the Job controller will delete all active Pods associated with this Job. Users must design their workload to gracefully handle this. Suspending a Job will reset the StartTime field of the Job, effectively resetting the ActiveDeadlineSeconds timer too. Defaults to false.")
|
||||
template: IoK8sApiCoreV1PodTemplateSpec = Field(description="Describes the pod that will be created when executing a job. The only allowed template.spec.restartPolicy values are \"Never\" or \"OnFailure\". More info: https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/")
|
||||
ttl_seconds_after_finished: Optional[StrictInt] = Field(default=None, description="ttlSecondsAfterFinished limits the lifetime of a Job that has finished execution (either Complete or Failed). If this field is set, ttlSecondsAfterFinished after the Job finishes, it is eligible to be automatically deleted. When the Job is being deleted, its lifecycle guarantees (e.g. finalizers) will be honored. If this field is unset, the Job won't be automatically deleted. If this field is set to zero, the Job becomes eligible to be deleted immediately after it finishes.", alias="ttlSecondsAfterFinished")
|
||||
__properties: ClassVar[List[str]] = ["activeDeadlineSeconds", "backoffLimit", "backoffLimitPerIndex", "completionMode", "completions", "managedBy", "manualSelector", "maxFailedIndexes", "parallelism", "podFailurePolicy", "podReplacementPolicy", "selector", "successPolicy", "suspend", "template", "ttlSecondsAfterFinished"]
|
||||
|
||||
@field_validator('completion_mode')
|
||||
def completion_mode_validate_enum(cls, value):
|
||||
"""Validates the enum"""
|
||||
if value is None:
|
||||
return value
|
||||
|
||||
if value not in set(['Indexed', 'NonIndexed']):
|
||||
raise ValueError("must be one of enum values ('Indexed', 'NonIndexed')")
|
||||
return value
|
||||
|
||||
@field_validator('pod_replacement_policy')
|
||||
def pod_replacement_policy_validate_enum(cls, value):
|
||||
"""Validates the enum"""
|
||||
if value is None:
|
||||
return value
|
||||
|
||||
if value not in set(['Failed', 'TerminatingOrFailed']):
|
||||
raise ValueError("must be one of enum values ('Failed', 'TerminatingOrFailed')")
|
||||
return value
|
||||
|
||||
model_config = ConfigDict(
|
||||
populate_by_name=True,
|
||||
validate_assignment=True,
|
||||
protected_namespaces=(),
|
||||
)
|
||||
|
||||
|
||||
def to_str(self) -> str:
|
||||
"""Returns the string representation of the model using alias"""
|
||||
return pprint.pformat(self.model_dump(by_alias=True))
|
||||
|
||||
def to_json(self) -> str:
|
||||
"""Returns the JSON representation of the model using alias"""
|
||||
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
||||
return json.dumps(self.to_dict())
|
||||
|
||||
@classmethod
|
||||
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||
"""Create an instance of IoK8sApiBatchV1JobSpec from a JSON string"""
|
||||
return cls.from_dict(json.loads(json_str))
|
||||
|
||||
def to_dict(self) -> Dict[str, Any]:
|
||||
"""Return the dictionary representation of the model using alias.
|
||||
|
||||
This has the following differences from calling pydantic's
|
||||
`self.model_dump(by_alias=True)`:
|
||||
|
||||
* `None` is only added to the output dict for nullable fields that
|
||||
were set at model initialization. Other fields with value `None`
|
||||
are ignored.
|
||||
"""
|
||||
excluded_fields: Set[str] = set([
|
||||
])
|
||||
|
||||
_dict = self.model_dump(
|
||||
by_alias=True,
|
||||
exclude=excluded_fields,
|
||||
exclude_none=True,
|
||||
)
|
||||
# override the default output from pydantic by calling `to_dict()` of pod_failure_policy
|
||||
if self.pod_failure_policy:
|
||||
_dict['podFailurePolicy'] = self.pod_failure_policy.to_dict()
|
||||
# override the default output from pydantic by calling `to_dict()` of selector
|
||||
if self.selector:
|
||||
_dict['selector'] = self.selector.to_dict()
|
||||
# override the default output from pydantic by calling `to_dict()` of success_policy
|
||||
if self.success_policy:
|
||||
_dict['successPolicy'] = self.success_policy.to_dict()
|
||||
# override the default output from pydantic by calling `to_dict()` of template
|
||||
if self.template:
|
||||
_dict['template'] = self.template.to_dict()
|
||||
return _dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||
"""Create an instance of IoK8sApiBatchV1JobSpec from a dict"""
|
||||
if obj is None:
|
||||
return None
|
||||
|
||||
if not isinstance(obj, dict):
|
||||
return cls.model_validate(obj)
|
||||
|
||||
_obj = cls.model_validate({
|
||||
"activeDeadlineSeconds": obj.get("activeDeadlineSeconds"),
|
||||
"backoffLimit": obj.get("backoffLimit"),
|
||||
"backoffLimitPerIndex": obj.get("backoffLimitPerIndex"),
|
||||
"completionMode": obj.get("completionMode"),
|
||||
"completions": obj.get("completions"),
|
||||
"managedBy": obj.get("managedBy"),
|
||||
"manualSelector": obj.get("manualSelector"),
|
||||
"maxFailedIndexes": obj.get("maxFailedIndexes"),
|
||||
"parallelism": obj.get("parallelism"),
|
||||
"podFailurePolicy": IoK8sApiBatchV1PodFailurePolicy.from_dict(obj["podFailurePolicy"]) if obj.get("podFailurePolicy") is not None else None,
|
||||
"podReplacementPolicy": obj.get("podReplacementPolicy"),
|
||||
"selector": IoK8sApimachineryPkgApisMetaV1LabelSelector.from_dict(obj["selector"]) if obj.get("selector") is not None else None,
|
||||
"successPolicy": IoK8sApiBatchV1SuccessPolicy.from_dict(obj["successPolicy"]) if obj.get("successPolicy") is not None else None,
|
||||
"suspend": obj.get("suspend"),
|
||||
"template": IoK8sApiCoreV1PodTemplateSpec.from_dict(obj["template"]) if obj.get("template") is not None else None,
|
||||
"ttlSecondsAfterFinished": obj.get("ttlSecondsAfterFinished")
|
||||
})
|
||||
return _obj
|
||||
|
||||
|
||||
@@ -0,0 +1,120 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
Kubeflow Trainer OpenAPI Spec
|
||||
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
|
||||
The version of the OpenAPI document: unversioned
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
|
||||
Do not edit the class manually.
|
||||
""" # noqa: E501
|
||||
|
||||
|
||||
from __future__ import annotations
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
import json
|
||||
|
||||
from datetime import datetime
|
||||
from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr
|
||||
from typing import Any, ClassVar, Dict, List, Optional
|
||||
from kubeflow_trainer_api.models.io_k8s_api_batch_v1_job_condition import IoK8sApiBatchV1JobCondition
|
||||
from kubeflow_trainer_api.models.io_k8s_api_batch_v1_uncounted_terminated_pods import IoK8sApiBatchV1UncountedTerminatedPods
|
||||
from typing import Optional, Set
|
||||
from typing_extensions import Self
|
||||
|
||||
class IoK8sApiBatchV1JobStatus(BaseModel):
|
||||
"""
|
||||
JobStatus represents the current state of a Job.
|
||||
""" # noqa: E501
|
||||
active: Optional[StrictInt] = Field(default=None, description="The number of pending and running pods which are not terminating (without a deletionTimestamp). The value is zero for finished jobs.")
|
||||
completed_indexes: Optional[StrictStr] = Field(default=None, description="completedIndexes holds the completed indexes when .spec.completionMode = \"Indexed\" in a text format. The indexes are represented as decimal integers separated by commas. The numbers are listed in increasing order. Three or more consecutive numbers are compressed and represented by the first and last element of the series, separated by a hyphen. For example, if the completed indexes are 1, 3, 4, 5 and 7, they are represented as \"1,3-5,7\".", alias="completedIndexes")
|
||||
completion_time: Optional[datetime] = Field(default=None, description="Represents time when the job was completed. It is not guaranteed to be set in happens-before order across separate operations. It is represented in RFC3339 form and is in UTC. The completion time is set when the job finishes successfully, and only then. The value cannot be updated or removed. The value indicates the same or later point in time as the startTime field.", alias="completionTime")
|
||||
conditions: Optional[List[IoK8sApiBatchV1JobCondition]] = Field(default=None, description="The latest available observations of an object's current state. When a Job fails, one of the conditions will have type \"Failed\" and status true. When a Job is suspended, one of the conditions will have type \"Suspended\" and status true; when the Job is resumed, the status of this condition will become false. When a Job is completed, one of the conditions will have type \"Complete\" and status true. A job is considered finished when it is in a terminal condition, either \"Complete\" or \"Failed\". A Job cannot have both the \"Complete\" and \"Failed\" conditions. Additionally, it cannot be in the \"Complete\" and \"FailureTarget\" conditions. The \"Complete\", \"Failed\" and \"FailureTarget\" conditions cannot be disabled. More info: https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/")
|
||||
failed: Optional[StrictInt] = Field(default=None, description="The number of pods which reached phase Failed. The value increases monotonically.")
|
||||
failed_indexes: Optional[StrictStr] = Field(default=None, description="FailedIndexes holds the failed indexes when spec.backoffLimitPerIndex is set. The indexes are represented in the text format analogous as for the `completedIndexes` field, ie. they are kept as decimal integers separated by commas. The numbers are listed in increasing order. Three or more consecutive numbers are compressed and represented by the first and last element of the series, separated by a hyphen. For example, if the failed indexes are 1, 3, 4, 5 and 7, they are represented as \"1,3-5,7\". The set of failed indexes cannot overlap with the set of completed indexes. This field is beta-level. It can be used when the `JobBackoffLimitPerIndex` feature gate is enabled (enabled by default).", alias="failedIndexes")
|
||||
ready: Optional[StrictInt] = Field(default=None, description="The number of active pods which have a Ready condition and are not terminating (without a deletionTimestamp).")
|
||||
start_time: Optional[datetime] = Field(default=None, description="Represents time when the job controller started processing a job. When a Job is created in the suspended state, this field is not set until the first time it is resumed. This field is reset every time a Job is resumed from suspension. It is represented in RFC3339 form and is in UTC. Once set, the field can only be removed when the job is suspended. The field cannot be modified while the job is unsuspended or finished.", alias="startTime")
|
||||
succeeded: Optional[StrictInt] = Field(default=None, description="The number of pods which reached phase Succeeded. The value increases monotonically for a given spec. However, it may decrease in reaction to scale down of elastic indexed jobs.")
|
||||
terminating: Optional[StrictInt] = Field(default=None, description="The number of pods which are terminating (in phase Pending or Running and have a deletionTimestamp). This field is beta-level. The job controller populates the field when the feature gate JobPodReplacementPolicy is enabled (enabled by default).")
|
||||
uncounted_terminated_pods: Optional[IoK8sApiBatchV1UncountedTerminatedPods] = Field(default=None, description="uncountedTerminatedPods holds the UIDs of Pods that have terminated but the job controller hasn't yet accounted for in the status counters. The job controller creates pods with a finalizer. When a pod terminates (succeeded or failed), the controller does three steps to account for it in the job status: 1. Add the pod UID to the arrays in this field. 2. Remove the pod finalizer. 3. Remove the pod UID from the arrays while increasing the corresponding counter. Old jobs might not be tracked using this field, in which case the field remains null. The structure is empty for finished jobs.", alias="uncountedTerminatedPods")
|
||||
__properties: ClassVar[List[str]] = ["active", "completedIndexes", "completionTime", "conditions", "failed", "failedIndexes", "ready", "startTime", "succeeded", "terminating", "uncountedTerminatedPods"]
|
||||
|
||||
model_config = ConfigDict(
|
||||
populate_by_name=True,
|
||||
validate_assignment=True,
|
||||
protected_namespaces=(),
|
||||
)
|
||||
|
||||
|
||||
def to_str(self) -> str:
|
||||
"""Returns the string representation of the model using alias"""
|
||||
return pprint.pformat(self.model_dump(by_alias=True))
|
||||
|
||||
def to_json(self) -> str:
|
||||
"""Returns the JSON representation of the model using alias"""
|
||||
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
||||
return json.dumps(self.to_dict())
|
||||
|
||||
@classmethod
|
||||
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||
"""Create an instance of IoK8sApiBatchV1JobStatus from a JSON string"""
|
||||
return cls.from_dict(json.loads(json_str))
|
||||
|
||||
def to_dict(self) -> Dict[str, Any]:
|
||||
"""Return the dictionary representation of the model using alias.
|
||||
|
||||
This has the following differences from calling pydantic's
|
||||
`self.model_dump(by_alias=True)`:
|
||||
|
||||
* `None` is only added to the output dict for nullable fields that
|
||||
were set at model initialization. Other fields with value `None`
|
||||
are ignored.
|
||||
"""
|
||||
excluded_fields: Set[str] = set([
|
||||
])
|
||||
|
||||
_dict = self.model_dump(
|
||||
by_alias=True,
|
||||
exclude=excluded_fields,
|
||||
exclude_none=True,
|
||||
)
|
||||
# override the default output from pydantic by calling `to_dict()` of each item in conditions (list)
|
||||
_items = []
|
||||
if self.conditions:
|
||||
for _item_conditions in self.conditions:
|
||||
if _item_conditions:
|
||||
_items.append(_item_conditions.to_dict())
|
||||
_dict['conditions'] = _items
|
||||
# override the default output from pydantic by calling `to_dict()` of uncounted_terminated_pods
|
||||
if self.uncounted_terminated_pods:
|
||||
_dict['uncountedTerminatedPods'] = self.uncounted_terminated_pods.to_dict()
|
||||
return _dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||
"""Create an instance of IoK8sApiBatchV1JobStatus from a dict"""
|
||||
if obj is None:
|
||||
return None
|
||||
|
||||
if not isinstance(obj, dict):
|
||||
return cls.model_validate(obj)
|
||||
|
||||
_obj = cls.model_validate({
|
||||
"active": obj.get("active"),
|
||||
"completedIndexes": obj.get("completedIndexes"),
|
||||
"completionTime": obj.get("completionTime"),
|
||||
"conditions": [IoK8sApiBatchV1JobCondition.from_dict(_item) for _item in obj["conditions"]] if obj.get("conditions") is not None else None,
|
||||
"failed": obj.get("failed"),
|
||||
"failedIndexes": obj.get("failedIndexes"),
|
||||
"ready": obj.get("ready"),
|
||||
"startTime": obj.get("startTime"),
|
||||
"succeeded": obj.get("succeeded"),
|
||||
"terminating": obj.get("terminating"),
|
||||
"uncountedTerminatedPods": IoK8sApiBatchV1UncountedTerminatedPods.from_dict(obj["uncountedTerminatedPods"]) if obj.get("uncountedTerminatedPods") is not None else None
|
||||
})
|
||||
return _obj
|
||||
|
||||
|
||||
@@ -0,0 +1,97 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
Kubeflow Trainer OpenAPI Spec
|
||||
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
|
||||
The version of the OpenAPI document: unversioned
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
|
||||
Do not edit the class manually.
|
||||
""" # noqa: E501
|
||||
|
||||
|
||||
from __future__ import annotations
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
import json
|
||||
|
||||
from pydantic import BaseModel, ConfigDict, Field
|
||||
from typing import Any, ClassVar, Dict, List, Optional
|
||||
from kubeflow_trainer_api.models.io_k8s_api_batch_v1_job_spec import IoK8sApiBatchV1JobSpec
|
||||
from kubeflow_trainer_api.models.io_k8s_apimachinery_pkg_apis_meta_v1_object_meta import IoK8sApimachineryPkgApisMetaV1ObjectMeta
|
||||
from typing import Optional, Set
|
||||
from typing_extensions import Self
|
||||
|
||||
class IoK8sApiBatchV1JobTemplateSpec(BaseModel):
|
||||
"""
|
||||
JobTemplateSpec describes the data a Job should have when created from a template
|
||||
""" # noqa: E501
|
||||
metadata: Optional[IoK8sApimachineryPkgApisMetaV1ObjectMeta] = Field(default=None, description="Standard object's metadata of the jobs created from this template. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata")
|
||||
spec: Optional[IoK8sApiBatchV1JobSpec] = Field(default=None, description="Specification of the desired behavior of the job. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status")
|
||||
__properties: ClassVar[List[str]] = ["metadata", "spec"]
|
||||
|
||||
model_config = ConfigDict(
|
||||
populate_by_name=True,
|
||||
validate_assignment=True,
|
||||
protected_namespaces=(),
|
||||
)
|
||||
|
||||
|
||||
def to_str(self) -> str:
|
||||
"""Returns the string representation of the model using alias"""
|
||||
return pprint.pformat(self.model_dump(by_alias=True))
|
||||
|
||||
def to_json(self) -> str:
|
||||
"""Returns the JSON representation of the model using alias"""
|
||||
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
||||
return json.dumps(self.to_dict())
|
||||
|
||||
@classmethod
|
||||
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||
"""Create an instance of IoK8sApiBatchV1JobTemplateSpec from a JSON string"""
|
||||
return cls.from_dict(json.loads(json_str))
|
||||
|
||||
def to_dict(self) -> Dict[str, Any]:
|
||||
"""Return the dictionary representation of the model using alias.
|
||||
|
||||
This has the following differences from calling pydantic's
|
||||
`self.model_dump(by_alias=True)`:
|
||||
|
||||
* `None` is only added to the output dict for nullable fields that
|
||||
were set at model initialization. Other fields with value `None`
|
||||
are ignored.
|
||||
"""
|
||||
excluded_fields: Set[str] = set([
|
||||
])
|
||||
|
||||
_dict = self.model_dump(
|
||||
by_alias=True,
|
||||
exclude=excluded_fields,
|
||||
exclude_none=True,
|
||||
)
|
||||
# override the default output from pydantic by calling `to_dict()` of metadata
|
||||
if self.metadata:
|
||||
_dict['metadata'] = self.metadata.to_dict()
|
||||
# override the default output from pydantic by calling `to_dict()` of spec
|
||||
if self.spec:
|
||||
_dict['spec'] = self.spec.to_dict()
|
||||
return _dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||
"""Create an instance of IoK8sApiBatchV1JobTemplateSpec from a dict"""
|
||||
if obj is None:
|
||||
return None
|
||||
|
||||
if not isinstance(obj, dict):
|
||||
return cls.model_validate(obj)
|
||||
|
||||
_obj = cls.model_validate({
|
||||
"metadata": IoK8sApimachineryPkgApisMetaV1ObjectMeta.from_dict(obj["metadata"]) if obj.get("metadata") is not None else None,
|
||||
"spec": IoK8sApiBatchV1JobSpec.from_dict(obj["spec"]) if obj.get("spec") is not None else None
|
||||
})
|
||||
return _obj
|
||||
|
||||
|
||||
@@ -0,0 +1,95 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
Kubeflow Trainer OpenAPI Spec
|
||||
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
|
||||
The version of the OpenAPI document: unversioned
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
|
||||
Do not edit the class manually.
|
||||
""" # noqa: E501
|
||||
|
||||
|
||||
from __future__ import annotations
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
import json
|
||||
|
||||
from pydantic import BaseModel, ConfigDict, Field
|
||||
from typing import Any, ClassVar, Dict, List
|
||||
from kubeflow_trainer_api.models.io_k8s_api_batch_v1_pod_failure_policy_rule import IoK8sApiBatchV1PodFailurePolicyRule
|
||||
from typing import Optional, Set
|
||||
from typing_extensions import Self
|
||||
|
||||
class IoK8sApiBatchV1PodFailurePolicy(BaseModel):
|
||||
"""
|
||||
PodFailurePolicy describes how failed pods influence the backoffLimit.
|
||||
""" # noqa: E501
|
||||
rules: List[IoK8sApiBatchV1PodFailurePolicyRule] = Field(description="A list of pod failure policy rules. The rules are evaluated in order. Once a rule matches a Pod failure, the remaining of the rules are ignored. When no rule matches the Pod failure, the default handling applies - the counter of pod failures is incremented and it is checked against the backoffLimit. At most 20 elements are allowed.")
|
||||
__properties: ClassVar[List[str]] = ["rules"]
|
||||
|
||||
model_config = ConfigDict(
|
||||
populate_by_name=True,
|
||||
validate_assignment=True,
|
||||
protected_namespaces=(),
|
||||
)
|
||||
|
||||
|
||||
def to_str(self) -> str:
|
||||
"""Returns the string representation of the model using alias"""
|
||||
return pprint.pformat(self.model_dump(by_alias=True))
|
||||
|
||||
def to_json(self) -> str:
|
||||
"""Returns the JSON representation of the model using alias"""
|
||||
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
||||
return json.dumps(self.to_dict())
|
||||
|
||||
@classmethod
|
||||
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||
"""Create an instance of IoK8sApiBatchV1PodFailurePolicy from a JSON string"""
|
||||
return cls.from_dict(json.loads(json_str))
|
||||
|
||||
def to_dict(self) -> Dict[str, Any]:
|
||||
"""Return the dictionary representation of the model using alias.
|
||||
|
||||
This has the following differences from calling pydantic's
|
||||
`self.model_dump(by_alias=True)`:
|
||||
|
||||
* `None` is only added to the output dict for nullable fields that
|
||||
were set at model initialization. Other fields with value `None`
|
||||
are ignored.
|
||||
"""
|
||||
excluded_fields: Set[str] = set([
|
||||
])
|
||||
|
||||
_dict = self.model_dump(
|
||||
by_alias=True,
|
||||
exclude=excluded_fields,
|
||||
exclude_none=True,
|
||||
)
|
||||
# override the default output from pydantic by calling `to_dict()` of each item in rules (list)
|
||||
_items = []
|
||||
if self.rules:
|
||||
for _item_rules in self.rules:
|
||||
if _item_rules:
|
||||
_items.append(_item_rules.to_dict())
|
||||
_dict['rules'] = _items
|
||||
return _dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||
"""Create an instance of IoK8sApiBatchV1PodFailurePolicy from a dict"""
|
||||
if obj is None:
|
||||
return None
|
||||
|
||||
if not isinstance(obj, dict):
|
||||
return cls.model_validate(obj)
|
||||
|
||||
_obj = cls.model_validate({
|
||||
"rules": [IoK8sApiBatchV1PodFailurePolicyRule.from_dict(_item) for _item in obj["rules"]] if obj.get("rules") is not None else None
|
||||
})
|
||||
return _obj
|
||||
|
||||
|
||||
+98
@@ -0,0 +1,98 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
Kubeflow Trainer OpenAPI Spec
|
||||
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
|
||||
The version of the OpenAPI document: unversioned
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
|
||||
Do not edit the class manually.
|
||||
""" # noqa: E501
|
||||
|
||||
|
||||
from __future__ import annotations
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
import json
|
||||
|
||||
from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator
|
||||
from typing import Any, ClassVar, Dict, List, Optional
|
||||
from typing import Optional, Set
|
||||
from typing_extensions import Self
|
||||
|
||||
class IoK8sApiBatchV1PodFailurePolicyOnExitCodesRequirement(BaseModel):
|
||||
"""
|
||||
PodFailurePolicyOnExitCodesRequirement describes the requirement for handling a failed pod based on its container exit codes. In particular, it lookups the .state.terminated.exitCode for each app container and init container status, represented by the .status.containerStatuses and .status.initContainerStatuses fields in the Pod status, respectively. Containers completed with success (exit code 0) are excluded from the requirement check.
|
||||
""" # noqa: E501
|
||||
container_name: Optional[StrictStr] = Field(default=None, description="Restricts the check for exit codes to the container with the specified name. When null, the rule applies to all containers. When specified, it should match one the container or initContainer names in the pod template.", alias="containerName")
|
||||
operator: StrictStr = Field(description="Represents the relationship between the container exit code(s) and the specified values. Containers completed with success (exit code 0) are excluded from the requirement check. Possible values are: - In: the requirement is satisfied if at least one container exit code (might be multiple if there are multiple containers not restricted by the 'containerName' field) is in the set of specified values. - NotIn: the requirement is satisfied if at least one container exit code (might be multiple if there are multiple containers not restricted by the 'containerName' field) is not in the set of specified values. Additional values are considered to be added in the future. Clients should react to an unknown operator by assuming the requirement is not satisfied. Possible enum values: - `\"In\"` - `\"NotIn\"`")
|
||||
values: List[StrictInt] = Field(description="Specifies the set of values. Each returned container exit code (might be multiple in case of multiple containers) is checked against this set of values with respect to the operator. The list of values must be ordered and must not contain duplicates. Value '0' cannot be used for the In operator. At least one element is required. At most 255 elements are allowed.")
|
||||
__properties: ClassVar[List[str]] = ["containerName", "operator", "values"]
|
||||
|
||||
@field_validator('operator')
|
||||
def operator_validate_enum(cls, value):
|
||||
"""Validates the enum"""
|
||||
if value not in set(['In', 'NotIn']):
|
||||
raise ValueError("must be one of enum values ('In', 'NotIn')")
|
||||
return value
|
||||
|
||||
model_config = ConfigDict(
|
||||
populate_by_name=True,
|
||||
validate_assignment=True,
|
||||
protected_namespaces=(),
|
||||
)
|
||||
|
||||
|
||||
def to_str(self) -> str:
|
||||
"""Returns the string representation of the model using alias"""
|
||||
return pprint.pformat(self.model_dump(by_alias=True))
|
||||
|
||||
def to_json(self) -> str:
|
||||
"""Returns the JSON representation of the model using alias"""
|
||||
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
||||
return json.dumps(self.to_dict())
|
||||
|
||||
@classmethod
|
||||
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||
"""Create an instance of IoK8sApiBatchV1PodFailurePolicyOnExitCodesRequirement from a JSON string"""
|
||||
return cls.from_dict(json.loads(json_str))
|
||||
|
||||
def to_dict(self) -> Dict[str, Any]:
|
||||
"""Return the dictionary representation of the model using alias.
|
||||
|
||||
This has the following differences from calling pydantic's
|
||||
`self.model_dump(by_alias=True)`:
|
||||
|
||||
* `None` is only added to the output dict for nullable fields that
|
||||
were set at model initialization. Other fields with value `None`
|
||||
are ignored.
|
||||
"""
|
||||
excluded_fields: Set[str] = set([
|
||||
])
|
||||
|
||||
_dict = self.model_dump(
|
||||
by_alias=True,
|
||||
exclude=excluded_fields,
|
||||
exclude_none=True,
|
||||
)
|
||||
return _dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||
"""Create an instance of IoK8sApiBatchV1PodFailurePolicyOnExitCodesRequirement from a dict"""
|
||||
if obj is None:
|
||||
return None
|
||||
|
||||
if not isinstance(obj, dict):
|
||||
return cls.model_validate(obj)
|
||||
|
||||
_obj = cls.model_validate({
|
||||
"containerName": obj.get("containerName"),
|
||||
"operator": obj.get("operator"),
|
||||
"values": obj.get("values")
|
||||
})
|
||||
return _obj
|
||||
|
||||
|
||||
+89
@@ -0,0 +1,89 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
Kubeflow Trainer OpenAPI Spec
|
||||
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
|
||||
The version of the OpenAPI document: unversioned
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
|
||||
Do not edit the class manually.
|
||||
""" # noqa: E501
|
||||
|
||||
|
||||
from __future__ import annotations
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
import json
|
||||
|
||||
from pydantic import BaseModel, ConfigDict, Field, StrictStr
|
||||
from typing import Any, ClassVar, Dict, List
|
||||
from typing import Optional, Set
|
||||
from typing_extensions import Self
|
||||
|
||||
class IoK8sApiBatchV1PodFailurePolicyOnPodConditionsPattern(BaseModel):
|
||||
"""
|
||||
PodFailurePolicyOnPodConditionsPattern describes a pattern for matching an actual pod condition type.
|
||||
""" # noqa: E501
|
||||
status: StrictStr = Field(description="Specifies the required Pod condition status. To match a pod condition it is required that the specified status equals the pod condition status. Defaults to True.")
|
||||
type: StrictStr = Field(description="Specifies the required Pod condition type. To match a pod condition it is required that specified type equals the pod condition type.")
|
||||
__properties: ClassVar[List[str]] = ["status", "type"]
|
||||
|
||||
model_config = ConfigDict(
|
||||
populate_by_name=True,
|
||||
validate_assignment=True,
|
||||
protected_namespaces=(),
|
||||
)
|
||||
|
||||
|
||||
def to_str(self) -> str:
|
||||
"""Returns the string representation of the model using alias"""
|
||||
return pprint.pformat(self.model_dump(by_alias=True))
|
||||
|
||||
def to_json(self) -> str:
|
||||
"""Returns the JSON representation of the model using alias"""
|
||||
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
||||
return json.dumps(self.to_dict())
|
||||
|
||||
@classmethod
|
||||
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||
"""Create an instance of IoK8sApiBatchV1PodFailurePolicyOnPodConditionsPattern from a JSON string"""
|
||||
return cls.from_dict(json.loads(json_str))
|
||||
|
||||
def to_dict(self) -> Dict[str, Any]:
|
||||
"""Return the dictionary representation of the model using alias.
|
||||
|
||||
This has the following differences from calling pydantic's
|
||||
`self.model_dump(by_alias=True)`:
|
||||
|
||||
* `None` is only added to the output dict for nullable fields that
|
||||
were set at model initialization. Other fields with value `None`
|
||||
are ignored.
|
||||
"""
|
||||
excluded_fields: Set[str] = set([
|
||||
])
|
||||
|
||||
_dict = self.model_dump(
|
||||
by_alias=True,
|
||||
exclude=excluded_fields,
|
||||
exclude_none=True,
|
||||
)
|
||||
return _dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||
"""Create an instance of IoK8sApiBatchV1PodFailurePolicyOnPodConditionsPattern from a dict"""
|
||||
if obj is None:
|
||||
return None
|
||||
|
||||
if not isinstance(obj, dict):
|
||||
return cls.model_validate(obj)
|
||||
|
||||
_obj = cls.model_validate({
|
||||
"status": obj.get("status") if obj.get("status") is not None else '',
|
||||
"type": obj.get("type") if obj.get("type") is not None else ''
|
||||
})
|
||||
return _obj
|
||||
|
||||
|
||||
+110
@@ -0,0 +1,110 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
Kubeflow Trainer OpenAPI Spec
|
||||
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
|
||||
The version of the OpenAPI document: unversioned
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
|
||||
Do not edit the class manually.
|
||||
""" # noqa: E501
|
||||
|
||||
|
||||
from __future__ import annotations
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
import json
|
||||
|
||||
from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator
|
||||
from typing import Any, ClassVar, Dict, List, Optional
|
||||
from kubeflow_trainer_api.models.io_k8s_api_batch_v1_pod_failure_policy_on_exit_codes_requirement import IoK8sApiBatchV1PodFailurePolicyOnExitCodesRequirement
|
||||
from kubeflow_trainer_api.models.io_k8s_api_batch_v1_pod_failure_policy_on_pod_conditions_pattern import IoK8sApiBatchV1PodFailurePolicyOnPodConditionsPattern
|
||||
from typing import Optional, Set
|
||||
from typing_extensions import Self
|
||||
|
||||
class IoK8sApiBatchV1PodFailurePolicyRule(BaseModel):
|
||||
"""
|
||||
PodFailurePolicyRule describes how a pod failure is handled when the requirements are met. One of onExitCodes and onPodConditions, but not both, can be used in each rule.
|
||||
""" # noqa: E501
|
||||
action: StrictStr = Field(description="Specifies the action taken on a pod failure when the requirements are satisfied. Possible values are: - FailJob: indicates that the pod's job is marked as Failed and all running pods are terminated. - FailIndex: indicates that the pod's index is marked as Failed and will not be restarted. This value is beta-level. It can be used when the `JobBackoffLimitPerIndex` feature gate is enabled (enabled by default). - Ignore: indicates that the counter towards the .backoffLimit is not incremented and a replacement pod is created. - Count: indicates that the pod is handled in the default way - the counter towards the .backoffLimit is incremented. Additional values are considered to be added in the future. Clients should react to an unknown action by skipping the rule. Possible enum values: - `\"Count\"` This is an action which might be taken on a pod failure - the pod failure is handled in the default way - the counter towards .backoffLimit, represented by the job's .status.failed field, is incremented. - `\"FailIndex\"` This is an action which might be taken on a pod failure - mark the Job's index as failed to avoid restarts within this index. This action can only be used when backoffLimitPerIndex is set. This value is beta-level. - `\"FailJob\"` This is an action which might be taken on a pod failure - mark the pod's job as Failed and terminate all running pods. - `\"Ignore\"` This is an action which might be taken on a pod failure - the counter towards .backoffLimit, represented by the job's .status.failed field, is not incremented and a replacement pod is created.")
|
||||
on_exit_codes: Optional[IoK8sApiBatchV1PodFailurePolicyOnExitCodesRequirement] = Field(default=None, description="Represents the requirement on the container exit codes.", alias="onExitCodes")
|
||||
on_pod_conditions: Optional[List[IoK8sApiBatchV1PodFailurePolicyOnPodConditionsPattern]] = Field(default=None, description="Represents the requirement on the pod conditions. The requirement is represented as a list of pod condition patterns. The requirement is satisfied if at least one pattern matches an actual pod condition. At most 20 elements are allowed.", alias="onPodConditions")
|
||||
__properties: ClassVar[List[str]] = ["action", "onExitCodes", "onPodConditions"]
|
||||
|
||||
@field_validator('action')
|
||||
def action_validate_enum(cls, value):
|
||||
"""Validates the enum"""
|
||||
if value not in set(['Count', 'FailIndex', 'FailJob', 'Ignore']):
|
||||
raise ValueError("must be one of enum values ('Count', 'FailIndex', 'FailJob', 'Ignore')")
|
||||
return value
|
||||
|
||||
model_config = ConfigDict(
|
||||
populate_by_name=True,
|
||||
validate_assignment=True,
|
||||
protected_namespaces=(),
|
||||
)
|
||||
|
||||
|
||||
def to_str(self) -> str:
|
||||
"""Returns the string representation of the model using alias"""
|
||||
return pprint.pformat(self.model_dump(by_alias=True))
|
||||
|
||||
def to_json(self) -> str:
|
||||
"""Returns the JSON representation of the model using alias"""
|
||||
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
||||
return json.dumps(self.to_dict())
|
||||
|
||||
@classmethod
|
||||
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||
"""Create an instance of IoK8sApiBatchV1PodFailurePolicyRule from a JSON string"""
|
||||
return cls.from_dict(json.loads(json_str))
|
||||
|
||||
def to_dict(self) -> Dict[str, Any]:
|
||||
"""Return the dictionary representation of the model using alias.
|
||||
|
||||
This has the following differences from calling pydantic's
|
||||
`self.model_dump(by_alias=True)`:
|
||||
|
||||
* `None` is only added to the output dict for nullable fields that
|
||||
were set at model initialization. Other fields with value `None`
|
||||
are ignored.
|
||||
"""
|
||||
excluded_fields: Set[str] = set([
|
||||
])
|
||||
|
||||
_dict = self.model_dump(
|
||||
by_alias=True,
|
||||
exclude=excluded_fields,
|
||||
exclude_none=True,
|
||||
)
|
||||
# override the default output from pydantic by calling `to_dict()` of on_exit_codes
|
||||
if self.on_exit_codes:
|
||||
_dict['onExitCodes'] = self.on_exit_codes.to_dict()
|
||||
# override the default output from pydantic by calling `to_dict()` of each item in on_pod_conditions (list)
|
||||
_items = []
|
||||
if self.on_pod_conditions:
|
||||
for _item_on_pod_conditions in self.on_pod_conditions:
|
||||
if _item_on_pod_conditions:
|
||||
_items.append(_item_on_pod_conditions.to_dict())
|
||||
_dict['onPodConditions'] = _items
|
||||
return _dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||
"""Create an instance of IoK8sApiBatchV1PodFailurePolicyRule from a dict"""
|
||||
if obj is None:
|
||||
return None
|
||||
|
||||
if not isinstance(obj, dict):
|
||||
return cls.model_validate(obj)
|
||||
|
||||
_obj = cls.model_validate({
|
||||
"action": obj.get("action"),
|
||||
"onExitCodes": IoK8sApiBatchV1PodFailurePolicyOnExitCodesRequirement.from_dict(obj["onExitCodes"]) if obj.get("onExitCodes") is not None else None,
|
||||
"onPodConditions": [IoK8sApiBatchV1PodFailurePolicyOnPodConditionsPattern.from_dict(_item) for _item in obj["onPodConditions"]] if obj.get("onPodConditions") is not None else None
|
||||
})
|
||||
return _obj
|
||||
|
||||
|
||||
@@ -0,0 +1,95 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
Kubeflow Trainer OpenAPI Spec
|
||||
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
|
||||
The version of the OpenAPI document: unversioned
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
|
||||
Do not edit the class manually.
|
||||
""" # noqa: E501
|
||||
|
||||
|
||||
from __future__ import annotations
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
import json
|
||||
|
||||
from pydantic import BaseModel, ConfigDict, Field
|
||||
from typing import Any, ClassVar, Dict, List
|
||||
from kubeflow_trainer_api.models.io_k8s_api_batch_v1_success_policy_rule import IoK8sApiBatchV1SuccessPolicyRule
|
||||
from typing import Optional, Set
|
||||
from typing_extensions import Self
|
||||
|
||||
class IoK8sApiBatchV1SuccessPolicy(BaseModel):
|
||||
"""
|
||||
SuccessPolicy describes when a Job can be declared as succeeded based on the success of some indexes.
|
||||
""" # noqa: E501
|
||||
rules: List[IoK8sApiBatchV1SuccessPolicyRule] = Field(description="rules represents the list of alternative rules for the declaring the Jobs as successful before `.status.succeeded >= .spec.completions`. Once any of the rules are met, the \"SucceededCriteriaMet\" condition is added, and the lingering pods are removed. The terminal state for such a Job has the \"Complete\" condition. Additionally, these rules are evaluated in order; Once the Job meets one of the rules, other rules are ignored. At most 20 elements are allowed.")
|
||||
__properties: ClassVar[List[str]] = ["rules"]
|
||||
|
||||
model_config = ConfigDict(
|
||||
populate_by_name=True,
|
||||
validate_assignment=True,
|
||||
protected_namespaces=(),
|
||||
)
|
||||
|
||||
|
||||
def to_str(self) -> str:
|
||||
"""Returns the string representation of the model using alias"""
|
||||
return pprint.pformat(self.model_dump(by_alias=True))
|
||||
|
||||
def to_json(self) -> str:
|
||||
"""Returns the JSON representation of the model using alias"""
|
||||
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
||||
return json.dumps(self.to_dict())
|
||||
|
||||
@classmethod
|
||||
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||
"""Create an instance of IoK8sApiBatchV1SuccessPolicy from a JSON string"""
|
||||
return cls.from_dict(json.loads(json_str))
|
||||
|
||||
def to_dict(self) -> Dict[str, Any]:
|
||||
"""Return the dictionary representation of the model using alias.
|
||||
|
||||
This has the following differences from calling pydantic's
|
||||
`self.model_dump(by_alias=True)`:
|
||||
|
||||
* `None` is only added to the output dict for nullable fields that
|
||||
were set at model initialization. Other fields with value `None`
|
||||
are ignored.
|
||||
"""
|
||||
excluded_fields: Set[str] = set([
|
||||
])
|
||||
|
||||
_dict = self.model_dump(
|
||||
by_alias=True,
|
||||
exclude=excluded_fields,
|
||||
exclude_none=True,
|
||||
)
|
||||
# override the default output from pydantic by calling `to_dict()` of each item in rules (list)
|
||||
_items = []
|
||||
if self.rules:
|
||||
for _item_rules in self.rules:
|
||||
if _item_rules:
|
||||
_items.append(_item_rules.to_dict())
|
||||
_dict['rules'] = _items
|
||||
return _dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||
"""Create an instance of IoK8sApiBatchV1SuccessPolicy from a dict"""
|
||||
if obj is None:
|
||||
return None
|
||||
|
||||
if not isinstance(obj, dict):
|
||||
return cls.model_validate(obj)
|
||||
|
||||
_obj = cls.model_validate({
|
||||
"rules": [IoK8sApiBatchV1SuccessPolicyRule.from_dict(_item) for _item in obj["rules"]] if obj.get("rules") is not None else None
|
||||
})
|
||||
return _obj
|
||||
|
||||
|
||||
@@ -0,0 +1,89 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
Kubeflow Trainer OpenAPI Spec
|
||||
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
|
||||
The version of the OpenAPI document: unversioned
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
|
||||
Do not edit the class manually.
|
||||
""" # noqa: E501
|
||||
|
||||
|
||||
from __future__ import annotations
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
import json
|
||||
|
||||
from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr
|
||||
from typing import Any, ClassVar, Dict, List, Optional
|
||||
from typing import Optional, Set
|
||||
from typing_extensions import Self
|
||||
|
||||
class IoK8sApiBatchV1SuccessPolicyRule(BaseModel):
|
||||
"""
|
||||
SuccessPolicyRule describes rule for declaring a Job as succeeded. Each rule must have at least one of the \"succeededIndexes\" or \"succeededCount\" specified.
|
||||
""" # noqa: E501
|
||||
succeeded_count: Optional[StrictInt] = Field(default=None, description="succeededCount specifies the minimal required size of the actual set of the succeeded indexes for the Job. When succeededCount is used along with succeededIndexes, the check is constrained only to the set of indexes specified by succeededIndexes. For example, given that succeededIndexes is \"1-4\", succeededCount is \"3\", and completed indexes are \"1\", \"3\", and \"5\", the Job isn't declared as succeeded because only \"1\" and \"3\" indexes are considered in that rules. When this field is null, this doesn't default to any value and is never evaluated at any time. When specified it needs to be a positive integer.", alias="succeededCount")
|
||||
succeeded_indexes: Optional[StrictStr] = Field(default=None, description="succeededIndexes specifies the set of indexes which need to be contained in the actual set of the succeeded indexes for the Job. The list of indexes must be within 0 to \".spec.completions-1\" and must not contain duplicates. At least one element is required. The indexes are represented as intervals separated by commas. The intervals can be a decimal integer or a pair of decimal integers separated by a hyphen. The number are listed in represented by the first and last element of the series, separated by a hyphen. For example, if the completed indexes are 1, 3, 4, 5 and 7, they are represented as \"1,3-5,7\". When this field is null, this field doesn't default to any value and is never evaluated at any time.", alias="succeededIndexes")
|
||||
__properties: ClassVar[List[str]] = ["succeededCount", "succeededIndexes"]
|
||||
|
||||
model_config = ConfigDict(
|
||||
populate_by_name=True,
|
||||
validate_assignment=True,
|
||||
protected_namespaces=(),
|
||||
)
|
||||
|
||||
|
||||
def to_str(self) -> str:
|
||||
"""Returns the string representation of the model using alias"""
|
||||
return pprint.pformat(self.model_dump(by_alias=True))
|
||||
|
||||
def to_json(self) -> str:
|
||||
"""Returns the JSON representation of the model using alias"""
|
||||
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
||||
return json.dumps(self.to_dict())
|
||||
|
||||
@classmethod
|
||||
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||
"""Create an instance of IoK8sApiBatchV1SuccessPolicyRule from a JSON string"""
|
||||
return cls.from_dict(json.loads(json_str))
|
||||
|
||||
def to_dict(self) -> Dict[str, Any]:
|
||||
"""Return the dictionary representation of the model using alias.
|
||||
|
||||
This has the following differences from calling pydantic's
|
||||
`self.model_dump(by_alias=True)`:
|
||||
|
||||
* `None` is only added to the output dict for nullable fields that
|
||||
were set at model initialization. Other fields with value `None`
|
||||
are ignored.
|
||||
"""
|
||||
excluded_fields: Set[str] = set([
|
||||
])
|
||||
|
||||
_dict = self.model_dump(
|
||||
by_alias=True,
|
||||
exclude=excluded_fields,
|
||||
exclude_none=True,
|
||||
)
|
||||
return _dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||
"""Create an instance of IoK8sApiBatchV1SuccessPolicyRule from a dict"""
|
||||
if obj is None:
|
||||
return None
|
||||
|
||||
if not isinstance(obj, dict):
|
||||
return cls.model_validate(obj)
|
||||
|
||||
_obj = cls.model_validate({
|
||||
"succeededCount": obj.get("succeededCount"),
|
||||
"succeededIndexes": obj.get("succeededIndexes")
|
||||
})
|
||||
return _obj
|
||||
|
||||
|
||||
+89
@@ -0,0 +1,89 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
Kubeflow Trainer OpenAPI Spec
|
||||
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
|
||||
The version of the OpenAPI document: unversioned
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
|
||||
Do not edit the class manually.
|
||||
""" # noqa: E501
|
||||
|
||||
|
||||
from __future__ import annotations
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
import json
|
||||
|
||||
from pydantic import BaseModel, ConfigDict, Field, StrictStr
|
||||
from typing import Any, ClassVar, Dict, List, Optional
|
||||
from typing import Optional, Set
|
||||
from typing_extensions import Self
|
||||
|
||||
class IoK8sApiBatchV1UncountedTerminatedPods(BaseModel):
|
||||
"""
|
||||
UncountedTerminatedPods holds UIDs of Pods that have terminated but haven't been accounted in Job status counters.
|
||||
""" # noqa: E501
|
||||
failed: Optional[List[StrictStr]] = Field(default=None, description="failed holds UIDs of failed Pods.")
|
||||
succeeded: Optional[List[StrictStr]] = Field(default=None, description="succeeded holds UIDs of succeeded Pods.")
|
||||
__properties: ClassVar[List[str]] = ["failed", "succeeded"]
|
||||
|
||||
model_config = ConfigDict(
|
||||
populate_by_name=True,
|
||||
validate_assignment=True,
|
||||
protected_namespaces=(),
|
||||
)
|
||||
|
||||
|
||||
def to_str(self) -> str:
|
||||
"""Returns the string representation of the model using alias"""
|
||||
return pprint.pformat(self.model_dump(by_alias=True))
|
||||
|
||||
def to_json(self) -> str:
|
||||
"""Returns the JSON representation of the model using alias"""
|
||||
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
||||
return json.dumps(self.to_dict())
|
||||
|
||||
@classmethod
|
||||
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||
"""Create an instance of IoK8sApiBatchV1UncountedTerminatedPods from a JSON string"""
|
||||
return cls.from_dict(json.loads(json_str))
|
||||
|
||||
def to_dict(self) -> Dict[str, Any]:
|
||||
"""Return the dictionary representation of the model using alias.
|
||||
|
||||
This has the following differences from calling pydantic's
|
||||
`self.model_dump(by_alias=True)`:
|
||||
|
||||
* `None` is only added to the output dict for nullable fields that
|
||||
were set at model initialization. Other fields with value `None`
|
||||
are ignored.
|
||||
"""
|
||||
excluded_fields: Set[str] = set([
|
||||
])
|
||||
|
||||
_dict = self.model_dump(
|
||||
by_alias=True,
|
||||
exclude=excluded_fields,
|
||||
exclude_none=True,
|
||||
)
|
||||
return _dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||
"""Create an instance of IoK8sApiBatchV1UncountedTerminatedPods from a dict"""
|
||||
if obj is None:
|
||||
return None
|
||||
|
||||
if not isinstance(obj, dict):
|
||||
return cls.model_validate(obj)
|
||||
|
||||
_obj = cls.model_validate({
|
||||
"failed": obj.get("failed"),
|
||||
"succeeded": obj.get("succeeded")
|
||||
})
|
||||
return _obj
|
||||
|
||||
|
||||
@@ -0,0 +1,103 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
Kubeflow Trainer OpenAPI Spec
|
||||
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
|
||||
The version of the OpenAPI document: unversioned
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
|
||||
Do not edit the class manually.
|
||||
""" # noqa: E501
|
||||
|
||||
|
||||
from __future__ import annotations
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
import json
|
||||
|
||||
from pydantic import BaseModel, ConfigDict, Field
|
||||
from typing import Any, ClassVar, Dict, List, Optional
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_node_affinity import IoK8sApiCoreV1NodeAffinity
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_pod_affinity import IoK8sApiCoreV1PodAffinity
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_pod_anti_affinity import IoK8sApiCoreV1PodAntiAffinity
|
||||
from typing import Optional, Set
|
||||
from typing_extensions import Self
|
||||
|
||||
class IoK8sApiCoreV1Affinity(BaseModel):
|
||||
"""
|
||||
Affinity is a group of affinity scheduling rules.
|
||||
""" # noqa: E501
|
||||
node_affinity: Optional[IoK8sApiCoreV1NodeAffinity] = Field(default=None, description="Describes node affinity scheduling rules for the pod.", alias="nodeAffinity")
|
||||
pod_affinity: Optional[IoK8sApiCoreV1PodAffinity] = Field(default=None, description="Describes pod affinity scheduling rules (e.g. co-locate this pod in the same node, zone, etc. as some other pod(s)).", alias="podAffinity")
|
||||
pod_anti_affinity: Optional[IoK8sApiCoreV1PodAntiAffinity] = Field(default=None, description="Describes pod anti-affinity scheduling rules (e.g. avoid putting this pod in the same node, zone, etc. as some other pod(s)).", alias="podAntiAffinity")
|
||||
__properties: ClassVar[List[str]] = ["nodeAffinity", "podAffinity", "podAntiAffinity"]
|
||||
|
||||
model_config = ConfigDict(
|
||||
populate_by_name=True,
|
||||
validate_assignment=True,
|
||||
protected_namespaces=(),
|
||||
)
|
||||
|
||||
|
||||
def to_str(self) -> str:
|
||||
"""Returns the string representation of the model using alias"""
|
||||
return pprint.pformat(self.model_dump(by_alias=True))
|
||||
|
||||
def to_json(self) -> str:
|
||||
"""Returns the JSON representation of the model using alias"""
|
||||
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
||||
return json.dumps(self.to_dict())
|
||||
|
||||
@classmethod
|
||||
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||
"""Create an instance of IoK8sApiCoreV1Affinity from a JSON string"""
|
||||
return cls.from_dict(json.loads(json_str))
|
||||
|
||||
def to_dict(self) -> Dict[str, Any]:
|
||||
"""Return the dictionary representation of the model using alias.
|
||||
|
||||
This has the following differences from calling pydantic's
|
||||
`self.model_dump(by_alias=True)`:
|
||||
|
||||
* `None` is only added to the output dict for nullable fields that
|
||||
were set at model initialization. Other fields with value `None`
|
||||
are ignored.
|
||||
"""
|
||||
excluded_fields: Set[str] = set([
|
||||
])
|
||||
|
||||
_dict = self.model_dump(
|
||||
by_alias=True,
|
||||
exclude=excluded_fields,
|
||||
exclude_none=True,
|
||||
)
|
||||
# override the default output from pydantic by calling `to_dict()` of node_affinity
|
||||
if self.node_affinity:
|
||||
_dict['nodeAffinity'] = self.node_affinity.to_dict()
|
||||
# override the default output from pydantic by calling `to_dict()` of pod_affinity
|
||||
if self.pod_affinity:
|
||||
_dict['podAffinity'] = self.pod_affinity.to_dict()
|
||||
# override the default output from pydantic by calling `to_dict()` of pod_anti_affinity
|
||||
if self.pod_anti_affinity:
|
||||
_dict['podAntiAffinity'] = self.pod_anti_affinity.to_dict()
|
||||
return _dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||
"""Create an instance of IoK8sApiCoreV1Affinity from a dict"""
|
||||
if obj is None:
|
||||
return None
|
||||
|
||||
if not isinstance(obj, dict):
|
||||
return cls.model_validate(obj)
|
||||
|
||||
_obj = cls.model_validate({
|
||||
"nodeAffinity": IoK8sApiCoreV1NodeAffinity.from_dict(obj["nodeAffinity"]) if obj.get("nodeAffinity") is not None else None,
|
||||
"podAffinity": IoK8sApiCoreV1PodAffinity.from_dict(obj["podAffinity"]) if obj.get("podAffinity") is not None else None,
|
||||
"podAntiAffinity": IoK8sApiCoreV1PodAntiAffinity.from_dict(obj["podAntiAffinity"]) if obj.get("podAntiAffinity") is not None else None
|
||||
})
|
||||
return _obj
|
||||
|
||||
|
||||
@@ -0,0 +1,96 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
Kubeflow Trainer OpenAPI Spec
|
||||
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
|
||||
The version of the OpenAPI document: unversioned
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
|
||||
Do not edit the class manually.
|
||||
""" # noqa: E501
|
||||
|
||||
|
||||
from __future__ import annotations
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
import json
|
||||
|
||||
from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator
|
||||
from typing import Any, ClassVar, Dict, List, Optional
|
||||
from typing import Optional, Set
|
||||
from typing_extensions import Self
|
||||
|
||||
class IoK8sApiCoreV1AppArmorProfile(BaseModel):
|
||||
"""
|
||||
AppArmorProfile defines a pod or container's AppArmor settings.
|
||||
""" # noqa: E501
|
||||
localhost_profile: Optional[StrictStr] = Field(default=None, description="localhostProfile indicates a profile loaded on the node that should be used. The profile must be preconfigured on the node to work. Must match the loaded name of the profile. Must be set if and only if type is \"Localhost\".", alias="localhostProfile")
|
||||
type: StrictStr = Field(description="type indicates which kind of AppArmor profile will be applied. Valid options are: Localhost - a profile pre-loaded on the node. RuntimeDefault - the container runtime's default profile. Unconfined - no AppArmor enforcement. Possible enum values: - `\"Localhost\"` indicates that a profile pre-loaded on the node should be used. - `\"RuntimeDefault\"` indicates that the container runtime's default AppArmor profile should be used. - `\"Unconfined\"` indicates that no AppArmor profile should be enforced.")
|
||||
__properties: ClassVar[List[str]] = ["localhostProfile", "type"]
|
||||
|
||||
@field_validator('type')
|
||||
def type_validate_enum(cls, value):
|
||||
"""Validates the enum"""
|
||||
if value not in set(['Localhost', 'RuntimeDefault', 'Unconfined']):
|
||||
raise ValueError("must be one of enum values ('Localhost', 'RuntimeDefault', 'Unconfined')")
|
||||
return value
|
||||
|
||||
model_config = ConfigDict(
|
||||
populate_by_name=True,
|
||||
validate_assignment=True,
|
||||
protected_namespaces=(),
|
||||
)
|
||||
|
||||
|
||||
def to_str(self) -> str:
|
||||
"""Returns the string representation of the model using alias"""
|
||||
return pprint.pformat(self.model_dump(by_alias=True))
|
||||
|
||||
def to_json(self) -> str:
|
||||
"""Returns the JSON representation of the model using alias"""
|
||||
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
||||
return json.dumps(self.to_dict())
|
||||
|
||||
@classmethod
|
||||
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||
"""Create an instance of IoK8sApiCoreV1AppArmorProfile from a JSON string"""
|
||||
return cls.from_dict(json.loads(json_str))
|
||||
|
||||
def to_dict(self) -> Dict[str, Any]:
|
||||
"""Return the dictionary representation of the model using alias.
|
||||
|
||||
This has the following differences from calling pydantic's
|
||||
`self.model_dump(by_alias=True)`:
|
||||
|
||||
* `None` is only added to the output dict for nullable fields that
|
||||
were set at model initialization. Other fields with value `None`
|
||||
are ignored.
|
||||
"""
|
||||
excluded_fields: Set[str] = set([
|
||||
])
|
||||
|
||||
_dict = self.model_dump(
|
||||
by_alias=True,
|
||||
exclude=excluded_fields,
|
||||
exclude_none=True,
|
||||
)
|
||||
return _dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||
"""Create an instance of IoK8sApiCoreV1AppArmorProfile from a dict"""
|
||||
if obj is None:
|
||||
return None
|
||||
|
||||
if not isinstance(obj, dict):
|
||||
return cls.model_validate(obj)
|
||||
|
||||
_obj = cls.model_validate({
|
||||
"localhostProfile": obj.get("localhostProfile"),
|
||||
"type": obj.get("type")
|
||||
})
|
||||
return _obj
|
||||
|
||||
|
||||
@@ -0,0 +1,89 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
Kubeflow Trainer OpenAPI Spec
|
||||
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
|
||||
The version of the OpenAPI document: unversioned
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
|
||||
Do not edit the class manually.
|
||||
""" # noqa: E501
|
||||
|
||||
|
||||
from __future__ import annotations
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
import json
|
||||
|
||||
from pydantic import BaseModel, ConfigDict, Field, StrictStr
|
||||
from typing import Any, ClassVar, Dict, List
|
||||
from typing import Optional, Set
|
||||
from typing_extensions import Self
|
||||
|
||||
class IoK8sApiCoreV1AttachedVolume(BaseModel):
|
||||
"""
|
||||
AttachedVolume describes a volume attached to a node
|
||||
""" # noqa: E501
|
||||
device_path: StrictStr = Field(description="DevicePath represents the device path where the volume should be available", alias="devicePath")
|
||||
name: StrictStr = Field(description="Name of the attached volume")
|
||||
__properties: ClassVar[List[str]] = ["devicePath", "name"]
|
||||
|
||||
model_config = ConfigDict(
|
||||
populate_by_name=True,
|
||||
validate_assignment=True,
|
||||
protected_namespaces=(),
|
||||
)
|
||||
|
||||
|
||||
def to_str(self) -> str:
|
||||
"""Returns the string representation of the model using alias"""
|
||||
return pprint.pformat(self.model_dump(by_alias=True))
|
||||
|
||||
def to_json(self) -> str:
|
||||
"""Returns the JSON representation of the model using alias"""
|
||||
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
||||
return json.dumps(self.to_dict())
|
||||
|
||||
@classmethod
|
||||
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||
"""Create an instance of IoK8sApiCoreV1AttachedVolume from a JSON string"""
|
||||
return cls.from_dict(json.loads(json_str))
|
||||
|
||||
def to_dict(self) -> Dict[str, Any]:
|
||||
"""Return the dictionary representation of the model using alias.
|
||||
|
||||
This has the following differences from calling pydantic's
|
||||
`self.model_dump(by_alias=True)`:
|
||||
|
||||
* `None` is only added to the output dict for nullable fields that
|
||||
were set at model initialization. Other fields with value `None`
|
||||
are ignored.
|
||||
"""
|
||||
excluded_fields: Set[str] = set([
|
||||
])
|
||||
|
||||
_dict = self.model_dump(
|
||||
by_alias=True,
|
||||
exclude=excluded_fields,
|
||||
exclude_none=True,
|
||||
)
|
||||
return _dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||
"""Create an instance of IoK8sApiCoreV1AttachedVolume from a dict"""
|
||||
if obj is None:
|
||||
return None
|
||||
|
||||
if not isinstance(obj, dict):
|
||||
return cls.model_validate(obj)
|
||||
|
||||
_obj = cls.model_validate({
|
||||
"devicePath": obj.get("devicePath") if obj.get("devicePath") is not None else '',
|
||||
"name": obj.get("name") if obj.get("name") is not None else ''
|
||||
})
|
||||
return _obj
|
||||
|
||||
|
||||
@@ -0,0 +1,95 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
Kubeflow Trainer OpenAPI Spec
|
||||
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
|
||||
The version of the OpenAPI document: unversioned
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
|
||||
Do not edit the class manually.
|
||||
""" # noqa: E501
|
||||
|
||||
|
||||
from __future__ import annotations
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
import json
|
||||
|
||||
from pydantic import BaseModel, ConfigDict, Field
|
||||
from typing import Any, ClassVar, Dict, List, Optional
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_prefer_avoid_pods_entry import IoK8sApiCoreV1PreferAvoidPodsEntry
|
||||
from typing import Optional, Set
|
||||
from typing_extensions import Self
|
||||
|
||||
class IoK8sApiCoreV1AvoidPods(BaseModel):
|
||||
"""
|
||||
AvoidPods describes pods that should avoid this node. This is the value for a Node annotation with key scheduler.alpha.kubernetes.io/preferAvoidPods and will eventually become a field of NodeStatus.
|
||||
""" # noqa: E501
|
||||
prefer_avoid_pods: Optional[List[IoK8sApiCoreV1PreferAvoidPodsEntry]] = Field(default=None, description="Bounded-sized list of signatures of pods that should avoid this node, sorted in timestamp order from oldest to newest. Size of the slice is unspecified.", alias="preferAvoidPods")
|
||||
__properties: ClassVar[List[str]] = ["preferAvoidPods"]
|
||||
|
||||
model_config = ConfigDict(
|
||||
populate_by_name=True,
|
||||
validate_assignment=True,
|
||||
protected_namespaces=(),
|
||||
)
|
||||
|
||||
|
||||
def to_str(self) -> str:
|
||||
"""Returns the string representation of the model using alias"""
|
||||
return pprint.pformat(self.model_dump(by_alias=True))
|
||||
|
||||
def to_json(self) -> str:
|
||||
"""Returns the JSON representation of the model using alias"""
|
||||
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
||||
return json.dumps(self.to_dict())
|
||||
|
||||
@classmethod
|
||||
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||
"""Create an instance of IoK8sApiCoreV1AvoidPods from a JSON string"""
|
||||
return cls.from_dict(json.loads(json_str))
|
||||
|
||||
def to_dict(self) -> Dict[str, Any]:
|
||||
"""Return the dictionary representation of the model using alias.
|
||||
|
||||
This has the following differences from calling pydantic's
|
||||
`self.model_dump(by_alias=True)`:
|
||||
|
||||
* `None` is only added to the output dict for nullable fields that
|
||||
were set at model initialization. Other fields with value `None`
|
||||
are ignored.
|
||||
"""
|
||||
excluded_fields: Set[str] = set([
|
||||
])
|
||||
|
||||
_dict = self.model_dump(
|
||||
by_alias=True,
|
||||
exclude=excluded_fields,
|
||||
exclude_none=True,
|
||||
)
|
||||
# override the default output from pydantic by calling `to_dict()` of each item in prefer_avoid_pods (list)
|
||||
_items = []
|
||||
if self.prefer_avoid_pods:
|
||||
for _item_prefer_avoid_pods in self.prefer_avoid_pods:
|
||||
if _item_prefer_avoid_pods:
|
||||
_items.append(_item_prefer_avoid_pods.to_dict())
|
||||
_dict['preferAvoidPods'] = _items
|
||||
return _dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||
"""Create an instance of IoK8sApiCoreV1AvoidPods from a dict"""
|
||||
if obj is None:
|
||||
return None
|
||||
|
||||
if not isinstance(obj, dict):
|
||||
return cls.model_validate(obj)
|
||||
|
||||
_obj = cls.model_validate({
|
||||
"preferAvoidPods": [IoK8sApiCoreV1PreferAvoidPodsEntry.from_dict(_item) for _item in obj["preferAvoidPods"]] if obj.get("preferAvoidPods") is not None else None
|
||||
})
|
||||
return _obj
|
||||
|
||||
|
||||
+93
@@ -0,0 +1,93 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
Kubeflow Trainer OpenAPI Spec
|
||||
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
|
||||
The version of the OpenAPI document: unversioned
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
|
||||
Do not edit the class manually.
|
||||
""" # noqa: E501
|
||||
|
||||
|
||||
from __future__ import annotations
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
import json
|
||||
|
||||
from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr
|
||||
from typing import Any, ClassVar, Dict, List, Optional
|
||||
from typing import Optional, Set
|
||||
from typing_extensions import Self
|
||||
|
||||
class IoK8sApiCoreV1AWSElasticBlockStoreVolumeSource(BaseModel):
|
||||
"""
|
||||
Represents a Persistent Disk resource in AWS. An AWS EBS disk must exist before mounting to a container. The disk must also be in the same AWS zone as the kubelet. An AWS EBS disk can only be mounted as read/write once. AWS EBS volumes support ownership management and SELinux relabeling.
|
||||
""" # noqa: E501
|
||||
fs_type: Optional[StrictStr] = Field(default=None, description="fsType is the filesystem type of the volume that you want to mount. Tip: Ensure that the filesystem type is supported by the host operating system. Examples: \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified. More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore", alias="fsType")
|
||||
partition: Optional[StrictInt] = Field(default=None, description="partition is the partition in the volume that you want to mount. If omitted, the default is to mount by volume name. Examples: For volume /dev/sda1, you specify the partition as \"1\". Similarly, the volume partition for /dev/sda is \"0\" (or you can leave the property empty).")
|
||||
read_only: Optional[StrictBool] = Field(default=None, description="readOnly value true will force the readOnly setting in VolumeMounts. More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore", alias="readOnly")
|
||||
volume_id: StrictStr = Field(description="volumeID is unique ID of the persistent disk resource in AWS (Amazon EBS volume). More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore", alias="volumeID")
|
||||
__properties: ClassVar[List[str]] = ["fsType", "partition", "readOnly", "volumeID"]
|
||||
|
||||
model_config = ConfigDict(
|
||||
populate_by_name=True,
|
||||
validate_assignment=True,
|
||||
protected_namespaces=(),
|
||||
)
|
||||
|
||||
|
||||
def to_str(self) -> str:
|
||||
"""Returns the string representation of the model using alias"""
|
||||
return pprint.pformat(self.model_dump(by_alias=True))
|
||||
|
||||
def to_json(self) -> str:
|
||||
"""Returns the JSON representation of the model using alias"""
|
||||
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
||||
return json.dumps(self.to_dict())
|
||||
|
||||
@classmethod
|
||||
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||
"""Create an instance of IoK8sApiCoreV1AWSElasticBlockStoreVolumeSource from a JSON string"""
|
||||
return cls.from_dict(json.loads(json_str))
|
||||
|
||||
def to_dict(self) -> Dict[str, Any]:
|
||||
"""Return the dictionary representation of the model using alias.
|
||||
|
||||
This has the following differences from calling pydantic's
|
||||
`self.model_dump(by_alias=True)`:
|
||||
|
||||
* `None` is only added to the output dict for nullable fields that
|
||||
were set at model initialization. Other fields with value `None`
|
||||
are ignored.
|
||||
"""
|
||||
excluded_fields: Set[str] = set([
|
||||
])
|
||||
|
||||
_dict = self.model_dump(
|
||||
by_alias=True,
|
||||
exclude=excluded_fields,
|
||||
exclude_none=True,
|
||||
)
|
||||
return _dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||
"""Create an instance of IoK8sApiCoreV1AWSElasticBlockStoreVolumeSource from a dict"""
|
||||
if obj is None:
|
||||
return None
|
||||
|
||||
if not isinstance(obj, dict):
|
||||
return cls.model_validate(obj)
|
||||
|
||||
_obj = cls.model_validate({
|
||||
"fsType": obj.get("fsType"),
|
||||
"partition": obj.get("partition"),
|
||||
"readOnly": obj.get("readOnly"),
|
||||
"volumeID": obj.get("volumeID") if obj.get("volumeID") is not None else ''
|
||||
})
|
||||
return _obj
|
||||
|
||||
|
||||
+117
@@ -0,0 +1,117 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
Kubeflow Trainer OpenAPI Spec
|
||||
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
|
||||
The version of the OpenAPI document: unversioned
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
|
||||
Do not edit the class manually.
|
||||
""" # noqa: E501
|
||||
|
||||
|
||||
from __future__ import annotations
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
import json
|
||||
|
||||
from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr, field_validator
|
||||
from typing import Any, ClassVar, Dict, List, Optional
|
||||
from typing import Optional, Set
|
||||
from typing_extensions import Self
|
||||
|
||||
class IoK8sApiCoreV1AzureDiskVolumeSource(BaseModel):
|
||||
"""
|
||||
AzureDisk represents an Azure Data Disk mount on the host and bind mount to the pod.
|
||||
""" # noqa: E501
|
||||
caching_mode: Optional[StrictStr] = Field(default='ReadWrite', description="cachingMode is the Host Caching mode: None, Read Only, Read Write. Possible enum values: - `\"None\"` - `\"ReadOnly\"` - `\"ReadWrite\"`", alias="cachingMode")
|
||||
disk_name: StrictStr = Field(description="diskName is the Name of the data disk in the blob storage", alias="diskName")
|
||||
disk_uri: StrictStr = Field(description="diskURI is the URI of data disk in the blob storage", alias="diskURI")
|
||||
fs_type: Optional[StrictStr] = Field(default='ext4', description="fsType is Filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified.", alias="fsType")
|
||||
kind: Optional[StrictStr] = Field(default='Shared', description="kind expected values are Shared: multiple blob disks per storage account Dedicated: single blob disk per storage account Managed: azure managed data disk (only in managed availability set). defaults to shared Possible enum values: - `\"Dedicated\"` - `\"Managed\"` - `\"Shared\"`")
|
||||
read_only: Optional[StrictBool] = Field(default=False, description="readOnly Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts.", alias="readOnly")
|
||||
__properties: ClassVar[List[str]] = ["cachingMode", "diskName", "diskURI", "fsType", "kind", "readOnly"]
|
||||
|
||||
@field_validator('caching_mode')
|
||||
def caching_mode_validate_enum(cls, value):
|
||||
"""Validates the enum"""
|
||||
if value is None:
|
||||
return value
|
||||
|
||||
if value not in set(['None', 'ReadOnly', 'ReadWrite']):
|
||||
raise ValueError("must be one of enum values ('None', 'ReadOnly', 'ReadWrite')")
|
||||
return value
|
||||
|
||||
@field_validator('kind')
|
||||
def kind_validate_enum(cls, value):
|
||||
"""Validates the enum"""
|
||||
if value is None:
|
||||
return value
|
||||
|
||||
if value not in set(['Dedicated', 'Managed', 'Shared']):
|
||||
raise ValueError("must be one of enum values ('Dedicated', 'Managed', 'Shared')")
|
||||
return value
|
||||
|
||||
model_config = ConfigDict(
|
||||
populate_by_name=True,
|
||||
validate_assignment=True,
|
||||
protected_namespaces=(),
|
||||
)
|
||||
|
||||
|
||||
def to_str(self) -> str:
|
||||
"""Returns the string representation of the model using alias"""
|
||||
return pprint.pformat(self.model_dump(by_alias=True))
|
||||
|
||||
def to_json(self) -> str:
|
||||
"""Returns the JSON representation of the model using alias"""
|
||||
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
||||
return json.dumps(self.to_dict())
|
||||
|
||||
@classmethod
|
||||
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||
"""Create an instance of IoK8sApiCoreV1AzureDiskVolumeSource from a JSON string"""
|
||||
return cls.from_dict(json.loads(json_str))
|
||||
|
||||
def to_dict(self) -> Dict[str, Any]:
|
||||
"""Return the dictionary representation of the model using alias.
|
||||
|
||||
This has the following differences from calling pydantic's
|
||||
`self.model_dump(by_alias=True)`:
|
||||
|
||||
* `None` is only added to the output dict for nullable fields that
|
||||
were set at model initialization. Other fields with value `None`
|
||||
are ignored.
|
||||
"""
|
||||
excluded_fields: Set[str] = set([
|
||||
])
|
||||
|
||||
_dict = self.model_dump(
|
||||
by_alias=True,
|
||||
exclude=excluded_fields,
|
||||
exclude_none=True,
|
||||
)
|
||||
return _dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||
"""Create an instance of IoK8sApiCoreV1AzureDiskVolumeSource from a dict"""
|
||||
if obj is None:
|
||||
return None
|
||||
|
||||
if not isinstance(obj, dict):
|
||||
return cls.model_validate(obj)
|
||||
|
||||
_obj = cls.model_validate({
|
||||
"cachingMode": obj.get("cachingMode") if obj.get("cachingMode") is not None else 'ReadWrite',
|
||||
"diskName": obj.get("diskName") if obj.get("diskName") is not None else '',
|
||||
"diskURI": obj.get("diskURI") if obj.get("diskURI") is not None else '',
|
||||
"fsType": obj.get("fsType") if obj.get("fsType") is not None else 'ext4',
|
||||
"kind": obj.get("kind") if obj.get("kind") is not None else 'Shared',
|
||||
"readOnly": obj.get("readOnly") if obj.get("readOnly") is not None else False
|
||||
})
|
||||
return _obj
|
||||
|
||||
|
||||
+93
@@ -0,0 +1,93 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
Kubeflow Trainer OpenAPI Spec
|
||||
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
|
||||
The version of the OpenAPI document: unversioned
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
|
||||
Do not edit the class manually.
|
||||
""" # noqa: E501
|
||||
|
||||
|
||||
from __future__ import annotations
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
import json
|
||||
|
||||
from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr
|
||||
from typing import Any, ClassVar, Dict, List, Optional
|
||||
from typing import Optional, Set
|
||||
from typing_extensions import Self
|
||||
|
||||
class IoK8sApiCoreV1AzureFilePersistentVolumeSource(BaseModel):
|
||||
"""
|
||||
AzureFile represents an Azure File Service mount on the host and bind mount to the pod.
|
||||
""" # noqa: E501
|
||||
read_only: Optional[StrictBool] = Field(default=None, description="readOnly defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts.", alias="readOnly")
|
||||
secret_name: StrictStr = Field(description="secretName is the name of secret that contains Azure Storage Account Name and Key", alias="secretName")
|
||||
secret_namespace: Optional[StrictStr] = Field(default=None, description="secretNamespace is the namespace of the secret that contains Azure Storage Account Name and Key default is the same as the Pod", alias="secretNamespace")
|
||||
share_name: StrictStr = Field(description="shareName is the azure Share Name", alias="shareName")
|
||||
__properties: ClassVar[List[str]] = ["readOnly", "secretName", "secretNamespace", "shareName"]
|
||||
|
||||
model_config = ConfigDict(
|
||||
populate_by_name=True,
|
||||
validate_assignment=True,
|
||||
protected_namespaces=(),
|
||||
)
|
||||
|
||||
|
||||
def to_str(self) -> str:
|
||||
"""Returns the string representation of the model using alias"""
|
||||
return pprint.pformat(self.model_dump(by_alias=True))
|
||||
|
||||
def to_json(self) -> str:
|
||||
"""Returns the JSON representation of the model using alias"""
|
||||
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
||||
return json.dumps(self.to_dict())
|
||||
|
||||
@classmethod
|
||||
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||
"""Create an instance of IoK8sApiCoreV1AzureFilePersistentVolumeSource from a JSON string"""
|
||||
return cls.from_dict(json.loads(json_str))
|
||||
|
||||
def to_dict(self) -> Dict[str, Any]:
|
||||
"""Return the dictionary representation of the model using alias.
|
||||
|
||||
This has the following differences from calling pydantic's
|
||||
`self.model_dump(by_alias=True)`:
|
||||
|
||||
* `None` is only added to the output dict for nullable fields that
|
||||
were set at model initialization. Other fields with value `None`
|
||||
are ignored.
|
||||
"""
|
||||
excluded_fields: Set[str] = set([
|
||||
])
|
||||
|
||||
_dict = self.model_dump(
|
||||
by_alias=True,
|
||||
exclude=excluded_fields,
|
||||
exclude_none=True,
|
||||
)
|
||||
return _dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||
"""Create an instance of IoK8sApiCoreV1AzureFilePersistentVolumeSource from a dict"""
|
||||
if obj is None:
|
||||
return None
|
||||
|
||||
if not isinstance(obj, dict):
|
||||
return cls.model_validate(obj)
|
||||
|
||||
_obj = cls.model_validate({
|
||||
"readOnly": obj.get("readOnly"),
|
||||
"secretName": obj.get("secretName") if obj.get("secretName") is not None else '',
|
||||
"secretNamespace": obj.get("secretNamespace"),
|
||||
"shareName": obj.get("shareName") if obj.get("shareName") is not None else ''
|
||||
})
|
||||
return _obj
|
||||
|
||||
|
||||
+91
@@ -0,0 +1,91 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
Kubeflow Trainer OpenAPI Spec
|
||||
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
|
||||
The version of the OpenAPI document: unversioned
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
|
||||
Do not edit the class manually.
|
||||
""" # noqa: E501
|
||||
|
||||
|
||||
from __future__ import annotations
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
import json
|
||||
|
||||
from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr
|
||||
from typing import Any, ClassVar, Dict, List, Optional
|
||||
from typing import Optional, Set
|
||||
from typing_extensions import Self
|
||||
|
||||
class IoK8sApiCoreV1AzureFileVolumeSource(BaseModel):
|
||||
"""
|
||||
AzureFile represents an Azure File Service mount on the host and bind mount to the pod.
|
||||
""" # noqa: E501
|
||||
read_only: Optional[StrictBool] = Field(default=None, description="readOnly defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts.", alias="readOnly")
|
||||
secret_name: StrictStr = Field(description="secretName is the name of secret that contains Azure Storage Account Name and Key", alias="secretName")
|
||||
share_name: StrictStr = Field(description="shareName is the azure share Name", alias="shareName")
|
||||
__properties: ClassVar[List[str]] = ["readOnly", "secretName", "shareName"]
|
||||
|
||||
model_config = ConfigDict(
|
||||
populate_by_name=True,
|
||||
validate_assignment=True,
|
||||
protected_namespaces=(),
|
||||
)
|
||||
|
||||
|
||||
def to_str(self) -> str:
|
||||
"""Returns the string representation of the model using alias"""
|
||||
return pprint.pformat(self.model_dump(by_alias=True))
|
||||
|
||||
def to_json(self) -> str:
|
||||
"""Returns the JSON representation of the model using alias"""
|
||||
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
||||
return json.dumps(self.to_dict())
|
||||
|
||||
@classmethod
|
||||
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||
"""Create an instance of IoK8sApiCoreV1AzureFileVolumeSource from a JSON string"""
|
||||
return cls.from_dict(json.loads(json_str))
|
||||
|
||||
def to_dict(self) -> Dict[str, Any]:
|
||||
"""Return the dictionary representation of the model using alias.
|
||||
|
||||
This has the following differences from calling pydantic's
|
||||
`self.model_dump(by_alias=True)`:
|
||||
|
||||
* `None` is only added to the output dict for nullable fields that
|
||||
were set at model initialization. Other fields with value `None`
|
||||
are ignored.
|
||||
"""
|
||||
excluded_fields: Set[str] = set([
|
||||
])
|
||||
|
||||
_dict = self.model_dump(
|
||||
by_alias=True,
|
||||
exclude=excluded_fields,
|
||||
exclude_none=True,
|
||||
)
|
||||
return _dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||
"""Create an instance of IoK8sApiCoreV1AzureFileVolumeSource from a dict"""
|
||||
if obj is None:
|
||||
return None
|
||||
|
||||
if not isinstance(obj, dict):
|
||||
return cls.model_validate(obj)
|
||||
|
||||
_obj = cls.model_validate({
|
||||
"readOnly": obj.get("readOnly"),
|
||||
"secretName": obj.get("secretName") if obj.get("secretName") is not None else '',
|
||||
"shareName": obj.get("shareName") if obj.get("shareName") is not None else ''
|
||||
})
|
||||
return _obj
|
||||
|
||||
|
||||
@@ -0,0 +1,101 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
Kubeflow Trainer OpenAPI Spec
|
||||
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
|
||||
The version of the OpenAPI document: unversioned
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
|
||||
Do not edit the class manually.
|
||||
""" # noqa: E501
|
||||
|
||||
|
||||
from __future__ import annotations
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
import json
|
||||
|
||||
from pydantic import BaseModel, ConfigDict, Field, StrictStr
|
||||
from typing import Any, ClassVar, Dict, List, Optional
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_object_reference import IoK8sApiCoreV1ObjectReference
|
||||
from kubeflow_trainer_api.models.io_k8s_apimachinery_pkg_apis_meta_v1_object_meta import IoK8sApimachineryPkgApisMetaV1ObjectMeta
|
||||
from typing import Optional, Set
|
||||
from typing_extensions import Self
|
||||
|
||||
class IoK8sApiCoreV1Binding(BaseModel):
|
||||
"""
|
||||
Binding ties one object to another; for example, a pod is bound to a node by a scheduler.
|
||||
""" # noqa: E501
|
||||
api_version: Optional[StrictStr] = Field(default=None, description="APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", alias="apiVersion")
|
||||
kind: Optional[StrictStr] = Field(default=None, description="Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds")
|
||||
metadata: Optional[IoK8sApimachineryPkgApisMetaV1ObjectMeta] = Field(default=None, description="Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata")
|
||||
target: IoK8sApiCoreV1ObjectReference = Field(description="The target object that you want to bind to the standard object.")
|
||||
__properties: ClassVar[List[str]] = ["apiVersion", "kind", "metadata", "target"]
|
||||
|
||||
model_config = ConfigDict(
|
||||
populate_by_name=True,
|
||||
validate_assignment=True,
|
||||
protected_namespaces=(),
|
||||
)
|
||||
|
||||
|
||||
def to_str(self) -> str:
|
||||
"""Returns the string representation of the model using alias"""
|
||||
return pprint.pformat(self.model_dump(by_alias=True))
|
||||
|
||||
def to_json(self) -> str:
|
||||
"""Returns the JSON representation of the model using alias"""
|
||||
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
||||
return json.dumps(self.to_dict())
|
||||
|
||||
@classmethod
|
||||
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||
"""Create an instance of IoK8sApiCoreV1Binding from a JSON string"""
|
||||
return cls.from_dict(json.loads(json_str))
|
||||
|
||||
def to_dict(self) -> Dict[str, Any]:
|
||||
"""Return the dictionary representation of the model using alias.
|
||||
|
||||
This has the following differences from calling pydantic's
|
||||
`self.model_dump(by_alias=True)`:
|
||||
|
||||
* `None` is only added to the output dict for nullable fields that
|
||||
were set at model initialization. Other fields with value `None`
|
||||
are ignored.
|
||||
"""
|
||||
excluded_fields: Set[str] = set([
|
||||
])
|
||||
|
||||
_dict = self.model_dump(
|
||||
by_alias=True,
|
||||
exclude=excluded_fields,
|
||||
exclude_none=True,
|
||||
)
|
||||
# override the default output from pydantic by calling `to_dict()` of metadata
|
||||
if self.metadata:
|
||||
_dict['metadata'] = self.metadata.to_dict()
|
||||
# override the default output from pydantic by calling `to_dict()` of target
|
||||
if self.target:
|
||||
_dict['target'] = self.target.to_dict()
|
||||
return _dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||
"""Create an instance of IoK8sApiCoreV1Binding from a dict"""
|
||||
if obj is None:
|
||||
return None
|
||||
|
||||
if not isinstance(obj, dict):
|
||||
return cls.model_validate(obj)
|
||||
|
||||
_obj = cls.model_validate({
|
||||
"apiVersion": obj.get("apiVersion"),
|
||||
"kind": obj.get("kind"),
|
||||
"metadata": IoK8sApimachineryPkgApisMetaV1ObjectMeta.from_dict(obj["metadata"]) if obj.get("metadata") is not None else None,
|
||||
"target": IoK8sApiCoreV1ObjectReference.from_dict(obj["target"]) if obj.get("target") is not None else None
|
||||
})
|
||||
return _obj
|
||||
|
||||
|
||||
@@ -0,0 +1,89 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
Kubeflow Trainer OpenAPI Spec
|
||||
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
|
||||
The version of the OpenAPI document: unversioned
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
|
||||
Do not edit the class manually.
|
||||
""" # noqa: E501
|
||||
|
||||
|
||||
from __future__ import annotations
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
import json
|
||||
|
||||
from pydantic import BaseModel, ConfigDict, Field, StrictStr
|
||||
from typing import Any, ClassVar, Dict, List, Optional
|
||||
from typing import Optional, Set
|
||||
from typing_extensions import Self
|
||||
|
||||
class IoK8sApiCoreV1Capabilities(BaseModel):
|
||||
"""
|
||||
Adds and removes POSIX capabilities from running containers.
|
||||
""" # noqa: E501
|
||||
add: Optional[List[StrictStr]] = Field(default=None, description="Added capabilities")
|
||||
drop: Optional[List[StrictStr]] = Field(default=None, description="Removed capabilities")
|
||||
__properties: ClassVar[List[str]] = ["add", "drop"]
|
||||
|
||||
model_config = ConfigDict(
|
||||
populate_by_name=True,
|
||||
validate_assignment=True,
|
||||
protected_namespaces=(),
|
||||
)
|
||||
|
||||
|
||||
def to_str(self) -> str:
|
||||
"""Returns the string representation of the model using alias"""
|
||||
return pprint.pformat(self.model_dump(by_alias=True))
|
||||
|
||||
def to_json(self) -> str:
|
||||
"""Returns the JSON representation of the model using alias"""
|
||||
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
||||
return json.dumps(self.to_dict())
|
||||
|
||||
@classmethod
|
||||
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||
"""Create an instance of IoK8sApiCoreV1Capabilities from a JSON string"""
|
||||
return cls.from_dict(json.loads(json_str))
|
||||
|
||||
def to_dict(self) -> Dict[str, Any]:
|
||||
"""Return the dictionary representation of the model using alias.
|
||||
|
||||
This has the following differences from calling pydantic's
|
||||
`self.model_dump(by_alias=True)`:
|
||||
|
||||
* `None` is only added to the output dict for nullable fields that
|
||||
were set at model initialization. Other fields with value `None`
|
||||
are ignored.
|
||||
"""
|
||||
excluded_fields: Set[str] = set([
|
||||
])
|
||||
|
||||
_dict = self.model_dump(
|
||||
by_alias=True,
|
||||
exclude=excluded_fields,
|
||||
exclude_none=True,
|
||||
)
|
||||
return _dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||
"""Create an instance of IoK8sApiCoreV1Capabilities from a dict"""
|
||||
if obj is None:
|
||||
return None
|
||||
|
||||
if not isinstance(obj, dict):
|
||||
return cls.model_validate(obj)
|
||||
|
||||
_obj = cls.model_validate({
|
||||
"add": obj.get("add"),
|
||||
"drop": obj.get("drop")
|
||||
})
|
||||
return _obj
|
||||
|
||||
|
||||
+101
@@ -0,0 +1,101 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
Kubeflow Trainer OpenAPI Spec
|
||||
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
|
||||
The version of the OpenAPI document: unversioned
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
|
||||
Do not edit the class manually.
|
||||
""" # noqa: E501
|
||||
|
||||
|
||||
from __future__ import annotations
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
import json
|
||||
|
||||
from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr
|
||||
from typing import Any, ClassVar, Dict, List, Optional
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_secret_reference import IoK8sApiCoreV1SecretReference
|
||||
from typing import Optional, Set
|
||||
from typing_extensions import Self
|
||||
|
||||
class IoK8sApiCoreV1CephFSPersistentVolumeSource(BaseModel):
|
||||
"""
|
||||
Represents a Ceph Filesystem mount that lasts the lifetime of a pod Cephfs volumes do not support ownership management or SELinux relabeling.
|
||||
""" # noqa: E501
|
||||
monitors: List[StrictStr] = Field(description="monitors is Required: Monitors is a collection of Ceph monitors More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it")
|
||||
path: Optional[StrictStr] = Field(default=None, description="path is Optional: Used as the mounted root, rather than the full Ceph tree, default is /")
|
||||
read_only: Optional[StrictBool] = Field(default=None, description="readOnly is Optional: Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts. More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it", alias="readOnly")
|
||||
secret_file: Optional[StrictStr] = Field(default=None, description="secretFile is Optional: SecretFile is the path to key ring for User, default is /etc/ceph/user.secret More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it", alias="secretFile")
|
||||
secret_ref: Optional[IoK8sApiCoreV1SecretReference] = Field(default=None, description="secretRef is Optional: SecretRef is reference to the authentication secret for User, default is empty. More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it", alias="secretRef")
|
||||
user: Optional[StrictStr] = Field(default=None, description="user is Optional: User is the rados user name, default is admin More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it")
|
||||
__properties: ClassVar[List[str]] = ["monitors", "path", "readOnly", "secretFile", "secretRef", "user"]
|
||||
|
||||
model_config = ConfigDict(
|
||||
populate_by_name=True,
|
||||
validate_assignment=True,
|
||||
protected_namespaces=(),
|
||||
)
|
||||
|
||||
|
||||
def to_str(self) -> str:
|
||||
"""Returns the string representation of the model using alias"""
|
||||
return pprint.pformat(self.model_dump(by_alias=True))
|
||||
|
||||
def to_json(self) -> str:
|
||||
"""Returns the JSON representation of the model using alias"""
|
||||
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
||||
return json.dumps(self.to_dict())
|
||||
|
||||
@classmethod
|
||||
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||
"""Create an instance of IoK8sApiCoreV1CephFSPersistentVolumeSource from a JSON string"""
|
||||
return cls.from_dict(json.loads(json_str))
|
||||
|
||||
def to_dict(self) -> Dict[str, Any]:
|
||||
"""Return the dictionary representation of the model using alias.
|
||||
|
||||
This has the following differences from calling pydantic's
|
||||
`self.model_dump(by_alias=True)`:
|
||||
|
||||
* `None` is only added to the output dict for nullable fields that
|
||||
were set at model initialization. Other fields with value `None`
|
||||
are ignored.
|
||||
"""
|
||||
excluded_fields: Set[str] = set([
|
||||
])
|
||||
|
||||
_dict = self.model_dump(
|
||||
by_alias=True,
|
||||
exclude=excluded_fields,
|
||||
exclude_none=True,
|
||||
)
|
||||
# override the default output from pydantic by calling `to_dict()` of secret_ref
|
||||
if self.secret_ref:
|
||||
_dict['secretRef'] = self.secret_ref.to_dict()
|
||||
return _dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||
"""Create an instance of IoK8sApiCoreV1CephFSPersistentVolumeSource from a dict"""
|
||||
if obj is None:
|
||||
return None
|
||||
|
||||
if not isinstance(obj, dict):
|
||||
return cls.model_validate(obj)
|
||||
|
||||
_obj = cls.model_validate({
|
||||
"monitors": obj.get("monitors"),
|
||||
"path": obj.get("path"),
|
||||
"readOnly": obj.get("readOnly"),
|
||||
"secretFile": obj.get("secretFile"),
|
||||
"secretRef": IoK8sApiCoreV1SecretReference.from_dict(obj["secretRef"]) if obj.get("secretRef") is not None else None,
|
||||
"user": obj.get("user")
|
||||
})
|
||||
return _obj
|
||||
|
||||
|
||||
+101
@@ -0,0 +1,101 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
Kubeflow Trainer OpenAPI Spec
|
||||
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
|
||||
The version of the OpenAPI document: unversioned
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
|
||||
Do not edit the class manually.
|
||||
""" # noqa: E501
|
||||
|
||||
|
||||
from __future__ import annotations
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
import json
|
||||
|
||||
from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr
|
||||
from typing import Any, ClassVar, Dict, List, Optional
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_local_object_reference import IoK8sApiCoreV1LocalObjectReference
|
||||
from typing import Optional, Set
|
||||
from typing_extensions import Self
|
||||
|
||||
class IoK8sApiCoreV1CephFSVolumeSource(BaseModel):
|
||||
"""
|
||||
Represents a Ceph Filesystem mount that lasts the lifetime of a pod Cephfs volumes do not support ownership management or SELinux relabeling.
|
||||
""" # noqa: E501
|
||||
monitors: List[StrictStr] = Field(description="monitors is Required: Monitors is a collection of Ceph monitors More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it")
|
||||
path: Optional[StrictStr] = Field(default=None, description="path is Optional: Used as the mounted root, rather than the full Ceph tree, default is /")
|
||||
read_only: Optional[StrictBool] = Field(default=None, description="readOnly is Optional: Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts. More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it", alias="readOnly")
|
||||
secret_file: Optional[StrictStr] = Field(default=None, description="secretFile is Optional: SecretFile is the path to key ring for User, default is /etc/ceph/user.secret More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it", alias="secretFile")
|
||||
secret_ref: Optional[IoK8sApiCoreV1LocalObjectReference] = Field(default=None, description="secretRef is Optional: SecretRef is reference to the authentication secret for User, default is empty. More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it", alias="secretRef")
|
||||
user: Optional[StrictStr] = Field(default=None, description="user is optional: User is the rados user name, default is admin More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it")
|
||||
__properties: ClassVar[List[str]] = ["monitors", "path", "readOnly", "secretFile", "secretRef", "user"]
|
||||
|
||||
model_config = ConfigDict(
|
||||
populate_by_name=True,
|
||||
validate_assignment=True,
|
||||
protected_namespaces=(),
|
||||
)
|
||||
|
||||
|
||||
def to_str(self) -> str:
|
||||
"""Returns the string representation of the model using alias"""
|
||||
return pprint.pformat(self.model_dump(by_alias=True))
|
||||
|
||||
def to_json(self) -> str:
|
||||
"""Returns the JSON representation of the model using alias"""
|
||||
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
||||
return json.dumps(self.to_dict())
|
||||
|
||||
@classmethod
|
||||
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||
"""Create an instance of IoK8sApiCoreV1CephFSVolumeSource from a JSON string"""
|
||||
return cls.from_dict(json.loads(json_str))
|
||||
|
||||
def to_dict(self) -> Dict[str, Any]:
|
||||
"""Return the dictionary representation of the model using alias.
|
||||
|
||||
This has the following differences from calling pydantic's
|
||||
`self.model_dump(by_alias=True)`:
|
||||
|
||||
* `None` is only added to the output dict for nullable fields that
|
||||
were set at model initialization. Other fields with value `None`
|
||||
are ignored.
|
||||
"""
|
||||
excluded_fields: Set[str] = set([
|
||||
])
|
||||
|
||||
_dict = self.model_dump(
|
||||
by_alias=True,
|
||||
exclude=excluded_fields,
|
||||
exclude_none=True,
|
||||
)
|
||||
# override the default output from pydantic by calling `to_dict()` of secret_ref
|
||||
if self.secret_ref:
|
||||
_dict['secretRef'] = self.secret_ref.to_dict()
|
||||
return _dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||
"""Create an instance of IoK8sApiCoreV1CephFSVolumeSource from a dict"""
|
||||
if obj is None:
|
||||
return None
|
||||
|
||||
if not isinstance(obj, dict):
|
||||
return cls.model_validate(obj)
|
||||
|
||||
_obj = cls.model_validate({
|
||||
"monitors": obj.get("monitors"),
|
||||
"path": obj.get("path"),
|
||||
"readOnly": obj.get("readOnly"),
|
||||
"secretFile": obj.get("secretFile"),
|
||||
"secretRef": IoK8sApiCoreV1LocalObjectReference.from_dict(obj["secretRef"]) if obj.get("secretRef") is not None else None,
|
||||
"user": obj.get("user")
|
||||
})
|
||||
return _obj
|
||||
|
||||
|
||||
+97
@@ -0,0 +1,97 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
Kubeflow Trainer OpenAPI Spec
|
||||
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
|
||||
The version of the OpenAPI document: unversioned
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
|
||||
Do not edit the class manually.
|
||||
""" # noqa: E501
|
||||
|
||||
|
||||
from __future__ import annotations
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
import json
|
||||
|
||||
from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr
|
||||
from typing import Any, ClassVar, Dict, List, Optional
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_secret_reference import IoK8sApiCoreV1SecretReference
|
||||
from typing import Optional, Set
|
||||
from typing_extensions import Self
|
||||
|
||||
class IoK8sApiCoreV1CinderPersistentVolumeSource(BaseModel):
|
||||
"""
|
||||
Represents a cinder volume resource in Openstack. A Cinder volume must exist before mounting to a container. The volume must also be in the same region as the kubelet. Cinder volumes support ownership management and SELinux relabeling.
|
||||
""" # noqa: E501
|
||||
fs_type: Optional[StrictStr] = Field(default=None, description="fsType Filesystem type to mount. Must be a filesystem type supported by the host operating system. Examples: \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified. More info: https://examples.k8s.io/mysql-cinder-pd/README.md", alias="fsType")
|
||||
read_only: Optional[StrictBool] = Field(default=None, description="readOnly is Optional: Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts. More info: https://examples.k8s.io/mysql-cinder-pd/README.md", alias="readOnly")
|
||||
secret_ref: Optional[IoK8sApiCoreV1SecretReference] = Field(default=None, description="secretRef is Optional: points to a secret object containing parameters used to connect to OpenStack.", alias="secretRef")
|
||||
volume_id: StrictStr = Field(description="volumeID used to identify the volume in cinder. More info: https://examples.k8s.io/mysql-cinder-pd/README.md", alias="volumeID")
|
||||
__properties: ClassVar[List[str]] = ["fsType", "readOnly", "secretRef", "volumeID"]
|
||||
|
||||
model_config = ConfigDict(
|
||||
populate_by_name=True,
|
||||
validate_assignment=True,
|
||||
protected_namespaces=(),
|
||||
)
|
||||
|
||||
|
||||
def to_str(self) -> str:
|
||||
"""Returns the string representation of the model using alias"""
|
||||
return pprint.pformat(self.model_dump(by_alias=True))
|
||||
|
||||
def to_json(self) -> str:
|
||||
"""Returns the JSON representation of the model using alias"""
|
||||
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
||||
return json.dumps(self.to_dict())
|
||||
|
||||
@classmethod
|
||||
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||
"""Create an instance of IoK8sApiCoreV1CinderPersistentVolumeSource from a JSON string"""
|
||||
return cls.from_dict(json.loads(json_str))
|
||||
|
||||
def to_dict(self) -> Dict[str, Any]:
|
||||
"""Return the dictionary representation of the model using alias.
|
||||
|
||||
This has the following differences from calling pydantic's
|
||||
`self.model_dump(by_alias=True)`:
|
||||
|
||||
* `None` is only added to the output dict for nullable fields that
|
||||
were set at model initialization. Other fields with value `None`
|
||||
are ignored.
|
||||
"""
|
||||
excluded_fields: Set[str] = set([
|
||||
])
|
||||
|
||||
_dict = self.model_dump(
|
||||
by_alias=True,
|
||||
exclude=excluded_fields,
|
||||
exclude_none=True,
|
||||
)
|
||||
# override the default output from pydantic by calling `to_dict()` of secret_ref
|
||||
if self.secret_ref:
|
||||
_dict['secretRef'] = self.secret_ref.to_dict()
|
||||
return _dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||
"""Create an instance of IoK8sApiCoreV1CinderPersistentVolumeSource from a dict"""
|
||||
if obj is None:
|
||||
return None
|
||||
|
||||
if not isinstance(obj, dict):
|
||||
return cls.model_validate(obj)
|
||||
|
||||
_obj = cls.model_validate({
|
||||
"fsType": obj.get("fsType"),
|
||||
"readOnly": obj.get("readOnly"),
|
||||
"secretRef": IoK8sApiCoreV1SecretReference.from_dict(obj["secretRef"]) if obj.get("secretRef") is not None else None,
|
||||
"volumeID": obj.get("volumeID") if obj.get("volumeID") is not None else ''
|
||||
})
|
||||
return _obj
|
||||
|
||||
|
||||
@@ -0,0 +1,97 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
Kubeflow Trainer OpenAPI Spec
|
||||
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
|
||||
The version of the OpenAPI document: unversioned
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
|
||||
Do not edit the class manually.
|
||||
""" # noqa: E501
|
||||
|
||||
|
||||
from __future__ import annotations
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
import json
|
||||
|
||||
from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr
|
||||
from typing import Any, ClassVar, Dict, List, Optional
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_local_object_reference import IoK8sApiCoreV1LocalObjectReference
|
||||
from typing import Optional, Set
|
||||
from typing_extensions import Self
|
||||
|
||||
class IoK8sApiCoreV1CinderVolumeSource(BaseModel):
|
||||
"""
|
||||
Represents a cinder volume resource in Openstack. A Cinder volume must exist before mounting to a container. The volume must also be in the same region as the kubelet. Cinder volumes support ownership management and SELinux relabeling.
|
||||
""" # noqa: E501
|
||||
fs_type: Optional[StrictStr] = Field(default=None, description="fsType is the filesystem type to mount. Must be a filesystem type supported by the host operating system. Examples: \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified. More info: https://examples.k8s.io/mysql-cinder-pd/README.md", alias="fsType")
|
||||
read_only: Optional[StrictBool] = Field(default=None, description="readOnly defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts. More info: https://examples.k8s.io/mysql-cinder-pd/README.md", alias="readOnly")
|
||||
secret_ref: Optional[IoK8sApiCoreV1LocalObjectReference] = Field(default=None, description="secretRef is optional: points to a secret object containing parameters used to connect to OpenStack.", alias="secretRef")
|
||||
volume_id: StrictStr = Field(description="volumeID used to identify the volume in cinder. More info: https://examples.k8s.io/mysql-cinder-pd/README.md", alias="volumeID")
|
||||
__properties: ClassVar[List[str]] = ["fsType", "readOnly", "secretRef", "volumeID"]
|
||||
|
||||
model_config = ConfigDict(
|
||||
populate_by_name=True,
|
||||
validate_assignment=True,
|
||||
protected_namespaces=(),
|
||||
)
|
||||
|
||||
|
||||
def to_str(self) -> str:
|
||||
"""Returns the string representation of the model using alias"""
|
||||
return pprint.pformat(self.model_dump(by_alias=True))
|
||||
|
||||
def to_json(self) -> str:
|
||||
"""Returns the JSON representation of the model using alias"""
|
||||
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
||||
return json.dumps(self.to_dict())
|
||||
|
||||
@classmethod
|
||||
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||
"""Create an instance of IoK8sApiCoreV1CinderVolumeSource from a JSON string"""
|
||||
return cls.from_dict(json.loads(json_str))
|
||||
|
||||
def to_dict(self) -> Dict[str, Any]:
|
||||
"""Return the dictionary representation of the model using alias.
|
||||
|
||||
This has the following differences from calling pydantic's
|
||||
`self.model_dump(by_alias=True)`:
|
||||
|
||||
* `None` is only added to the output dict for nullable fields that
|
||||
were set at model initialization. Other fields with value `None`
|
||||
are ignored.
|
||||
"""
|
||||
excluded_fields: Set[str] = set([
|
||||
])
|
||||
|
||||
_dict = self.model_dump(
|
||||
by_alias=True,
|
||||
exclude=excluded_fields,
|
||||
exclude_none=True,
|
||||
)
|
||||
# override the default output from pydantic by calling `to_dict()` of secret_ref
|
||||
if self.secret_ref:
|
||||
_dict['secretRef'] = self.secret_ref.to_dict()
|
||||
return _dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||
"""Create an instance of IoK8sApiCoreV1CinderVolumeSource from a dict"""
|
||||
if obj is None:
|
||||
return None
|
||||
|
||||
if not isinstance(obj, dict):
|
||||
return cls.model_validate(obj)
|
||||
|
||||
_obj = cls.model_validate({
|
||||
"fsType": obj.get("fsType"),
|
||||
"readOnly": obj.get("readOnly"),
|
||||
"secretRef": IoK8sApiCoreV1LocalObjectReference.from_dict(obj["secretRef"]) if obj.get("secretRef") is not None else None,
|
||||
"volumeID": obj.get("volumeID") if obj.get("volumeID") is not None else ''
|
||||
})
|
||||
return _obj
|
||||
|
||||
|
||||
@@ -0,0 +1,87 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
Kubeflow Trainer OpenAPI Spec
|
||||
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
|
||||
The version of the OpenAPI document: unversioned
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
|
||||
Do not edit the class manually.
|
||||
""" # noqa: E501
|
||||
|
||||
|
||||
from __future__ import annotations
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
import json
|
||||
|
||||
from pydantic import BaseModel, ConfigDict, Field, StrictInt
|
||||
from typing import Any, ClassVar, Dict, List, Optional
|
||||
from typing import Optional, Set
|
||||
from typing_extensions import Self
|
||||
|
||||
class IoK8sApiCoreV1ClientIPConfig(BaseModel):
|
||||
"""
|
||||
ClientIPConfig represents the configurations of Client IP based session affinity.
|
||||
""" # noqa: E501
|
||||
timeout_seconds: Optional[StrictInt] = Field(default=None, description="timeoutSeconds specifies the seconds of ClientIP type session sticky time. The value must be >0 && <=86400(for 1 day) if ServiceAffinity == \"ClientIP\". Default value is 10800(for 3 hours).", alias="timeoutSeconds")
|
||||
__properties: ClassVar[List[str]] = ["timeoutSeconds"]
|
||||
|
||||
model_config = ConfigDict(
|
||||
populate_by_name=True,
|
||||
validate_assignment=True,
|
||||
protected_namespaces=(),
|
||||
)
|
||||
|
||||
|
||||
def to_str(self) -> str:
|
||||
"""Returns the string representation of the model using alias"""
|
||||
return pprint.pformat(self.model_dump(by_alias=True))
|
||||
|
||||
def to_json(self) -> str:
|
||||
"""Returns the JSON representation of the model using alias"""
|
||||
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
||||
return json.dumps(self.to_dict())
|
||||
|
||||
@classmethod
|
||||
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||
"""Create an instance of IoK8sApiCoreV1ClientIPConfig from a JSON string"""
|
||||
return cls.from_dict(json.loads(json_str))
|
||||
|
||||
def to_dict(self) -> Dict[str, Any]:
|
||||
"""Return the dictionary representation of the model using alias.
|
||||
|
||||
This has the following differences from calling pydantic's
|
||||
`self.model_dump(by_alias=True)`:
|
||||
|
||||
* `None` is only added to the output dict for nullable fields that
|
||||
were set at model initialization. Other fields with value `None`
|
||||
are ignored.
|
||||
"""
|
||||
excluded_fields: Set[str] = set([
|
||||
])
|
||||
|
||||
_dict = self.model_dump(
|
||||
by_alias=True,
|
||||
exclude=excluded_fields,
|
||||
exclude_none=True,
|
||||
)
|
||||
return _dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||
"""Create an instance of IoK8sApiCoreV1ClientIPConfig from a dict"""
|
||||
if obj is None:
|
||||
return None
|
||||
|
||||
if not isinstance(obj, dict):
|
||||
return cls.model_validate(obj)
|
||||
|
||||
_obj = cls.model_validate({
|
||||
"timeoutSeconds": obj.get("timeoutSeconds")
|
||||
})
|
||||
return _obj
|
||||
|
||||
|
||||
+99
@@ -0,0 +1,99 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
Kubeflow Trainer OpenAPI Spec
|
||||
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
|
||||
The version of the OpenAPI document: unversioned
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
|
||||
Do not edit the class manually.
|
||||
""" # noqa: E501
|
||||
|
||||
|
||||
from __future__ import annotations
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
import json
|
||||
|
||||
from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr
|
||||
from typing import Any, ClassVar, Dict, List, Optional
|
||||
from kubeflow_trainer_api.models.io_k8s_apimachinery_pkg_apis_meta_v1_label_selector import IoK8sApimachineryPkgApisMetaV1LabelSelector
|
||||
from typing import Optional, Set
|
||||
from typing_extensions import Self
|
||||
|
||||
class IoK8sApiCoreV1ClusterTrustBundleProjection(BaseModel):
|
||||
"""
|
||||
ClusterTrustBundleProjection describes how to select a set of ClusterTrustBundle objects and project their contents into the pod filesystem.
|
||||
""" # noqa: E501
|
||||
label_selector: Optional[IoK8sApimachineryPkgApisMetaV1LabelSelector] = Field(default=None, description="Select all ClusterTrustBundles that match this label selector. Only has effect if signerName is set. Mutually-exclusive with name. If unset, interpreted as \"match nothing\". If set but empty, interpreted as \"match everything\".", alias="labelSelector")
|
||||
name: Optional[StrictStr] = Field(default=None, description="Select a single ClusterTrustBundle by object name. Mutually-exclusive with signerName and labelSelector.")
|
||||
optional: Optional[StrictBool] = Field(default=None, description="If true, don't block pod startup if the referenced ClusterTrustBundle(s) aren't available. If using name, then the named ClusterTrustBundle is allowed not to exist. If using signerName, then the combination of signerName and labelSelector is allowed to match zero ClusterTrustBundles.")
|
||||
path: StrictStr = Field(description="Relative path from the volume root to write the bundle.")
|
||||
signer_name: Optional[StrictStr] = Field(default=None, description="Select all ClusterTrustBundles that match this signer name. Mutually-exclusive with name. The contents of all selected ClusterTrustBundles will be unified and deduplicated.", alias="signerName")
|
||||
__properties: ClassVar[List[str]] = ["labelSelector", "name", "optional", "path", "signerName"]
|
||||
|
||||
model_config = ConfigDict(
|
||||
populate_by_name=True,
|
||||
validate_assignment=True,
|
||||
protected_namespaces=(),
|
||||
)
|
||||
|
||||
|
||||
def to_str(self) -> str:
|
||||
"""Returns the string representation of the model using alias"""
|
||||
return pprint.pformat(self.model_dump(by_alias=True))
|
||||
|
||||
def to_json(self) -> str:
|
||||
"""Returns the JSON representation of the model using alias"""
|
||||
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
||||
return json.dumps(self.to_dict())
|
||||
|
||||
@classmethod
|
||||
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||
"""Create an instance of IoK8sApiCoreV1ClusterTrustBundleProjection from a JSON string"""
|
||||
return cls.from_dict(json.loads(json_str))
|
||||
|
||||
def to_dict(self) -> Dict[str, Any]:
|
||||
"""Return the dictionary representation of the model using alias.
|
||||
|
||||
This has the following differences from calling pydantic's
|
||||
`self.model_dump(by_alias=True)`:
|
||||
|
||||
* `None` is only added to the output dict for nullable fields that
|
||||
were set at model initialization. Other fields with value `None`
|
||||
are ignored.
|
||||
"""
|
||||
excluded_fields: Set[str] = set([
|
||||
])
|
||||
|
||||
_dict = self.model_dump(
|
||||
by_alias=True,
|
||||
exclude=excluded_fields,
|
||||
exclude_none=True,
|
||||
)
|
||||
# override the default output from pydantic by calling `to_dict()` of label_selector
|
||||
if self.label_selector:
|
||||
_dict['labelSelector'] = self.label_selector.to_dict()
|
||||
return _dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||
"""Create an instance of IoK8sApiCoreV1ClusterTrustBundleProjection from a dict"""
|
||||
if obj is None:
|
||||
return None
|
||||
|
||||
if not isinstance(obj, dict):
|
||||
return cls.model_validate(obj)
|
||||
|
||||
_obj = cls.model_validate({
|
||||
"labelSelector": IoK8sApimachineryPkgApisMetaV1LabelSelector.from_dict(obj["labelSelector"]) if obj.get("labelSelector") is not None else None,
|
||||
"name": obj.get("name"),
|
||||
"optional": obj.get("optional"),
|
||||
"path": obj.get("path") if obj.get("path") is not None else '',
|
||||
"signerName": obj.get("signerName")
|
||||
})
|
||||
return _obj
|
||||
|
||||
|
||||
@@ -0,0 +1,93 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
Kubeflow Trainer OpenAPI Spec
|
||||
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
|
||||
The version of the OpenAPI document: unversioned
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
|
||||
Do not edit the class manually.
|
||||
""" # noqa: E501
|
||||
|
||||
|
||||
from __future__ import annotations
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
import json
|
||||
|
||||
from pydantic import BaseModel, ConfigDict, Field, StrictStr
|
||||
from typing import Any, ClassVar, Dict, List, Optional
|
||||
from typing import Optional, Set
|
||||
from typing_extensions import Self
|
||||
|
||||
class IoK8sApiCoreV1ComponentCondition(BaseModel):
|
||||
"""
|
||||
Information about the condition of a component.
|
||||
""" # noqa: E501
|
||||
error: Optional[StrictStr] = Field(default=None, description="Condition error code for a component. For example, a health check error code.")
|
||||
message: Optional[StrictStr] = Field(default=None, description="Message about the condition for a component. For example, information about a health check.")
|
||||
status: StrictStr = Field(description="Status of the condition for a component. Valid values for \"Healthy\": \"True\", \"False\", or \"Unknown\".")
|
||||
type: StrictStr = Field(description="Type of condition for a component. Valid value: \"Healthy\"")
|
||||
__properties: ClassVar[List[str]] = ["error", "message", "status", "type"]
|
||||
|
||||
model_config = ConfigDict(
|
||||
populate_by_name=True,
|
||||
validate_assignment=True,
|
||||
protected_namespaces=(),
|
||||
)
|
||||
|
||||
|
||||
def to_str(self) -> str:
|
||||
"""Returns the string representation of the model using alias"""
|
||||
return pprint.pformat(self.model_dump(by_alias=True))
|
||||
|
||||
def to_json(self) -> str:
|
||||
"""Returns the JSON representation of the model using alias"""
|
||||
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
||||
return json.dumps(self.to_dict())
|
||||
|
||||
@classmethod
|
||||
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||
"""Create an instance of IoK8sApiCoreV1ComponentCondition from a JSON string"""
|
||||
return cls.from_dict(json.loads(json_str))
|
||||
|
||||
def to_dict(self) -> Dict[str, Any]:
|
||||
"""Return the dictionary representation of the model using alias.
|
||||
|
||||
This has the following differences from calling pydantic's
|
||||
`self.model_dump(by_alias=True)`:
|
||||
|
||||
* `None` is only added to the output dict for nullable fields that
|
||||
were set at model initialization. Other fields with value `None`
|
||||
are ignored.
|
||||
"""
|
||||
excluded_fields: Set[str] = set([
|
||||
])
|
||||
|
||||
_dict = self.model_dump(
|
||||
by_alias=True,
|
||||
exclude=excluded_fields,
|
||||
exclude_none=True,
|
||||
)
|
||||
return _dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||
"""Create an instance of IoK8sApiCoreV1ComponentCondition from a dict"""
|
||||
if obj is None:
|
||||
return None
|
||||
|
||||
if not isinstance(obj, dict):
|
||||
return cls.model_validate(obj)
|
||||
|
||||
_obj = cls.model_validate({
|
||||
"error": obj.get("error"),
|
||||
"message": obj.get("message"),
|
||||
"status": obj.get("status") if obj.get("status") is not None else '',
|
||||
"type": obj.get("type") if obj.get("type") is not None else ''
|
||||
})
|
||||
return _obj
|
||||
|
||||
|
||||
@@ -0,0 +1,105 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
Kubeflow Trainer OpenAPI Spec
|
||||
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
|
||||
The version of the OpenAPI document: unversioned
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
|
||||
Do not edit the class manually.
|
||||
""" # noqa: E501
|
||||
|
||||
|
||||
from __future__ import annotations
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
import json
|
||||
|
||||
from pydantic import BaseModel, ConfigDict, Field, StrictStr
|
||||
from typing import Any, ClassVar, Dict, List, Optional
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_component_condition import IoK8sApiCoreV1ComponentCondition
|
||||
from kubeflow_trainer_api.models.io_k8s_apimachinery_pkg_apis_meta_v1_object_meta import IoK8sApimachineryPkgApisMetaV1ObjectMeta
|
||||
from typing import Optional, Set
|
||||
from typing_extensions import Self
|
||||
|
||||
class IoK8sApiCoreV1ComponentStatus(BaseModel):
|
||||
"""
|
||||
ComponentStatus (and ComponentStatusList) holds the cluster validation info. Deprecated: This API is deprecated in v1.19+
|
||||
""" # noqa: E501
|
||||
api_version: Optional[StrictStr] = Field(default=None, description="APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", alias="apiVersion")
|
||||
conditions: Optional[List[IoK8sApiCoreV1ComponentCondition]] = Field(default=None, description="List of component conditions observed")
|
||||
kind: Optional[StrictStr] = Field(default=None, description="Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds")
|
||||
metadata: Optional[IoK8sApimachineryPkgApisMetaV1ObjectMeta] = Field(default=None, description="Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata")
|
||||
__properties: ClassVar[List[str]] = ["apiVersion", "conditions", "kind", "metadata"]
|
||||
|
||||
model_config = ConfigDict(
|
||||
populate_by_name=True,
|
||||
validate_assignment=True,
|
||||
protected_namespaces=(),
|
||||
)
|
||||
|
||||
|
||||
def to_str(self) -> str:
|
||||
"""Returns the string representation of the model using alias"""
|
||||
return pprint.pformat(self.model_dump(by_alias=True))
|
||||
|
||||
def to_json(self) -> str:
|
||||
"""Returns the JSON representation of the model using alias"""
|
||||
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
||||
return json.dumps(self.to_dict())
|
||||
|
||||
@classmethod
|
||||
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||
"""Create an instance of IoK8sApiCoreV1ComponentStatus from a JSON string"""
|
||||
return cls.from_dict(json.loads(json_str))
|
||||
|
||||
def to_dict(self) -> Dict[str, Any]:
|
||||
"""Return the dictionary representation of the model using alias.
|
||||
|
||||
This has the following differences from calling pydantic's
|
||||
`self.model_dump(by_alias=True)`:
|
||||
|
||||
* `None` is only added to the output dict for nullable fields that
|
||||
were set at model initialization. Other fields with value `None`
|
||||
are ignored.
|
||||
"""
|
||||
excluded_fields: Set[str] = set([
|
||||
])
|
||||
|
||||
_dict = self.model_dump(
|
||||
by_alias=True,
|
||||
exclude=excluded_fields,
|
||||
exclude_none=True,
|
||||
)
|
||||
# override the default output from pydantic by calling `to_dict()` of each item in conditions (list)
|
||||
_items = []
|
||||
if self.conditions:
|
||||
for _item_conditions in self.conditions:
|
||||
if _item_conditions:
|
||||
_items.append(_item_conditions.to_dict())
|
||||
_dict['conditions'] = _items
|
||||
# override the default output from pydantic by calling `to_dict()` of metadata
|
||||
if self.metadata:
|
||||
_dict['metadata'] = self.metadata.to_dict()
|
||||
return _dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||
"""Create an instance of IoK8sApiCoreV1ComponentStatus from a dict"""
|
||||
if obj is None:
|
||||
return None
|
||||
|
||||
if not isinstance(obj, dict):
|
||||
return cls.model_validate(obj)
|
||||
|
||||
_obj = cls.model_validate({
|
||||
"apiVersion": obj.get("apiVersion"),
|
||||
"conditions": [IoK8sApiCoreV1ComponentCondition.from_dict(_item) for _item in obj["conditions"]] if obj.get("conditions") is not None else None,
|
||||
"kind": obj.get("kind"),
|
||||
"metadata": IoK8sApimachineryPkgApisMetaV1ObjectMeta.from_dict(obj["metadata"]) if obj.get("metadata") is not None else None
|
||||
})
|
||||
return _obj
|
||||
|
||||
|
||||
+105
@@ -0,0 +1,105 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
Kubeflow Trainer OpenAPI Spec
|
||||
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
|
||||
The version of the OpenAPI document: unversioned
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
|
||||
Do not edit the class manually.
|
||||
""" # noqa: E501
|
||||
|
||||
|
||||
from __future__ import annotations
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
import json
|
||||
|
||||
from pydantic import BaseModel, ConfigDict, Field, StrictStr
|
||||
from typing import Any, ClassVar, Dict, List, Optional
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_component_status import IoK8sApiCoreV1ComponentStatus
|
||||
from kubeflow_trainer_api.models.io_k8s_apimachinery_pkg_apis_meta_v1_list_meta import IoK8sApimachineryPkgApisMetaV1ListMeta
|
||||
from typing import Optional, Set
|
||||
from typing_extensions import Self
|
||||
|
||||
class IoK8sApiCoreV1ComponentStatusList(BaseModel):
|
||||
"""
|
||||
Status of all the conditions for the component as a list of ComponentStatus objects. Deprecated: This API is deprecated in v1.19+
|
||||
""" # noqa: E501
|
||||
api_version: Optional[StrictStr] = Field(default=None, description="APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", alias="apiVersion")
|
||||
items: List[IoK8sApiCoreV1ComponentStatus] = Field(description="List of ComponentStatus objects.")
|
||||
kind: Optional[StrictStr] = Field(default=None, description="Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds")
|
||||
metadata: Optional[IoK8sApimachineryPkgApisMetaV1ListMeta] = Field(default=None, description="Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds")
|
||||
__properties: ClassVar[List[str]] = ["apiVersion", "items", "kind", "metadata"]
|
||||
|
||||
model_config = ConfigDict(
|
||||
populate_by_name=True,
|
||||
validate_assignment=True,
|
||||
protected_namespaces=(),
|
||||
)
|
||||
|
||||
|
||||
def to_str(self) -> str:
|
||||
"""Returns the string representation of the model using alias"""
|
||||
return pprint.pformat(self.model_dump(by_alias=True))
|
||||
|
||||
def to_json(self) -> str:
|
||||
"""Returns the JSON representation of the model using alias"""
|
||||
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
||||
return json.dumps(self.to_dict())
|
||||
|
||||
@classmethod
|
||||
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||
"""Create an instance of IoK8sApiCoreV1ComponentStatusList from a JSON string"""
|
||||
return cls.from_dict(json.loads(json_str))
|
||||
|
||||
def to_dict(self) -> Dict[str, Any]:
|
||||
"""Return the dictionary representation of the model using alias.
|
||||
|
||||
This has the following differences from calling pydantic's
|
||||
`self.model_dump(by_alias=True)`:
|
||||
|
||||
* `None` is only added to the output dict for nullable fields that
|
||||
were set at model initialization. Other fields with value `None`
|
||||
are ignored.
|
||||
"""
|
||||
excluded_fields: Set[str] = set([
|
||||
])
|
||||
|
||||
_dict = self.model_dump(
|
||||
by_alias=True,
|
||||
exclude=excluded_fields,
|
||||
exclude_none=True,
|
||||
)
|
||||
# override the default output from pydantic by calling `to_dict()` of each item in items (list)
|
||||
_items = []
|
||||
if self.items:
|
||||
for _item_items in self.items:
|
||||
if _item_items:
|
||||
_items.append(_item_items.to_dict())
|
||||
_dict['items'] = _items
|
||||
# override the default output from pydantic by calling `to_dict()` of metadata
|
||||
if self.metadata:
|
||||
_dict['metadata'] = self.metadata.to_dict()
|
||||
return _dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||
"""Create an instance of IoK8sApiCoreV1ComponentStatusList from a dict"""
|
||||
if obj is None:
|
||||
return None
|
||||
|
||||
if not isinstance(obj, dict):
|
||||
return cls.model_validate(obj)
|
||||
|
||||
_obj = cls.model_validate({
|
||||
"apiVersion": obj.get("apiVersion"),
|
||||
"items": [IoK8sApiCoreV1ComponentStatus.from_dict(_item) for _item in obj["items"]] if obj.get("items") is not None else None,
|
||||
"kind": obj.get("kind"),
|
||||
"metadata": IoK8sApimachineryPkgApisMetaV1ListMeta.from_dict(obj["metadata"]) if obj.get("metadata") is not None else None
|
||||
})
|
||||
return _obj
|
||||
|
||||
|
||||
@@ -0,0 +1,101 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
Kubeflow Trainer OpenAPI Spec
|
||||
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
|
||||
The version of the OpenAPI document: unversioned
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
|
||||
Do not edit the class manually.
|
||||
""" # noqa: E501
|
||||
|
||||
|
||||
from __future__ import annotations
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
import json
|
||||
|
||||
from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictBytes, StrictStr
|
||||
from typing import Any, ClassVar, Dict, List, Optional, Union
|
||||
from kubeflow_trainer_api.models.io_k8s_apimachinery_pkg_apis_meta_v1_object_meta import IoK8sApimachineryPkgApisMetaV1ObjectMeta
|
||||
from typing import Optional, Set
|
||||
from typing_extensions import Self
|
||||
|
||||
class IoK8sApiCoreV1ConfigMap(BaseModel):
|
||||
"""
|
||||
ConfigMap holds configuration data for pods to consume.
|
||||
""" # noqa: E501
|
||||
api_version: Optional[StrictStr] = Field(default=None, description="APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", alias="apiVersion")
|
||||
binary_data: Optional[Dict[str, Union[StrictBytes, StrictStr]]] = Field(default=None, description="BinaryData contains the binary data. Each key must consist of alphanumeric characters, '-', '_' or '.'. BinaryData can contain byte sequences that are not in the UTF-8 range. The keys stored in BinaryData must not overlap with the ones in the Data field, this is enforced during validation process. Using this field will require 1.10+ apiserver and kubelet.", alias="binaryData")
|
||||
data: Optional[Dict[str, StrictStr]] = Field(default=None, description="Data contains the configuration data. Each key must consist of alphanumeric characters, '-', '_' or '.'. Values with non-UTF-8 byte sequences must use the BinaryData field. The keys stored in Data must not overlap with the keys in the BinaryData field, this is enforced during validation process.")
|
||||
immutable: Optional[StrictBool] = Field(default=None, description="Immutable, if set to true, ensures that data stored in the ConfigMap cannot be updated (only object metadata can be modified). If not set to true, the field can be modified at any time. Defaulted to nil.")
|
||||
kind: Optional[StrictStr] = Field(default=None, description="Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds")
|
||||
metadata: Optional[IoK8sApimachineryPkgApisMetaV1ObjectMeta] = Field(default=None, description="Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata")
|
||||
__properties: ClassVar[List[str]] = ["apiVersion", "binaryData", "data", "immutable", "kind", "metadata"]
|
||||
|
||||
model_config = ConfigDict(
|
||||
populate_by_name=True,
|
||||
validate_assignment=True,
|
||||
protected_namespaces=(),
|
||||
)
|
||||
|
||||
|
||||
def to_str(self) -> str:
|
||||
"""Returns the string representation of the model using alias"""
|
||||
return pprint.pformat(self.model_dump(by_alias=True))
|
||||
|
||||
def to_json(self) -> str:
|
||||
"""Returns the JSON representation of the model using alias"""
|
||||
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
||||
return json.dumps(self.to_dict())
|
||||
|
||||
@classmethod
|
||||
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||
"""Create an instance of IoK8sApiCoreV1ConfigMap from a JSON string"""
|
||||
return cls.from_dict(json.loads(json_str))
|
||||
|
||||
def to_dict(self) -> Dict[str, Any]:
|
||||
"""Return the dictionary representation of the model using alias.
|
||||
|
||||
This has the following differences from calling pydantic's
|
||||
`self.model_dump(by_alias=True)`:
|
||||
|
||||
* `None` is only added to the output dict for nullable fields that
|
||||
were set at model initialization. Other fields with value `None`
|
||||
are ignored.
|
||||
"""
|
||||
excluded_fields: Set[str] = set([
|
||||
])
|
||||
|
||||
_dict = self.model_dump(
|
||||
by_alias=True,
|
||||
exclude=excluded_fields,
|
||||
exclude_none=True,
|
||||
)
|
||||
# override the default output from pydantic by calling `to_dict()` of metadata
|
||||
if self.metadata:
|
||||
_dict['metadata'] = self.metadata.to_dict()
|
||||
return _dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||
"""Create an instance of IoK8sApiCoreV1ConfigMap from a dict"""
|
||||
if obj is None:
|
||||
return None
|
||||
|
||||
if not isinstance(obj, dict):
|
||||
return cls.model_validate(obj)
|
||||
|
||||
_obj = cls.model_validate({
|
||||
"apiVersion": obj.get("apiVersion"),
|
||||
"binaryData": obj.get("binaryData"),
|
||||
"data": obj.get("data"),
|
||||
"immutable": obj.get("immutable"),
|
||||
"kind": obj.get("kind"),
|
||||
"metadata": IoK8sApimachineryPkgApisMetaV1ObjectMeta.from_dict(obj["metadata"]) if obj.get("metadata") is not None else None
|
||||
})
|
||||
return _obj
|
||||
|
||||
|
||||
+89
@@ -0,0 +1,89 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
Kubeflow Trainer OpenAPI Spec
|
||||
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
|
||||
The version of the OpenAPI document: unversioned
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
|
||||
Do not edit the class manually.
|
||||
""" # noqa: E501
|
||||
|
||||
|
||||
from __future__ import annotations
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
import json
|
||||
|
||||
from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr
|
||||
from typing import Any, ClassVar, Dict, List, Optional
|
||||
from typing import Optional, Set
|
||||
from typing_extensions import Self
|
||||
|
||||
class IoK8sApiCoreV1ConfigMapEnvSource(BaseModel):
|
||||
"""
|
||||
ConfigMapEnvSource selects a ConfigMap to populate the environment variables with. The contents of the target ConfigMap's Data field will represent the key-value pairs as environment variables.
|
||||
""" # noqa: E501
|
||||
name: Optional[StrictStr] = Field(default='', description="Name of the referent. This field is effectively required, but due to backwards compatibility is allowed to be empty. Instances of this type with an empty value here are almost certainly wrong. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names")
|
||||
optional: Optional[StrictBool] = Field(default=None, description="Specify whether the ConfigMap must be defined")
|
||||
__properties: ClassVar[List[str]] = ["name", "optional"]
|
||||
|
||||
model_config = ConfigDict(
|
||||
populate_by_name=True,
|
||||
validate_assignment=True,
|
||||
protected_namespaces=(),
|
||||
)
|
||||
|
||||
|
||||
def to_str(self) -> str:
|
||||
"""Returns the string representation of the model using alias"""
|
||||
return pprint.pformat(self.model_dump(by_alias=True))
|
||||
|
||||
def to_json(self) -> str:
|
||||
"""Returns the JSON representation of the model using alias"""
|
||||
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
||||
return json.dumps(self.to_dict())
|
||||
|
||||
@classmethod
|
||||
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||
"""Create an instance of IoK8sApiCoreV1ConfigMapEnvSource from a JSON string"""
|
||||
return cls.from_dict(json.loads(json_str))
|
||||
|
||||
def to_dict(self) -> Dict[str, Any]:
|
||||
"""Return the dictionary representation of the model using alias.
|
||||
|
||||
This has the following differences from calling pydantic's
|
||||
`self.model_dump(by_alias=True)`:
|
||||
|
||||
* `None` is only added to the output dict for nullable fields that
|
||||
were set at model initialization. Other fields with value `None`
|
||||
are ignored.
|
||||
"""
|
||||
excluded_fields: Set[str] = set([
|
||||
])
|
||||
|
||||
_dict = self.model_dump(
|
||||
by_alias=True,
|
||||
exclude=excluded_fields,
|
||||
exclude_none=True,
|
||||
)
|
||||
return _dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||
"""Create an instance of IoK8sApiCoreV1ConfigMapEnvSource from a dict"""
|
||||
if obj is None:
|
||||
return None
|
||||
|
||||
if not isinstance(obj, dict):
|
||||
return cls.model_validate(obj)
|
||||
|
||||
_obj = cls.model_validate({
|
||||
"name": obj.get("name") if obj.get("name") is not None else '',
|
||||
"optional": obj.get("optional")
|
||||
})
|
||||
return _obj
|
||||
|
||||
|
||||
+91
@@ -0,0 +1,91 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
Kubeflow Trainer OpenAPI Spec
|
||||
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
|
||||
The version of the OpenAPI document: unversioned
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
|
||||
Do not edit the class manually.
|
||||
""" # noqa: E501
|
||||
|
||||
|
||||
from __future__ import annotations
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
import json
|
||||
|
||||
from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr
|
||||
from typing import Any, ClassVar, Dict, List, Optional
|
||||
from typing import Optional, Set
|
||||
from typing_extensions import Self
|
||||
|
||||
class IoK8sApiCoreV1ConfigMapKeySelector(BaseModel):
|
||||
"""
|
||||
Selects a key from a ConfigMap.
|
||||
""" # noqa: E501
|
||||
key: StrictStr = Field(description="The key to select.")
|
||||
name: Optional[StrictStr] = Field(default='', description="Name of the referent. This field is effectively required, but due to backwards compatibility is allowed to be empty. Instances of this type with an empty value here are almost certainly wrong. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names")
|
||||
optional: Optional[StrictBool] = Field(default=None, description="Specify whether the ConfigMap or its key must be defined")
|
||||
__properties: ClassVar[List[str]] = ["key", "name", "optional"]
|
||||
|
||||
model_config = ConfigDict(
|
||||
populate_by_name=True,
|
||||
validate_assignment=True,
|
||||
protected_namespaces=(),
|
||||
)
|
||||
|
||||
|
||||
def to_str(self) -> str:
|
||||
"""Returns the string representation of the model using alias"""
|
||||
return pprint.pformat(self.model_dump(by_alias=True))
|
||||
|
||||
def to_json(self) -> str:
|
||||
"""Returns the JSON representation of the model using alias"""
|
||||
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
||||
return json.dumps(self.to_dict())
|
||||
|
||||
@classmethod
|
||||
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||
"""Create an instance of IoK8sApiCoreV1ConfigMapKeySelector from a JSON string"""
|
||||
return cls.from_dict(json.loads(json_str))
|
||||
|
||||
def to_dict(self) -> Dict[str, Any]:
|
||||
"""Return the dictionary representation of the model using alias.
|
||||
|
||||
This has the following differences from calling pydantic's
|
||||
`self.model_dump(by_alias=True)`:
|
||||
|
||||
* `None` is only added to the output dict for nullable fields that
|
||||
were set at model initialization. Other fields with value `None`
|
||||
are ignored.
|
||||
"""
|
||||
excluded_fields: Set[str] = set([
|
||||
])
|
||||
|
||||
_dict = self.model_dump(
|
||||
by_alias=True,
|
||||
exclude=excluded_fields,
|
||||
exclude_none=True,
|
||||
)
|
||||
return _dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||
"""Create an instance of IoK8sApiCoreV1ConfigMapKeySelector from a dict"""
|
||||
if obj is None:
|
||||
return None
|
||||
|
||||
if not isinstance(obj, dict):
|
||||
return cls.model_validate(obj)
|
||||
|
||||
_obj = cls.model_validate({
|
||||
"key": obj.get("key") if obj.get("key") is not None else '',
|
||||
"name": obj.get("name") if obj.get("name") is not None else '',
|
||||
"optional": obj.get("optional")
|
||||
})
|
||||
return _obj
|
||||
|
||||
|
||||
@@ -0,0 +1,105 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
Kubeflow Trainer OpenAPI Spec
|
||||
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
|
||||
The version of the OpenAPI document: unversioned
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
|
||||
Do not edit the class manually.
|
||||
""" # noqa: E501
|
||||
|
||||
|
||||
from __future__ import annotations
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
import json
|
||||
|
||||
from pydantic import BaseModel, ConfigDict, Field, StrictStr
|
||||
from typing import Any, ClassVar, Dict, List, Optional
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_config_map import IoK8sApiCoreV1ConfigMap
|
||||
from kubeflow_trainer_api.models.io_k8s_apimachinery_pkg_apis_meta_v1_list_meta import IoK8sApimachineryPkgApisMetaV1ListMeta
|
||||
from typing import Optional, Set
|
||||
from typing_extensions import Self
|
||||
|
||||
class IoK8sApiCoreV1ConfigMapList(BaseModel):
|
||||
"""
|
||||
ConfigMapList is a resource containing a list of ConfigMap objects.
|
||||
""" # noqa: E501
|
||||
api_version: Optional[StrictStr] = Field(default=None, description="APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", alias="apiVersion")
|
||||
items: List[IoK8sApiCoreV1ConfigMap] = Field(description="Items is the list of ConfigMaps.")
|
||||
kind: Optional[StrictStr] = Field(default=None, description="Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds")
|
||||
metadata: Optional[IoK8sApimachineryPkgApisMetaV1ListMeta] = Field(default=None, description="More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata")
|
||||
__properties: ClassVar[List[str]] = ["apiVersion", "items", "kind", "metadata"]
|
||||
|
||||
model_config = ConfigDict(
|
||||
populate_by_name=True,
|
||||
validate_assignment=True,
|
||||
protected_namespaces=(),
|
||||
)
|
||||
|
||||
|
||||
def to_str(self) -> str:
|
||||
"""Returns the string representation of the model using alias"""
|
||||
return pprint.pformat(self.model_dump(by_alias=True))
|
||||
|
||||
def to_json(self) -> str:
|
||||
"""Returns the JSON representation of the model using alias"""
|
||||
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
||||
return json.dumps(self.to_dict())
|
||||
|
||||
@classmethod
|
||||
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||
"""Create an instance of IoK8sApiCoreV1ConfigMapList from a JSON string"""
|
||||
return cls.from_dict(json.loads(json_str))
|
||||
|
||||
def to_dict(self) -> Dict[str, Any]:
|
||||
"""Return the dictionary representation of the model using alias.
|
||||
|
||||
This has the following differences from calling pydantic's
|
||||
`self.model_dump(by_alias=True)`:
|
||||
|
||||
* `None` is only added to the output dict for nullable fields that
|
||||
were set at model initialization. Other fields with value `None`
|
||||
are ignored.
|
||||
"""
|
||||
excluded_fields: Set[str] = set([
|
||||
])
|
||||
|
||||
_dict = self.model_dump(
|
||||
by_alias=True,
|
||||
exclude=excluded_fields,
|
||||
exclude_none=True,
|
||||
)
|
||||
# override the default output from pydantic by calling `to_dict()` of each item in items (list)
|
||||
_items = []
|
||||
if self.items:
|
||||
for _item_items in self.items:
|
||||
if _item_items:
|
||||
_items.append(_item_items.to_dict())
|
||||
_dict['items'] = _items
|
||||
# override the default output from pydantic by calling `to_dict()` of metadata
|
||||
if self.metadata:
|
||||
_dict['metadata'] = self.metadata.to_dict()
|
||||
return _dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||
"""Create an instance of IoK8sApiCoreV1ConfigMapList from a dict"""
|
||||
if obj is None:
|
||||
return None
|
||||
|
||||
if not isinstance(obj, dict):
|
||||
return cls.model_validate(obj)
|
||||
|
||||
_obj = cls.model_validate({
|
||||
"apiVersion": obj.get("apiVersion"),
|
||||
"items": [IoK8sApiCoreV1ConfigMap.from_dict(_item) for _item in obj["items"]] if obj.get("items") is not None else None,
|
||||
"kind": obj.get("kind"),
|
||||
"metadata": IoK8sApimachineryPkgApisMetaV1ListMeta.from_dict(obj["metadata"]) if obj.get("metadata") is not None else None
|
||||
})
|
||||
return _obj
|
||||
|
||||
|
||||
+95
@@ -0,0 +1,95 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
Kubeflow Trainer OpenAPI Spec
|
||||
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
|
||||
The version of the OpenAPI document: unversioned
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
|
||||
Do not edit the class manually.
|
||||
""" # noqa: E501
|
||||
|
||||
|
||||
from __future__ import annotations
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
import json
|
||||
|
||||
from pydantic import BaseModel, ConfigDict, Field, StrictStr
|
||||
from typing import Any, ClassVar, Dict, List, Optional
|
||||
from typing import Optional, Set
|
||||
from typing_extensions import Self
|
||||
|
||||
class IoK8sApiCoreV1ConfigMapNodeConfigSource(BaseModel):
|
||||
"""
|
||||
ConfigMapNodeConfigSource contains the information to reference a ConfigMap as a config source for the Node. This API is deprecated since 1.22: https://git.k8s.io/enhancements/keps/sig-node/281-dynamic-kubelet-configuration
|
||||
""" # noqa: E501
|
||||
kubelet_config_key: StrictStr = Field(description="KubeletConfigKey declares which key of the referenced ConfigMap corresponds to the KubeletConfiguration structure This field is required in all cases.", alias="kubeletConfigKey")
|
||||
name: StrictStr = Field(description="Name is the metadata.name of the referenced ConfigMap. This field is required in all cases.")
|
||||
namespace: StrictStr = Field(description="Namespace is the metadata.namespace of the referenced ConfigMap. This field is required in all cases.")
|
||||
resource_version: Optional[StrictStr] = Field(default=None, description="ResourceVersion is the metadata.ResourceVersion of the referenced ConfigMap. This field is forbidden in Node.Spec, and required in Node.Status.", alias="resourceVersion")
|
||||
uid: Optional[StrictStr] = Field(default=None, description="UID is the metadata.UID of the referenced ConfigMap. This field is forbidden in Node.Spec, and required in Node.Status.")
|
||||
__properties: ClassVar[List[str]] = ["kubeletConfigKey", "name", "namespace", "resourceVersion", "uid"]
|
||||
|
||||
model_config = ConfigDict(
|
||||
populate_by_name=True,
|
||||
validate_assignment=True,
|
||||
protected_namespaces=(),
|
||||
)
|
||||
|
||||
|
||||
def to_str(self) -> str:
|
||||
"""Returns the string representation of the model using alias"""
|
||||
return pprint.pformat(self.model_dump(by_alias=True))
|
||||
|
||||
def to_json(self) -> str:
|
||||
"""Returns the JSON representation of the model using alias"""
|
||||
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
||||
return json.dumps(self.to_dict())
|
||||
|
||||
@classmethod
|
||||
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||
"""Create an instance of IoK8sApiCoreV1ConfigMapNodeConfigSource from a JSON string"""
|
||||
return cls.from_dict(json.loads(json_str))
|
||||
|
||||
def to_dict(self) -> Dict[str, Any]:
|
||||
"""Return the dictionary representation of the model using alias.
|
||||
|
||||
This has the following differences from calling pydantic's
|
||||
`self.model_dump(by_alias=True)`:
|
||||
|
||||
* `None` is only added to the output dict for nullable fields that
|
||||
were set at model initialization. Other fields with value `None`
|
||||
are ignored.
|
||||
"""
|
||||
excluded_fields: Set[str] = set([
|
||||
])
|
||||
|
||||
_dict = self.model_dump(
|
||||
by_alias=True,
|
||||
exclude=excluded_fields,
|
||||
exclude_none=True,
|
||||
)
|
||||
return _dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||
"""Create an instance of IoK8sApiCoreV1ConfigMapNodeConfigSource from a dict"""
|
||||
if obj is None:
|
||||
return None
|
||||
|
||||
if not isinstance(obj, dict):
|
||||
return cls.model_validate(obj)
|
||||
|
||||
_obj = cls.model_validate({
|
||||
"kubeletConfigKey": obj.get("kubeletConfigKey") if obj.get("kubeletConfigKey") is not None else '',
|
||||
"name": obj.get("name") if obj.get("name") is not None else '',
|
||||
"namespace": obj.get("namespace") if obj.get("namespace") is not None else '',
|
||||
"resourceVersion": obj.get("resourceVersion"),
|
||||
"uid": obj.get("uid")
|
||||
})
|
||||
return _obj
|
||||
|
||||
|
||||
+99
@@ -0,0 +1,99 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
Kubeflow Trainer OpenAPI Spec
|
||||
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
|
||||
The version of the OpenAPI document: unversioned
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
|
||||
Do not edit the class manually.
|
||||
""" # noqa: E501
|
||||
|
||||
|
||||
from __future__ import annotations
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
import json
|
||||
|
||||
from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr
|
||||
from typing import Any, ClassVar, Dict, List, Optional
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_key_to_path import IoK8sApiCoreV1KeyToPath
|
||||
from typing import Optional, Set
|
||||
from typing_extensions import Self
|
||||
|
||||
class IoK8sApiCoreV1ConfigMapProjection(BaseModel):
|
||||
"""
|
||||
Adapts a ConfigMap into a projected volume. The contents of the target ConfigMap's Data field will be presented in a projected volume as files using the keys in the Data field as the file names, unless the items element is populated with specific mappings of keys to paths. Note that this is identical to a configmap volume source without the default mode.
|
||||
""" # noqa: E501
|
||||
items: Optional[List[IoK8sApiCoreV1KeyToPath]] = Field(default=None, description="items if unspecified, each key-value pair in the Data field of the referenced ConfigMap will be projected into the volume as a file whose name is the key and content is the value. If specified, the listed keys will be projected into the specified paths, and unlisted keys will not be present. If a key is specified which is not present in the ConfigMap, the volume setup will error unless it is marked optional. Paths must be relative and may not contain the '..' path or start with '..'.")
|
||||
name: Optional[StrictStr] = Field(default='', description="Name of the referent. This field is effectively required, but due to backwards compatibility is allowed to be empty. Instances of this type with an empty value here are almost certainly wrong. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names")
|
||||
optional: Optional[StrictBool] = Field(default=None, description="optional specify whether the ConfigMap or its keys must be defined")
|
||||
__properties: ClassVar[List[str]] = ["items", "name", "optional"]
|
||||
|
||||
model_config = ConfigDict(
|
||||
populate_by_name=True,
|
||||
validate_assignment=True,
|
||||
protected_namespaces=(),
|
||||
)
|
||||
|
||||
|
||||
def to_str(self) -> str:
|
||||
"""Returns the string representation of the model using alias"""
|
||||
return pprint.pformat(self.model_dump(by_alias=True))
|
||||
|
||||
def to_json(self) -> str:
|
||||
"""Returns the JSON representation of the model using alias"""
|
||||
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
||||
return json.dumps(self.to_dict())
|
||||
|
||||
@classmethod
|
||||
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||
"""Create an instance of IoK8sApiCoreV1ConfigMapProjection from a JSON string"""
|
||||
return cls.from_dict(json.loads(json_str))
|
||||
|
||||
def to_dict(self) -> Dict[str, Any]:
|
||||
"""Return the dictionary representation of the model using alias.
|
||||
|
||||
This has the following differences from calling pydantic's
|
||||
`self.model_dump(by_alias=True)`:
|
||||
|
||||
* `None` is only added to the output dict for nullable fields that
|
||||
were set at model initialization. Other fields with value `None`
|
||||
are ignored.
|
||||
"""
|
||||
excluded_fields: Set[str] = set([
|
||||
])
|
||||
|
||||
_dict = self.model_dump(
|
||||
by_alias=True,
|
||||
exclude=excluded_fields,
|
||||
exclude_none=True,
|
||||
)
|
||||
# override the default output from pydantic by calling `to_dict()` of each item in items (list)
|
||||
_items = []
|
||||
if self.items:
|
||||
for _item_items in self.items:
|
||||
if _item_items:
|
||||
_items.append(_item_items.to_dict())
|
||||
_dict['items'] = _items
|
||||
return _dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||
"""Create an instance of IoK8sApiCoreV1ConfigMapProjection from a dict"""
|
||||
if obj is None:
|
||||
return None
|
||||
|
||||
if not isinstance(obj, dict):
|
||||
return cls.model_validate(obj)
|
||||
|
||||
_obj = cls.model_validate({
|
||||
"items": [IoK8sApiCoreV1KeyToPath.from_dict(_item) for _item in obj["items"]] if obj.get("items") is not None else None,
|
||||
"name": obj.get("name") if obj.get("name") is not None else '',
|
||||
"optional": obj.get("optional")
|
||||
})
|
||||
return _obj
|
||||
|
||||
|
||||
+101
@@ -0,0 +1,101 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
Kubeflow Trainer OpenAPI Spec
|
||||
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
|
||||
The version of the OpenAPI document: unversioned
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
|
||||
Do not edit the class manually.
|
||||
""" # noqa: E501
|
||||
|
||||
|
||||
from __future__ import annotations
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
import json
|
||||
|
||||
from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr
|
||||
from typing import Any, ClassVar, Dict, List, Optional
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_key_to_path import IoK8sApiCoreV1KeyToPath
|
||||
from typing import Optional, Set
|
||||
from typing_extensions import Self
|
||||
|
||||
class IoK8sApiCoreV1ConfigMapVolumeSource(BaseModel):
|
||||
"""
|
||||
Adapts a ConfigMap into a volume. The contents of the target ConfigMap's Data field will be presented in a volume as files using the keys in the Data field as the file names, unless the items element is populated with specific mappings of keys to paths. ConfigMap volumes support ownership management and SELinux relabeling.
|
||||
""" # noqa: E501
|
||||
default_mode: Optional[StrictInt] = Field(default=None, description="defaultMode is optional: mode bits used to set permissions on created files by default. Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. Defaults to 0644. Directories within the path are not affected by this setting. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.", alias="defaultMode")
|
||||
items: Optional[List[IoK8sApiCoreV1KeyToPath]] = Field(default=None, description="items if unspecified, each key-value pair in the Data field of the referenced ConfigMap will be projected into the volume as a file whose name is the key and content is the value. If specified, the listed keys will be projected into the specified paths, and unlisted keys will not be present. If a key is specified which is not present in the ConfigMap, the volume setup will error unless it is marked optional. Paths must be relative and may not contain the '..' path or start with '..'.")
|
||||
name: Optional[StrictStr] = Field(default='', description="Name of the referent. This field is effectively required, but due to backwards compatibility is allowed to be empty. Instances of this type with an empty value here are almost certainly wrong. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names")
|
||||
optional: Optional[StrictBool] = Field(default=None, description="optional specify whether the ConfigMap or its keys must be defined")
|
||||
__properties: ClassVar[List[str]] = ["defaultMode", "items", "name", "optional"]
|
||||
|
||||
model_config = ConfigDict(
|
||||
populate_by_name=True,
|
||||
validate_assignment=True,
|
||||
protected_namespaces=(),
|
||||
)
|
||||
|
||||
|
||||
def to_str(self) -> str:
|
||||
"""Returns the string representation of the model using alias"""
|
||||
return pprint.pformat(self.model_dump(by_alias=True))
|
||||
|
||||
def to_json(self) -> str:
|
||||
"""Returns the JSON representation of the model using alias"""
|
||||
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
||||
return json.dumps(self.to_dict())
|
||||
|
||||
@classmethod
|
||||
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||
"""Create an instance of IoK8sApiCoreV1ConfigMapVolumeSource from a JSON string"""
|
||||
return cls.from_dict(json.loads(json_str))
|
||||
|
||||
def to_dict(self) -> Dict[str, Any]:
|
||||
"""Return the dictionary representation of the model using alias.
|
||||
|
||||
This has the following differences from calling pydantic's
|
||||
`self.model_dump(by_alias=True)`:
|
||||
|
||||
* `None` is only added to the output dict for nullable fields that
|
||||
were set at model initialization. Other fields with value `None`
|
||||
are ignored.
|
||||
"""
|
||||
excluded_fields: Set[str] = set([
|
||||
])
|
||||
|
||||
_dict = self.model_dump(
|
||||
by_alias=True,
|
||||
exclude=excluded_fields,
|
||||
exclude_none=True,
|
||||
)
|
||||
# override the default output from pydantic by calling `to_dict()` of each item in items (list)
|
||||
_items = []
|
||||
if self.items:
|
||||
for _item_items in self.items:
|
||||
if _item_items:
|
||||
_items.append(_item_items.to_dict())
|
||||
_dict['items'] = _items
|
||||
return _dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||
"""Create an instance of IoK8sApiCoreV1ConfigMapVolumeSource from a dict"""
|
||||
if obj is None:
|
||||
return None
|
||||
|
||||
if not isinstance(obj, dict):
|
||||
return cls.model_validate(obj)
|
||||
|
||||
_obj = cls.model_validate({
|
||||
"defaultMode": obj.get("defaultMode"),
|
||||
"items": [IoK8sApiCoreV1KeyToPath.from_dict(_item) for _item in obj["items"]] if obj.get("items") is not None else None,
|
||||
"name": obj.get("name") if obj.get("name") is not None else '',
|
||||
"optional": obj.get("optional")
|
||||
})
|
||||
return _obj
|
||||
|
||||
|
||||
@@ -0,0 +1,223 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
Kubeflow Trainer OpenAPI Spec
|
||||
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
|
||||
The version of the OpenAPI document: unversioned
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
|
||||
Do not edit the class manually.
|
||||
""" # noqa: E501
|
||||
|
||||
|
||||
from __future__ import annotations
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
import json
|
||||
|
||||
from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr, field_validator
|
||||
from typing import Any, ClassVar, Dict, List, Optional
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_container_port import IoK8sApiCoreV1ContainerPort
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_container_resize_policy import IoK8sApiCoreV1ContainerResizePolicy
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_env_from_source import IoK8sApiCoreV1EnvFromSource
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_env_var import IoK8sApiCoreV1EnvVar
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_lifecycle import IoK8sApiCoreV1Lifecycle
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_probe import IoK8sApiCoreV1Probe
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_resource_requirements import IoK8sApiCoreV1ResourceRequirements
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_security_context import IoK8sApiCoreV1SecurityContext
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_volume_device import IoK8sApiCoreV1VolumeDevice
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_volume_mount import IoK8sApiCoreV1VolumeMount
|
||||
from typing import Optional, Set
|
||||
from typing_extensions import Self
|
||||
|
||||
class IoK8sApiCoreV1Container(BaseModel):
|
||||
"""
|
||||
A single application container that you want to run within a pod.
|
||||
""" # noqa: E501
|
||||
args: Optional[List[StrictStr]] = Field(default=None, description="Arguments to the entrypoint. The container image's CMD is used if this is not provided. Variable references $(VAR_NAME) are expanded using the container's environment. If a variable cannot be resolved, the reference in the input string will be unchanged. Double $$ are reduced to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. \"$$(VAR_NAME)\" will produce the string literal \"$(VAR_NAME)\". Escaped references will never be expanded, regardless of whether the variable exists or not. Cannot be updated. More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell")
|
||||
command: Optional[List[StrictStr]] = Field(default=None, description="Entrypoint array. Not executed within a shell. The container image's ENTRYPOINT is used if this is not provided. Variable references $(VAR_NAME) are expanded using the container's environment. If a variable cannot be resolved, the reference in the input string will be unchanged. Double $$ are reduced to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. \"$$(VAR_NAME)\" will produce the string literal \"$(VAR_NAME)\". Escaped references will never be expanded, regardless of whether the variable exists or not. Cannot be updated. More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell")
|
||||
env: Optional[List[IoK8sApiCoreV1EnvVar]] = Field(default=None, description="List of environment variables to set in the container. Cannot be updated.")
|
||||
env_from: Optional[List[IoK8sApiCoreV1EnvFromSource]] = Field(default=None, description="List of sources to populate environment variables in the container. The keys defined within a source must be a C_IDENTIFIER. All invalid keys will be reported as an event when the container is starting. When a key exists in multiple sources, the value associated with the last source will take precedence. Values defined by an Env with a duplicate key will take precedence. Cannot be updated.", alias="envFrom")
|
||||
image: Optional[StrictStr] = Field(default=None, description="Container image name. More info: https://kubernetes.io/docs/concepts/containers/images This field is optional to allow higher level config management to default or override container images in workload controllers like Deployments and StatefulSets.")
|
||||
image_pull_policy: Optional[StrictStr] = Field(default=None, description="Image pull policy. One of Always, Never, IfNotPresent. Defaults to Always if :latest tag is specified, or IfNotPresent otherwise. Cannot be updated. More info: https://kubernetes.io/docs/concepts/containers/images#updating-images Possible enum values: - `\"Always\"` means that kubelet always attempts to pull the latest image. Container will fail If the pull fails. - `\"IfNotPresent\"` means that kubelet pulls if the image isn't present on disk. Container will fail if the image isn't present and the pull fails. - `\"Never\"` means that kubelet never pulls an image, but only uses a local image. Container will fail if the image isn't present", alias="imagePullPolicy")
|
||||
lifecycle: Optional[IoK8sApiCoreV1Lifecycle] = Field(default=None, description="Actions that the management system should take in response to container lifecycle events. Cannot be updated.")
|
||||
liveness_probe: Optional[IoK8sApiCoreV1Probe] = Field(default=None, description="Periodic probe of container liveness. Container will be restarted if the probe fails. Cannot be updated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes", alias="livenessProbe")
|
||||
name: StrictStr = Field(description="Name of the container specified as a DNS_LABEL. Each container in a pod must have a unique name (DNS_LABEL). Cannot be updated.")
|
||||
ports: Optional[List[IoK8sApiCoreV1ContainerPort]] = Field(default=None, description="List of ports to expose from the container. Not specifying a port here DOES NOT prevent that port from being exposed. Any port which is listening on the default \"0.0.0.0\" address inside a container will be accessible from the network. Modifying this array with strategic merge patch may corrupt the data. For more information See https://github.com/kubernetes/kubernetes/issues/108255. Cannot be updated.")
|
||||
readiness_probe: Optional[IoK8sApiCoreV1Probe] = Field(default=None, description="Periodic probe of container service readiness. Container will be removed from service endpoints if the probe fails. Cannot be updated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes", alias="readinessProbe")
|
||||
resize_policy: Optional[List[IoK8sApiCoreV1ContainerResizePolicy]] = Field(default=None, description="Resources resize policy for the container.", alias="resizePolicy")
|
||||
resources: Optional[IoK8sApiCoreV1ResourceRequirements] = Field(default=None, description="Compute Resources required by this container. Cannot be updated. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/")
|
||||
restart_policy: Optional[StrictStr] = Field(default=None, description="RestartPolicy defines the restart behavior of individual containers in a pod. This field may only be set for init containers, and the only allowed value is \"Always\". For non-init containers or when this field is not specified, the restart behavior is defined by the Pod's restart policy and the container type. Setting the RestartPolicy as \"Always\" for the init container will have the following effect: this init container will be continually restarted on exit until all regular containers have terminated. Once all regular containers have completed, all init containers with restartPolicy \"Always\" will be shut down. This lifecycle differs from normal init containers and is often referred to as a \"sidecar\" container. Although this init container still starts in the init container sequence, it does not wait for the container to complete before proceeding to the next init container. Instead, the next init container starts immediately after this init container is started, or after any startupProbe has successfully completed.", alias="restartPolicy")
|
||||
security_context: Optional[IoK8sApiCoreV1SecurityContext] = Field(default=None, description="SecurityContext defines the security options the container should be run with. If set, the fields of SecurityContext override the equivalent fields of PodSecurityContext. More info: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/", alias="securityContext")
|
||||
startup_probe: Optional[IoK8sApiCoreV1Probe] = Field(default=None, description="StartupProbe indicates that the Pod has successfully initialized. If specified, no other probes are executed until this completes successfully. If this probe fails, the Pod will be restarted, just as if the livenessProbe failed. This can be used to provide different probe parameters at the beginning of a Pod's lifecycle, when it might take a long time to load data or warm a cache, than during steady-state operation. This cannot be updated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes", alias="startupProbe")
|
||||
stdin: Optional[StrictBool] = Field(default=None, description="Whether this container should allocate a buffer for stdin in the container runtime. If this is not set, reads from stdin in the container will always result in EOF. Default is false.")
|
||||
stdin_once: Optional[StrictBool] = Field(default=None, description="Whether the container runtime should close the stdin channel after it has been opened by a single attach. When stdin is true the stdin stream will remain open across multiple attach sessions. If stdinOnce is set to true, stdin is opened on container start, is empty until the first client attaches to stdin, and then remains open and accepts data until the client disconnects, at which time stdin is closed and remains closed until the container is restarted. If this flag is false, a container processes that reads from stdin will never receive an EOF. Default is false", alias="stdinOnce")
|
||||
termination_message_path: Optional[StrictStr] = Field(default=None, description="Optional: Path at which the file to which the container's termination message will be written is mounted into the container's filesystem. Message written is intended to be brief final status, such as an assertion failure message. Will be truncated by the node if greater than 4096 bytes. The total message length across all containers will be limited to 12kb. Defaults to /dev/termination-log. Cannot be updated.", alias="terminationMessagePath")
|
||||
termination_message_policy: Optional[StrictStr] = Field(default=None, description="Indicate how the termination message should be populated. File will use the contents of terminationMessagePath to populate the container status message on both success and failure. FallbackToLogsOnError will use the last chunk of container log output if the termination message file is empty and the container exited with an error. The log output is limited to 2048 bytes or 80 lines, whichever is smaller. Defaults to File. Cannot be updated. Possible enum values: - `\"FallbackToLogsOnError\"` will read the most recent contents of the container logs for the container status message when the container exits with an error and the terminationMessagePath has no contents. - `\"File\"` is the default behavior and will set the container status message to the contents of the container's terminationMessagePath when the container exits.", alias="terminationMessagePolicy")
|
||||
tty: Optional[StrictBool] = Field(default=None, description="Whether this container should allocate a TTY for itself, also requires 'stdin' to be true. Default is false.")
|
||||
volume_devices: Optional[List[IoK8sApiCoreV1VolumeDevice]] = Field(default=None, description="volumeDevices is the list of block devices to be used by the container.", alias="volumeDevices")
|
||||
volume_mounts: Optional[List[IoK8sApiCoreV1VolumeMount]] = Field(default=None, description="Pod volumes to mount into the container's filesystem. Cannot be updated.", alias="volumeMounts")
|
||||
working_dir: Optional[StrictStr] = Field(default=None, description="Container's working directory. If not specified, the container runtime's default will be used, which might be configured in the container image. Cannot be updated.", alias="workingDir")
|
||||
__properties: ClassVar[List[str]] = ["args", "command", "env", "envFrom", "image", "imagePullPolicy", "lifecycle", "livenessProbe", "name", "ports", "readinessProbe", "resizePolicy", "resources", "restartPolicy", "securityContext", "startupProbe", "stdin", "stdinOnce", "terminationMessagePath", "terminationMessagePolicy", "tty", "volumeDevices", "volumeMounts", "workingDir"]
|
||||
|
||||
@field_validator('image_pull_policy')
|
||||
def image_pull_policy_validate_enum(cls, value):
|
||||
"""Validates the enum"""
|
||||
if value is None:
|
||||
return value
|
||||
|
||||
if value not in set(['Always', 'IfNotPresent', 'Never']):
|
||||
raise ValueError("must be one of enum values ('Always', 'IfNotPresent', 'Never')")
|
||||
return value
|
||||
|
||||
@field_validator('termination_message_policy')
|
||||
def termination_message_policy_validate_enum(cls, value):
|
||||
"""Validates the enum"""
|
||||
if value is None:
|
||||
return value
|
||||
|
||||
if value not in set(['FallbackToLogsOnError', 'File']):
|
||||
raise ValueError("must be one of enum values ('FallbackToLogsOnError', 'File')")
|
||||
return value
|
||||
|
||||
model_config = ConfigDict(
|
||||
populate_by_name=True,
|
||||
validate_assignment=True,
|
||||
protected_namespaces=(),
|
||||
)
|
||||
|
||||
|
||||
def to_str(self) -> str:
|
||||
"""Returns the string representation of the model using alias"""
|
||||
return pprint.pformat(self.model_dump(by_alias=True))
|
||||
|
||||
def to_json(self) -> str:
|
||||
"""Returns the JSON representation of the model using alias"""
|
||||
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
||||
return json.dumps(self.to_dict())
|
||||
|
||||
@classmethod
|
||||
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||
"""Create an instance of IoK8sApiCoreV1Container from a JSON string"""
|
||||
return cls.from_dict(json.loads(json_str))
|
||||
|
||||
def to_dict(self) -> Dict[str, Any]:
|
||||
"""Return the dictionary representation of the model using alias.
|
||||
|
||||
This has the following differences from calling pydantic's
|
||||
`self.model_dump(by_alias=True)`:
|
||||
|
||||
* `None` is only added to the output dict for nullable fields that
|
||||
were set at model initialization. Other fields with value `None`
|
||||
are ignored.
|
||||
"""
|
||||
excluded_fields: Set[str] = set([
|
||||
])
|
||||
|
||||
_dict = self.model_dump(
|
||||
by_alias=True,
|
||||
exclude=excluded_fields,
|
||||
exclude_none=True,
|
||||
)
|
||||
# override the default output from pydantic by calling `to_dict()` of each item in env (list)
|
||||
_items = []
|
||||
if self.env:
|
||||
for _item_env in self.env:
|
||||
if _item_env:
|
||||
_items.append(_item_env.to_dict())
|
||||
_dict['env'] = _items
|
||||
# override the default output from pydantic by calling `to_dict()` of each item in env_from (list)
|
||||
_items = []
|
||||
if self.env_from:
|
||||
for _item_env_from in self.env_from:
|
||||
if _item_env_from:
|
||||
_items.append(_item_env_from.to_dict())
|
||||
_dict['envFrom'] = _items
|
||||
# override the default output from pydantic by calling `to_dict()` of lifecycle
|
||||
if self.lifecycle:
|
||||
_dict['lifecycle'] = self.lifecycle.to_dict()
|
||||
# override the default output from pydantic by calling `to_dict()` of liveness_probe
|
||||
if self.liveness_probe:
|
||||
_dict['livenessProbe'] = self.liveness_probe.to_dict()
|
||||
# override the default output from pydantic by calling `to_dict()` of each item in ports (list)
|
||||
_items = []
|
||||
if self.ports:
|
||||
for _item_ports in self.ports:
|
||||
if _item_ports:
|
||||
_items.append(_item_ports.to_dict())
|
||||
_dict['ports'] = _items
|
||||
# override the default output from pydantic by calling `to_dict()` of readiness_probe
|
||||
if self.readiness_probe:
|
||||
_dict['readinessProbe'] = self.readiness_probe.to_dict()
|
||||
# override the default output from pydantic by calling `to_dict()` of each item in resize_policy (list)
|
||||
_items = []
|
||||
if self.resize_policy:
|
||||
for _item_resize_policy in self.resize_policy:
|
||||
if _item_resize_policy:
|
||||
_items.append(_item_resize_policy.to_dict())
|
||||
_dict['resizePolicy'] = _items
|
||||
# override the default output from pydantic by calling `to_dict()` of resources
|
||||
if self.resources:
|
||||
_dict['resources'] = self.resources.to_dict()
|
||||
# override the default output from pydantic by calling `to_dict()` of security_context
|
||||
if self.security_context:
|
||||
_dict['securityContext'] = self.security_context.to_dict()
|
||||
# override the default output from pydantic by calling `to_dict()` of startup_probe
|
||||
if self.startup_probe:
|
||||
_dict['startupProbe'] = self.startup_probe.to_dict()
|
||||
# override the default output from pydantic by calling `to_dict()` of each item in volume_devices (list)
|
||||
_items = []
|
||||
if self.volume_devices:
|
||||
for _item_volume_devices in self.volume_devices:
|
||||
if _item_volume_devices:
|
||||
_items.append(_item_volume_devices.to_dict())
|
||||
_dict['volumeDevices'] = _items
|
||||
# override the default output from pydantic by calling `to_dict()` of each item in volume_mounts (list)
|
||||
_items = []
|
||||
if self.volume_mounts:
|
||||
for _item_volume_mounts in self.volume_mounts:
|
||||
if _item_volume_mounts:
|
||||
_items.append(_item_volume_mounts.to_dict())
|
||||
_dict['volumeMounts'] = _items
|
||||
return _dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||
"""Create an instance of IoK8sApiCoreV1Container from a dict"""
|
||||
if obj is None:
|
||||
return None
|
||||
|
||||
if not isinstance(obj, dict):
|
||||
return cls.model_validate(obj)
|
||||
|
||||
_obj = cls.model_validate({
|
||||
"args": obj.get("args"),
|
||||
"command": obj.get("command"),
|
||||
"env": [IoK8sApiCoreV1EnvVar.from_dict(_item) for _item in obj["env"]] if obj.get("env") is not None else None,
|
||||
"envFrom": [IoK8sApiCoreV1EnvFromSource.from_dict(_item) for _item in obj["envFrom"]] if obj.get("envFrom") is not None else None,
|
||||
"image": obj.get("image"),
|
||||
"imagePullPolicy": obj.get("imagePullPolicy"),
|
||||
"lifecycle": IoK8sApiCoreV1Lifecycle.from_dict(obj["lifecycle"]) if obj.get("lifecycle") is not None else None,
|
||||
"livenessProbe": IoK8sApiCoreV1Probe.from_dict(obj["livenessProbe"]) if obj.get("livenessProbe") is not None else None,
|
||||
"name": obj.get("name") if obj.get("name") is not None else '',
|
||||
"ports": [IoK8sApiCoreV1ContainerPort.from_dict(_item) for _item in obj["ports"]] if obj.get("ports") is not None else None,
|
||||
"readinessProbe": IoK8sApiCoreV1Probe.from_dict(obj["readinessProbe"]) if obj.get("readinessProbe") is not None else None,
|
||||
"resizePolicy": [IoK8sApiCoreV1ContainerResizePolicy.from_dict(_item) for _item in obj["resizePolicy"]] if obj.get("resizePolicy") is not None else None,
|
||||
"resources": IoK8sApiCoreV1ResourceRequirements.from_dict(obj["resources"]) if obj.get("resources") is not None else None,
|
||||
"restartPolicy": obj.get("restartPolicy"),
|
||||
"securityContext": IoK8sApiCoreV1SecurityContext.from_dict(obj["securityContext"]) if obj.get("securityContext") is not None else None,
|
||||
"startupProbe": IoK8sApiCoreV1Probe.from_dict(obj["startupProbe"]) if obj.get("startupProbe") is not None else None,
|
||||
"stdin": obj.get("stdin"),
|
||||
"stdinOnce": obj.get("stdinOnce"),
|
||||
"terminationMessagePath": obj.get("terminationMessagePath"),
|
||||
"terminationMessagePolicy": obj.get("terminationMessagePolicy"),
|
||||
"tty": obj.get("tty"),
|
||||
"volumeDevices": [IoK8sApiCoreV1VolumeDevice.from_dict(_item) for _item in obj["volumeDevices"]] if obj.get("volumeDevices") is not None else None,
|
||||
"volumeMounts": [IoK8sApiCoreV1VolumeMount.from_dict(_item) for _item in obj["volumeMounts"]] if obj.get("volumeMounts") is not None else None,
|
||||
"workingDir": obj.get("workingDir")
|
||||
})
|
||||
return _obj
|
||||
|
||||
|
||||
@@ -0,0 +1,89 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
Kubeflow Trainer OpenAPI Spec
|
||||
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
|
||||
The version of the OpenAPI document: unversioned
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
|
||||
Do not edit the class manually.
|
||||
""" # noqa: E501
|
||||
|
||||
|
||||
from __future__ import annotations
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
import json
|
||||
|
||||
from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr
|
||||
from typing import Any, ClassVar, Dict, List, Optional
|
||||
from typing import Optional, Set
|
||||
from typing_extensions import Self
|
||||
|
||||
class IoK8sApiCoreV1ContainerImage(BaseModel):
|
||||
"""
|
||||
Describe a container image
|
||||
""" # noqa: E501
|
||||
names: Optional[List[StrictStr]] = Field(default=None, description="Names by which this image is known. e.g. [\"kubernetes.example/hyperkube:v1.0.7\", \"cloud-vendor.registry.example/cloud-vendor/hyperkube:v1.0.7\"]")
|
||||
size_bytes: Optional[StrictInt] = Field(default=None, description="The size of the image in bytes.", alias="sizeBytes")
|
||||
__properties: ClassVar[List[str]] = ["names", "sizeBytes"]
|
||||
|
||||
model_config = ConfigDict(
|
||||
populate_by_name=True,
|
||||
validate_assignment=True,
|
||||
protected_namespaces=(),
|
||||
)
|
||||
|
||||
|
||||
def to_str(self) -> str:
|
||||
"""Returns the string representation of the model using alias"""
|
||||
return pprint.pformat(self.model_dump(by_alias=True))
|
||||
|
||||
def to_json(self) -> str:
|
||||
"""Returns the JSON representation of the model using alias"""
|
||||
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
||||
return json.dumps(self.to_dict())
|
||||
|
||||
@classmethod
|
||||
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||
"""Create an instance of IoK8sApiCoreV1ContainerImage from a JSON string"""
|
||||
return cls.from_dict(json.loads(json_str))
|
||||
|
||||
def to_dict(self) -> Dict[str, Any]:
|
||||
"""Return the dictionary representation of the model using alias.
|
||||
|
||||
This has the following differences from calling pydantic's
|
||||
`self.model_dump(by_alias=True)`:
|
||||
|
||||
* `None` is only added to the output dict for nullable fields that
|
||||
were set at model initialization. Other fields with value `None`
|
||||
are ignored.
|
||||
"""
|
||||
excluded_fields: Set[str] = set([
|
||||
])
|
||||
|
||||
_dict = self.model_dump(
|
||||
by_alias=True,
|
||||
exclude=excluded_fields,
|
||||
exclude_none=True,
|
||||
)
|
||||
return _dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||
"""Create an instance of IoK8sApiCoreV1ContainerImage from a dict"""
|
||||
if obj is None:
|
||||
return None
|
||||
|
||||
if not isinstance(obj, dict):
|
||||
return cls.model_validate(obj)
|
||||
|
||||
_obj = cls.model_validate({
|
||||
"names": obj.get("names"),
|
||||
"sizeBytes": obj.get("sizeBytes")
|
||||
})
|
||||
return _obj
|
||||
|
||||
|
||||
@@ -0,0 +1,105 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
Kubeflow Trainer OpenAPI Spec
|
||||
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
|
||||
The version of the OpenAPI document: unversioned
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
|
||||
Do not edit the class manually.
|
||||
""" # noqa: E501
|
||||
|
||||
|
||||
from __future__ import annotations
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
import json
|
||||
|
||||
from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator
|
||||
from typing import Any, ClassVar, Dict, List, Optional
|
||||
from typing import Optional, Set
|
||||
from typing_extensions import Self
|
||||
|
||||
class IoK8sApiCoreV1ContainerPort(BaseModel):
|
||||
"""
|
||||
ContainerPort represents a network port in a single container.
|
||||
""" # noqa: E501
|
||||
container_port: StrictInt = Field(description="Number of port to expose on the pod's IP address. This must be a valid port number, 0 < x < 65536.", alias="containerPort")
|
||||
host_ip: Optional[StrictStr] = Field(default=None, description="What host IP to bind the external port to.", alias="hostIP")
|
||||
host_port: Optional[StrictInt] = Field(default=None, description="Number of port to expose on the host. If specified, this must be a valid port number, 0 < x < 65536. If HostNetwork is specified, this must match ContainerPort. Most containers do not need this.", alias="hostPort")
|
||||
name: Optional[StrictStr] = Field(default=None, description="If specified, this must be an IANA_SVC_NAME and unique within the pod. Each named port in a pod must have a unique name. Name for the port that can be referred to by services.")
|
||||
protocol: Optional[StrictStr] = Field(default='TCP', description="Protocol for port. Must be UDP, TCP, or SCTP. Defaults to \"TCP\". Possible enum values: - `\"SCTP\"` is the SCTP protocol. - `\"TCP\"` is the TCP protocol. - `\"UDP\"` is the UDP protocol.")
|
||||
__properties: ClassVar[List[str]] = ["containerPort", "hostIP", "hostPort", "name", "protocol"]
|
||||
|
||||
@field_validator('protocol')
|
||||
def protocol_validate_enum(cls, value):
|
||||
"""Validates the enum"""
|
||||
if value is None:
|
||||
return value
|
||||
|
||||
if value not in set(['SCTP', 'TCP', 'UDP']):
|
||||
raise ValueError("must be one of enum values ('SCTP', 'TCP', 'UDP')")
|
||||
return value
|
||||
|
||||
model_config = ConfigDict(
|
||||
populate_by_name=True,
|
||||
validate_assignment=True,
|
||||
protected_namespaces=(),
|
||||
)
|
||||
|
||||
|
||||
def to_str(self) -> str:
|
||||
"""Returns the string representation of the model using alias"""
|
||||
return pprint.pformat(self.model_dump(by_alias=True))
|
||||
|
||||
def to_json(self) -> str:
|
||||
"""Returns the JSON representation of the model using alias"""
|
||||
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
||||
return json.dumps(self.to_dict())
|
||||
|
||||
@classmethod
|
||||
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||
"""Create an instance of IoK8sApiCoreV1ContainerPort from a JSON string"""
|
||||
return cls.from_dict(json.loads(json_str))
|
||||
|
||||
def to_dict(self) -> Dict[str, Any]:
|
||||
"""Return the dictionary representation of the model using alias.
|
||||
|
||||
This has the following differences from calling pydantic's
|
||||
`self.model_dump(by_alias=True)`:
|
||||
|
||||
* `None` is only added to the output dict for nullable fields that
|
||||
were set at model initialization. Other fields with value `None`
|
||||
are ignored.
|
||||
"""
|
||||
excluded_fields: Set[str] = set([
|
||||
])
|
||||
|
||||
_dict = self.model_dump(
|
||||
by_alias=True,
|
||||
exclude=excluded_fields,
|
||||
exclude_none=True,
|
||||
)
|
||||
return _dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||
"""Create an instance of IoK8sApiCoreV1ContainerPort from a dict"""
|
||||
if obj is None:
|
||||
return None
|
||||
|
||||
if not isinstance(obj, dict):
|
||||
return cls.model_validate(obj)
|
||||
|
||||
_obj = cls.model_validate({
|
||||
"containerPort": obj.get("containerPort") if obj.get("containerPort") is not None else 0,
|
||||
"hostIP": obj.get("hostIP"),
|
||||
"hostPort": obj.get("hostPort"),
|
||||
"name": obj.get("name"),
|
||||
"protocol": obj.get("protocol") if obj.get("protocol") is not None else 'TCP'
|
||||
})
|
||||
return _obj
|
||||
|
||||
|
||||
+89
@@ -0,0 +1,89 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
Kubeflow Trainer OpenAPI Spec
|
||||
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
|
||||
The version of the OpenAPI document: unversioned
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
|
||||
Do not edit the class manually.
|
||||
""" # noqa: E501
|
||||
|
||||
|
||||
from __future__ import annotations
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
import json
|
||||
|
||||
from pydantic import BaseModel, ConfigDict, Field, StrictStr
|
||||
from typing import Any, ClassVar, Dict, List
|
||||
from typing import Optional, Set
|
||||
from typing_extensions import Self
|
||||
|
||||
class IoK8sApiCoreV1ContainerResizePolicy(BaseModel):
|
||||
"""
|
||||
ContainerResizePolicy represents resource resize policy for the container.
|
||||
""" # noqa: E501
|
||||
resource_name: StrictStr = Field(description="Name of the resource to which this resource resize policy applies. Supported values: cpu, memory.", alias="resourceName")
|
||||
restart_policy: StrictStr = Field(description="Restart policy to apply when specified resource is resized. If not specified, it defaults to NotRequired.", alias="restartPolicy")
|
||||
__properties: ClassVar[List[str]] = ["resourceName", "restartPolicy"]
|
||||
|
||||
model_config = ConfigDict(
|
||||
populate_by_name=True,
|
||||
validate_assignment=True,
|
||||
protected_namespaces=(),
|
||||
)
|
||||
|
||||
|
||||
def to_str(self) -> str:
|
||||
"""Returns the string representation of the model using alias"""
|
||||
return pprint.pformat(self.model_dump(by_alias=True))
|
||||
|
||||
def to_json(self) -> str:
|
||||
"""Returns the JSON representation of the model using alias"""
|
||||
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
||||
return json.dumps(self.to_dict())
|
||||
|
||||
@classmethod
|
||||
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||
"""Create an instance of IoK8sApiCoreV1ContainerResizePolicy from a JSON string"""
|
||||
return cls.from_dict(json.loads(json_str))
|
||||
|
||||
def to_dict(self) -> Dict[str, Any]:
|
||||
"""Return the dictionary representation of the model using alias.
|
||||
|
||||
This has the following differences from calling pydantic's
|
||||
`self.model_dump(by_alias=True)`:
|
||||
|
||||
* `None` is only added to the output dict for nullable fields that
|
||||
were set at model initialization. Other fields with value `None`
|
||||
are ignored.
|
||||
"""
|
||||
excluded_fields: Set[str] = set([
|
||||
])
|
||||
|
||||
_dict = self.model_dump(
|
||||
by_alias=True,
|
||||
exclude=excluded_fields,
|
||||
exclude_none=True,
|
||||
)
|
||||
return _dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||
"""Create an instance of IoK8sApiCoreV1ContainerResizePolicy from a dict"""
|
||||
if obj is None:
|
||||
return None
|
||||
|
||||
if not isinstance(obj, dict):
|
||||
return cls.model_validate(obj)
|
||||
|
||||
_obj = cls.model_validate({
|
||||
"resourceName": obj.get("resourceName") if obj.get("resourceName") is not None else '',
|
||||
"restartPolicy": obj.get("restartPolicy") if obj.get("restartPolicy") is not None else ''
|
||||
})
|
||||
return _obj
|
||||
|
||||
|
||||
@@ -0,0 +1,103 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
Kubeflow Trainer OpenAPI Spec
|
||||
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
|
||||
The version of the OpenAPI document: unversioned
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
|
||||
Do not edit the class manually.
|
||||
""" # noqa: E501
|
||||
|
||||
|
||||
from __future__ import annotations
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
import json
|
||||
|
||||
from pydantic import BaseModel, ConfigDict, Field
|
||||
from typing import Any, ClassVar, Dict, List, Optional
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_container_state_running import IoK8sApiCoreV1ContainerStateRunning
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_container_state_terminated import IoK8sApiCoreV1ContainerStateTerminated
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_container_state_waiting import IoK8sApiCoreV1ContainerStateWaiting
|
||||
from typing import Optional, Set
|
||||
from typing_extensions import Self
|
||||
|
||||
class IoK8sApiCoreV1ContainerState(BaseModel):
|
||||
"""
|
||||
ContainerState holds a possible state of container. Only one of its members may be specified. If none of them is specified, the default one is ContainerStateWaiting.
|
||||
""" # noqa: E501
|
||||
running: Optional[IoK8sApiCoreV1ContainerStateRunning] = Field(default=None, description="Details about a running container")
|
||||
terminated: Optional[IoK8sApiCoreV1ContainerStateTerminated] = Field(default=None, description="Details about a terminated container")
|
||||
waiting: Optional[IoK8sApiCoreV1ContainerStateWaiting] = Field(default=None, description="Details about a waiting container")
|
||||
__properties: ClassVar[List[str]] = ["running", "terminated", "waiting"]
|
||||
|
||||
model_config = ConfigDict(
|
||||
populate_by_name=True,
|
||||
validate_assignment=True,
|
||||
protected_namespaces=(),
|
||||
)
|
||||
|
||||
|
||||
def to_str(self) -> str:
|
||||
"""Returns the string representation of the model using alias"""
|
||||
return pprint.pformat(self.model_dump(by_alias=True))
|
||||
|
||||
def to_json(self) -> str:
|
||||
"""Returns the JSON representation of the model using alias"""
|
||||
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
||||
return json.dumps(self.to_dict())
|
||||
|
||||
@classmethod
|
||||
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||
"""Create an instance of IoK8sApiCoreV1ContainerState from a JSON string"""
|
||||
return cls.from_dict(json.loads(json_str))
|
||||
|
||||
def to_dict(self) -> Dict[str, Any]:
|
||||
"""Return the dictionary representation of the model using alias.
|
||||
|
||||
This has the following differences from calling pydantic's
|
||||
`self.model_dump(by_alias=True)`:
|
||||
|
||||
* `None` is only added to the output dict for nullable fields that
|
||||
were set at model initialization. Other fields with value `None`
|
||||
are ignored.
|
||||
"""
|
||||
excluded_fields: Set[str] = set([
|
||||
])
|
||||
|
||||
_dict = self.model_dump(
|
||||
by_alias=True,
|
||||
exclude=excluded_fields,
|
||||
exclude_none=True,
|
||||
)
|
||||
# override the default output from pydantic by calling `to_dict()` of running
|
||||
if self.running:
|
||||
_dict['running'] = self.running.to_dict()
|
||||
# override the default output from pydantic by calling `to_dict()` of terminated
|
||||
if self.terminated:
|
||||
_dict['terminated'] = self.terminated.to_dict()
|
||||
# override the default output from pydantic by calling `to_dict()` of waiting
|
||||
if self.waiting:
|
||||
_dict['waiting'] = self.waiting.to_dict()
|
||||
return _dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||
"""Create an instance of IoK8sApiCoreV1ContainerState from a dict"""
|
||||
if obj is None:
|
||||
return None
|
||||
|
||||
if not isinstance(obj, dict):
|
||||
return cls.model_validate(obj)
|
||||
|
||||
_obj = cls.model_validate({
|
||||
"running": IoK8sApiCoreV1ContainerStateRunning.from_dict(obj["running"]) if obj.get("running") is not None else None,
|
||||
"terminated": IoK8sApiCoreV1ContainerStateTerminated.from_dict(obj["terminated"]) if obj.get("terminated") is not None else None,
|
||||
"waiting": IoK8sApiCoreV1ContainerStateWaiting.from_dict(obj["waiting"]) if obj.get("waiting") is not None else None
|
||||
})
|
||||
return _obj
|
||||
|
||||
|
||||
+88
@@ -0,0 +1,88 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
Kubeflow Trainer OpenAPI Spec
|
||||
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
|
||||
The version of the OpenAPI document: unversioned
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
|
||||
Do not edit the class manually.
|
||||
""" # noqa: E501
|
||||
|
||||
|
||||
from __future__ import annotations
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
import json
|
||||
|
||||
from datetime import datetime
|
||||
from pydantic import BaseModel, ConfigDict, Field
|
||||
from typing import Any, ClassVar, Dict, List, Optional
|
||||
from typing import Optional, Set
|
||||
from typing_extensions import Self
|
||||
|
||||
class IoK8sApiCoreV1ContainerStateRunning(BaseModel):
|
||||
"""
|
||||
ContainerStateRunning is a running state of a container.
|
||||
""" # noqa: E501
|
||||
started_at: Optional[datetime] = Field(default=None, description="Time at which the container was last (re-)started", alias="startedAt")
|
||||
__properties: ClassVar[List[str]] = ["startedAt"]
|
||||
|
||||
model_config = ConfigDict(
|
||||
populate_by_name=True,
|
||||
validate_assignment=True,
|
||||
protected_namespaces=(),
|
||||
)
|
||||
|
||||
|
||||
def to_str(self) -> str:
|
||||
"""Returns the string representation of the model using alias"""
|
||||
return pprint.pformat(self.model_dump(by_alias=True))
|
||||
|
||||
def to_json(self) -> str:
|
||||
"""Returns the JSON representation of the model using alias"""
|
||||
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
||||
return json.dumps(self.to_dict())
|
||||
|
||||
@classmethod
|
||||
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||
"""Create an instance of IoK8sApiCoreV1ContainerStateRunning from a JSON string"""
|
||||
return cls.from_dict(json.loads(json_str))
|
||||
|
||||
def to_dict(self) -> Dict[str, Any]:
|
||||
"""Return the dictionary representation of the model using alias.
|
||||
|
||||
This has the following differences from calling pydantic's
|
||||
`self.model_dump(by_alias=True)`:
|
||||
|
||||
* `None` is only added to the output dict for nullable fields that
|
||||
were set at model initialization. Other fields with value `None`
|
||||
are ignored.
|
||||
"""
|
||||
excluded_fields: Set[str] = set([
|
||||
])
|
||||
|
||||
_dict = self.model_dump(
|
||||
by_alias=True,
|
||||
exclude=excluded_fields,
|
||||
exclude_none=True,
|
||||
)
|
||||
return _dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||
"""Create an instance of IoK8sApiCoreV1ContainerStateRunning from a dict"""
|
||||
if obj is None:
|
||||
return None
|
||||
|
||||
if not isinstance(obj, dict):
|
||||
return cls.model_validate(obj)
|
||||
|
||||
_obj = cls.model_validate({
|
||||
"startedAt": obj.get("startedAt")
|
||||
})
|
||||
return _obj
|
||||
|
||||
|
||||
+100
@@ -0,0 +1,100 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
Kubeflow Trainer OpenAPI Spec
|
||||
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
|
||||
The version of the OpenAPI document: unversioned
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
|
||||
Do not edit the class manually.
|
||||
""" # noqa: E501
|
||||
|
||||
|
||||
from __future__ import annotations
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
import json
|
||||
|
||||
from datetime import datetime
|
||||
from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr
|
||||
from typing import Any, ClassVar, Dict, List, Optional
|
||||
from typing import Optional, Set
|
||||
from typing_extensions import Self
|
||||
|
||||
class IoK8sApiCoreV1ContainerStateTerminated(BaseModel):
|
||||
"""
|
||||
ContainerStateTerminated is a terminated state of a container.
|
||||
""" # noqa: E501
|
||||
container_id: Optional[StrictStr] = Field(default=None, description="Container's ID in the format '<type>://<container_id>'", alias="containerID")
|
||||
exit_code: StrictInt = Field(description="Exit status from the last termination of the container", alias="exitCode")
|
||||
finished_at: Optional[datetime] = Field(default=None, description="Time at which the container last terminated", alias="finishedAt")
|
||||
message: Optional[StrictStr] = Field(default=None, description="Message regarding the last termination of the container")
|
||||
reason: Optional[StrictStr] = Field(default=None, description="(brief) reason from the last termination of the container")
|
||||
signal: Optional[StrictInt] = Field(default=None, description="Signal from the last termination of the container")
|
||||
started_at: Optional[datetime] = Field(default=None, description="Time at which previous execution of the container started", alias="startedAt")
|
||||
__properties: ClassVar[List[str]] = ["containerID", "exitCode", "finishedAt", "message", "reason", "signal", "startedAt"]
|
||||
|
||||
model_config = ConfigDict(
|
||||
populate_by_name=True,
|
||||
validate_assignment=True,
|
||||
protected_namespaces=(),
|
||||
)
|
||||
|
||||
|
||||
def to_str(self) -> str:
|
||||
"""Returns the string representation of the model using alias"""
|
||||
return pprint.pformat(self.model_dump(by_alias=True))
|
||||
|
||||
def to_json(self) -> str:
|
||||
"""Returns the JSON representation of the model using alias"""
|
||||
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
||||
return json.dumps(self.to_dict())
|
||||
|
||||
@classmethod
|
||||
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||
"""Create an instance of IoK8sApiCoreV1ContainerStateTerminated from a JSON string"""
|
||||
return cls.from_dict(json.loads(json_str))
|
||||
|
||||
def to_dict(self) -> Dict[str, Any]:
|
||||
"""Return the dictionary representation of the model using alias.
|
||||
|
||||
This has the following differences from calling pydantic's
|
||||
`self.model_dump(by_alias=True)`:
|
||||
|
||||
* `None` is only added to the output dict for nullable fields that
|
||||
were set at model initialization. Other fields with value `None`
|
||||
are ignored.
|
||||
"""
|
||||
excluded_fields: Set[str] = set([
|
||||
])
|
||||
|
||||
_dict = self.model_dump(
|
||||
by_alias=True,
|
||||
exclude=excluded_fields,
|
||||
exclude_none=True,
|
||||
)
|
||||
return _dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||
"""Create an instance of IoK8sApiCoreV1ContainerStateTerminated from a dict"""
|
||||
if obj is None:
|
||||
return None
|
||||
|
||||
if not isinstance(obj, dict):
|
||||
return cls.model_validate(obj)
|
||||
|
||||
_obj = cls.model_validate({
|
||||
"containerID": obj.get("containerID"),
|
||||
"exitCode": obj.get("exitCode") if obj.get("exitCode") is not None else 0,
|
||||
"finishedAt": obj.get("finishedAt"),
|
||||
"message": obj.get("message"),
|
||||
"reason": obj.get("reason"),
|
||||
"signal": obj.get("signal"),
|
||||
"startedAt": obj.get("startedAt")
|
||||
})
|
||||
return _obj
|
||||
|
||||
|
||||
+89
@@ -0,0 +1,89 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
Kubeflow Trainer OpenAPI Spec
|
||||
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
|
||||
The version of the OpenAPI document: unversioned
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
|
||||
Do not edit the class manually.
|
||||
""" # noqa: E501
|
||||
|
||||
|
||||
from __future__ import annotations
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
import json
|
||||
|
||||
from pydantic import BaseModel, ConfigDict, Field, StrictStr
|
||||
from typing import Any, ClassVar, Dict, List, Optional
|
||||
from typing import Optional, Set
|
||||
from typing_extensions import Self
|
||||
|
||||
class IoK8sApiCoreV1ContainerStateWaiting(BaseModel):
|
||||
"""
|
||||
ContainerStateWaiting is a waiting state of a container.
|
||||
""" # noqa: E501
|
||||
message: Optional[StrictStr] = Field(default=None, description="Message regarding why the container is not yet running.")
|
||||
reason: Optional[StrictStr] = Field(default=None, description="(brief) reason the container is not yet running.")
|
||||
__properties: ClassVar[List[str]] = ["message", "reason"]
|
||||
|
||||
model_config = ConfigDict(
|
||||
populate_by_name=True,
|
||||
validate_assignment=True,
|
||||
protected_namespaces=(),
|
||||
)
|
||||
|
||||
|
||||
def to_str(self) -> str:
|
||||
"""Returns the string representation of the model using alias"""
|
||||
return pprint.pformat(self.model_dump(by_alias=True))
|
||||
|
||||
def to_json(self) -> str:
|
||||
"""Returns the JSON representation of the model using alias"""
|
||||
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
||||
return json.dumps(self.to_dict())
|
||||
|
||||
@classmethod
|
||||
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||
"""Create an instance of IoK8sApiCoreV1ContainerStateWaiting from a JSON string"""
|
||||
return cls.from_dict(json.loads(json_str))
|
||||
|
||||
def to_dict(self) -> Dict[str, Any]:
|
||||
"""Return the dictionary representation of the model using alias.
|
||||
|
||||
This has the following differences from calling pydantic's
|
||||
`self.model_dump(by_alias=True)`:
|
||||
|
||||
* `None` is only added to the output dict for nullable fields that
|
||||
were set at model initialization. Other fields with value `None`
|
||||
are ignored.
|
||||
"""
|
||||
excluded_fields: Set[str] = set([
|
||||
])
|
||||
|
||||
_dict = self.model_dump(
|
||||
by_alias=True,
|
||||
exclude=excluded_fields,
|
||||
exclude_none=True,
|
||||
)
|
||||
return _dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||
"""Create an instance of IoK8sApiCoreV1ContainerStateWaiting from a dict"""
|
||||
if obj is None:
|
||||
return None
|
||||
|
||||
if not isinstance(obj, dict):
|
||||
return cls.model_validate(obj)
|
||||
|
||||
_obj = cls.model_validate({
|
||||
"message": obj.get("message"),
|
||||
"reason": obj.get("reason")
|
||||
})
|
||||
return _obj
|
||||
|
||||
|
||||
@@ -0,0 +1,157 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
Kubeflow Trainer OpenAPI Spec
|
||||
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
|
||||
The version of the OpenAPI document: unversioned
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
|
||||
Do not edit the class manually.
|
||||
""" # noqa: E501
|
||||
|
||||
|
||||
from __future__ import annotations
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
import json
|
||||
|
||||
from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr
|
||||
from typing import Any, ClassVar, Dict, List, Optional
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_container_state import IoK8sApiCoreV1ContainerState
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_container_user import IoK8sApiCoreV1ContainerUser
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_resource_requirements import IoK8sApiCoreV1ResourceRequirements
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_resource_status import IoK8sApiCoreV1ResourceStatus
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_volume_mount_status import IoK8sApiCoreV1VolumeMountStatus
|
||||
from kubeflow_trainer_api.models.io_k8s_apimachinery_pkg_api_resource_quantity import IoK8sApimachineryPkgApiResourceQuantity
|
||||
from typing import Optional, Set
|
||||
from typing_extensions import Self
|
||||
|
||||
class IoK8sApiCoreV1ContainerStatus(BaseModel):
|
||||
"""
|
||||
ContainerStatus contains details for the current status of this container.
|
||||
""" # noqa: E501
|
||||
allocated_resources: Optional[Dict[str, IoK8sApimachineryPkgApiResourceQuantity]] = Field(default=None, description="AllocatedResources represents the compute resources allocated for this container by the node. Kubelet sets this value to Container.Resources.Requests upon successful pod admission and after successfully admitting desired pod resize.", alias="allocatedResources")
|
||||
allocated_resources_status: Optional[List[IoK8sApiCoreV1ResourceStatus]] = Field(default=None, description="AllocatedResourcesStatus represents the status of various resources allocated for this Pod.", alias="allocatedResourcesStatus")
|
||||
container_id: Optional[StrictStr] = Field(default=None, description="ContainerID is the ID of the container in the format '<type>://<container_id>'. Where type is a container runtime identifier, returned from Version call of CRI API (for example \"containerd\").", alias="containerID")
|
||||
image: StrictStr = Field(description="Image is the name of container image that the container is running. The container image may not match the image used in the PodSpec, as it may have been resolved by the runtime. More info: https://kubernetes.io/docs/concepts/containers/images.")
|
||||
image_id: StrictStr = Field(description="ImageID is the image ID of the container's image. The image ID may not match the image ID of the image used in the PodSpec, as it may have been resolved by the runtime.", alias="imageID")
|
||||
last_state: Optional[IoK8sApiCoreV1ContainerState] = Field(default=None, description="LastTerminationState holds the last termination state of the container to help debug container crashes and restarts. This field is not populated if the container is still running and RestartCount is 0.", alias="lastState")
|
||||
name: StrictStr = Field(description="Name is a DNS_LABEL representing the unique name of the container. Each container in a pod must have a unique name across all container types. Cannot be updated.")
|
||||
ready: StrictBool = Field(description="Ready specifies whether the container is currently passing its readiness check. The value will change as readiness probes keep executing. If no readiness probes are specified, this field defaults to true once the container is fully started (see Started field). The value is typically used to determine whether a container is ready to accept traffic.")
|
||||
resources: Optional[IoK8sApiCoreV1ResourceRequirements] = Field(default=None, description="Resources represents the compute resource requests and limits that have been successfully enacted on the running container after it has been started or has been successfully resized.")
|
||||
restart_count: StrictInt = Field(description="RestartCount holds the number of times the container has been restarted. Kubelet makes an effort to always increment the value, but there are cases when the state may be lost due to node restarts and then the value may be reset to 0. The value is never negative.", alias="restartCount")
|
||||
started: Optional[StrictBool] = Field(default=None, description="Started indicates whether the container has finished its postStart lifecycle hook and passed its startup probe. Initialized as false, becomes true after startupProbe is considered successful. Resets to false when the container is restarted, or if kubelet loses state temporarily. In both cases, startup probes will run again. Is always true when no startupProbe is defined and container is running and has passed the postStart lifecycle hook. The null value must be treated the same as false.")
|
||||
state: Optional[IoK8sApiCoreV1ContainerState] = Field(default=None, description="State holds details about the container's current condition.")
|
||||
user: Optional[IoK8sApiCoreV1ContainerUser] = Field(default=None, description="User represents user identity information initially attached to the first process of the container")
|
||||
volume_mounts: Optional[List[IoK8sApiCoreV1VolumeMountStatus]] = Field(default=None, description="Status of volume mounts.", alias="volumeMounts")
|
||||
__properties: ClassVar[List[str]] = ["allocatedResources", "allocatedResourcesStatus", "containerID", "image", "imageID", "lastState", "name", "ready", "resources", "restartCount", "started", "state", "user", "volumeMounts"]
|
||||
|
||||
model_config = ConfigDict(
|
||||
populate_by_name=True,
|
||||
validate_assignment=True,
|
||||
protected_namespaces=(),
|
||||
)
|
||||
|
||||
|
||||
def to_str(self) -> str:
|
||||
"""Returns the string representation of the model using alias"""
|
||||
return pprint.pformat(self.model_dump(by_alias=True))
|
||||
|
||||
def to_json(self) -> str:
|
||||
"""Returns the JSON representation of the model using alias"""
|
||||
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
||||
return json.dumps(self.to_dict())
|
||||
|
||||
@classmethod
|
||||
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||
"""Create an instance of IoK8sApiCoreV1ContainerStatus from a JSON string"""
|
||||
return cls.from_dict(json.loads(json_str))
|
||||
|
||||
def to_dict(self) -> Dict[str, Any]:
|
||||
"""Return the dictionary representation of the model using alias.
|
||||
|
||||
This has the following differences from calling pydantic's
|
||||
`self.model_dump(by_alias=True)`:
|
||||
|
||||
* `None` is only added to the output dict for nullable fields that
|
||||
were set at model initialization. Other fields with value `None`
|
||||
are ignored.
|
||||
"""
|
||||
excluded_fields: Set[str] = set([
|
||||
])
|
||||
|
||||
_dict = self.model_dump(
|
||||
by_alias=True,
|
||||
exclude=excluded_fields,
|
||||
exclude_none=True,
|
||||
)
|
||||
# override the default output from pydantic by calling `to_dict()` of each value in allocated_resources (dict)
|
||||
_field_dict = {}
|
||||
if self.allocated_resources:
|
||||
for _key_allocated_resources in self.allocated_resources:
|
||||
if self.allocated_resources[_key_allocated_resources]:
|
||||
_field_dict[_key_allocated_resources] = self.allocated_resources[_key_allocated_resources].to_dict()
|
||||
_dict['allocatedResources'] = _field_dict
|
||||
# override the default output from pydantic by calling `to_dict()` of each item in allocated_resources_status (list)
|
||||
_items = []
|
||||
if self.allocated_resources_status:
|
||||
for _item_allocated_resources_status in self.allocated_resources_status:
|
||||
if _item_allocated_resources_status:
|
||||
_items.append(_item_allocated_resources_status.to_dict())
|
||||
_dict['allocatedResourcesStatus'] = _items
|
||||
# override the default output from pydantic by calling `to_dict()` of last_state
|
||||
if self.last_state:
|
||||
_dict['lastState'] = self.last_state.to_dict()
|
||||
# override the default output from pydantic by calling `to_dict()` of resources
|
||||
if self.resources:
|
||||
_dict['resources'] = self.resources.to_dict()
|
||||
# override the default output from pydantic by calling `to_dict()` of state
|
||||
if self.state:
|
||||
_dict['state'] = self.state.to_dict()
|
||||
# override the default output from pydantic by calling `to_dict()` of user
|
||||
if self.user:
|
||||
_dict['user'] = self.user.to_dict()
|
||||
# override the default output from pydantic by calling `to_dict()` of each item in volume_mounts (list)
|
||||
_items = []
|
||||
if self.volume_mounts:
|
||||
for _item_volume_mounts in self.volume_mounts:
|
||||
if _item_volume_mounts:
|
||||
_items.append(_item_volume_mounts.to_dict())
|
||||
_dict['volumeMounts'] = _items
|
||||
return _dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||
"""Create an instance of IoK8sApiCoreV1ContainerStatus from a dict"""
|
||||
if obj is None:
|
||||
return None
|
||||
|
||||
if not isinstance(obj, dict):
|
||||
return cls.model_validate(obj)
|
||||
|
||||
_obj = cls.model_validate({
|
||||
"allocatedResources": dict(
|
||||
(_k, IoK8sApimachineryPkgApiResourceQuantity.from_dict(_v))
|
||||
for _k, _v in obj["allocatedResources"].items()
|
||||
)
|
||||
if obj.get("allocatedResources") is not None
|
||||
else None,
|
||||
"allocatedResourcesStatus": [IoK8sApiCoreV1ResourceStatus.from_dict(_item) for _item in obj["allocatedResourcesStatus"]] if obj.get("allocatedResourcesStatus") is not None else None,
|
||||
"containerID": obj.get("containerID"),
|
||||
"image": obj.get("image") if obj.get("image") is not None else '',
|
||||
"imageID": obj.get("imageID") if obj.get("imageID") is not None else '',
|
||||
"lastState": IoK8sApiCoreV1ContainerState.from_dict(obj["lastState"]) if obj.get("lastState") is not None else None,
|
||||
"name": obj.get("name") if obj.get("name") is not None else '',
|
||||
"ready": obj.get("ready") if obj.get("ready") is not None else False,
|
||||
"resources": IoK8sApiCoreV1ResourceRequirements.from_dict(obj["resources"]) if obj.get("resources") is not None else None,
|
||||
"restartCount": obj.get("restartCount") if obj.get("restartCount") is not None else 0,
|
||||
"started": obj.get("started"),
|
||||
"state": IoK8sApiCoreV1ContainerState.from_dict(obj["state"]) if obj.get("state") is not None else None,
|
||||
"user": IoK8sApiCoreV1ContainerUser.from_dict(obj["user"]) if obj.get("user") is not None else None,
|
||||
"volumeMounts": [IoK8sApiCoreV1VolumeMountStatus.from_dict(_item) for _item in obj["volumeMounts"]] if obj.get("volumeMounts") is not None else None
|
||||
})
|
||||
return _obj
|
||||
|
||||
|
||||
@@ -0,0 +1,91 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
Kubeflow Trainer OpenAPI Spec
|
||||
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
|
||||
The version of the OpenAPI document: unversioned
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
|
||||
Do not edit the class manually.
|
||||
""" # noqa: E501
|
||||
|
||||
|
||||
from __future__ import annotations
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
import json
|
||||
|
||||
from pydantic import BaseModel, ConfigDict, Field
|
||||
from typing import Any, ClassVar, Dict, List, Optional
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_linux_container_user import IoK8sApiCoreV1LinuxContainerUser
|
||||
from typing import Optional, Set
|
||||
from typing_extensions import Self
|
||||
|
||||
class IoK8sApiCoreV1ContainerUser(BaseModel):
|
||||
"""
|
||||
ContainerUser represents user identity information
|
||||
""" # noqa: E501
|
||||
linux: Optional[IoK8sApiCoreV1LinuxContainerUser] = Field(default=None, description="Linux holds user identity information initially attached to the first process of the containers in Linux. Note that the actual running identity can be changed if the process has enough privilege to do so.")
|
||||
__properties: ClassVar[List[str]] = ["linux"]
|
||||
|
||||
model_config = ConfigDict(
|
||||
populate_by_name=True,
|
||||
validate_assignment=True,
|
||||
protected_namespaces=(),
|
||||
)
|
||||
|
||||
|
||||
def to_str(self) -> str:
|
||||
"""Returns the string representation of the model using alias"""
|
||||
return pprint.pformat(self.model_dump(by_alias=True))
|
||||
|
||||
def to_json(self) -> str:
|
||||
"""Returns the JSON representation of the model using alias"""
|
||||
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
||||
return json.dumps(self.to_dict())
|
||||
|
||||
@classmethod
|
||||
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||
"""Create an instance of IoK8sApiCoreV1ContainerUser from a JSON string"""
|
||||
return cls.from_dict(json.loads(json_str))
|
||||
|
||||
def to_dict(self) -> Dict[str, Any]:
|
||||
"""Return the dictionary representation of the model using alias.
|
||||
|
||||
This has the following differences from calling pydantic's
|
||||
`self.model_dump(by_alias=True)`:
|
||||
|
||||
* `None` is only added to the output dict for nullable fields that
|
||||
were set at model initialization. Other fields with value `None`
|
||||
are ignored.
|
||||
"""
|
||||
excluded_fields: Set[str] = set([
|
||||
])
|
||||
|
||||
_dict = self.model_dump(
|
||||
by_alias=True,
|
||||
exclude=excluded_fields,
|
||||
exclude_none=True,
|
||||
)
|
||||
# override the default output from pydantic by calling `to_dict()` of linux
|
||||
if self.linux:
|
||||
_dict['linux'] = self.linux.to_dict()
|
||||
return _dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||
"""Create an instance of IoK8sApiCoreV1ContainerUser from a dict"""
|
||||
if obj is None:
|
||||
return None
|
||||
|
||||
if not isinstance(obj, dict):
|
||||
return cls.model_validate(obj)
|
||||
|
||||
_obj = cls.model_validate({
|
||||
"linux": IoK8sApiCoreV1LinuxContainerUser.from_dict(obj["linux"]) if obj.get("linux") is not None else None
|
||||
})
|
||||
return _obj
|
||||
|
||||
|
||||
+121
@@ -0,0 +1,121 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
Kubeflow Trainer OpenAPI Spec
|
||||
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
|
||||
The version of the OpenAPI document: unversioned
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
|
||||
Do not edit the class manually.
|
||||
""" # noqa: E501
|
||||
|
||||
|
||||
from __future__ import annotations
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
import json
|
||||
|
||||
from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr
|
||||
from typing import Any, ClassVar, Dict, List, Optional
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_secret_reference import IoK8sApiCoreV1SecretReference
|
||||
from typing import Optional, Set
|
||||
from typing_extensions import Self
|
||||
|
||||
class IoK8sApiCoreV1CSIPersistentVolumeSource(BaseModel):
|
||||
"""
|
||||
Represents storage that is managed by an external CSI volume driver
|
||||
""" # noqa: E501
|
||||
controller_expand_secret_ref: Optional[IoK8sApiCoreV1SecretReference] = Field(default=None, description="controllerExpandSecretRef is a reference to the secret object containing sensitive information to pass to the CSI driver to complete the CSI ControllerExpandVolume call. This field is optional, and may be empty if no secret is required. If the secret object contains more than one secret, all secrets are passed.", alias="controllerExpandSecretRef")
|
||||
controller_publish_secret_ref: Optional[IoK8sApiCoreV1SecretReference] = Field(default=None, description="controllerPublishSecretRef is a reference to the secret object containing sensitive information to pass to the CSI driver to complete the CSI ControllerPublishVolume and ControllerUnpublishVolume calls. This field is optional, and may be empty if no secret is required. If the secret object contains more than one secret, all secrets are passed.", alias="controllerPublishSecretRef")
|
||||
driver: StrictStr = Field(description="driver is the name of the driver to use for this volume. Required.")
|
||||
fs_type: Optional[StrictStr] = Field(default=None, description="fsType to mount. Must be a filesystem type supported by the host operating system. Ex. \"ext4\", \"xfs\", \"ntfs\".", alias="fsType")
|
||||
node_expand_secret_ref: Optional[IoK8sApiCoreV1SecretReference] = Field(default=None, description="nodeExpandSecretRef is a reference to the secret object containing sensitive information to pass to the CSI driver to complete the CSI NodeExpandVolume call. This field is optional, may be omitted if no secret is required. If the secret object contains more than one secret, all secrets are passed.", alias="nodeExpandSecretRef")
|
||||
node_publish_secret_ref: Optional[IoK8sApiCoreV1SecretReference] = Field(default=None, description="nodePublishSecretRef is a reference to the secret object containing sensitive information to pass to the CSI driver to complete the CSI NodePublishVolume and NodeUnpublishVolume calls. This field is optional, and may be empty if no secret is required. If the secret object contains more than one secret, all secrets are passed.", alias="nodePublishSecretRef")
|
||||
node_stage_secret_ref: Optional[IoK8sApiCoreV1SecretReference] = Field(default=None, description="nodeStageSecretRef is a reference to the secret object containing sensitive information to pass to the CSI driver to complete the CSI NodeStageVolume and NodeStageVolume and NodeUnstageVolume calls. This field is optional, and may be empty if no secret is required. If the secret object contains more than one secret, all secrets are passed.", alias="nodeStageSecretRef")
|
||||
read_only: Optional[StrictBool] = Field(default=None, description="readOnly value to pass to ControllerPublishVolumeRequest. Defaults to false (read/write).", alias="readOnly")
|
||||
volume_attributes: Optional[Dict[str, StrictStr]] = Field(default=None, description="volumeAttributes of the volume to publish.", alias="volumeAttributes")
|
||||
volume_handle: StrictStr = Field(description="volumeHandle is the unique volume name returned by the CSI volume plugin’s CreateVolume to refer to the volume on all subsequent calls. Required.", alias="volumeHandle")
|
||||
__properties: ClassVar[List[str]] = ["controllerExpandSecretRef", "controllerPublishSecretRef", "driver", "fsType", "nodeExpandSecretRef", "nodePublishSecretRef", "nodeStageSecretRef", "readOnly", "volumeAttributes", "volumeHandle"]
|
||||
|
||||
model_config = ConfigDict(
|
||||
populate_by_name=True,
|
||||
validate_assignment=True,
|
||||
protected_namespaces=(),
|
||||
)
|
||||
|
||||
|
||||
def to_str(self) -> str:
|
||||
"""Returns the string representation of the model using alias"""
|
||||
return pprint.pformat(self.model_dump(by_alias=True))
|
||||
|
||||
def to_json(self) -> str:
|
||||
"""Returns the JSON representation of the model using alias"""
|
||||
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
||||
return json.dumps(self.to_dict())
|
||||
|
||||
@classmethod
|
||||
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||
"""Create an instance of IoK8sApiCoreV1CSIPersistentVolumeSource from a JSON string"""
|
||||
return cls.from_dict(json.loads(json_str))
|
||||
|
||||
def to_dict(self) -> Dict[str, Any]:
|
||||
"""Return the dictionary representation of the model using alias.
|
||||
|
||||
This has the following differences from calling pydantic's
|
||||
`self.model_dump(by_alias=True)`:
|
||||
|
||||
* `None` is only added to the output dict for nullable fields that
|
||||
were set at model initialization. Other fields with value `None`
|
||||
are ignored.
|
||||
"""
|
||||
excluded_fields: Set[str] = set([
|
||||
])
|
||||
|
||||
_dict = self.model_dump(
|
||||
by_alias=True,
|
||||
exclude=excluded_fields,
|
||||
exclude_none=True,
|
||||
)
|
||||
# override the default output from pydantic by calling `to_dict()` of controller_expand_secret_ref
|
||||
if self.controller_expand_secret_ref:
|
||||
_dict['controllerExpandSecretRef'] = self.controller_expand_secret_ref.to_dict()
|
||||
# override the default output from pydantic by calling `to_dict()` of controller_publish_secret_ref
|
||||
if self.controller_publish_secret_ref:
|
||||
_dict['controllerPublishSecretRef'] = self.controller_publish_secret_ref.to_dict()
|
||||
# override the default output from pydantic by calling `to_dict()` of node_expand_secret_ref
|
||||
if self.node_expand_secret_ref:
|
||||
_dict['nodeExpandSecretRef'] = self.node_expand_secret_ref.to_dict()
|
||||
# override the default output from pydantic by calling `to_dict()` of node_publish_secret_ref
|
||||
if self.node_publish_secret_ref:
|
||||
_dict['nodePublishSecretRef'] = self.node_publish_secret_ref.to_dict()
|
||||
# override the default output from pydantic by calling `to_dict()` of node_stage_secret_ref
|
||||
if self.node_stage_secret_ref:
|
||||
_dict['nodeStageSecretRef'] = self.node_stage_secret_ref.to_dict()
|
||||
return _dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||
"""Create an instance of IoK8sApiCoreV1CSIPersistentVolumeSource from a dict"""
|
||||
if obj is None:
|
||||
return None
|
||||
|
||||
if not isinstance(obj, dict):
|
||||
return cls.model_validate(obj)
|
||||
|
||||
_obj = cls.model_validate({
|
||||
"controllerExpandSecretRef": IoK8sApiCoreV1SecretReference.from_dict(obj["controllerExpandSecretRef"]) if obj.get("controllerExpandSecretRef") is not None else None,
|
||||
"controllerPublishSecretRef": IoK8sApiCoreV1SecretReference.from_dict(obj["controllerPublishSecretRef"]) if obj.get("controllerPublishSecretRef") is not None else None,
|
||||
"driver": obj.get("driver") if obj.get("driver") is not None else '',
|
||||
"fsType": obj.get("fsType"),
|
||||
"nodeExpandSecretRef": IoK8sApiCoreV1SecretReference.from_dict(obj["nodeExpandSecretRef"]) if obj.get("nodeExpandSecretRef") is not None else None,
|
||||
"nodePublishSecretRef": IoK8sApiCoreV1SecretReference.from_dict(obj["nodePublishSecretRef"]) if obj.get("nodePublishSecretRef") is not None else None,
|
||||
"nodeStageSecretRef": IoK8sApiCoreV1SecretReference.from_dict(obj["nodeStageSecretRef"]) if obj.get("nodeStageSecretRef") is not None else None,
|
||||
"readOnly": obj.get("readOnly"),
|
||||
"volumeAttributes": obj.get("volumeAttributes"),
|
||||
"volumeHandle": obj.get("volumeHandle") if obj.get("volumeHandle") is not None else ''
|
||||
})
|
||||
return _obj
|
||||
|
||||
|
||||
@@ -0,0 +1,99 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
Kubeflow Trainer OpenAPI Spec
|
||||
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
|
||||
The version of the OpenAPI document: unversioned
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
|
||||
Do not edit the class manually.
|
||||
""" # noqa: E501
|
||||
|
||||
|
||||
from __future__ import annotations
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
import json
|
||||
|
||||
from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr
|
||||
from typing import Any, ClassVar, Dict, List, Optional
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_local_object_reference import IoK8sApiCoreV1LocalObjectReference
|
||||
from typing import Optional, Set
|
||||
from typing_extensions import Self
|
||||
|
||||
class IoK8sApiCoreV1CSIVolumeSource(BaseModel):
|
||||
"""
|
||||
Represents a source location of a volume to mount, managed by an external CSI driver
|
||||
""" # noqa: E501
|
||||
driver: StrictStr = Field(description="driver is the name of the CSI driver that handles this volume. Consult with your admin for the correct name as registered in the cluster.")
|
||||
fs_type: Optional[StrictStr] = Field(default=None, description="fsType to mount. Ex. \"ext4\", \"xfs\", \"ntfs\". If not provided, the empty value is passed to the associated CSI driver which will determine the default filesystem to apply.", alias="fsType")
|
||||
node_publish_secret_ref: Optional[IoK8sApiCoreV1LocalObjectReference] = Field(default=None, description="nodePublishSecretRef is a reference to the secret object containing sensitive information to pass to the CSI driver to complete the CSI NodePublishVolume and NodeUnpublishVolume calls. This field is optional, and may be empty if no secret is required. If the secret object contains more than one secret, all secret references are passed.", alias="nodePublishSecretRef")
|
||||
read_only: Optional[StrictBool] = Field(default=None, description="readOnly specifies a read-only configuration for the volume. Defaults to false (read/write).", alias="readOnly")
|
||||
volume_attributes: Optional[Dict[str, StrictStr]] = Field(default=None, description="volumeAttributes stores driver-specific properties that are passed to the CSI driver. Consult your driver's documentation for supported values.", alias="volumeAttributes")
|
||||
__properties: ClassVar[List[str]] = ["driver", "fsType", "nodePublishSecretRef", "readOnly", "volumeAttributes"]
|
||||
|
||||
model_config = ConfigDict(
|
||||
populate_by_name=True,
|
||||
validate_assignment=True,
|
||||
protected_namespaces=(),
|
||||
)
|
||||
|
||||
|
||||
def to_str(self) -> str:
|
||||
"""Returns the string representation of the model using alias"""
|
||||
return pprint.pformat(self.model_dump(by_alias=True))
|
||||
|
||||
def to_json(self) -> str:
|
||||
"""Returns the JSON representation of the model using alias"""
|
||||
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
||||
return json.dumps(self.to_dict())
|
||||
|
||||
@classmethod
|
||||
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||
"""Create an instance of IoK8sApiCoreV1CSIVolumeSource from a JSON string"""
|
||||
return cls.from_dict(json.loads(json_str))
|
||||
|
||||
def to_dict(self) -> Dict[str, Any]:
|
||||
"""Return the dictionary representation of the model using alias.
|
||||
|
||||
This has the following differences from calling pydantic's
|
||||
`self.model_dump(by_alias=True)`:
|
||||
|
||||
* `None` is only added to the output dict for nullable fields that
|
||||
were set at model initialization. Other fields with value `None`
|
||||
are ignored.
|
||||
"""
|
||||
excluded_fields: Set[str] = set([
|
||||
])
|
||||
|
||||
_dict = self.model_dump(
|
||||
by_alias=True,
|
||||
exclude=excluded_fields,
|
||||
exclude_none=True,
|
||||
)
|
||||
# override the default output from pydantic by calling `to_dict()` of node_publish_secret_ref
|
||||
if self.node_publish_secret_ref:
|
||||
_dict['nodePublishSecretRef'] = self.node_publish_secret_ref.to_dict()
|
||||
return _dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||
"""Create an instance of IoK8sApiCoreV1CSIVolumeSource from a dict"""
|
||||
if obj is None:
|
||||
return None
|
||||
|
||||
if not isinstance(obj, dict):
|
||||
return cls.model_validate(obj)
|
||||
|
||||
_obj = cls.model_validate({
|
||||
"driver": obj.get("driver") if obj.get("driver") is not None else '',
|
||||
"fsType": obj.get("fsType"),
|
||||
"nodePublishSecretRef": IoK8sApiCoreV1LocalObjectReference.from_dict(obj["nodePublishSecretRef"]) if obj.get("nodePublishSecretRef") is not None else None,
|
||||
"readOnly": obj.get("readOnly"),
|
||||
"volumeAttributes": obj.get("volumeAttributes")
|
||||
})
|
||||
return _obj
|
||||
|
||||
|
||||
@@ -0,0 +1,87 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
Kubeflow Trainer OpenAPI Spec
|
||||
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
|
||||
The version of the OpenAPI document: unversioned
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
|
||||
Do not edit the class manually.
|
||||
""" # noqa: E501
|
||||
|
||||
|
||||
from __future__ import annotations
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
import json
|
||||
|
||||
from pydantic import BaseModel, ConfigDict, Field, StrictInt
|
||||
from typing import Any, ClassVar, Dict, List
|
||||
from typing import Optional, Set
|
||||
from typing_extensions import Self
|
||||
|
||||
class IoK8sApiCoreV1DaemonEndpoint(BaseModel):
|
||||
"""
|
||||
DaemonEndpoint contains information about a single Daemon endpoint.
|
||||
""" # noqa: E501
|
||||
port: StrictInt = Field(description="Port number of the given endpoint.", alias="Port")
|
||||
__properties: ClassVar[List[str]] = ["Port"]
|
||||
|
||||
model_config = ConfigDict(
|
||||
populate_by_name=True,
|
||||
validate_assignment=True,
|
||||
protected_namespaces=(),
|
||||
)
|
||||
|
||||
|
||||
def to_str(self) -> str:
|
||||
"""Returns the string representation of the model using alias"""
|
||||
return pprint.pformat(self.model_dump(by_alias=True))
|
||||
|
||||
def to_json(self) -> str:
|
||||
"""Returns the JSON representation of the model using alias"""
|
||||
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
||||
return json.dumps(self.to_dict())
|
||||
|
||||
@classmethod
|
||||
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||
"""Create an instance of IoK8sApiCoreV1DaemonEndpoint from a JSON string"""
|
||||
return cls.from_dict(json.loads(json_str))
|
||||
|
||||
def to_dict(self) -> Dict[str, Any]:
|
||||
"""Return the dictionary representation of the model using alias.
|
||||
|
||||
This has the following differences from calling pydantic's
|
||||
`self.model_dump(by_alias=True)`:
|
||||
|
||||
* `None` is only added to the output dict for nullable fields that
|
||||
were set at model initialization. Other fields with value `None`
|
||||
are ignored.
|
||||
"""
|
||||
excluded_fields: Set[str] = set([
|
||||
])
|
||||
|
||||
_dict = self.model_dump(
|
||||
by_alias=True,
|
||||
exclude=excluded_fields,
|
||||
exclude_none=True,
|
||||
)
|
||||
return _dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||
"""Create an instance of IoK8sApiCoreV1DaemonEndpoint from a dict"""
|
||||
if obj is None:
|
||||
return None
|
||||
|
||||
if not isinstance(obj, dict):
|
||||
return cls.model_validate(obj)
|
||||
|
||||
_obj = cls.model_validate({
|
||||
"Port": obj.get("Port") if obj.get("Port") is not None else 0
|
||||
})
|
||||
return _obj
|
||||
|
||||
|
||||
+95
@@ -0,0 +1,95 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
Kubeflow Trainer OpenAPI Spec
|
||||
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
|
||||
The version of the OpenAPI document: unversioned
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
|
||||
Do not edit the class manually.
|
||||
""" # noqa: E501
|
||||
|
||||
|
||||
from __future__ import annotations
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
import json
|
||||
|
||||
from pydantic import BaseModel, ConfigDict, Field
|
||||
from typing import Any, ClassVar, Dict, List, Optional
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_downward_api_volume_file import IoK8sApiCoreV1DownwardAPIVolumeFile
|
||||
from typing import Optional, Set
|
||||
from typing_extensions import Self
|
||||
|
||||
class IoK8sApiCoreV1DownwardAPIProjection(BaseModel):
|
||||
"""
|
||||
Represents downward API info for projecting into a projected volume. Note that this is identical to a downwardAPI volume source without the default mode.
|
||||
""" # noqa: E501
|
||||
items: Optional[List[IoK8sApiCoreV1DownwardAPIVolumeFile]] = Field(default=None, description="Items is a list of DownwardAPIVolume file")
|
||||
__properties: ClassVar[List[str]] = ["items"]
|
||||
|
||||
model_config = ConfigDict(
|
||||
populate_by_name=True,
|
||||
validate_assignment=True,
|
||||
protected_namespaces=(),
|
||||
)
|
||||
|
||||
|
||||
def to_str(self) -> str:
|
||||
"""Returns the string representation of the model using alias"""
|
||||
return pprint.pformat(self.model_dump(by_alias=True))
|
||||
|
||||
def to_json(self) -> str:
|
||||
"""Returns the JSON representation of the model using alias"""
|
||||
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
||||
return json.dumps(self.to_dict())
|
||||
|
||||
@classmethod
|
||||
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||
"""Create an instance of IoK8sApiCoreV1DownwardAPIProjection from a JSON string"""
|
||||
return cls.from_dict(json.loads(json_str))
|
||||
|
||||
def to_dict(self) -> Dict[str, Any]:
|
||||
"""Return the dictionary representation of the model using alias.
|
||||
|
||||
This has the following differences from calling pydantic's
|
||||
`self.model_dump(by_alias=True)`:
|
||||
|
||||
* `None` is only added to the output dict for nullable fields that
|
||||
were set at model initialization. Other fields with value `None`
|
||||
are ignored.
|
||||
"""
|
||||
excluded_fields: Set[str] = set([
|
||||
])
|
||||
|
||||
_dict = self.model_dump(
|
||||
by_alias=True,
|
||||
exclude=excluded_fields,
|
||||
exclude_none=True,
|
||||
)
|
||||
# override the default output from pydantic by calling `to_dict()` of each item in items (list)
|
||||
_items = []
|
||||
if self.items:
|
||||
for _item_items in self.items:
|
||||
if _item_items:
|
||||
_items.append(_item_items.to_dict())
|
||||
_dict['items'] = _items
|
||||
return _dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||
"""Create an instance of IoK8sApiCoreV1DownwardAPIProjection from a dict"""
|
||||
if obj is None:
|
||||
return None
|
||||
|
||||
if not isinstance(obj, dict):
|
||||
return cls.model_validate(obj)
|
||||
|
||||
_obj = cls.model_validate({
|
||||
"items": [IoK8sApiCoreV1DownwardAPIVolumeFile.from_dict(_item) for _item in obj["items"]] if obj.get("items") is not None else None
|
||||
})
|
||||
return _obj
|
||||
|
||||
|
||||
+101
@@ -0,0 +1,101 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
Kubeflow Trainer OpenAPI Spec
|
||||
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
|
||||
The version of the OpenAPI document: unversioned
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
|
||||
Do not edit the class manually.
|
||||
""" # noqa: E501
|
||||
|
||||
|
||||
from __future__ import annotations
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
import json
|
||||
|
||||
from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr
|
||||
from typing import Any, ClassVar, Dict, List, Optional
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_object_field_selector import IoK8sApiCoreV1ObjectFieldSelector
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_resource_field_selector import IoK8sApiCoreV1ResourceFieldSelector
|
||||
from typing import Optional, Set
|
||||
from typing_extensions import Self
|
||||
|
||||
class IoK8sApiCoreV1DownwardAPIVolumeFile(BaseModel):
|
||||
"""
|
||||
DownwardAPIVolumeFile represents information to create the file containing the pod field
|
||||
""" # noqa: E501
|
||||
field_ref: Optional[IoK8sApiCoreV1ObjectFieldSelector] = Field(default=None, description="Required: Selects a field of the pod: only annotations, labels, name, namespace and uid are supported.", alias="fieldRef")
|
||||
mode: Optional[StrictInt] = Field(default=None, description="Optional: mode bits used to set permissions on this file, must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. If not specified, the volume defaultMode will be used. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.")
|
||||
path: StrictStr = Field(description="Required: Path is the relative path name of the file to be created. Must not be absolute or contain the '..' path. Must be utf-8 encoded. The first item of the relative path must not start with '..'")
|
||||
resource_field_ref: Optional[IoK8sApiCoreV1ResourceFieldSelector] = Field(default=None, description="Selects a resource of the container: only resources limits and requests (limits.cpu, limits.memory, requests.cpu and requests.memory) are currently supported.", alias="resourceFieldRef")
|
||||
__properties: ClassVar[List[str]] = ["fieldRef", "mode", "path", "resourceFieldRef"]
|
||||
|
||||
model_config = ConfigDict(
|
||||
populate_by_name=True,
|
||||
validate_assignment=True,
|
||||
protected_namespaces=(),
|
||||
)
|
||||
|
||||
|
||||
def to_str(self) -> str:
|
||||
"""Returns the string representation of the model using alias"""
|
||||
return pprint.pformat(self.model_dump(by_alias=True))
|
||||
|
||||
def to_json(self) -> str:
|
||||
"""Returns the JSON representation of the model using alias"""
|
||||
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
||||
return json.dumps(self.to_dict())
|
||||
|
||||
@classmethod
|
||||
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||
"""Create an instance of IoK8sApiCoreV1DownwardAPIVolumeFile from a JSON string"""
|
||||
return cls.from_dict(json.loads(json_str))
|
||||
|
||||
def to_dict(self) -> Dict[str, Any]:
|
||||
"""Return the dictionary representation of the model using alias.
|
||||
|
||||
This has the following differences from calling pydantic's
|
||||
`self.model_dump(by_alias=True)`:
|
||||
|
||||
* `None` is only added to the output dict for nullable fields that
|
||||
were set at model initialization. Other fields with value `None`
|
||||
are ignored.
|
||||
"""
|
||||
excluded_fields: Set[str] = set([
|
||||
])
|
||||
|
||||
_dict = self.model_dump(
|
||||
by_alias=True,
|
||||
exclude=excluded_fields,
|
||||
exclude_none=True,
|
||||
)
|
||||
# override the default output from pydantic by calling `to_dict()` of field_ref
|
||||
if self.field_ref:
|
||||
_dict['fieldRef'] = self.field_ref.to_dict()
|
||||
# override the default output from pydantic by calling `to_dict()` of resource_field_ref
|
||||
if self.resource_field_ref:
|
||||
_dict['resourceFieldRef'] = self.resource_field_ref.to_dict()
|
||||
return _dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||
"""Create an instance of IoK8sApiCoreV1DownwardAPIVolumeFile from a dict"""
|
||||
if obj is None:
|
||||
return None
|
||||
|
||||
if not isinstance(obj, dict):
|
||||
return cls.model_validate(obj)
|
||||
|
||||
_obj = cls.model_validate({
|
||||
"fieldRef": IoK8sApiCoreV1ObjectFieldSelector.from_dict(obj["fieldRef"]) if obj.get("fieldRef") is not None else None,
|
||||
"mode": obj.get("mode"),
|
||||
"path": obj.get("path") if obj.get("path") is not None else '',
|
||||
"resourceFieldRef": IoK8sApiCoreV1ResourceFieldSelector.from_dict(obj["resourceFieldRef"]) if obj.get("resourceFieldRef") is not None else None
|
||||
})
|
||||
return _obj
|
||||
|
||||
|
||||
+97
@@ -0,0 +1,97 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
Kubeflow Trainer OpenAPI Spec
|
||||
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
|
||||
The version of the OpenAPI document: unversioned
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
|
||||
Do not edit the class manually.
|
||||
""" # noqa: E501
|
||||
|
||||
|
||||
from __future__ import annotations
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
import json
|
||||
|
||||
from pydantic import BaseModel, ConfigDict, Field, StrictInt
|
||||
from typing import Any, ClassVar, Dict, List, Optional
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_downward_api_volume_file import IoK8sApiCoreV1DownwardAPIVolumeFile
|
||||
from typing import Optional, Set
|
||||
from typing_extensions import Self
|
||||
|
||||
class IoK8sApiCoreV1DownwardAPIVolumeSource(BaseModel):
|
||||
"""
|
||||
DownwardAPIVolumeSource represents a volume containing downward API info. Downward API volumes support ownership management and SELinux relabeling.
|
||||
""" # noqa: E501
|
||||
default_mode: Optional[StrictInt] = Field(default=None, description="Optional: mode bits to use on created files by default. Must be a Optional: mode bits used to set permissions on created files by default. Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. Defaults to 0644. Directories within the path are not affected by this setting. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.", alias="defaultMode")
|
||||
items: Optional[List[IoK8sApiCoreV1DownwardAPIVolumeFile]] = Field(default=None, description="Items is a list of downward API volume file")
|
||||
__properties: ClassVar[List[str]] = ["defaultMode", "items"]
|
||||
|
||||
model_config = ConfigDict(
|
||||
populate_by_name=True,
|
||||
validate_assignment=True,
|
||||
protected_namespaces=(),
|
||||
)
|
||||
|
||||
|
||||
def to_str(self) -> str:
|
||||
"""Returns the string representation of the model using alias"""
|
||||
return pprint.pformat(self.model_dump(by_alias=True))
|
||||
|
||||
def to_json(self) -> str:
|
||||
"""Returns the JSON representation of the model using alias"""
|
||||
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
||||
return json.dumps(self.to_dict())
|
||||
|
||||
@classmethod
|
||||
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||
"""Create an instance of IoK8sApiCoreV1DownwardAPIVolumeSource from a JSON string"""
|
||||
return cls.from_dict(json.loads(json_str))
|
||||
|
||||
def to_dict(self) -> Dict[str, Any]:
|
||||
"""Return the dictionary representation of the model using alias.
|
||||
|
||||
This has the following differences from calling pydantic's
|
||||
`self.model_dump(by_alias=True)`:
|
||||
|
||||
* `None` is only added to the output dict for nullable fields that
|
||||
were set at model initialization. Other fields with value `None`
|
||||
are ignored.
|
||||
"""
|
||||
excluded_fields: Set[str] = set([
|
||||
])
|
||||
|
||||
_dict = self.model_dump(
|
||||
by_alias=True,
|
||||
exclude=excluded_fields,
|
||||
exclude_none=True,
|
||||
)
|
||||
# override the default output from pydantic by calling `to_dict()` of each item in items (list)
|
||||
_items = []
|
||||
if self.items:
|
||||
for _item_items in self.items:
|
||||
if _item_items:
|
||||
_items.append(_item_items.to_dict())
|
||||
_dict['items'] = _items
|
||||
return _dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||
"""Create an instance of IoK8sApiCoreV1DownwardAPIVolumeSource from a dict"""
|
||||
if obj is None:
|
||||
return None
|
||||
|
||||
if not isinstance(obj, dict):
|
||||
return cls.model_validate(obj)
|
||||
|
||||
_obj = cls.model_validate({
|
||||
"defaultMode": obj.get("defaultMode"),
|
||||
"items": [IoK8sApiCoreV1DownwardAPIVolumeFile.from_dict(_item) for _item in obj["items"]] if obj.get("items") is not None else None
|
||||
})
|
||||
return _obj
|
||||
|
||||
|
||||
+93
@@ -0,0 +1,93 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
Kubeflow Trainer OpenAPI Spec
|
||||
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
|
||||
The version of the OpenAPI document: unversioned
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
|
||||
Do not edit the class manually.
|
||||
""" # noqa: E501
|
||||
|
||||
|
||||
from __future__ import annotations
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
import json
|
||||
|
||||
from pydantic import BaseModel, ConfigDict, Field, StrictStr
|
||||
from typing import Any, ClassVar, Dict, List, Optional
|
||||
from kubeflow_trainer_api.models.io_k8s_apimachinery_pkg_api_resource_quantity import IoK8sApimachineryPkgApiResourceQuantity
|
||||
from typing import Optional, Set
|
||||
from typing_extensions import Self
|
||||
|
||||
class IoK8sApiCoreV1EmptyDirVolumeSource(BaseModel):
|
||||
"""
|
||||
Represents an empty directory for a pod. Empty directory volumes support ownership management and SELinux relabeling.
|
||||
""" # noqa: E501
|
||||
medium: Optional[StrictStr] = Field(default=None, description="medium represents what type of storage medium should back this directory. The default is \"\" which means to use the node's default medium. Must be an empty string (default) or Memory. More info: https://kubernetes.io/docs/concepts/storage/volumes#emptydir")
|
||||
size_limit: Optional[IoK8sApimachineryPkgApiResourceQuantity] = Field(default=None, description="sizeLimit is the total amount of local storage required for this EmptyDir volume. The size limit is also applicable for memory medium. The maximum usage on memory medium EmptyDir would be the minimum value between the SizeLimit specified here and the sum of memory limits of all containers in a pod. The default is nil which means that the limit is undefined. More info: https://kubernetes.io/docs/concepts/storage/volumes#emptydir", alias="sizeLimit")
|
||||
__properties: ClassVar[List[str]] = ["medium", "sizeLimit"]
|
||||
|
||||
model_config = ConfigDict(
|
||||
populate_by_name=True,
|
||||
validate_assignment=True,
|
||||
protected_namespaces=(),
|
||||
)
|
||||
|
||||
|
||||
def to_str(self) -> str:
|
||||
"""Returns the string representation of the model using alias"""
|
||||
return pprint.pformat(self.model_dump(by_alias=True))
|
||||
|
||||
def to_json(self) -> str:
|
||||
"""Returns the JSON representation of the model using alias"""
|
||||
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
||||
return json.dumps(self.to_dict())
|
||||
|
||||
@classmethod
|
||||
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||
"""Create an instance of IoK8sApiCoreV1EmptyDirVolumeSource from a JSON string"""
|
||||
return cls.from_dict(json.loads(json_str))
|
||||
|
||||
def to_dict(self) -> Dict[str, Any]:
|
||||
"""Return the dictionary representation of the model using alias.
|
||||
|
||||
This has the following differences from calling pydantic's
|
||||
`self.model_dump(by_alias=True)`:
|
||||
|
||||
* `None` is only added to the output dict for nullable fields that
|
||||
were set at model initialization. Other fields with value `None`
|
||||
are ignored.
|
||||
"""
|
||||
excluded_fields: Set[str] = set([
|
||||
])
|
||||
|
||||
_dict = self.model_dump(
|
||||
by_alias=True,
|
||||
exclude=excluded_fields,
|
||||
exclude_none=True,
|
||||
)
|
||||
# override the default output from pydantic by calling `to_dict()` of size_limit
|
||||
if self.size_limit:
|
||||
_dict['sizeLimit'] = self.size_limit.to_dict()
|
||||
return _dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||
"""Create an instance of IoK8sApiCoreV1EmptyDirVolumeSource from a dict"""
|
||||
if obj is None:
|
||||
return None
|
||||
|
||||
if not isinstance(obj, dict):
|
||||
return cls.model_validate(obj)
|
||||
|
||||
_obj = cls.model_validate({
|
||||
"medium": obj.get("medium"),
|
||||
"sizeLimit": IoK8sApimachineryPkgApiResourceQuantity.from_dict(obj["sizeLimit"]) if obj.get("sizeLimit") is not None else None
|
||||
})
|
||||
return _obj
|
||||
|
||||
|
||||
@@ -0,0 +1,97 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
Kubeflow Trainer OpenAPI Spec
|
||||
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
|
||||
The version of the OpenAPI document: unversioned
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
|
||||
Do not edit the class manually.
|
||||
""" # noqa: E501
|
||||
|
||||
|
||||
from __future__ import annotations
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
import json
|
||||
|
||||
from pydantic import BaseModel, ConfigDict, Field, StrictStr
|
||||
from typing import Any, ClassVar, Dict, List, Optional
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_object_reference import IoK8sApiCoreV1ObjectReference
|
||||
from typing import Optional, Set
|
||||
from typing_extensions import Self
|
||||
|
||||
class IoK8sApiCoreV1EndpointAddress(BaseModel):
|
||||
"""
|
||||
EndpointAddress is a tuple that describes single IP address.
|
||||
""" # noqa: E501
|
||||
hostname: Optional[StrictStr] = Field(default=None, description="The Hostname of this endpoint")
|
||||
ip: StrictStr = Field(description="The IP of this endpoint. May not be loopback (127.0.0.0/8 or ::1), link-local (169.254.0.0/16 or fe80::/10), or link-local multicast (224.0.0.0/24 or ff02::/16).")
|
||||
node_name: Optional[StrictStr] = Field(default=None, description="Optional: Node hosting this endpoint. This can be used to determine endpoints local to a node.", alias="nodeName")
|
||||
target_ref: Optional[IoK8sApiCoreV1ObjectReference] = Field(default=None, description="Reference to object providing the endpoint.", alias="targetRef")
|
||||
__properties: ClassVar[List[str]] = ["hostname", "ip", "nodeName", "targetRef"]
|
||||
|
||||
model_config = ConfigDict(
|
||||
populate_by_name=True,
|
||||
validate_assignment=True,
|
||||
protected_namespaces=(),
|
||||
)
|
||||
|
||||
|
||||
def to_str(self) -> str:
|
||||
"""Returns the string representation of the model using alias"""
|
||||
return pprint.pformat(self.model_dump(by_alias=True))
|
||||
|
||||
def to_json(self) -> str:
|
||||
"""Returns the JSON representation of the model using alias"""
|
||||
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
||||
return json.dumps(self.to_dict())
|
||||
|
||||
@classmethod
|
||||
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||
"""Create an instance of IoK8sApiCoreV1EndpointAddress from a JSON string"""
|
||||
return cls.from_dict(json.loads(json_str))
|
||||
|
||||
def to_dict(self) -> Dict[str, Any]:
|
||||
"""Return the dictionary representation of the model using alias.
|
||||
|
||||
This has the following differences from calling pydantic's
|
||||
`self.model_dump(by_alias=True)`:
|
||||
|
||||
* `None` is only added to the output dict for nullable fields that
|
||||
were set at model initialization. Other fields with value `None`
|
||||
are ignored.
|
||||
"""
|
||||
excluded_fields: Set[str] = set([
|
||||
])
|
||||
|
||||
_dict = self.model_dump(
|
||||
by_alias=True,
|
||||
exclude=excluded_fields,
|
||||
exclude_none=True,
|
||||
)
|
||||
# override the default output from pydantic by calling `to_dict()` of target_ref
|
||||
if self.target_ref:
|
||||
_dict['targetRef'] = self.target_ref.to_dict()
|
||||
return _dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||
"""Create an instance of IoK8sApiCoreV1EndpointAddress from a dict"""
|
||||
if obj is None:
|
||||
return None
|
||||
|
||||
if not isinstance(obj, dict):
|
||||
return cls.model_validate(obj)
|
||||
|
||||
_obj = cls.model_validate({
|
||||
"hostname": obj.get("hostname"),
|
||||
"ip": obj.get("ip") if obj.get("ip") is not None else '',
|
||||
"nodeName": obj.get("nodeName"),
|
||||
"targetRef": IoK8sApiCoreV1ObjectReference.from_dict(obj["targetRef"]) if obj.get("targetRef") is not None else None
|
||||
})
|
||||
return _obj
|
||||
|
||||
|
||||
@@ -0,0 +1,103 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
Kubeflow Trainer OpenAPI Spec
|
||||
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
|
||||
The version of the OpenAPI document: unversioned
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
|
||||
Do not edit the class manually.
|
||||
""" # noqa: E501
|
||||
|
||||
|
||||
from __future__ import annotations
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
import json
|
||||
|
||||
from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator
|
||||
from typing import Any, ClassVar, Dict, List, Optional
|
||||
from typing import Optional, Set
|
||||
from typing_extensions import Self
|
||||
|
||||
class IoK8sApiCoreV1EndpointPort(BaseModel):
|
||||
"""
|
||||
EndpointPort is a tuple that describes a single port.
|
||||
""" # noqa: E501
|
||||
app_protocol: Optional[StrictStr] = Field(default=None, description="The application protocol for this port. This is used as a hint for implementations to offer richer behavior for protocols that they understand. This field follows standard Kubernetes label syntax. Valid values are either: * Un-prefixed protocol names - reserved for IANA standard service names (as per RFC-6335 and https://www.iana.org/assignments/service-names). * Kubernetes-defined prefixed names: * 'kubernetes.io/h2c' - HTTP/2 prior knowledge over cleartext as described in https://www.rfc-editor.org/rfc/rfc9113.html#name-starting-http-2-with-prior- * 'kubernetes.io/ws' - WebSocket over cleartext as described in https://www.rfc-editor.org/rfc/rfc6455 * 'kubernetes.io/wss' - WebSocket over TLS as described in https://www.rfc-editor.org/rfc/rfc6455 * Other protocols should use implementation-defined prefixed names such as mycompany.com/my-custom-protocol.", alias="appProtocol")
|
||||
name: Optional[StrictStr] = Field(default=None, description="The name of this port. This must match the 'name' field in the corresponding ServicePort. Must be a DNS_LABEL. Optional only if one port is defined.")
|
||||
port: StrictInt = Field(description="The port number of the endpoint.")
|
||||
protocol: Optional[StrictStr] = Field(default=None, description="The IP protocol for this port. Must be UDP, TCP, or SCTP. Default is TCP. Possible enum values: - `\"SCTP\"` is the SCTP protocol. - `\"TCP\"` is the TCP protocol. - `\"UDP\"` is the UDP protocol.")
|
||||
__properties: ClassVar[List[str]] = ["appProtocol", "name", "port", "protocol"]
|
||||
|
||||
@field_validator('protocol')
|
||||
def protocol_validate_enum(cls, value):
|
||||
"""Validates the enum"""
|
||||
if value is None:
|
||||
return value
|
||||
|
||||
if value not in set(['SCTP', 'TCP', 'UDP']):
|
||||
raise ValueError("must be one of enum values ('SCTP', 'TCP', 'UDP')")
|
||||
return value
|
||||
|
||||
model_config = ConfigDict(
|
||||
populate_by_name=True,
|
||||
validate_assignment=True,
|
||||
protected_namespaces=(),
|
||||
)
|
||||
|
||||
|
||||
def to_str(self) -> str:
|
||||
"""Returns the string representation of the model using alias"""
|
||||
return pprint.pformat(self.model_dump(by_alias=True))
|
||||
|
||||
def to_json(self) -> str:
|
||||
"""Returns the JSON representation of the model using alias"""
|
||||
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
||||
return json.dumps(self.to_dict())
|
||||
|
||||
@classmethod
|
||||
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||
"""Create an instance of IoK8sApiCoreV1EndpointPort from a JSON string"""
|
||||
return cls.from_dict(json.loads(json_str))
|
||||
|
||||
def to_dict(self) -> Dict[str, Any]:
|
||||
"""Return the dictionary representation of the model using alias.
|
||||
|
||||
This has the following differences from calling pydantic's
|
||||
`self.model_dump(by_alias=True)`:
|
||||
|
||||
* `None` is only added to the output dict for nullable fields that
|
||||
were set at model initialization. Other fields with value `None`
|
||||
are ignored.
|
||||
"""
|
||||
excluded_fields: Set[str] = set([
|
||||
])
|
||||
|
||||
_dict = self.model_dump(
|
||||
by_alias=True,
|
||||
exclude=excluded_fields,
|
||||
exclude_none=True,
|
||||
)
|
||||
return _dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||
"""Create an instance of IoK8sApiCoreV1EndpointPort from a dict"""
|
||||
if obj is None:
|
||||
return None
|
||||
|
||||
if not isinstance(obj, dict):
|
||||
return cls.model_validate(obj)
|
||||
|
||||
_obj = cls.model_validate({
|
||||
"appProtocol": obj.get("appProtocol"),
|
||||
"name": obj.get("name"),
|
||||
"port": obj.get("port") if obj.get("port") is not None else 0,
|
||||
"protocol": obj.get("protocol")
|
||||
})
|
||||
return _obj
|
||||
|
||||
|
||||
@@ -0,0 +1,114 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
Kubeflow Trainer OpenAPI Spec
|
||||
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
|
||||
The version of the OpenAPI document: unversioned
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
|
||||
Do not edit the class manually.
|
||||
""" # noqa: E501
|
||||
|
||||
|
||||
from __future__ import annotations
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
import json
|
||||
|
||||
from pydantic import BaseModel, ConfigDict, Field
|
||||
from typing import Any, ClassVar, Dict, List, Optional
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_endpoint_address import IoK8sApiCoreV1EndpointAddress
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_endpoint_port import IoK8sApiCoreV1EndpointPort
|
||||
from typing import Optional, Set
|
||||
from typing_extensions import Self
|
||||
|
||||
class IoK8sApiCoreV1EndpointSubset(BaseModel):
|
||||
"""
|
||||
EndpointSubset is a group of addresses with a common set of ports. The expanded set of endpoints is the Cartesian product of Addresses x Ports. For example, given: { Addresses: [{\"ip\": \"10.10.1.1\"}, {\"ip\": \"10.10.2.2\"}], Ports: [{\"name\": \"a\", \"port\": 8675}, {\"name\": \"b\", \"port\": 309}] } The resulting set of endpoints can be viewed as: a: [ 10.10.1.1:8675, 10.10.2.2:8675 ], b: [ 10.10.1.1:309, 10.10.2.2:309 ]
|
||||
""" # noqa: E501
|
||||
addresses: Optional[List[IoK8sApiCoreV1EndpointAddress]] = Field(default=None, description="IP addresses which offer the related ports that are marked as ready. These endpoints should be considered safe for load balancers and clients to utilize.")
|
||||
not_ready_addresses: Optional[List[IoK8sApiCoreV1EndpointAddress]] = Field(default=None, description="IP addresses which offer the related ports but are not currently marked as ready because they have not yet finished starting, have recently failed a readiness check, or have recently failed a liveness check.", alias="notReadyAddresses")
|
||||
ports: Optional[List[IoK8sApiCoreV1EndpointPort]] = Field(default=None, description="Port numbers available on the related IP addresses.")
|
||||
__properties: ClassVar[List[str]] = ["addresses", "notReadyAddresses", "ports"]
|
||||
|
||||
model_config = ConfigDict(
|
||||
populate_by_name=True,
|
||||
validate_assignment=True,
|
||||
protected_namespaces=(),
|
||||
)
|
||||
|
||||
|
||||
def to_str(self) -> str:
|
||||
"""Returns the string representation of the model using alias"""
|
||||
return pprint.pformat(self.model_dump(by_alias=True))
|
||||
|
||||
def to_json(self) -> str:
|
||||
"""Returns the JSON representation of the model using alias"""
|
||||
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
||||
return json.dumps(self.to_dict())
|
||||
|
||||
@classmethod
|
||||
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||
"""Create an instance of IoK8sApiCoreV1EndpointSubset from a JSON string"""
|
||||
return cls.from_dict(json.loads(json_str))
|
||||
|
||||
def to_dict(self) -> Dict[str, Any]:
|
||||
"""Return the dictionary representation of the model using alias.
|
||||
|
||||
This has the following differences from calling pydantic's
|
||||
`self.model_dump(by_alias=True)`:
|
||||
|
||||
* `None` is only added to the output dict for nullable fields that
|
||||
were set at model initialization. Other fields with value `None`
|
||||
are ignored.
|
||||
"""
|
||||
excluded_fields: Set[str] = set([
|
||||
])
|
||||
|
||||
_dict = self.model_dump(
|
||||
by_alias=True,
|
||||
exclude=excluded_fields,
|
||||
exclude_none=True,
|
||||
)
|
||||
# override the default output from pydantic by calling `to_dict()` of each item in addresses (list)
|
||||
_items = []
|
||||
if self.addresses:
|
||||
for _item_addresses in self.addresses:
|
||||
if _item_addresses:
|
||||
_items.append(_item_addresses.to_dict())
|
||||
_dict['addresses'] = _items
|
||||
# override the default output from pydantic by calling `to_dict()` of each item in not_ready_addresses (list)
|
||||
_items = []
|
||||
if self.not_ready_addresses:
|
||||
for _item_not_ready_addresses in self.not_ready_addresses:
|
||||
if _item_not_ready_addresses:
|
||||
_items.append(_item_not_ready_addresses.to_dict())
|
||||
_dict['notReadyAddresses'] = _items
|
||||
# override the default output from pydantic by calling `to_dict()` of each item in ports (list)
|
||||
_items = []
|
||||
if self.ports:
|
||||
for _item_ports in self.ports:
|
||||
if _item_ports:
|
||||
_items.append(_item_ports.to_dict())
|
||||
_dict['ports'] = _items
|
||||
return _dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||
"""Create an instance of IoK8sApiCoreV1EndpointSubset from a dict"""
|
||||
if obj is None:
|
||||
return None
|
||||
|
||||
if not isinstance(obj, dict):
|
||||
return cls.model_validate(obj)
|
||||
|
||||
_obj = cls.model_validate({
|
||||
"addresses": [IoK8sApiCoreV1EndpointAddress.from_dict(_item) for _item in obj["addresses"]] if obj.get("addresses") is not None else None,
|
||||
"notReadyAddresses": [IoK8sApiCoreV1EndpointAddress.from_dict(_item) for _item in obj["notReadyAddresses"]] if obj.get("notReadyAddresses") is not None else None,
|
||||
"ports": [IoK8sApiCoreV1EndpointPort.from_dict(_item) for _item in obj["ports"]] if obj.get("ports") is not None else None
|
||||
})
|
||||
return _obj
|
||||
|
||||
|
||||
@@ -0,0 +1,105 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
Kubeflow Trainer OpenAPI Spec
|
||||
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
|
||||
The version of the OpenAPI document: unversioned
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
|
||||
Do not edit the class manually.
|
||||
""" # noqa: E501
|
||||
|
||||
|
||||
from __future__ import annotations
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
import json
|
||||
|
||||
from pydantic import BaseModel, ConfigDict, Field, StrictStr
|
||||
from typing import Any, ClassVar, Dict, List, Optional
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_endpoint_subset import IoK8sApiCoreV1EndpointSubset
|
||||
from kubeflow_trainer_api.models.io_k8s_apimachinery_pkg_apis_meta_v1_object_meta import IoK8sApimachineryPkgApisMetaV1ObjectMeta
|
||||
from typing import Optional, Set
|
||||
from typing_extensions import Self
|
||||
|
||||
class IoK8sApiCoreV1Endpoints(BaseModel):
|
||||
"""
|
||||
Endpoints is a collection of endpoints that implement the actual service. Example: Name: \"mysvc\", Subsets: [ { Addresses: [{\"ip\": \"10.10.1.1\"}, {\"ip\": \"10.10.2.2\"}], Ports: [{\"name\": \"a\", \"port\": 8675}, {\"name\": \"b\", \"port\": 309}] }, { Addresses: [{\"ip\": \"10.10.3.3\"}], Ports: [{\"name\": \"a\", \"port\": 93}, {\"name\": \"b\", \"port\": 76}] }, ]
|
||||
""" # noqa: E501
|
||||
api_version: Optional[StrictStr] = Field(default=None, description="APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", alias="apiVersion")
|
||||
kind: Optional[StrictStr] = Field(default=None, description="Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds")
|
||||
metadata: Optional[IoK8sApimachineryPkgApisMetaV1ObjectMeta] = Field(default=None, description="Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata")
|
||||
subsets: Optional[List[IoK8sApiCoreV1EndpointSubset]] = Field(default=None, description="The set of all endpoints is the union of all subsets. Addresses are placed into subsets according to the IPs they share. A single address with multiple ports, some of which are ready and some of which are not (because they come from different containers) will result in the address being displayed in different subsets for the different ports. No address will appear in both Addresses and NotReadyAddresses in the same subset. Sets of addresses and ports that comprise a service.")
|
||||
__properties: ClassVar[List[str]] = ["apiVersion", "kind", "metadata", "subsets"]
|
||||
|
||||
model_config = ConfigDict(
|
||||
populate_by_name=True,
|
||||
validate_assignment=True,
|
||||
protected_namespaces=(),
|
||||
)
|
||||
|
||||
|
||||
def to_str(self) -> str:
|
||||
"""Returns the string representation of the model using alias"""
|
||||
return pprint.pformat(self.model_dump(by_alias=True))
|
||||
|
||||
def to_json(self) -> str:
|
||||
"""Returns the JSON representation of the model using alias"""
|
||||
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
||||
return json.dumps(self.to_dict())
|
||||
|
||||
@classmethod
|
||||
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||
"""Create an instance of IoK8sApiCoreV1Endpoints from a JSON string"""
|
||||
return cls.from_dict(json.loads(json_str))
|
||||
|
||||
def to_dict(self) -> Dict[str, Any]:
|
||||
"""Return the dictionary representation of the model using alias.
|
||||
|
||||
This has the following differences from calling pydantic's
|
||||
`self.model_dump(by_alias=True)`:
|
||||
|
||||
* `None` is only added to the output dict for nullable fields that
|
||||
were set at model initialization. Other fields with value `None`
|
||||
are ignored.
|
||||
"""
|
||||
excluded_fields: Set[str] = set([
|
||||
])
|
||||
|
||||
_dict = self.model_dump(
|
||||
by_alias=True,
|
||||
exclude=excluded_fields,
|
||||
exclude_none=True,
|
||||
)
|
||||
# override the default output from pydantic by calling `to_dict()` of metadata
|
||||
if self.metadata:
|
||||
_dict['metadata'] = self.metadata.to_dict()
|
||||
# override the default output from pydantic by calling `to_dict()` of each item in subsets (list)
|
||||
_items = []
|
||||
if self.subsets:
|
||||
for _item_subsets in self.subsets:
|
||||
if _item_subsets:
|
||||
_items.append(_item_subsets.to_dict())
|
||||
_dict['subsets'] = _items
|
||||
return _dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||
"""Create an instance of IoK8sApiCoreV1Endpoints from a dict"""
|
||||
if obj is None:
|
||||
return None
|
||||
|
||||
if not isinstance(obj, dict):
|
||||
return cls.model_validate(obj)
|
||||
|
||||
_obj = cls.model_validate({
|
||||
"apiVersion": obj.get("apiVersion"),
|
||||
"kind": obj.get("kind"),
|
||||
"metadata": IoK8sApimachineryPkgApisMetaV1ObjectMeta.from_dict(obj["metadata"]) if obj.get("metadata") is not None else None,
|
||||
"subsets": [IoK8sApiCoreV1EndpointSubset.from_dict(_item) for _item in obj["subsets"]] if obj.get("subsets") is not None else None
|
||||
})
|
||||
return _obj
|
||||
|
||||
|
||||
@@ -0,0 +1,105 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
Kubeflow Trainer OpenAPI Spec
|
||||
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
|
||||
The version of the OpenAPI document: unversioned
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
|
||||
Do not edit the class manually.
|
||||
""" # noqa: E501
|
||||
|
||||
|
||||
from __future__ import annotations
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
import json
|
||||
|
||||
from pydantic import BaseModel, ConfigDict, Field, StrictStr
|
||||
from typing import Any, ClassVar, Dict, List, Optional
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_endpoints import IoK8sApiCoreV1Endpoints
|
||||
from kubeflow_trainer_api.models.io_k8s_apimachinery_pkg_apis_meta_v1_list_meta import IoK8sApimachineryPkgApisMetaV1ListMeta
|
||||
from typing import Optional, Set
|
||||
from typing_extensions import Self
|
||||
|
||||
class IoK8sApiCoreV1EndpointsList(BaseModel):
|
||||
"""
|
||||
EndpointsList is a list of endpoints.
|
||||
""" # noqa: E501
|
||||
api_version: Optional[StrictStr] = Field(default=None, description="APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", alias="apiVersion")
|
||||
items: List[IoK8sApiCoreV1Endpoints] = Field(description="List of endpoints.")
|
||||
kind: Optional[StrictStr] = Field(default=None, description="Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds")
|
||||
metadata: Optional[IoK8sApimachineryPkgApisMetaV1ListMeta] = Field(default=None, description="Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds")
|
||||
__properties: ClassVar[List[str]] = ["apiVersion", "items", "kind", "metadata"]
|
||||
|
||||
model_config = ConfigDict(
|
||||
populate_by_name=True,
|
||||
validate_assignment=True,
|
||||
protected_namespaces=(),
|
||||
)
|
||||
|
||||
|
||||
def to_str(self) -> str:
|
||||
"""Returns the string representation of the model using alias"""
|
||||
return pprint.pformat(self.model_dump(by_alias=True))
|
||||
|
||||
def to_json(self) -> str:
|
||||
"""Returns the JSON representation of the model using alias"""
|
||||
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
||||
return json.dumps(self.to_dict())
|
||||
|
||||
@classmethod
|
||||
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||
"""Create an instance of IoK8sApiCoreV1EndpointsList from a JSON string"""
|
||||
return cls.from_dict(json.loads(json_str))
|
||||
|
||||
def to_dict(self) -> Dict[str, Any]:
|
||||
"""Return the dictionary representation of the model using alias.
|
||||
|
||||
This has the following differences from calling pydantic's
|
||||
`self.model_dump(by_alias=True)`:
|
||||
|
||||
* `None` is only added to the output dict for nullable fields that
|
||||
were set at model initialization. Other fields with value `None`
|
||||
are ignored.
|
||||
"""
|
||||
excluded_fields: Set[str] = set([
|
||||
])
|
||||
|
||||
_dict = self.model_dump(
|
||||
by_alias=True,
|
||||
exclude=excluded_fields,
|
||||
exclude_none=True,
|
||||
)
|
||||
# override the default output from pydantic by calling `to_dict()` of each item in items (list)
|
||||
_items = []
|
||||
if self.items:
|
||||
for _item_items in self.items:
|
||||
if _item_items:
|
||||
_items.append(_item_items.to_dict())
|
||||
_dict['items'] = _items
|
||||
# override the default output from pydantic by calling `to_dict()` of metadata
|
||||
if self.metadata:
|
||||
_dict['metadata'] = self.metadata.to_dict()
|
||||
return _dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||
"""Create an instance of IoK8sApiCoreV1EndpointsList from a dict"""
|
||||
if obj is None:
|
||||
return None
|
||||
|
||||
if not isinstance(obj, dict):
|
||||
return cls.model_validate(obj)
|
||||
|
||||
_obj = cls.model_validate({
|
||||
"apiVersion": obj.get("apiVersion"),
|
||||
"items": [IoK8sApiCoreV1Endpoints.from_dict(_item) for _item in obj["items"]] if obj.get("items") is not None else None,
|
||||
"kind": obj.get("kind"),
|
||||
"metadata": IoK8sApimachineryPkgApisMetaV1ListMeta.from_dict(obj["metadata"]) if obj.get("metadata") is not None else None
|
||||
})
|
||||
return _obj
|
||||
|
||||
|
||||
@@ -0,0 +1,99 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
Kubeflow Trainer OpenAPI Spec
|
||||
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
|
||||
The version of the OpenAPI document: unversioned
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
|
||||
Do not edit the class manually.
|
||||
""" # noqa: E501
|
||||
|
||||
|
||||
from __future__ import annotations
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
import json
|
||||
|
||||
from pydantic import BaseModel, ConfigDict, Field, StrictStr
|
||||
from typing import Any, ClassVar, Dict, List, Optional
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_config_map_env_source import IoK8sApiCoreV1ConfigMapEnvSource
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_secret_env_source import IoK8sApiCoreV1SecretEnvSource
|
||||
from typing import Optional, Set
|
||||
from typing_extensions import Self
|
||||
|
||||
class IoK8sApiCoreV1EnvFromSource(BaseModel):
|
||||
"""
|
||||
EnvFromSource represents the source of a set of ConfigMaps
|
||||
""" # noqa: E501
|
||||
config_map_ref: Optional[IoK8sApiCoreV1ConfigMapEnvSource] = Field(default=None, description="The ConfigMap to select from", alias="configMapRef")
|
||||
prefix: Optional[StrictStr] = Field(default=None, description="An optional identifier to prepend to each key in the ConfigMap. Must be a C_IDENTIFIER.")
|
||||
secret_ref: Optional[IoK8sApiCoreV1SecretEnvSource] = Field(default=None, description="The Secret to select from", alias="secretRef")
|
||||
__properties: ClassVar[List[str]] = ["configMapRef", "prefix", "secretRef"]
|
||||
|
||||
model_config = ConfigDict(
|
||||
populate_by_name=True,
|
||||
validate_assignment=True,
|
||||
protected_namespaces=(),
|
||||
)
|
||||
|
||||
|
||||
def to_str(self) -> str:
|
||||
"""Returns the string representation of the model using alias"""
|
||||
return pprint.pformat(self.model_dump(by_alias=True))
|
||||
|
||||
def to_json(self) -> str:
|
||||
"""Returns the JSON representation of the model using alias"""
|
||||
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
||||
return json.dumps(self.to_dict())
|
||||
|
||||
@classmethod
|
||||
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||
"""Create an instance of IoK8sApiCoreV1EnvFromSource from a JSON string"""
|
||||
return cls.from_dict(json.loads(json_str))
|
||||
|
||||
def to_dict(self) -> Dict[str, Any]:
|
||||
"""Return the dictionary representation of the model using alias.
|
||||
|
||||
This has the following differences from calling pydantic's
|
||||
`self.model_dump(by_alias=True)`:
|
||||
|
||||
* `None` is only added to the output dict for nullable fields that
|
||||
were set at model initialization. Other fields with value `None`
|
||||
are ignored.
|
||||
"""
|
||||
excluded_fields: Set[str] = set([
|
||||
])
|
||||
|
||||
_dict = self.model_dump(
|
||||
by_alias=True,
|
||||
exclude=excluded_fields,
|
||||
exclude_none=True,
|
||||
)
|
||||
# override the default output from pydantic by calling `to_dict()` of config_map_ref
|
||||
if self.config_map_ref:
|
||||
_dict['configMapRef'] = self.config_map_ref.to_dict()
|
||||
# override the default output from pydantic by calling `to_dict()` of secret_ref
|
||||
if self.secret_ref:
|
||||
_dict['secretRef'] = self.secret_ref.to_dict()
|
||||
return _dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||
"""Create an instance of IoK8sApiCoreV1EnvFromSource from a dict"""
|
||||
if obj is None:
|
||||
return None
|
||||
|
||||
if not isinstance(obj, dict):
|
||||
return cls.model_validate(obj)
|
||||
|
||||
_obj = cls.model_validate({
|
||||
"configMapRef": IoK8sApiCoreV1ConfigMapEnvSource.from_dict(obj["configMapRef"]) if obj.get("configMapRef") is not None else None,
|
||||
"prefix": obj.get("prefix"),
|
||||
"secretRef": IoK8sApiCoreV1SecretEnvSource.from_dict(obj["secretRef"]) if obj.get("secretRef") is not None else None
|
||||
})
|
||||
return _obj
|
||||
|
||||
|
||||
@@ -0,0 +1,95 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
Kubeflow Trainer OpenAPI Spec
|
||||
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
|
||||
The version of the OpenAPI document: unversioned
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
|
||||
Do not edit the class manually.
|
||||
""" # noqa: E501
|
||||
|
||||
|
||||
from __future__ import annotations
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
import json
|
||||
|
||||
from pydantic import BaseModel, ConfigDict, Field, StrictStr
|
||||
from typing import Any, ClassVar, Dict, List, Optional
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_env_var_source import IoK8sApiCoreV1EnvVarSource
|
||||
from typing import Optional, Set
|
||||
from typing_extensions import Self
|
||||
|
||||
class IoK8sApiCoreV1EnvVar(BaseModel):
|
||||
"""
|
||||
EnvVar represents an environment variable present in a Container.
|
||||
""" # noqa: E501
|
||||
name: StrictStr = Field(description="Name of the environment variable. Must be a C_IDENTIFIER.")
|
||||
value: Optional[StrictStr] = Field(default=None, description="Variable references $(VAR_NAME) are expanded using the previously defined environment variables in the container and any service environment variables. If a variable cannot be resolved, the reference in the input string will be unchanged. Double $$ are reduced to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. \"$$(VAR_NAME)\" will produce the string literal \"$(VAR_NAME)\". Escaped references will never be expanded, regardless of whether the variable exists or not. Defaults to \"\".")
|
||||
value_from: Optional[IoK8sApiCoreV1EnvVarSource] = Field(default=None, description="Source for the environment variable's value. Cannot be used if value is not empty.", alias="valueFrom")
|
||||
__properties: ClassVar[List[str]] = ["name", "value", "valueFrom"]
|
||||
|
||||
model_config = ConfigDict(
|
||||
populate_by_name=True,
|
||||
validate_assignment=True,
|
||||
protected_namespaces=(),
|
||||
)
|
||||
|
||||
|
||||
def to_str(self) -> str:
|
||||
"""Returns the string representation of the model using alias"""
|
||||
return pprint.pformat(self.model_dump(by_alias=True))
|
||||
|
||||
def to_json(self) -> str:
|
||||
"""Returns the JSON representation of the model using alias"""
|
||||
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
||||
return json.dumps(self.to_dict())
|
||||
|
||||
@classmethod
|
||||
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||
"""Create an instance of IoK8sApiCoreV1EnvVar from a JSON string"""
|
||||
return cls.from_dict(json.loads(json_str))
|
||||
|
||||
def to_dict(self) -> Dict[str, Any]:
|
||||
"""Return the dictionary representation of the model using alias.
|
||||
|
||||
This has the following differences from calling pydantic's
|
||||
`self.model_dump(by_alias=True)`:
|
||||
|
||||
* `None` is only added to the output dict for nullable fields that
|
||||
were set at model initialization. Other fields with value `None`
|
||||
are ignored.
|
||||
"""
|
||||
excluded_fields: Set[str] = set([
|
||||
])
|
||||
|
||||
_dict = self.model_dump(
|
||||
by_alias=True,
|
||||
exclude=excluded_fields,
|
||||
exclude_none=True,
|
||||
)
|
||||
# override the default output from pydantic by calling `to_dict()` of value_from
|
||||
if self.value_from:
|
||||
_dict['valueFrom'] = self.value_from.to_dict()
|
||||
return _dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||
"""Create an instance of IoK8sApiCoreV1EnvVar from a dict"""
|
||||
if obj is None:
|
||||
return None
|
||||
|
||||
if not isinstance(obj, dict):
|
||||
return cls.model_validate(obj)
|
||||
|
||||
_obj = cls.model_validate({
|
||||
"name": obj.get("name") if obj.get("name") is not None else '',
|
||||
"value": obj.get("value"),
|
||||
"valueFrom": IoK8sApiCoreV1EnvVarSource.from_dict(obj["valueFrom"]) if obj.get("valueFrom") is not None else None
|
||||
})
|
||||
return _obj
|
||||
|
||||
|
||||
@@ -0,0 +1,109 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
Kubeflow Trainer OpenAPI Spec
|
||||
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
|
||||
The version of the OpenAPI document: unversioned
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
|
||||
Do not edit the class manually.
|
||||
""" # noqa: E501
|
||||
|
||||
|
||||
from __future__ import annotations
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
import json
|
||||
|
||||
from pydantic import BaseModel, ConfigDict, Field
|
||||
from typing import Any, ClassVar, Dict, List, Optional
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_config_map_key_selector import IoK8sApiCoreV1ConfigMapKeySelector
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_object_field_selector import IoK8sApiCoreV1ObjectFieldSelector
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_resource_field_selector import IoK8sApiCoreV1ResourceFieldSelector
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_secret_key_selector import IoK8sApiCoreV1SecretKeySelector
|
||||
from typing import Optional, Set
|
||||
from typing_extensions import Self
|
||||
|
||||
class IoK8sApiCoreV1EnvVarSource(BaseModel):
|
||||
"""
|
||||
EnvVarSource represents a source for the value of an EnvVar.
|
||||
""" # noqa: E501
|
||||
config_map_key_ref: Optional[IoK8sApiCoreV1ConfigMapKeySelector] = Field(default=None, description="Selects a key of a ConfigMap.", alias="configMapKeyRef")
|
||||
field_ref: Optional[IoK8sApiCoreV1ObjectFieldSelector] = Field(default=None, description="Selects a field of the pod: supports metadata.name, metadata.namespace, `metadata.labels['<KEY>']`, `metadata.annotations['<KEY>']`, spec.nodeName, spec.serviceAccountName, status.hostIP, status.podIP, status.podIPs.", alias="fieldRef")
|
||||
resource_field_ref: Optional[IoK8sApiCoreV1ResourceFieldSelector] = Field(default=None, description="Selects a resource of the container: only resources limits and requests (limits.cpu, limits.memory, limits.ephemeral-storage, requests.cpu, requests.memory and requests.ephemeral-storage) are currently supported.", alias="resourceFieldRef")
|
||||
secret_key_ref: Optional[IoK8sApiCoreV1SecretKeySelector] = Field(default=None, description="Selects a key of a secret in the pod's namespace", alias="secretKeyRef")
|
||||
__properties: ClassVar[List[str]] = ["configMapKeyRef", "fieldRef", "resourceFieldRef", "secretKeyRef"]
|
||||
|
||||
model_config = ConfigDict(
|
||||
populate_by_name=True,
|
||||
validate_assignment=True,
|
||||
protected_namespaces=(),
|
||||
)
|
||||
|
||||
|
||||
def to_str(self) -> str:
|
||||
"""Returns the string representation of the model using alias"""
|
||||
return pprint.pformat(self.model_dump(by_alias=True))
|
||||
|
||||
def to_json(self) -> str:
|
||||
"""Returns the JSON representation of the model using alias"""
|
||||
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
||||
return json.dumps(self.to_dict())
|
||||
|
||||
@classmethod
|
||||
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||
"""Create an instance of IoK8sApiCoreV1EnvVarSource from a JSON string"""
|
||||
return cls.from_dict(json.loads(json_str))
|
||||
|
||||
def to_dict(self) -> Dict[str, Any]:
|
||||
"""Return the dictionary representation of the model using alias.
|
||||
|
||||
This has the following differences from calling pydantic's
|
||||
`self.model_dump(by_alias=True)`:
|
||||
|
||||
* `None` is only added to the output dict for nullable fields that
|
||||
were set at model initialization. Other fields with value `None`
|
||||
are ignored.
|
||||
"""
|
||||
excluded_fields: Set[str] = set([
|
||||
])
|
||||
|
||||
_dict = self.model_dump(
|
||||
by_alias=True,
|
||||
exclude=excluded_fields,
|
||||
exclude_none=True,
|
||||
)
|
||||
# override the default output from pydantic by calling `to_dict()` of config_map_key_ref
|
||||
if self.config_map_key_ref:
|
||||
_dict['configMapKeyRef'] = self.config_map_key_ref.to_dict()
|
||||
# override the default output from pydantic by calling `to_dict()` of field_ref
|
||||
if self.field_ref:
|
||||
_dict['fieldRef'] = self.field_ref.to_dict()
|
||||
# override the default output from pydantic by calling `to_dict()` of resource_field_ref
|
||||
if self.resource_field_ref:
|
||||
_dict['resourceFieldRef'] = self.resource_field_ref.to_dict()
|
||||
# override the default output from pydantic by calling `to_dict()` of secret_key_ref
|
||||
if self.secret_key_ref:
|
||||
_dict['secretKeyRef'] = self.secret_key_ref.to_dict()
|
||||
return _dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||
"""Create an instance of IoK8sApiCoreV1EnvVarSource from a dict"""
|
||||
if obj is None:
|
||||
return None
|
||||
|
||||
if not isinstance(obj, dict):
|
||||
return cls.model_validate(obj)
|
||||
|
||||
_obj = cls.model_validate({
|
||||
"configMapKeyRef": IoK8sApiCoreV1ConfigMapKeySelector.from_dict(obj["configMapKeyRef"]) if obj.get("configMapKeyRef") is not None else None,
|
||||
"fieldRef": IoK8sApiCoreV1ObjectFieldSelector.from_dict(obj["fieldRef"]) if obj.get("fieldRef") is not None else None,
|
||||
"resourceFieldRef": IoK8sApiCoreV1ResourceFieldSelector.from_dict(obj["resourceFieldRef"]) if obj.get("resourceFieldRef") is not None else None,
|
||||
"secretKeyRef": IoK8sApiCoreV1SecretKeySelector.from_dict(obj["secretKeyRef"]) if obj.get("secretKeyRef") is not None else None
|
||||
})
|
||||
return _obj
|
||||
|
||||
|
||||
@@ -0,0 +1,225 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
Kubeflow Trainer OpenAPI Spec
|
||||
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
|
||||
The version of the OpenAPI document: unversioned
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
|
||||
Do not edit the class manually.
|
||||
""" # noqa: E501
|
||||
|
||||
|
||||
from __future__ import annotations
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
import json
|
||||
|
||||
from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr, field_validator
|
||||
from typing import Any, ClassVar, Dict, List, Optional
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_container_port import IoK8sApiCoreV1ContainerPort
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_container_resize_policy import IoK8sApiCoreV1ContainerResizePolicy
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_env_from_source import IoK8sApiCoreV1EnvFromSource
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_env_var import IoK8sApiCoreV1EnvVar
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_lifecycle import IoK8sApiCoreV1Lifecycle
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_probe import IoK8sApiCoreV1Probe
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_resource_requirements import IoK8sApiCoreV1ResourceRequirements
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_security_context import IoK8sApiCoreV1SecurityContext
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_volume_device import IoK8sApiCoreV1VolumeDevice
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_volume_mount import IoK8sApiCoreV1VolumeMount
|
||||
from typing import Optional, Set
|
||||
from typing_extensions import Self
|
||||
|
||||
class IoK8sApiCoreV1EphemeralContainer(BaseModel):
|
||||
"""
|
||||
An EphemeralContainer is a temporary container that you may add to an existing Pod for user-initiated activities such as debugging. Ephemeral containers have no resource or scheduling guarantees, and they will not be restarted when they exit or when a Pod is removed or restarted. The kubelet may evict a Pod if an ephemeral container causes the Pod to exceed its resource allocation. To add an ephemeral container, use the ephemeralcontainers subresource of an existing Pod. Ephemeral containers may not be removed or restarted.
|
||||
""" # noqa: E501
|
||||
args: Optional[List[StrictStr]] = Field(default=None, description="Arguments to the entrypoint. The image's CMD is used if this is not provided. Variable references $(VAR_NAME) are expanded using the container's environment. If a variable cannot be resolved, the reference in the input string will be unchanged. Double $$ are reduced to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. \"$$(VAR_NAME)\" will produce the string literal \"$(VAR_NAME)\". Escaped references will never be expanded, regardless of whether the variable exists or not. Cannot be updated. More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell")
|
||||
command: Optional[List[StrictStr]] = Field(default=None, description="Entrypoint array. Not executed within a shell. The image's ENTRYPOINT is used if this is not provided. Variable references $(VAR_NAME) are expanded using the container's environment. If a variable cannot be resolved, the reference in the input string will be unchanged. Double $$ are reduced to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. \"$$(VAR_NAME)\" will produce the string literal \"$(VAR_NAME)\". Escaped references will never be expanded, regardless of whether the variable exists or not. Cannot be updated. More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell")
|
||||
env: Optional[List[IoK8sApiCoreV1EnvVar]] = Field(default=None, description="List of environment variables to set in the container. Cannot be updated.")
|
||||
env_from: Optional[List[IoK8sApiCoreV1EnvFromSource]] = Field(default=None, description="List of sources to populate environment variables in the container. The keys defined within a source must be a C_IDENTIFIER. All invalid keys will be reported as an event when the container is starting. When a key exists in multiple sources, the value associated with the last source will take precedence. Values defined by an Env with a duplicate key will take precedence. Cannot be updated.", alias="envFrom")
|
||||
image: Optional[StrictStr] = Field(default=None, description="Container image name. More info: https://kubernetes.io/docs/concepts/containers/images")
|
||||
image_pull_policy: Optional[StrictStr] = Field(default=None, description="Image pull policy. One of Always, Never, IfNotPresent. Defaults to Always if :latest tag is specified, or IfNotPresent otherwise. Cannot be updated. More info: https://kubernetes.io/docs/concepts/containers/images#updating-images Possible enum values: - `\"Always\"` means that kubelet always attempts to pull the latest image. Container will fail If the pull fails. - `\"IfNotPresent\"` means that kubelet pulls if the image isn't present on disk. Container will fail if the image isn't present and the pull fails. - `\"Never\"` means that kubelet never pulls an image, but only uses a local image. Container will fail if the image isn't present", alias="imagePullPolicy")
|
||||
lifecycle: Optional[IoK8sApiCoreV1Lifecycle] = Field(default=None, description="Lifecycle is not allowed for ephemeral containers.")
|
||||
liveness_probe: Optional[IoK8sApiCoreV1Probe] = Field(default=None, description="Probes are not allowed for ephemeral containers.", alias="livenessProbe")
|
||||
name: StrictStr = Field(description="Name of the ephemeral container specified as a DNS_LABEL. This name must be unique among all containers, init containers and ephemeral containers.")
|
||||
ports: Optional[List[IoK8sApiCoreV1ContainerPort]] = Field(default=None, description="Ports are not allowed for ephemeral containers.")
|
||||
readiness_probe: Optional[IoK8sApiCoreV1Probe] = Field(default=None, description="Probes are not allowed for ephemeral containers.", alias="readinessProbe")
|
||||
resize_policy: Optional[List[IoK8sApiCoreV1ContainerResizePolicy]] = Field(default=None, description="Resources resize policy for the container.", alias="resizePolicy")
|
||||
resources: Optional[IoK8sApiCoreV1ResourceRequirements] = Field(default=None, description="Resources are not allowed for ephemeral containers. Ephemeral containers use spare resources already allocated to the pod.")
|
||||
restart_policy: Optional[StrictStr] = Field(default=None, description="Restart policy for the container to manage the restart behavior of each container within a pod. This may only be set for init containers. You cannot set this field on ephemeral containers.", alias="restartPolicy")
|
||||
security_context: Optional[IoK8sApiCoreV1SecurityContext] = Field(default=None, description="Optional: SecurityContext defines the security options the ephemeral container should be run with. If set, the fields of SecurityContext override the equivalent fields of PodSecurityContext.", alias="securityContext")
|
||||
startup_probe: Optional[IoK8sApiCoreV1Probe] = Field(default=None, description="Probes are not allowed for ephemeral containers.", alias="startupProbe")
|
||||
stdin: Optional[StrictBool] = Field(default=None, description="Whether this container should allocate a buffer for stdin in the container runtime. If this is not set, reads from stdin in the container will always result in EOF. Default is false.")
|
||||
stdin_once: Optional[StrictBool] = Field(default=None, description="Whether the container runtime should close the stdin channel after it has been opened by a single attach. When stdin is true the stdin stream will remain open across multiple attach sessions. If stdinOnce is set to true, stdin is opened on container start, is empty until the first client attaches to stdin, and then remains open and accepts data until the client disconnects, at which time stdin is closed and remains closed until the container is restarted. If this flag is false, a container processes that reads from stdin will never receive an EOF. Default is false", alias="stdinOnce")
|
||||
target_container_name: Optional[StrictStr] = Field(default=None, description="If set, the name of the container from PodSpec that this ephemeral container targets. The ephemeral container will be run in the namespaces (IPC, PID, etc) of this container. If not set then the ephemeral container uses the namespaces configured in the Pod spec. The container runtime must implement support for this feature. If the runtime does not support namespace targeting then the result of setting this field is undefined.", alias="targetContainerName")
|
||||
termination_message_path: Optional[StrictStr] = Field(default=None, description="Optional: Path at which the file to which the container's termination message will be written is mounted into the container's filesystem. Message written is intended to be brief final status, such as an assertion failure message. Will be truncated by the node if greater than 4096 bytes. The total message length across all containers will be limited to 12kb. Defaults to /dev/termination-log. Cannot be updated.", alias="terminationMessagePath")
|
||||
termination_message_policy: Optional[StrictStr] = Field(default=None, description="Indicate how the termination message should be populated. File will use the contents of terminationMessagePath to populate the container status message on both success and failure. FallbackToLogsOnError will use the last chunk of container log output if the termination message file is empty and the container exited with an error. The log output is limited to 2048 bytes or 80 lines, whichever is smaller. Defaults to File. Cannot be updated. Possible enum values: - `\"FallbackToLogsOnError\"` will read the most recent contents of the container logs for the container status message when the container exits with an error and the terminationMessagePath has no contents. - `\"File\"` is the default behavior and will set the container status message to the contents of the container's terminationMessagePath when the container exits.", alias="terminationMessagePolicy")
|
||||
tty: Optional[StrictBool] = Field(default=None, description="Whether this container should allocate a TTY for itself, also requires 'stdin' to be true. Default is false.")
|
||||
volume_devices: Optional[List[IoK8sApiCoreV1VolumeDevice]] = Field(default=None, description="volumeDevices is the list of block devices to be used by the container.", alias="volumeDevices")
|
||||
volume_mounts: Optional[List[IoK8sApiCoreV1VolumeMount]] = Field(default=None, description="Pod volumes to mount into the container's filesystem. Subpath mounts are not allowed for ephemeral containers. Cannot be updated.", alias="volumeMounts")
|
||||
working_dir: Optional[StrictStr] = Field(default=None, description="Container's working directory. If not specified, the container runtime's default will be used, which might be configured in the container image. Cannot be updated.", alias="workingDir")
|
||||
__properties: ClassVar[List[str]] = ["args", "command", "env", "envFrom", "image", "imagePullPolicy", "lifecycle", "livenessProbe", "name", "ports", "readinessProbe", "resizePolicy", "resources", "restartPolicy", "securityContext", "startupProbe", "stdin", "stdinOnce", "targetContainerName", "terminationMessagePath", "terminationMessagePolicy", "tty", "volumeDevices", "volumeMounts", "workingDir"]
|
||||
|
||||
@field_validator('image_pull_policy')
|
||||
def image_pull_policy_validate_enum(cls, value):
|
||||
"""Validates the enum"""
|
||||
if value is None:
|
||||
return value
|
||||
|
||||
if value not in set(['Always', 'IfNotPresent', 'Never']):
|
||||
raise ValueError("must be one of enum values ('Always', 'IfNotPresent', 'Never')")
|
||||
return value
|
||||
|
||||
@field_validator('termination_message_policy')
|
||||
def termination_message_policy_validate_enum(cls, value):
|
||||
"""Validates the enum"""
|
||||
if value is None:
|
||||
return value
|
||||
|
||||
if value not in set(['FallbackToLogsOnError', 'File']):
|
||||
raise ValueError("must be one of enum values ('FallbackToLogsOnError', 'File')")
|
||||
return value
|
||||
|
||||
model_config = ConfigDict(
|
||||
populate_by_name=True,
|
||||
validate_assignment=True,
|
||||
protected_namespaces=(),
|
||||
)
|
||||
|
||||
|
||||
def to_str(self) -> str:
|
||||
"""Returns the string representation of the model using alias"""
|
||||
return pprint.pformat(self.model_dump(by_alias=True))
|
||||
|
||||
def to_json(self) -> str:
|
||||
"""Returns the JSON representation of the model using alias"""
|
||||
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
||||
return json.dumps(self.to_dict())
|
||||
|
||||
@classmethod
|
||||
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||
"""Create an instance of IoK8sApiCoreV1EphemeralContainer from a JSON string"""
|
||||
return cls.from_dict(json.loads(json_str))
|
||||
|
||||
def to_dict(self) -> Dict[str, Any]:
|
||||
"""Return the dictionary representation of the model using alias.
|
||||
|
||||
This has the following differences from calling pydantic's
|
||||
`self.model_dump(by_alias=True)`:
|
||||
|
||||
* `None` is only added to the output dict for nullable fields that
|
||||
were set at model initialization. Other fields with value `None`
|
||||
are ignored.
|
||||
"""
|
||||
excluded_fields: Set[str] = set([
|
||||
])
|
||||
|
||||
_dict = self.model_dump(
|
||||
by_alias=True,
|
||||
exclude=excluded_fields,
|
||||
exclude_none=True,
|
||||
)
|
||||
# override the default output from pydantic by calling `to_dict()` of each item in env (list)
|
||||
_items = []
|
||||
if self.env:
|
||||
for _item_env in self.env:
|
||||
if _item_env:
|
||||
_items.append(_item_env.to_dict())
|
||||
_dict['env'] = _items
|
||||
# override the default output from pydantic by calling `to_dict()` of each item in env_from (list)
|
||||
_items = []
|
||||
if self.env_from:
|
||||
for _item_env_from in self.env_from:
|
||||
if _item_env_from:
|
||||
_items.append(_item_env_from.to_dict())
|
||||
_dict['envFrom'] = _items
|
||||
# override the default output from pydantic by calling `to_dict()` of lifecycle
|
||||
if self.lifecycle:
|
||||
_dict['lifecycle'] = self.lifecycle.to_dict()
|
||||
# override the default output from pydantic by calling `to_dict()` of liveness_probe
|
||||
if self.liveness_probe:
|
||||
_dict['livenessProbe'] = self.liveness_probe.to_dict()
|
||||
# override the default output from pydantic by calling `to_dict()` of each item in ports (list)
|
||||
_items = []
|
||||
if self.ports:
|
||||
for _item_ports in self.ports:
|
||||
if _item_ports:
|
||||
_items.append(_item_ports.to_dict())
|
||||
_dict['ports'] = _items
|
||||
# override the default output from pydantic by calling `to_dict()` of readiness_probe
|
||||
if self.readiness_probe:
|
||||
_dict['readinessProbe'] = self.readiness_probe.to_dict()
|
||||
# override the default output from pydantic by calling `to_dict()` of each item in resize_policy (list)
|
||||
_items = []
|
||||
if self.resize_policy:
|
||||
for _item_resize_policy in self.resize_policy:
|
||||
if _item_resize_policy:
|
||||
_items.append(_item_resize_policy.to_dict())
|
||||
_dict['resizePolicy'] = _items
|
||||
# override the default output from pydantic by calling `to_dict()` of resources
|
||||
if self.resources:
|
||||
_dict['resources'] = self.resources.to_dict()
|
||||
# override the default output from pydantic by calling `to_dict()` of security_context
|
||||
if self.security_context:
|
||||
_dict['securityContext'] = self.security_context.to_dict()
|
||||
# override the default output from pydantic by calling `to_dict()` of startup_probe
|
||||
if self.startup_probe:
|
||||
_dict['startupProbe'] = self.startup_probe.to_dict()
|
||||
# override the default output from pydantic by calling `to_dict()` of each item in volume_devices (list)
|
||||
_items = []
|
||||
if self.volume_devices:
|
||||
for _item_volume_devices in self.volume_devices:
|
||||
if _item_volume_devices:
|
||||
_items.append(_item_volume_devices.to_dict())
|
||||
_dict['volumeDevices'] = _items
|
||||
# override the default output from pydantic by calling `to_dict()` of each item in volume_mounts (list)
|
||||
_items = []
|
||||
if self.volume_mounts:
|
||||
for _item_volume_mounts in self.volume_mounts:
|
||||
if _item_volume_mounts:
|
||||
_items.append(_item_volume_mounts.to_dict())
|
||||
_dict['volumeMounts'] = _items
|
||||
return _dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||
"""Create an instance of IoK8sApiCoreV1EphemeralContainer from a dict"""
|
||||
if obj is None:
|
||||
return None
|
||||
|
||||
if not isinstance(obj, dict):
|
||||
return cls.model_validate(obj)
|
||||
|
||||
_obj = cls.model_validate({
|
||||
"args": obj.get("args"),
|
||||
"command": obj.get("command"),
|
||||
"env": [IoK8sApiCoreV1EnvVar.from_dict(_item) for _item in obj["env"]] if obj.get("env") is not None else None,
|
||||
"envFrom": [IoK8sApiCoreV1EnvFromSource.from_dict(_item) for _item in obj["envFrom"]] if obj.get("envFrom") is not None else None,
|
||||
"image": obj.get("image"),
|
||||
"imagePullPolicy": obj.get("imagePullPolicy"),
|
||||
"lifecycle": IoK8sApiCoreV1Lifecycle.from_dict(obj["lifecycle"]) if obj.get("lifecycle") is not None else None,
|
||||
"livenessProbe": IoK8sApiCoreV1Probe.from_dict(obj["livenessProbe"]) if obj.get("livenessProbe") is not None else None,
|
||||
"name": obj.get("name") if obj.get("name") is not None else '',
|
||||
"ports": [IoK8sApiCoreV1ContainerPort.from_dict(_item) for _item in obj["ports"]] if obj.get("ports") is not None else None,
|
||||
"readinessProbe": IoK8sApiCoreV1Probe.from_dict(obj["readinessProbe"]) if obj.get("readinessProbe") is not None else None,
|
||||
"resizePolicy": [IoK8sApiCoreV1ContainerResizePolicy.from_dict(_item) for _item in obj["resizePolicy"]] if obj.get("resizePolicy") is not None else None,
|
||||
"resources": IoK8sApiCoreV1ResourceRequirements.from_dict(obj["resources"]) if obj.get("resources") is not None else None,
|
||||
"restartPolicy": obj.get("restartPolicy"),
|
||||
"securityContext": IoK8sApiCoreV1SecurityContext.from_dict(obj["securityContext"]) if obj.get("securityContext") is not None else None,
|
||||
"startupProbe": IoK8sApiCoreV1Probe.from_dict(obj["startupProbe"]) if obj.get("startupProbe") is not None else None,
|
||||
"stdin": obj.get("stdin"),
|
||||
"stdinOnce": obj.get("stdinOnce"),
|
||||
"targetContainerName": obj.get("targetContainerName"),
|
||||
"terminationMessagePath": obj.get("terminationMessagePath"),
|
||||
"terminationMessagePolicy": obj.get("terminationMessagePolicy"),
|
||||
"tty": obj.get("tty"),
|
||||
"volumeDevices": [IoK8sApiCoreV1VolumeDevice.from_dict(_item) for _item in obj["volumeDevices"]] if obj.get("volumeDevices") is not None else None,
|
||||
"volumeMounts": [IoK8sApiCoreV1VolumeMount.from_dict(_item) for _item in obj["volumeMounts"]] if obj.get("volumeMounts") is not None else None,
|
||||
"workingDir": obj.get("workingDir")
|
||||
})
|
||||
return _obj
|
||||
|
||||
|
||||
+223
@@ -0,0 +1,223 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
Kubeflow Trainer OpenAPI Spec
|
||||
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
|
||||
The version of the OpenAPI document: unversioned
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
|
||||
Do not edit the class manually.
|
||||
""" # noqa: E501
|
||||
|
||||
|
||||
from __future__ import annotations
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
import json
|
||||
|
||||
from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr, field_validator
|
||||
from typing import Any, ClassVar, Dict, List, Optional
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_container_port import IoK8sApiCoreV1ContainerPort
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_container_resize_policy import IoK8sApiCoreV1ContainerResizePolicy
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_env_from_source import IoK8sApiCoreV1EnvFromSource
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_env_var import IoK8sApiCoreV1EnvVar
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_lifecycle import IoK8sApiCoreV1Lifecycle
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_probe import IoK8sApiCoreV1Probe
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_resource_requirements import IoK8sApiCoreV1ResourceRequirements
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_security_context import IoK8sApiCoreV1SecurityContext
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_volume_device import IoK8sApiCoreV1VolumeDevice
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_volume_mount import IoK8sApiCoreV1VolumeMount
|
||||
from typing import Optional, Set
|
||||
from typing_extensions import Self
|
||||
|
||||
class IoK8sApiCoreV1EphemeralContainerCommon(BaseModel):
|
||||
"""
|
||||
EphemeralContainerCommon is a copy of all fields in Container to be inlined in EphemeralContainer. This separate type allows easy conversion from EphemeralContainer to Container and allows separate documentation for the fields of EphemeralContainer. When a new field is added to Container it must be added here as well.
|
||||
""" # noqa: E501
|
||||
args: Optional[List[StrictStr]] = Field(default=None, description="Arguments to the entrypoint. The image's CMD is used if this is not provided. Variable references $(VAR_NAME) are expanded using the container's environment. If a variable cannot be resolved, the reference in the input string will be unchanged. Double $$ are reduced to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. \"$$(VAR_NAME)\" will produce the string literal \"$(VAR_NAME)\". Escaped references will never be expanded, regardless of whether the variable exists or not. Cannot be updated. More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell")
|
||||
command: Optional[List[StrictStr]] = Field(default=None, description="Entrypoint array. Not executed within a shell. The image's ENTRYPOINT is used if this is not provided. Variable references $(VAR_NAME) are expanded using the container's environment. If a variable cannot be resolved, the reference in the input string will be unchanged. Double $$ are reduced to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. \"$$(VAR_NAME)\" will produce the string literal \"$(VAR_NAME)\". Escaped references will never be expanded, regardless of whether the variable exists or not. Cannot be updated. More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell")
|
||||
env: Optional[List[IoK8sApiCoreV1EnvVar]] = Field(default=None, description="List of environment variables to set in the container. Cannot be updated.")
|
||||
env_from: Optional[List[IoK8sApiCoreV1EnvFromSource]] = Field(default=None, description="List of sources to populate environment variables in the container. The keys defined within a source must be a C_IDENTIFIER. All invalid keys will be reported as an event when the container is starting. When a key exists in multiple sources, the value associated with the last source will take precedence. Values defined by an Env with a duplicate key will take precedence. Cannot be updated.", alias="envFrom")
|
||||
image: Optional[StrictStr] = Field(default=None, description="Container image name. More info: https://kubernetes.io/docs/concepts/containers/images")
|
||||
image_pull_policy: Optional[StrictStr] = Field(default=None, description="Image pull policy. One of Always, Never, IfNotPresent. Defaults to Always if :latest tag is specified, or IfNotPresent otherwise. Cannot be updated. More info: https://kubernetes.io/docs/concepts/containers/images#updating-images Possible enum values: - `\"Always\"` means that kubelet always attempts to pull the latest image. Container will fail If the pull fails. - `\"IfNotPresent\"` means that kubelet pulls if the image isn't present on disk. Container will fail if the image isn't present and the pull fails. - `\"Never\"` means that kubelet never pulls an image, but only uses a local image. Container will fail if the image isn't present", alias="imagePullPolicy")
|
||||
lifecycle: Optional[IoK8sApiCoreV1Lifecycle] = Field(default=None, description="Lifecycle is not allowed for ephemeral containers.")
|
||||
liveness_probe: Optional[IoK8sApiCoreV1Probe] = Field(default=None, description="Probes are not allowed for ephemeral containers.", alias="livenessProbe")
|
||||
name: StrictStr = Field(description="Name of the ephemeral container specified as a DNS_LABEL. This name must be unique among all containers, init containers and ephemeral containers.")
|
||||
ports: Optional[List[IoK8sApiCoreV1ContainerPort]] = Field(default=None, description="Ports are not allowed for ephemeral containers.")
|
||||
readiness_probe: Optional[IoK8sApiCoreV1Probe] = Field(default=None, description="Probes are not allowed for ephemeral containers.", alias="readinessProbe")
|
||||
resize_policy: Optional[List[IoK8sApiCoreV1ContainerResizePolicy]] = Field(default=None, description="Resources resize policy for the container.", alias="resizePolicy")
|
||||
resources: Optional[IoK8sApiCoreV1ResourceRequirements] = Field(default=None, description="Resources are not allowed for ephemeral containers. Ephemeral containers use spare resources already allocated to the pod.")
|
||||
restart_policy: Optional[StrictStr] = Field(default=None, description="Restart policy for the container to manage the restart behavior of each container within a pod. This may only be set for init containers. You cannot set this field on ephemeral containers.", alias="restartPolicy")
|
||||
security_context: Optional[IoK8sApiCoreV1SecurityContext] = Field(default=None, description="Optional: SecurityContext defines the security options the ephemeral container should be run with. If set, the fields of SecurityContext override the equivalent fields of PodSecurityContext.", alias="securityContext")
|
||||
startup_probe: Optional[IoK8sApiCoreV1Probe] = Field(default=None, description="Probes are not allowed for ephemeral containers.", alias="startupProbe")
|
||||
stdin: Optional[StrictBool] = Field(default=None, description="Whether this container should allocate a buffer for stdin in the container runtime. If this is not set, reads from stdin in the container will always result in EOF. Default is false.")
|
||||
stdin_once: Optional[StrictBool] = Field(default=None, description="Whether the container runtime should close the stdin channel after it has been opened by a single attach. When stdin is true the stdin stream will remain open across multiple attach sessions. If stdinOnce is set to true, stdin is opened on container start, is empty until the first client attaches to stdin, and then remains open and accepts data until the client disconnects, at which time stdin is closed and remains closed until the container is restarted. If this flag is false, a container processes that reads from stdin will never receive an EOF. Default is false", alias="stdinOnce")
|
||||
termination_message_path: Optional[StrictStr] = Field(default=None, description="Optional: Path at which the file to which the container's termination message will be written is mounted into the container's filesystem. Message written is intended to be brief final status, such as an assertion failure message. Will be truncated by the node if greater than 4096 bytes. The total message length across all containers will be limited to 12kb. Defaults to /dev/termination-log. Cannot be updated.", alias="terminationMessagePath")
|
||||
termination_message_policy: Optional[StrictStr] = Field(default=None, description="Indicate how the termination message should be populated. File will use the contents of terminationMessagePath to populate the container status message on both success and failure. FallbackToLogsOnError will use the last chunk of container log output if the termination message file is empty and the container exited with an error. The log output is limited to 2048 bytes or 80 lines, whichever is smaller. Defaults to File. Cannot be updated. Possible enum values: - `\"FallbackToLogsOnError\"` will read the most recent contents of the container logs for the container status message when the container exits with an error and the terminationMessagePath has no contents. - `\"File\"` is the default behavior and will set the container status message to the contents of the container's terminationMessagePath when the container exits.", alias="terminationMessagePolicy")
|
||||
tty: Optional[StrictBool] = Field(default=None, description="Whether this container should allocate a TTY for itself, also requires 'stdin' to be true. Default is false.")
|
||||
volume_devices: Optional[List[IoK8sApiCoreV1VolumeDevice]] = Field(default=None, description="volumeDevices is the list of block devices to be used by the container.", alias="volumeDevices")
|
||||
volume_mounts: Optional[List[IoK8sApiCoreV1VolumeMount]] = Field(default=None, description="Pod volumes to mount into the container's filesystem. Subpath mounts are not allowed for ephemeral containers. Cannot be updated.", alias="volumeMounts")
|
||||
working_dir: Optional[StrictStr] = Field(default=None, description="Container's working directory. If not specified, the container runtime's default will be used, which might be configured in the container image. Cannot be updated.", alias="workingDir")
|
||||
__properties: ClassVar[List[str]] = ["args", "command", "env", "envFrom", "image", "imagePullPolicy", "lifecycle", "livenessProbe", "name", "ports", "readinessProbe", "resizePolicy", "resources", "restartPolicy", "securityContext", "startupProbe", "stdin", "stdinOnce", "terminationMessagePath", "terminationMessagePolicy", "tty", "volumeDevices", "volumeMounts", "workingDir"]
|
||||
|
||||
@field_validator('image_pull_policy')
|
||||
def image_pull_policy_validate_enum(cls, value):
|
||||
"""Validates the enum"""
|
||||
if value is None:
|
||||
return value
|
||||
|
||||
if value not in set(['Always', 'IfNotPresent', 'Never']):
|
||||
raise ValueError("must be one of enum values ('Always', 'IfNotPresent', 'Never')")
|
||||
return value
|
||||
|
||||
@field_validator('termination_message_policy')
|
||||
def termination_message_policy_validate_enum(cls, value):
|
||||
"""Validates the enum"""
|
||||
if value is None:
|
||||
return value
|
||||
|
||||
if value not in set(['FallbackToLogsOnError', 'File']):
|
||||
raise ValueError("must be one of enum values ('FallbackToLogsOnError', 'File')")
|
||||
return value
|
||||
|
||||
model_config = ConfigDict(
|
||||
populate_by_name=True,
|
||||
validate_assignment=True,
|
||||
protected_namespaces=(),
|
||||
)
|
||||
|
||||
|
||||
def to_str(self) -> str:
|
||||
"""Returns the string representation of the model using alias"""
|
||||
return pprint.pformat(self.model_dump(by_alias=True))
|
||||
|
||||
def to_json(self) -> str:
|
||||
"""Returns the JSON representation of the model using alias"""
|
||||
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
||||
return json.dumps(self.to_dict())
|
||||
|
||||
@classmethod
|
||||
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||
"""Create an instance of IoK8sApiCoreV1EphemeralContainerCommon from a JSON string"""
|
||||
return cls.from_dict(json.loads(json_str))
|
||||
|
||||
def to_dict(self) -> Dict[str, Any]:
|
||||
"""Return the dictionary representation of the model using alias.
|
||||
|
||||
This has the following differences from calling pydantic's
|
||||
`self.model_dump(by_alias=True)`:
|
||||
|
||||
* `None` is only added to the output dict for nullable fields that
|
||||
were set at model initialization. Other fields with value `None`
|
||||
are ignored.
|
||||
"""
|
||||
excluded_fields: Set[str] = set([
|
||||
])
|
||||
|
||||
_dict = self.model_dump(
|
||||
by_alias=True,
|
||||
exclude=excluded_fields,
|
||||
exclude_none=True,
|
||||
)
|
||||
# override the default output from pydantic by calling `to_dict()` of each item in env (list)
|
||||
_items = []
|
||||
if self.env:
|
||||
for _item_env in self.env:
|
||||
if _item_env:
|
||||
_items.append(_item_env.to_dict())
|
||||
_dict['env'] = _items
|
||||
# override the default output from pydantic by calling `to_dict()` of each item in env_from (list)
|
||||
_items = []
|
||||
if self.env_from:
|
||||
for _item_env_from in self.env_from:
|
||||
if _item_env_from:
|
||||
_items.append(_item_env_from.to_dict())
|
||||
_dict['envFrom'] = _items
|
||||
# override the default output from pydantic by calling `to_dict()` of lifecycle
|
||||
if self.lifecycle:
|
||||
_dict['lifecycle'] = self.lifecycle.to_dict()
|
||||
# override the default output from pydantic by calling `to_dict()` of liveness_probe
|
||||
if self.liveness_probe:
|
||||
_dict['livenessProbe'] = self.liveness_probe.to_dict()
|
||||
# override the default output from pydantic by calling `to_dict()` of each item in ports (list)
|
||||
_items = []
|
||||
if self.ports:
|
||||
for _item_ports in self.ports:
|
||||
if _item_ports:
|
||||
_items.append(_item_ports.to_dict())
|
||||
_dict['ports'] = _items
|
||||
# override the default output from pydantic by calling `to_dict()` of readiness_probe
|
||||
if self.readiness_probe:
|
||||
_dict['readinessProbe'] = self.readiness_probe.to_dict()
|
||||
# override the default output from pydantic by calling `to_dict()` of each item in resize_policy (list)
|
||||
_items = []
|
||||
if self.resize_policy:
|
||||
for _item_resize_policy in self.resize_policy:
|
||||
if _item_resize_policy:
|
||||
_items.append(_item_resize_policy.to_dict())
|
||||
_dict['resizePolicy'] = _items
|
||||
# override the default output from pydantic by calling `to_dict()` of resources
|
||||
if self.resources:
|
||||
_dict['resources'] = self.resources.to_dict()
|
||||
# override the default output from pydantic by calling `to_dict()` of security_context
|
||||
if self.security_context:
|
||||
_dict['securityContext'] = self.security_context.to_dict()
|
||||
# override the default output from pydantic by calling `to_dict()` of startup_probe
|
||||
if self.startup_probe:
|
||||
_dict['startupProbe'] = self.startup_probe.to_dict()
|
||||
# override the default output from pydantic by calling `to_dict()` of each item in volume_devices (list)
|
||||
_items = []
|
||||
if self.volume_devices:
|
||||
for _item_volume_devices in self.volume_devices:
|
||||
if _item_volume_devices:
|
||||
_items.append(_item_volume_devices.to_dict())
|
||||
_dict['volumeDevices'] = _items
|
||||
# override the default output from pydantic by calling `to_dict()` of each item in volume_mounts (list)
|
||||
_items = []
|
||||
if self.volume_mounts:
|
||||
for _item_volume_mounts in self.volume_mounts:
|
||||
if _item_volume_mounts:
|
||||
_items.append(_item_volume_mounts.to_dict())
|
||||
_dict['volumeMounts'] = _items
|
||||
return _dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||
"""Create an instance of IoK8sApiCoreV1EphemeralContainerCommon from a dict"""
|
||||
if obj is None:
|
||||
return None
|
||||
|
||||
if not isinstance(obj, dict):
|
||||
return cls.model_validate(obj)
|
||||
|
||||
_obj = cls.model_validate({
|
||||
"args": obj.get("args"),
|
||||
"command": obj.get("command"),
|
||||
"env": [IoK8sApiCoreV1EnvVar.from_dict(_item) for _item in obj["env"]] if obj.get("env") is not None else None,
|
||||
"envFrom": [IoK8sApiCoreV1EnvFromSource.from_dict(_item) for _item in obj["envFrom"]] if obj.get("envFrom") is not None else None,
|
||||
"image": obj.get("image"),
|
||||
"imagePullPolicy": obj.get("imagePullPolicy"),
|
||||
"lifecycle": IoK8sApiCoreV1Lifecycle.from_dict(obj["lifecycle"]) if obj.get("lifecycle") is not None else None,
|
||||
"livenessProbe": IoK8sApiCoreV1Probe.from_dict(obj["livenessProbe"]) if obj.get("livenessProbe") is not None else None,
|
||||
"name": obj.get("name") if obj.get("name") is not None else '',
|
||||
"ports": [IoK8sApiCoreV1ContainerPort.from_dict(_item) for _item in obj["ports"]] if obj.get("ports") is not None else None,
|
||||
"readinessProbe": IoK8sApiCoreV1Probe.from_dict(obj["readinessProbe"]) if obj.get("readinessProbe") is not None else None,
|
||||
"resizePolicy": [IoK8sApiCoreV1ContainerResizePolicy.from_dict(_item) for _item in obj["resizePolicy"]] if obj.get("resizePolicy") is not None else None,
|
||||
"resources": IoK8sApiCoreV1ResourceRequirements.from_dict(obj["resources"]) if obj.get("resources") is not None else None,
|
||||
"restartPolicy": obj.get("restartPolicy"),
|
||||
"securityContext": IoK8sApiCoreV1SecurityContext.from_dict(obj["securityContext"]) if obj.get("securityContext") is not None else None,
|
||||
"startupProbe": IoK8sApiCoreV1Probe.from_dict(obj["startupProbe"]) if obj.get("startupProbe") is not None else None,
|
||||
"stdin": obj.get("stdin"),
|
||||
"stdinOnce": obj.get("stdinOnce"),
|
||||
"terminationMessagePath": obj.get("terminationMessagePath"),
|
||||
"terminationMessagePolicy": obj.get("terminationMessagePolicy"),
|
||||
"tty": obj.get("tty"),
|
||||
"volumeDevices": [IoK8sApiCoreV1VolumeDevice.from_dict(_item) for _item in obj["volumeDevices"]] if obj.get("volumeDevices") is not None else None,
|
||||
"volumeMounts": [IoK8sApiCoreV1VolumeMount.from_dict(_item) for _item in obj["volumeMounts"]] if obj.get("volumeMounts") is not None else None,
|
||||
"workingDir": obj.get("workingDir")
|
||||
})
|
||||
return _obj
|
||||
|
||||
|
||||
+91
@@ -0,0 +1,91 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
Kubeflow Trainer OpenAPI Spec
|
||||
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
|
||||
The version of the OpenAPI document: unversioned
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
|
||||
Do not edit the class manually.
|
||||
""" # noqa: E501
|
||||
|
||||
|
||||
from __future__ import annotations
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
import json
|
||||
|
||||
from pydantic import BaseModel, ConfigDict, Field
|
||||
from typing import Any, ClassVar, Dict, List, Optional
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_persistent_volume_claim_template import IoK8sApiCoreV1PersistentVolumeClaimTemplate
|
||||
from typing import Optional, Set
|
||||
from typing_extensions import Self
|
||||
|
||||
class IoK8sApiCoreV1EphemeralVolumeSource(BaseModel):
|
||||
"""
|
||||
Represents an ephemeral volume that is handled by a normal storage driver.
|
||||
""" # noqa: E501
|
||||
volume_claim_template: Optional[IoK8sApiCoreV1PersistentVolumeClaimTemplate] = Field(default=None, description="Will be used to create a stand-alone PVC to provision the volume. The pod in which this EphemeralVolumeSource is embedded will be the owner of the PVC, i.e. the PVC will be deleted together with the pod. The name of the PVC will be `<pod name>-<volume name>` where `<volume name>` is the name from the `PodSpec.Volumes` array entry. Pod validation will reject the pod if the concatenated name is not valid for a PVC (for example, too long). An existing PVC with that name that is not owned by the pod will *not* be used for the pod to avoid using an unrelated volume by mistake. Starting the pod is then blocked until the unrelated PVC is removed. If such a pre-created PVC is meant to be used by the pod, the PVC has to updated with an owner reference to the pod once the pod exists. Normally this should not be necessary, but it may be useful when manually reconstructing a broken cluster. This field is read-only and no changes will be made by Kubernetes to the PVC after it has been created. Required, must not be nil.", alias="volumeClaimTemplate")
|
||||
__properties: ClassVar[List[str]] = ["volumeClaimTemplate"]
|
||||
|
||||
model_config = ConfigDict(
|
||||
populate_by_name=True,
|
||||
validate_assignment=True,
|
||||
protected_namespaces=(),
|
||||
)
|
||||
|
||||
|
||||
def to_str(self) -> str:
|
||||
"""Returns the string representation of the model using alias"""
|
||||
return pprint.pformat(self.model_dump(by_alias=True))
|
||||
|
||||
def to_json(self) -> str:
|
||||
"""Returns the JSON representation of the model using alias"""
|
||||
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
||||
return json.dumps(self.to_dict())
|
||||
|
||||
@classmethod
|
||||
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||
"""Create an instance of IoK8sApiCoreV1EphemeralVolumeSource from a JSON string"""
|
||||
return cls.from_dict(json.loads(json_str))
|
||||
|
||||
def to_dict(self) -> Dict[str, Any]:
|
||||
"""Return the dictionary representation of the model using alias.
|
||||
|
||||
This has the following differences from calling pydantic's
|
||||
`self.model_dump(by_alias=True)`:
|
||||
|
||||
* `None` is only added to the output dict for nullable fields that
|
||||
were set at model initialization. Other fields with value `None`
|
||||
are ignored.
|
||||
"""
|
||||
excluded_fields: Set[str] = set([
|
||||
])
|
||||
|
||||
_dict = self.model_dump(
|
||||
by_alias=True,
|
||||
exclude=excluded_fields,
|
||||
exclude_none=True,
|
||||
)
|
||||
# override the default output from pydantic by calling `to_dict()` of volume_claim_template
|
||||
if self.volume_claim_template:
|
||||
_dict['volumeClaimTemplate'] = self.volume_claim_template.to_dict()
|
||||
return _dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||
"""Create an instance of IoK8sApiCoreV1EphemeralVolumeSource from a dict"""
|
||||
if obj is None:
|
||||
return None
|
||||
|
||||
if not isinstance(obj, dict):
|
||||
return cls.model_validate(obj)
|
||||
|
||||
_obj = cls.model_validate({
|
||||
"volumeClaimTemplate": IoK8sApiCoreV1PersistentVolumeClaimTemplate.from_dict(obj["volumeClaimTemplate"]) if obj.get("volumeClaimTemplate") is not None else None
|
||||
})
|
||||
return _obj
|
||||
|
||||
|
||||
@@ -0,0 +1,139 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
Kubeflow Trainer OpenAPI Spec
|
||||
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
|
||||
The version of the OpenAPI document: unversioned
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
|
||||
Do not edit the class manually.
|
||||
""" # noqa: E501
|
||||
|
||||
|
||||
from __future__ import annotations
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
import json
|
||||
|
||||
from datetime import datetime
|
||||
from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr
|
||||
from typing import Any, ClassVar, Dict, List, Optional
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_event_series import IoK8sApiCoreV1EventSeries
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_event_source import IoK8sApiCoreV1EventSource
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_object_reference import IoK8sApiCoreV1ObjectReference
|
||||
from kubeflow_trainer_api.models.io_k8s_apimachinery_pkg_apis_meta_v1_object_meta import IoK8sApimachineryPkgApisMetaV1ObjectMeta
|
||||
from typing import Optional, Set
|
||||
from typing_extensions import Self
|
||||
|
||||
class IoK8sApiCoreV1Event(BaseModel):
|
||||
"""
|
||||
Event is a report of an event somewhere in the cluster. Events have a limited retention time and triggers and messages may evolve with time. Event consumers should not rely on the timing of an event with a given Reason reflecting a consistent underlying trigger, or the continued existence of events with that Reason. Events should be treated as informative, best-effort, supplemental data.
|
||||
""" # noqa: E501
|
||||
action: Optional[StrictStr] = Field(default=None, description="What action was taken/failed regarding to the Regarding object.")
|
||||
api_version: Optional[StrictStr] = Field(default=None, description="APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", alias="apiVersion")
|
||||
count: Optional[StrictInt] = Field(default=None, description="The number of times this event has occurred.")
|
||||
event_time: Optional[datetime] = Field(default=None, description="Time when this Event was first observed.", alias="eventTime")
|
||||
first_timestamp: Optional[datetime] = Field(default=None, description="The time at which the event was first recorded. (Time of server receipt is in TypeMeta.)", alias="firstTimestamp")
|
||||
involved_object: IoK8sApiCoreV1ObjectReference = Field(description="The object that this event is about.", alias="involvedObject")
|
||||
kind: Optional[StrictStr] = Field(default=None, description="Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds")
|
||||
last_timestamp: Optional[datetime] = Field(default=None, description="The time at which the most recent occurrence of this event was recorded.", alias="lastTimestamp")
|
||||
message: Optional[StrictStr] = Field(default=None, description="A human-readable description of the status of this operation.")
|
||||
metadata: IoK8sApimachineryPkgApisMetaV1ObjectMeta = Field(description="Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata")
|
||||
reason: Optional[StrictStr] = Field(default=None, description="This should be a short, machine understandable string that gives the reason for the transition into the object's current status.")
|
||||
related: Optional[IoK8sApiCoreV1ObjectReference] = Field(default=None, description="Optional secondary object for more complex actions.")
|
||||
reporting_component: Optional[StrictStr] = Field(default='', description="Name of the controller that emitted this Event, e.g. `kubernetes.io/kubelet`.", alias="reportingComponent")
|
||||
reporting_instance: Optional[StrictStr] = Field(default='', description="ID of the controller instance, e.g. `kubelet-xyzf`.", alias="reportingInstance")
|
||||
series: Optional[IoK8sApiCoreV1EventSeries] = Field(default=None, description="Data about the Event series this event represents or nil if it's a singleton Event.")
|
||||
source: Optional[IoK8sApiCoreV1EventSource] = Field(default=None, description="The component reporting this event. Should be a short machine understandable string.")
|
||||
type: Optional[StrictStr] = Field(default=None, description="Type of this event (Normal, Warning), new types could be added in the future")
|
||||
__properties: ClassVar[List[str]] = ["action", "apiVersion", "count", "eventTime", "firstTimestamp", "involvedObject", "kind", "lastTimestamp", "message", "metadata", "reason", "related", "reportingComponent", "reportingInstance", "series", "source", "type"]
|
||||
|
||||
model_config = ConfigDict(
|
||||
populate_by_name=True,
|
||||
validate_assignment=True,
|
||||
protected_namespaces=(),
|
||||
)
|
||||
|
||||
|
||||
def to_str(self) -> str:
|
||||
"""Returns the string representation of the model using alias"""
|
||||
return pprint.pformat(self.model_dump(by_alias=True))
|
||||
|
||||
def to_json(self) -> str:
|
||||
"""Returns the JSON representation of the model using alias"""
|
||||
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
||||
return json.dumps(self.to_dict())
|
||||
|
||||
@classmethod
|
||||
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||
"""Create an instance of IoK8sApiCoreV1Event from a JSON string"""
|
||||
return cls.from_dict(json.loads(json_str))
|
||||
|
||||
def to_dict(self) -> Dict[str, Any]:
|
||||
"""Return the dictionary representation of the model using alias.
|
||||
|
||||
This has the following differences from calling pydantic's
|
||||
`self.model_dump(by_alias=True)`:
|
||||
|
||||
* `None` is only added to the output dict for nullable fields that
|
||||
were set at model initialization. Other fields with value `None`
|
||||
are ignored.
|
||||
"""
|
||||
excluded_fields: Set[str] = set([
|
||||
])
|
||||
|
||||
_dict = self.model_dump(
|
||||
by_alias=True,
|
||||
exclude=excluded_fields,
|
||||
exclude_none=True,
|
||||
)
|
||||
# override the default output from pydantic by calling `to_dict()` of involved_object
|
||||
if self.involved_object:
|
||||
_dict['involvedObject'] = self.involved_object.to_dict()
|
||||
# override the default output from pydantic by calling `to_dict()` of metadata
|
||||
if self.metadata:
|
||||
_dict['metadata'] = self.metadata.to_dict()
|
||||
# override the default output from pydantic by calling `to_dict()` of related
|
||||
if self.related:
|
||||
_dict['related'] = self.related.to_dict()
|
||||
# override the default output from pydantic by calling `to_dict()` of series
|
||||
if self.series:
|
||||
_dict['series'] = self.series.to_dict()
|
||||
# override the default output from pydantic by calling `to_dict()` of source
|
||||
if self.source:
|
||||
_dict['source'] = self.source.to_dict()
|
||||
return _dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||
"""Create an instance of IoK8sApiCoreV1Event from a dict"""
|
||||
if obj is None:
|
||||
return None
|
||||
|
||||
if not isinstance(obj, dict):
|
||||
return cls.model_validate(obj)
|
||||
|
||||
_obj = cls.model_validate({
|
||||
"action": obj.get("action"),
|
||||
"apiVersion": obj.get("apiVersion"),
|
||||
"count": obj.get("count"),
|
||||
"eventTime": obj.get("eventTime"),
|
||||
"firstTimestamp": obj.get("firstTimestamp"),
|
||||
"involvedObject": IoK8sApiCoreV1ObjectReference.from_dict(obj["involvedObject"]) if obj.get("involvedObject") is not None else None,
|
||||
"kind": obj.get("kind"),
|
||||
"lastTimestamp": obj.get("lastTimestamp"),
|
||||
"message": obj.get("message"),
|
||||
"metadata": IoK8sApimachineryPkgApisMetaV1ObjectMeta.from_dict(obj["metadata"]) if obj.get("metadata") is not None else None,
|
||||
"reason": obj.get("reason"),
|
||||
"related": IoK8sApiCoreV1ObjectReference.from_dict(obj["related"]) if obj.get("related") is not None else None,
|
||||
"reportingComponent": obj.get("reportingComponent") if obj.get("reportingComponent") is not None else '',
|
||||
"reportingInstance": obj.get("reportingInstance") if obj.get("reportingInstance") is not None else '',
|
||||
"series": IoK8sApiCoreV1EventSeries.from_dict(obj["series"]) if obj.get("series") is not None else None,
|
||||
"source": IoK8sApiCoreV1EventSource.from_dict(obj["source"]) if obj.get("source") is not None else None,
|
||||
"type": obj.get("type")
|
||||
})
|
||||
return _obj
|
||||
|
||||
|
||||
@@ -0,0 +1,105 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
Kubeflow Trainer OpenAPI Spec
|
||||
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
|
||||
The version of the OpenAPI document: unversioned
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
|
||||
Do not edit the class manually.
|
||||
""" # noqa: E501
|
||||
|
||||
|
||||
from __future__ import annotations
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
import json
|
||||
|
||||
from pydantic import BaseModel, ConfigDict, Field, StrictStr
|
||||
from typing import Any, ClassVar, Dict, List, Optional
|
||||
from kubeflow_trainer_api.models.io_k8s_api_core_v1_event import IoK8sApiCoreV1Event
|
||||
from kubeflow_trainer_api.models.io_k8s_apimachinery_pkg_apis_meta_v1_list_meta import IoK8sApimachineryPkgApisMetaV1ListMeta
|
||||
from typing import Optional, Set
|
||||
from typing_extensions import Self
|
||||
|
||||
class IoK8sApiCoreV1EventList(BaseModel):
|
||||
"""
|
||||
EventList is a list of events.
|
||||
""" # noqa: E501
|
||||
api_version: Optional[StrictStr] = Field(default=None, description="APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", alias="apiVersion")
|
||||
items: List[IoK8sApiCoreV1Event] = Field(description="List of events")
|
||||
kind: Optional[StrictStr] = Field(default=None, description="Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds")
|
||||
metadata: Optional[IoK8sApimachineryPkgApisMetaV1ListMeta] = Field(default=None, description="Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds")
|
||||
__properties: ClassVar[List[str]] = ["apiVersion", "items", "kind", "metadata"]
|
||||
|
||||
model_config = ConfigDict(
|
||||
populate_by_name=True,
|
||||
validate_assignment=True,
|
||||
protected_namespaces=(),
|
||||
)
|
||||
|
||||
|
||||
def to_str(self) -> str:
|
||||
"""Returns the string representation of the model using alias"""
|
||||
return pprint.pformat(self.model_dump(by_alias=True))
|
||||
|
||||
def to_json(self) -> str:
|
||||
"""Returns the JSON representation of the model using alias"""
|
||||
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
||||
return json.dumps(self.to_dict())
|
||||
|
||||
@classmethod
|
||||
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||
"""Create an instance of IoK8sApiCoreV1EventList from a JSON string"""
|
||||
return cls.from_dict(json.loads(json_str))
|
||||
|
||||
def to_dict(self) -> Dict[str, Any]:
|
||||
"""Return the dictionary representation of the model using alias.
|
||||
|
||||
This has the following differences from calling pydantic's
|
||||
`self.model_dump(by_alias=True)`:
|
||||
|
||||
* `None` is only added to the output dict for nullable fields that
|
||||
were set at model initialization. Other fields with value `None`
|
||||
are ignored.
|
||||
"""
|
||||
excluded_fields: Set[str] = set([
|
||||
])
|
||||
|
||||
_dict = self.model_dump(
|
||||
by_alias=True,
|
||||
exclude=excluded_fields,
|
||||
exclude_none=True,
|
||||
)
|
||||
# override the default output from pydantic by calling `to_dict()` of each item in items (list)
|
||||
_items = []
|
||||
if self.items:
|
||||
for _item_items in self.items:
|
||||
if _item_items:
|
||||
_items.append(_item_items.to_dict())
|
||||
_dict['items'] = _items
|
||||
# override the default output from pydantic by calling `to_dict()` of metadata
|
||||
if self.metadata:
|
||||
_dict['metadata'] = self.metadata.to_dict()
|
||||
return _dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||
"""Create an instance of IoK8sApiCoreV1EventList from a dict"""
|
||||
if obj is None:
|
||||
return None
|
||||
|
||||
if not isinstance(obj, dict):
|
||||
return cls.model_validate(obj)
|
||||
|
||||
_obj = cls.model_validate({
|
||||
"apiVersion": obj.get("apiVersion"),
|
||||
"items": [IoK8sApiCoreV1Event.from_dict(_item) for _item in obj["items"]] if obj.get("items") is not None else None,
|
||||
"kind": obj.get("kind"),
|
||||
"metadata": IoK8sApimachineryPkgApisMetaV1ListMeta.from_dict(obj["metadata"]) if obj.get("metadata") is not None else None
|
||||
})
|
||||
return _obj
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user