Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes14kdownloads
v1_security_context.py421 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 V1SecurityContext(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        'allow_privilege_escalation': 'bool',37        'app_armor_profile': 'V1AppArmorProfile',38        'capabilities': 'V1Capabilities',39        'privileged': 'bool',40        'proc_mount': 'str',41        'read_only_root_filesystem': 'bool',42        'run_as_group': 'int',43        'run_as_non_root': 'bool',44        'run_as_user': 'int',45        'se_linux_options': 'V1SELinuxOptions',46        'seccomp_profile': 'V1SeccompProfile',47        'windows_options': 'V1WindowsSecurityContextOptions'48    }49 50    attribute_map = {51        'allow_privilege_escalation': 'allowPrivilegeEscalation',52        'app_armor_profile': 'appArmorProfile',53        'capabilities': 'capabilities',54        'privileged': 'privileged',55        'proc_mount': 'procMount',56        'read_only_root_filesystem': 'readOnlyRootFilesystem',57        'run_as_group': 'runAsGroup',58        'run_as_non_root': 'runAsNonRoot',59        'run_as_user': 'runAsUser',60        'se_linux_options': 'seLinuxOptions',61        'seccomp_profile': 'seccompProfile',62        'windows_options': 'windowsOptions'63    }64 65    def __init__(self, allow_privilege_escalation=None, app_armor_profile=None, capabilities=None, privileged=None, proc_mount=None, read_only_root_filesystem=None, run_as_group=None, run_as_non_root=None, run_as_user=None, se_linux_options=None, seccomp_profile=None, windows_options=None, local_vars_configuration=None):  # noqa: E50166        """V1SecurityContext - a model defined in OpenAPI"""  # noqa: E50167        if local_vars_configuration is None:68            local_vars_configuration = Configuration()69        self.local_vars_configuration = local_vars_configuration70 71        self._allow_privilege_escalation = None72        self._app_armor_profile = None73        self._capabilities = None74        self._privileged = None75        self._proc_mount = None76        self._read_only_root_filesystem = None77        self._run_as_group = None78        self._run_as_non_root = None79        self._run_as_user = None80        self._se_linux_options = None81        self._seccomp_profile = None82        self._windows_options = None83        self.discriminator = None84 85        if allow_privilege_escalation is not None:86            self.allow_privilege_escalation = allow_privilege_escalation87        if app_armor_profile is not None:88            self.app_armor_profile = app_armor_profile89        if capabilities is not None:90            self.capabilities = capabilities91        if privileged is not None:92            self.privileged = privileged93        if proc_mount is not None:94            self.proc_mount = proc_mount95        if read_only_root_filesystem is not None:96            self.read_only_root_filesystem = read_only_root_filesystem97        if run_as_group is not None:98            self.run_as_group = run_as_group99        if run_as_non_root is not None:100            self.run_as_non_root = run_as_non_root101        if run_as_user is not None:102            self.run_as_user = run_as_user103        if se_linux_options is not None:104            self.se_linux_options = se_linux_options105        if seccomp_profile is not None:106            self.seccomp_profile = seccomp_profile107        if windows_options is not None:108            self.windows_options = windows_options109 110    @property111    def allow_privilege_escalation(self):112        """Gets the allow_privilege_escalation of this V1SecurityContext.  # noqa: E501113 114        AllowPrivilegeEscalation controls whether a process can gain more privileges than its parent process. This bool directly controls if the no_new_privs flag will be set on the container process. AllowPrivilegeEscalation is true always when the container is: 1) run as Privileged 2) has CAP_SYS_ADMIN Note that this field cannot be set when spec.os.name is windows.  # noqa: E501115 116        :return: The allow_privilege_escalation of this V1SecurityContext.  # noqa: E501117        :rtype: bool118        """119        return self._allow_privilege_escalation120 121    @allow_privilege_escalation.setter122    def allow_privilege_escalation(self, allow_privilege_escalation):123        """Sets the allow_privilege_escalation of this V1SecurityContext.124 125        AllowPrivilegeEscalation controls whether a process can gain more privileges than its parent process. This bool directly controls if the no_new_privs flag will be set on the container process. AllowPrivilegeEscalation is true always when the container is: 1) run as Privileged 2) has CAP_SYS_ADMIN Note that this field cannot be set when spec.os.name is windows.  # noqa: E501126 127        :param allow_privilege_escalation: The allow_privilege_escalation of this V1SecurityContext.  # noqa: E501128        :type: bool129        """130 131        self._allow_privilege_escalation = allow_privilege_escalation132 133    @property134    def app_armor_profile(self):135        """Gets the app_armor_profile of this V1SecurityContext.  # noqa: E501136 137 138        :return: The app_armor_profile of this V1SecurityContext.  # noqa: E501139        :rtype: V1AppArmorProfile140        """141        return self._app_armor_profile142 143    @app_armor_profile.setter144    def app_armor_profile(self, app_armor_profile):145        """Sets the app_armor_profile of this V1SecurityContext.146 147 148        :param app_armor_profile: The app_armor_profile of this V1SecurityContext.  # noqa: E501149        :type: V1AppArmorProfile150        """151 152        self._app_armor_profile = app_armor_profile153 154    @property155    def capabilities(self):156        """Gets the capabilities of this V1SecurityContext.  # noqa: E501157 158 159        :return: The capabilities of this V1SecurityContext.  # noqa: E501160        :rtype: V1Capabilities161        """162        return self._capabilities163 164    @capabilities.setter165    def capabilities(self, capabilities):166        """Sets the capabilities of this V1SecurityContext.167 168 169        :param capabilities: The capabilities of this V1SecurityContext.  # noqa: E501170        :type: V1Capabilities171        """172 173        self._capabilities = capabilities174 175    @property176    def privileged(self):177        """Gets the privileged of this V1SecurityContext.  # noqa: E501178 179        Run container in privileged mode. Processes in privileged containers are essentially equivalent to root on the host. Defaults to false. Note that this field cannot be set when spec.os.name is windows.  # noqa: E501180 181        :return: The privileged of this V1SecurityContext.  # noqa: E501182        :rtype: bool183        """184        return self._privileged185 186    @privileged.setter187    def privileged(self, privileged):188        """Sets the privileged of this V1SecurityContext.189 190        Run container in privileged mode. Processes in privileged containers are essentially equivalent to root on the host. Defaults to false. Note that this field cannot be set when spec.os.name is windows.  # noqa: E501191 192        :param privileged: The privileged of this V1SecurityContext.  # noqa: E501193        :type: bool194        """195 196        self._privileged = privileged197 198    @property199    def proc_mount(self):200        """Gets the proc_mount of this V1SecurityContext.  # noqa: E501201 202        procMount denotes the type of proc mount to use for the containers. The default value is Default which uses the container runtime defaults for readonly paths and masked paths. This requires the ProcMountType feature flag to be enabled. Note that this field cannot be set when spec.os.name is windows.  # noqa: E501203 204        :return: The proc_mount of this V1SecurityContext.  # noqa: E501205        :rtype: str206        """207        return self._proc_mount208 209    @proc_mount.setter210    def proc_mount(self, proc_mount):211        """Sets the proc_mount of this V1SecurityContext.212 213        procMount denotes the type of proc mount to use for the containers. The default value is Default which uses the container runtime defaults for readonly paths and masked paths. This requires the ProcMountType feature flag to be enabled. Note that this field cannot be set when spec.os.name is windows.  # noqa: E501214 215        :param proc_mount: The proc_mount of this V1SecurityContext.  # noqa: E501216        :type: str217        """218 219        self._proc_mount = proc_mount220 221    @property222    def read_only_root_filesystem(self):223        """Gets the read_only_root_filesystem of this V1SecurityContext.  # noqa: E501224 225        Whether this container has a read-only root filesystem. Default is false. Note that this field cannot be set when spec.os.name is windows.  # noqa: E501226 227        :return: The read_only_root_filesystem of this V1SecurityContext.  # noqa: E501228        :rtype: bool229        """230        return self._read_only_root_filesystem231 232    @read_only_root_filesystem.setter233    def read_only_root_filesystem(self, read_only_root_filesystem):234        """Sets the read_only_root_filesystem of this V1SecurityContext.235 236        Whether this container has a read-only root filesystem. Default is false. Note that this field cannot be set when spec.os.name is windows.  # noqa: E501237 238        :param read_only_root_filesystem: The read_only_root_filesystem of this V1SecurityContext.  # noqa: E501239        :type: bool240        """241 242        self._read_only_root_filesystem = read_only_root_filesystem243 244    @property245    def run_as_group(self):246        """Gets the run_as_group of this V1SecurityContext.  # noqa: E501247 248        The GID to run the entrypoint of the container process. Uses runtime default if unset. May also be set in PodSecurityContext.  If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence. Note that this field cannot be set when spec.os.name is windows.  # noqa: E501249 250        :return: The run_as_group of this V1SecurityContext.  # noqa: E501251        :rtype: int252        """253        return self._run_as_group254 255    @run_as_group.setter256    def run_as_group(self, run_as_group):257        """Sets the run_as_group of this V1SecurityContext.258 259        The GID to run the entrypoint of the container process. Uses runtime default if unset. May also be set in PodSecurityContext.  If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence. Note that this field cannot be set when spec.os.name is windows.  # noqa: E501260 261        :param run_as_group: The run_as_group of this V1SecurityContext.  # noqa: E501262        :type: int263        """264 265        self._run_as_group = run_as_group266 267    @property268    def run_as_non_root(self):269        """Gets the run_as_non_root of this V1SecurityContext.  # noqa: E501270 271        Indicates that the container must run as a non-root user. If true, the Kubelet will validate the image at runtime to ensure that it does not run as UID 0 (root) and fail to start the container if it does. If unset or false, no such validation will be performed. May also be set in PodSecurityContext.  If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence.  # noqa: E501272 273        :return: The run_as_non_root of this V1SecurityContext.  # noqa: E501274        :rtype: bool275        """276        return self._run_as_non_root277 278    @run_as_non_root.setter279    def run_as_non_root(self, run_as_non_root):280        """Sets the run_as_non_root of this V1SecurityContext.281 282        Indicates that the container must run as a non-root user. If true, the Kubelet will validate the image at runtime to ensure that it does not run as UID 0 (root) and fail to start the container if it does. If unset or false, no such validation will be performed. May also be set in PodSecurityContext.  If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence.  # noqa: E501283 284        :param run_as_non_root: The run_as_non_root of this V1SecurityContext.  # noqa: E501285        :type: bool286        """287 288        self._run_as_non_root = run_as_non_root289 290    @property291    def run_as_user(self):292        """Gets the run_as_user of this V1SecurityContext.  # noqa: E501293 294        The UID to run the entrypoint of the container process. Defaults to user specified in image metadata if unspecified. May also be set in PodSecurityContext.  If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence. Note that this field cannot be set when spec.os.name is windows.  # noqa: E501295 296        :return: The run_as_user of this V1SecurityContext.  # noqa: E501297        :rtype: int298        """299        return self._run_as_user300 301    @run_as_user.setter302    def run_as_user(self, run_as_user):303        """Sets the run_as_user of this V1SecurityContext.304 305        The UID to run the entrypoint of the container process. Defaults to user specified in image metadata if unspecified. May also be set in PodSecurityContext.  If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence. Note that this field cannot be set when spec.os.name is windows.  # noqa: E501306 307        :param run_as_user: The run_as_user of this V1SecurityContext.  # noqa: E501308        :type: int309        """310 311        self._run_as_user = run_as_user312 313    @property314    def se_linux_options(self):315        """Gets the se_linux_options of this V1SecurityContext.  # noqa: E501316 317 318        :return: The se_linux_options of this V1SecurityContext.  # noqa: E501319        :rtype: V1SELinuxOptions320        """321        return self._se_linux_options322 323    @se_linux_options.setter324    def se_linux_options(self, se_linux_options):325        """Sets the se_linux_options of this V1SecurityContext.326 327 328        :param se_linux_options: The se_linux_options of this V1SecurityContext.  # noqa: E501329        :type: V1SELinuxOptions330        """331 332        self._se_linux_options = se_linux_options333 334    @property335    def seccomp_profile(self):336        """Gets the seccomp_profile of this V1SecurityContext.  # noqa: E501337 338 339        :return: The seccomp_profile of this V1SecurityContext.  # noqa: E501340        :rtype: V1SeccompProfile341        """342        return self._seccomp_profile343 344    @seccomp_profile.setter345    def seccomp_profile(self, seccomp_profile):346        """Sets the seccomp_profile of this V1SecurityContext.347 348 349        :param seccomp_profile: The seccomp_profile of this V1SecurityContext.  # noqa: E501350        :type: V1SeccompProfile351        """352 353        self._seccomp_profile = seccomp_profile354 355    @property356    def windows_options(self):357        """Gets the windows_options of this V1SecurityContext.  # noqa: E501358 359 360        :return: The windows_options of this V1SecurityContext.  # noqa: E501361        :rtype: V1WindowsSecurityContextOptions362        """363        return self._windows_options364 365    @windows_options.setter366    def windows_options(self, windows_options):367        """Sets the windows_options of this V1SecurityContext.368 369 370        :param windows_options: The windows_options of this V1SecurityContext.  # noqa: E501371        :type: V1WindowsSecurityContextOptions372        """373 374        self._windows_options = windows_options375 376    def to_dict(self):377        """Returns the model properties as a dict"""378        result = {}379 380        for attr, _ in six.iteritems(self.openapi_types):381            value = getattr(self, attr)382            if isinstance(value, list):383                result[attr] = list(map(384                    lambda x: x.to_dict() if hasattr(x, "to_dict") else x,385                    value386                ))387            elif hasattr(value, "to_dict"):388                result[attr] = value.to_dict()389            elif isinstance(value, dict):390                result[attr] = dict(map(391                    lambda item: (item[0], item[1].to_dict())392                    if hasattr(item[1], "to_dict") else item,393                    value.items()394                ))395            else:396                result[attr] = value397 398        return result399 400    def to_str(self):401        """Returns the string representation of the model"""402        return pprint.pformat(self.to_dict())403 404    def __repr__(self):405        """For `print` and `pprint`"""406        return self.to_str()407 408    def __eq__(self, other):409        """Returns true if both objects are equal"""410        if not isinstance(other, V1SecurityContext):411            return False412 413        return self.to_dict() == other.to_dict()414 415    def __ne__(self, other):416        """Returns true if both objects are not equal"""417        if not isinstance(other, V1SecurityContext):418            return True419 420        return self.to_dict() != other.to_dict()421 
codekingpro/portable-devtools · Team Ai