Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes14kdownloads
v1_container_status.py512 linesDownload Raw Back to models
1# coding: utf-82 3"""4    Kubernetes5 6    No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)  # noqa: E5017 8    The version of the OpenAPI document: release-1.359    Generated by: https://openapi-generator.tech10"""11 12 13import pprint14import re  # noqa: F40115 16import six17 18from kubernetes.client.configuration import Configuration19 20 21class V1ContainerStatus(object):22    """NOTE: This class is auto generated by OpenAPI Generator.23    Ref: https://openapi-generator.tech24 25    Do not edit the class manually.26    """27 28    """29    Attributes:30      openapi_types (dict): The key is attribute name31                            and the value is attribute type.32      attribute_map (dict): The key is attribute name33                            and the value is json key in definition.34    """35    openapi_types = {36        'allocated_resources': 'dict(str, str)',37        'allocated_resources_status': 'list[V1ResourceStatus]',38        'container_id': 'str',39        'image': 'str',40        'image_id': 'str',41        'last_state': 'V1ContainerState',42        'name': 'str',43        'ready': 'bool',44        'resources': 'V1ResourceRequirements',45        'restart_count': 'int',46        'started': 'bool',47        'state': 'V1ContainerState',48        'stop_signal': 'str',49        'user': 'V1ContainerUser',50        'volume_mounts': 'list[V1VolumeMountStatus]'51    }52 53    attribute_map = {54        'allocated_resources': 'allocatedResources',55        'allocated_resources_status': 'allocatedResourcesStatus',56        'container_id': 'containerID',57        'image': 'image',58        'image_id': 'imageID',59        'last_state': 'lastState',60        'name': 'name',61        'ready': 'ready',62        'resources': 'resources',63        'restart_count': 'restartCount',64        'started': 'started',65        'state': 'state',66        'stop_signal': 'stopSignal',67        'user': 'user',68        'volume_mounts': 'volumeMounts'69    }70 71    def __init__(self, allocated_resources=None, allocated_resources_status=None, container_id=None, image=None, image_id=None, last_state=None, name=None, ready=None, resources=None, restart_count=None, started=None, state=None, stop_signal=None, user=None, volume_mounts=None, local_vars_configuration=None):  # noqa: E50172        """V1ContainerStatus - a model defined in OpenAPI"""  # noqa: E50173        if local_vars_configuration is None:74            local_vars_configuration = Configuration()75        self.local_vars_configuration = local_vars_configuration76 77        self._allocated_resources = None78        self._allocated_resources_status = None79        self._container_id = None80        self._image = None81        self._image_id = None82        self._last_state = None83        self._name = None84        self._ready = None85        self._resources = None86        self._restart_count = None87        self._started = None88        self._state = None89        self._stop_signal = None90        self._user = None91        self._volume_mounts = None92        self.discriminator = None93 94        if allocated_resources is not None:95            self.allocated_resources = allocated_resources96        if allocated_resources_status is not None:97            self.allocated_resources_status = allocated_resources_status98        if container_id is not None:99            self.container_id = container_id100        self.image = image101        self.image_id = image_id102        if last_state is not None:103            self.last_state = last_state104        self.name = name105        self.ready = ready106        if resources is not None:107            self.resources = resources108        self.restart_count = restart_count109        if started is not None:110            self.started = started111        if state is not None:112            self.state = state113        if stop_signal is not None:114            self.stop_signal = stop_signal115        if user is not None:116            self.user = user117        if volume_mounts is not None:118            self.volume_mounts = volume_mounts119 120    @property121    def allocated_resources(self):122        """Gets the allocated_resources of this V1ContainerStatus.  # noqa: E501123 124        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.  # noqa: E501125 126        :return: The allocated_resources of this V1ContainerStatus.  # noqa: E501127        :rtype: dict(str, str)128        """129        return self._allocated_resources130 131    @allocated_resources.setter132    def allocated_resources(self, allocated_resources):133        """Sets the allocated_resources of this V1ContainerStatus.134 135        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.  # noqa: E501136 137        :param allocated_resources: The allocated_resources of this V1ContainerStatus.  # noqa: E501138        :type: dict(str, str)139        """140 141        self._allocated_resources = allocated_resources142 143    @property144    def allocated_resources_status(self):145        """Gets the allocated_resources_status of this V1ContainerStatus.  # noqa: E501146 147        AllocatedResourcesStatus represents the status of various resources allocated for this Pod.  # noqa: E501148 149        :return: The allocated_resources_status of this V1ContainerStatus.  # noqa: E501150        :rtype: list[V1ResourceStatus]151        """152        return self._allocated_resources_status153 154    @allocated_resources_status.setter155    def allocated_resources_status(self, allocated_resources_status):156        """Sets the allocated_resources_status of this V1ContainerStatus.157 158        AllocatedResourcesStatus represents the status of various resources allocated for this Pod.  # noqa: E501159 160        :param allocated_resources_status: The allocated_resources_status of this V1ContainerStatus.  # noqa: E501161        :type: list[V1ResourceStatus]162        """163 164        self._allocated_resources_status = allocated_resources_status165 166    @property167    def container_id(self):168        """Gets the container_id of this V1ContainerStatus.  # noqa: E501169 170        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\").  # noqa: E501171 172        :return: The container_id of this V1ContainerStatus.  # noqa: E501173        :rtype: str174        """175        return self._container_id176 177    @container_id.setter178    def container_id(self, container_id):179        """Sets the container_id of this V1ContainerStatus.180 181        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\").  # noqa: E501182 183        :param container_id: The container_id of this V1ContainerStatus.  # noqa: E501184        :type: str185        """186 187        self._container_id = container_id188 189    @property190    def image(self):191        """Gets the image of this V1ContainerStatus.  # noqa: E501192 193        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.  # noqa: E501194 195        :return: The image of this V1ContainerStatus.  # noqa: E501196        :rtype: str197        """198        return self._image199 200    @image.setter201    def image(self, image):202        """Sets the image of this V1ContainerStatus.203 204        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.  # noqa: E501205 206        :param image: The image of this V1ContainerStatus.  # noqa: E501207        :type: str208        """209        if self.local_vars_configuration.client_side_validation and image is None:  # noqa: E501210            raise ValueError("Invalid value for `image`, must not be `None`")  # noqa: E501211 212        self._image = image213 214    @property215    def image_id(self):216        """Gets the image_id of this V1ContainerStatus.  # noqa: E501217 218        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.  # noqa: E501219 220        :return: The image_id of this V1ContainerStatus.  # noqa: E501221        :rtype: str222        """223        return self._image_id224 225    @image_id.setter226    def image_id(self, image_id):227        """Sets the image_id of this V1ContainerStatus.228 229        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.  # noqa: E501230 231        :param image_id: The image_id of this V1ContainerStatus.  # noqa: E501232        :type: str233        """234        if self.local_vars_configuration.client_side_validation and image_id is None:  # noqa: E501235            raise ValueError("Invalid value for `image_id`, must not be `None`")  # noqa: E501236 237        self._image_id = image_id238 239    @property240    def last_state(self):241        """Gets the last_state of this V1ContainerStatus.  # noqa: E501242 243 244        :return: The last_state of this V1ContainerStatus.  # noqa: E501245        :rtype: V1ContainerState246        """247        return self._last_state248 249    @last_state.setter250    def last_state(self, last_state):251        """Sets the last_state of this V1ContainerStatus.252 253 254        :param last_state: The last_state of this V1ContainerStatus.  # noqa: E501255        :type: V1ContainerState256        """257 258        self._last_state = last_state259 260    @property261    def name(self):262        """Gets the name of this V1ContainerStatus.  # noqa: E501263 264        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.  # noqa: E501265 266        :return: The name of this V1ContainerStatus.  # noqa: E501267        :rtype: str268        """269        return self._name270 271    @name.setter272    def name(self, name):273        """Sets the name of this V1ContainerStatus.274 275        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.  # noqa: E501276 277        :param name: The name of this V1ContainerStatus.  # noqa: E501278        :type: str279        """280        if self.local_vars_configuration.client_side_validation and name is None:  # noqa: E501281            raise ValueError("Invalid value for `name`, must not be `None`")  # noqa: E501282 283        self._name = name284 285    @property286    def ready(self):287        """Gets the ready of this V1ContainerStatus.  # noqa: E501288 289        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.  # noqa: E501290 291        :return: The ready of this V1ContainerStatus.  # noqa: E501292        :rtype: bool293        """294        return self._ready295 296    @ready.setter297    def ready(self, ready):298        """Sets the ready of this V1ContainerStatus.299 300        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.  # noqa: E501301 302        :param ready: The ready of this V1ContainerStatus.  # noqa: E501303        :type: bool304        """305        if self.local_vars_configuration.client_side_validation and ready is None:  # noqa: E501306            raise ValueError("Invalid value for `ready`, must not be `None`")  # noqa: E501307 308        self._ready = ready309 310    @property311    def resources(self):312        """Gets the resources of this V1ContainerStatus.  # noqa: E501313 314 315        :return: The resources of this V1ContainerStatus.  # noqa: E501316        :rtype: V1ResourceRequirements317        """318        return self._resources319 320    @resources.setter321    def resources(self, resources):322        """Sets the resources of this V1ContainerStatus.323 324 325        :param resources: The resources of this V1ContainerStatus.  # noqa: E501326        :type: V1ResourceRequirements327        """328 329        self._resources = resources330 331    @property332    def restart_count(self):333        """Gets the restart_count of this V1ContainerStatus.  # noqa: E501334 335        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.  # noqa: E501336 337        :return: The restart_count of this V1ContainerStatus.  # noqa: E501338        :rtype: int339        """340        return self._restart_count341 342    @restart_count.setter343    def restart_count(self, restart_count):344        """Sets the restart_count of this V1ContainerStatus.345 346        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.  # noqa: E501347 348        :param restart_count: The restart_count of this V1ContainerStatus.  # noqa: E501349        :type: int350        """351        if self.local_vars_configuration.client_side_validation and restart_count is None:  # noqa: E501352            raise ValueError("Invalid value for `restart_count`, must not be `None`")  # noqa: E501353 354        self._restart_count = restart_count355 356    @property357    def started(self):358        """Gets the started of this V1ContainerStatus.  # noqa: E501359 360        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.  # noqa: E501361 362        :return: The started of this V1ContainerStatus.  # noqa: E501363        :rtype: bool364        """365        return self._started366 367    @started.setter368    def started(self, started):369        """Sets the started of this V1ContainerStatus.370 371        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.  # noqa: E501372 373        :param started: The started of this V1ContainerStatus.  # noqa: E501374        :type: bool375        """376 377        self._started = started378 379    @property380    def state(self):381        """Gets the state of this V1ContainerStatus.  # noqa: E501382 383 384        :return: The state of this V1ContainerStatus.  # noqa: E501385        :rtype: V1ContainerState386        """387        return self._state388 389    @state.setter390    def state(self, state):391        """Sets the state of this V1ContainerStatus.392 393 394        :param state: The state of this V1ContainerStatus.  # noqa: E501395        :type: V1ContainerState396        """397 398        self._state = state399 400    @property401    def stop_signal(self):402        """Gets the stop_signal of this V1ContainerStatus.  # noqa: E501403 404        StopSignal reports the effective stop signal for this container  # noqa: E501405 406        :return: The stop_signal of this V1ContainerStatus.  # noqa: E501407        :rtype: str408        """409        return self._stop_signal410 411    @stop_signal.setter412    def stop_signal(self, stop_signal):413        """Sets the stop_signal of this V1ContainerStatus.414 415        StopSignal reports the effective stop signal for this container  # noqa: E501416 417        :param stop_signal: The stop_signal of this V1ContainerStatus.  # noqa: E501418        :type: str419        """420 421        self._stop_signal = stop_signal422 423    @property424    def user(self):425        """Gets the user of this V1ContainerStatus.  # noqa: E501426 427 428        :return: The user of this V1ContainerStatus.  # noqa: E501429        :rtype: V1ContainerUser430        """431        return self._user432 433    @user.setter434    def user(self, user):435        """Sets the user of this V1ContainerStatus.436 437 438        :param user: The user of this V1ContainerStatus.  # noqa: E501439        :type: V1ContainerUser440        """441 442        self._user = user443 444    @property445    def volume_mounts(self):446        """Gets the volume_mounts of this V1ContainerStatus.  # noqa: E501447 448        Status of volume mounts.  # noqa: E501449 450        :return: The volume_mounts of this V1ContainerStatus.  # noqa: E501451        :rtype: list[V1VolumeMountStatus]452        """453        return self._volume_mounts454 455    @volume_mounts.setter456    def volume_mounts(self, volume_mounts):457        """Sets the volume_mounts of this V1ContainerStatus.458 459        Status of volume mounts.  # noqa: E501460 461        :param volume_mounts: The volume_mounts of this V1ContainerStatus.  # noqa: E501462        :type: list[V1VolumeMountStatus]463        """464 465        self._volume_mounts = volume_mounts466 467    def to_dict(self):468        """Returns the model properties as a dict"""469        result = {}470 471        for attr, _ in six.iteritems(self.openapi_types):472            value = getattr(self, attr)473            if isinstance(value, list):474                result[attr] = list(map(475                    lambda x: x.to_dict() if hasattr(x, "to_dict") else x,476                    value477                ))478            elif hasattr(value, "to_dict"):479                result[attr] = value.to_dict()480            elif isinstance(value, dict):481                result[attr] = dict(map(482                    lambda item: (item[0], item[1].to_dict())483                    if hasattr(item[1], "to_dict") else item,484                    value.items()485                ))486            else:487                result[attr] = value488 489        return result490 491    def to_str(self):492        """Returns the string representation of the model"""493        return pprint.pformat(self.to_dict())494 495    def __repr__(self):496        """For `print` and `pprint`"""497        return self.to_str()498 499    def __eq__(self, other):500        """Returns true if both objects are equal"""501        if not isinstance(other, V1ContainerStatus):502            return False503 504        return self.to_dict() == other.to_dict()505 506    def __ne__(self, other):507        """Returns true if both objects are not equal"""508        if not isinstance(other, V1ContainerStatus):509            return True510 511        return self.to_dict() != other.to_dict()512 
codekingpro/portable-devtools · Team Ai