Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes14kdownloads
v1_cron_job_spec.py319 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 V1CronJobSpec(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        'concurrency_policy': 'str',37        'failed_jobs_history_limit': 'int',38        'job_template': 'V1JobTemplateSpec',39        'schedule': 'str',40        'starting_deadline_seconds': 'int',41        'successful_jobs_history_limit': 'int',42        'suspend': 'bool',43        'time_zone': 'str'44    }45 46    attribute_map = {47        'concurrency_policy': 'concurrencyPolicy',48        'failed_jobs_history_limit': 'failedJobsHistoryLimit',49        'job_template': 'jobTemplate',50        'schedule': 'schedule',51        'starting_deadline_seconds': 'startingDeadlineSeconds',52        'successful_jobs_history_limit': 'successfulJobsHistoryLimit',53        'suspend': 'suspend',54        'time_zone': 'timeZone'55    }56 57    def __init__(self, concurrency_policy=None, failed_jobs_history_limit=None, job_template=None, schedule=None, starting_deadline_seconds=None, successful_jobs_history_limit=None, suspend=None, time_zone=None, local_vars_configuration=None):  # noqa: E50158        """V1CronJobSpec - a model defined in OpenAPI"""  # noqa: E50159        if local_vars_configuration is None:60            local_vars_configuration = Configuration()61        self.local_vars_configuration = local_vars_configuration62 63        self._concurrency_policy = None64        self._failed_jobs_history_limit = None65        self._job_template = None66        self._schedule = None67        self._starting_deadline_seconds = None68        self._successful_jobs_history_limit = None69        self._suspend = None70        self._time_zone = None71        self.discriminator = None72 73        if concurrency_policy is not None:74            self.concurrency_policy = concurrency_policy75        if failed_jobs_history_limit is not None:76            self.failed_jobs_history_limit = failed_jobs_history_limit77        self.job_template = job_template78        self.schedule = schedule79        if starting_deadline_seconds is not None:80            self.starting_deadline_seconds = starting_deadline_seconds81        if successful_jobs_history_limit is not None:82            self.successful_jobs_history_limit = successful_jobs_history_limit83        if suspend is not None:84            self.suspend = suspend85        if time_zone is not None:86            self.time_zone = time_zone87 88    @property89    def concurrency_policy(self):90        """Gets the concurrency_policy of this V1CronJobSpec.  # noqa: E50191 92        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  # noqa: E50193 94        :return: The concurrency_policy of this V1CronJobSpec.  # noqa: E50195        :rtype: str96        """97        return self._concurrency_policy98 99    @concurrency_policy.setter100    def concurrency_policy(self, concurrency_policy):101        """Sets the concurrency_policy of this V1CronJobSpec.102 103        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  # noqa: E501104 105        :param concurrency_policy: The concurrency_policy of this V1CronJobSpec.  # noqa: E501106        :type: str107        """108 109        self._concurrency_policy = concurrency_policy110 111    @property112    def failed_jobs_history_limit(self):113        """Gets the failed_jobs_history_limit of this V1CronJobSpec.  # noqa: E501114 115        The number of failed finished jobs to retain. Value must be non-negative integer. Defaults to 1.  # noqa: E501116 117        :return: The failed_jobs_history_limit of this V1CronJobSpec.  # noqa: E501118        :rtype: int119        """120        return self._failed_jobs_history_limit121 122    @failed_jobs_history_limit.setter123    def failed_jobs_history_limit(self, failed_jobs_history_limit):124        """Sets the failed_jobs_history_limit of this V1CronJobSpec.125 126        The number of failed finished jobs to retain. Value must be non-negative integer. Defaults to 1.  # noqa: E501127 128        :param failed_jobs_history_limit: The failed_jobs_history_limit of this V1CronJobSpec.  # noqa: E501129        :type: int130        """131 132        self._failed_jobs_history_limit = failed_jobs_history_limit133 134    @property135    def job_template(self):136        """Gets the job_template of this V1CronJobSpec.  # noqa: E501137 138 139        :return: The job_template of this V1CronJobSpec.  # noqa: E501140        :rtype: V1JobTemplateSpec141        """142        return self._job_template143 144    @job_template.setter145    def job_template(self, job_template):146        """Sets the job_template of this V1CronJobSpec.147 148 149        :param job_template: The job_template of this V1CronJobSpec.  # noqa: E501150        :type: V1JobTemplateSpec151        """152        if self.local_vars_configuration.client_side_validation and job_template is None:  # noqa: E501153            raise ValueError("Invalid value for `job_template`, must not be `None`")  # noqa: E501154 155        self._job_template = job_template156 157    @property158    def schedule(self):159        """Gets the schedule of this V1CronJobSpec.  # noqa: E501160 161        The schedule in Cron format, see https://en.wikipedia.org/wiki/Cron.  # noqa: E501162 163        :return: The schedule of this V1CronJobSpec.  # noqa: E501164        :rtype: str165        """166        return self._schedule167 168    @schedule.setter169    def schedule(self, schedule):170        """Sets the schedule of this V1CronJobSpec.171 172        The schedule in Cron format, see https://en.wikipedia.org/wiki/Cron.  # noqa: E501173 174        :param schedule: The schedule of this V1CronJobSpec.  # noqa: E501175        :type: str176        """177        if self.local_vars_configuration.client_side_validation and schedule is None:  # noqa: E501178            raise ValueError("Invalid value for `schedule`, must not be `None`")  # noqa: E501179 180        self._schedule = schedule181 182    @property183    def starting_deadline_seconds(self):184        """Gets the starting_deadline_seconds of this V1CronJobSpec.  # noqa: E501185 186        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.  # noqa: E501187 188        :return: The starting_deadline_seconds of this V1CronJobSpec.  # noqa: E501189        :rtype: int190        """191        return self._starting_deadline_seconds192 193    @starting_deadline_seconds.setter194    def starting_deadline_seconds(self, starting_deadline_seconds):195        """Sets the starting_deadline_seconds of this V1CronJobSpec.196 197        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.  # noqa: E501198 199        :param starting_deadline_seconds: The starting_deadline_seconds of this V1CronJobSpec.  # noqa: E501200        :type: int201        """202 203        self._starting_deadline_seconds = starting_deadline_seconds204 205    @property206    def successful_jobs_history_limit(self):207        """Gets the successful_jobs_history_limit of this V1CronJobSpec.  # noqa: E501208 209        The number of successful finished jobs to retain. Value must be non-negative integer. Defaults to 3.  # noqa: E501210 211        :return: The successful_jobs_history_limit of this V1CronJobSpec.  # noqa: E501212        :rtype: int213        """214        return self._successful_jobs_history_limit215 216    @successful_jobs_history_limit.setter217    def successful_jobs_history_limit(self, successful_jobs_history_limit):218        """Sets the successful_jobs_history_limit of this V1CronJobSpec.219 220        The number of successful finished jobs to retain. Value must be non-negative integer. Defaults to 3.  # noqa: E501221 222        :param successful_jobs_history_limit: The successful_jobs_history_limit of this V1CronJobSpec.  # noqa: E501223        :type: int224        """225 226        self._successful_jobs_history_limit = successful_jobs_history_limit227 228    @property229    def suspend(self):230        """Gets the suspend of this V1CronJobSpec.  # noqa: E501231 232        This flag tells the controller to suspend subsequent executions, it does not apply to already started executions.  Defaults to false.  # noqa: E501233 234        :return: The suspend of this V1CronJobSpec.  # noqa: E501235        :rtype: bool236        """237        return self._suspend238 239    @suspend.setter240    def suspend(self, suspend):241        """Sets the suspend of this V1CronJobSpec.242 243        This flag tells the controller to suspend subsequent executions, it does not apply to already started executions.  Defaults to false.  # noqa: E501244 245        :param suspend: The suspend of this V1CronJobSpec.  # noqa: E501246        :type: bool247        """248 249        self._suspend = suspend250 251    @property252    def time_zone(self):253        """Gets the time_zone of this V1CronJobSpec.  # noqa: E501254 255        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  # noqa: E501256 257        :return: The time_zone of this V1CronJobSpec.  # noqa: E501258        :rtype: str259        """260        return self._time_zone261 262    @time_zone.setter263    def time_zone(self, time_zone):264        """Sets the time_zone of this V1CronJobSpec.265 266        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  # noqa: E501267 268        :param time_zone: The time_zone of this V1CronJobSpec.  # noqa: E501269        :type: str270        """271 272        self._time_zone = time_zone273 274    def to_dict(self):275        """Returns the model properties as a dict"""276        result = {}277 278        for attr, _ in six.iteritems(self.openapi_types):279            value = getattr(self, attr)280            if isinstance(value, list):281                result[attr] = list(map(282                    lambda x: x.to_dict() if hasattr(x, "to_dict") else x,283                    value284                ))285            elif hasattr(value, "to_dict"):286                result[attr] = value.to_dict()287            elif isinstance(value, dict):288                result[attr] = dict(map(289                    lambda item: (item[0], item[1].to_dict())290                    if hasattr(item[1], "to_dict") else item,291                    value.items()292                ))293            else:294                result[attr] = value295 296        return result297 298    def to_str(self):299        """Returns the string representation of the model"""300        return pprint.pformat(self.to_dict())301 302    def __repr__(self):303        """For `print` and `pprint`"""304        return self.to_str()305 306    def __eq__(self, other):307        """Returns true if both objects are equal"""308        if not isinstance(other, V1CronJobSpec):309            return False310 311        return self.to_dict() == other.to_dict()312 313    def __ne__(self, other):314        """Returns true if both objects are not equal"""315        if not isinstance(other, V1CronJobSpec):316            return True317 318        return self.to_dict() != other.to_dict()319 
codekingpro/portable-devtools · Team Ai