codekingpro/portable-devtools
114k
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 V1CSIDriverSpec(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 'attach_required': 'bool',37 'fs_group_policy': 'str',38 'node_allocatable_update_period_seconds': 'int',39 'pod_info_on_mount': 'bool',40 'requires_republish': 'bool',41 'se_linux_mount': 'bool',42 'service_account_token_in_secrets': 'bool',43 'storage_capacity': 'bool',44 'token_requests': 'list[StorageV1TokenRequest]',45 'volume_lifecycle_modes': 'list[str]'46 }47 48 attribute_map = {49 'attach_required': 'attachRequired',50 'fs_group_policy': 'fsGroupPolicy',51 'node_allocatable_update_period_seconds': 'nodeAllocatableUpdatePeriodSeconds',52 'pod_info_on_mount': 'podInfoOnMount',53 'requires_republish': 'requiresRepublish',54 'se_linux_mount': 'seLinuxMount',55 'service_account_token_in_secrets': 'serviceAccountTokenInSecrets',56 'storage_capacity': 'storageCapacity',57 'token_requests': 'tokenRequests',58 'volume_lifecycle_modes': 'volumeLifecycleModes'59 }60 61 def __init__(self, attach_required=None, fs_group_policy=None, node_allocatable_update_period_seconds=None, pod_info_on_mount=None, requires_republish=None, se_linux_mount=None, service_account_token_in_secrets=None, storage_capacity=None, token_requests=None, volume_lifecycle_modes=None, local_vars_configuration=None): # noqa: E50162 """V1CSIDriverSpec - a model defined in OpenAPI""" # noqa: E50163 if local_vars_configuration is None:64 local_vars_configuration = Configuration()65 self.local_vars_configuration = local_vars_configuration66 67 self._attach_required = None68 self._fs_group_policy = None69 self._node_allocatable_update_period_seconds = None70 self._pod_info_on_mount = None71 self._requires_republish = None72 self._se_linux_mount = None73 self._service_account_token_in_secrets = None74 self._storage_capacity = None75 self._token_requests = None76 self._volume_lifecycle_modes = None77 self.discriminator = None78 79 if attach_required is not None:80 self.attach_required = attach_required81 if fs_group_policy is not None:82 self.fs_group_policy = fs_group_policy83 if node_allocatable_update_period_seconds is not None:84 self.node_allocatable_update_period_seconds = node_allocatable_update_period_seconds85 if pod_info_on_mount is not None:86 self.pod_info_on_mount = pod_info_on_mount87 if requires_republish is not None:88 self.requires_republish = requires_republish89 if se_linux_mount is not None:90 self.se_linux_mount = se_linux_mount91 if service_account_token_in_secrets is not None:92 self.service_account_token_in_secrets = service_account_token_in_secrets93 if storage_capacity is not None:94 self.storage_capacity = storage_capacity95 if token_requests is not None:96 self.token_requests = token_requests97 if volume_lifecycle_modes is not None:98 self.volume_lifecycle_modes = volume_lifecycle_modes99 100 @property101 def attach_required(self):102 """Gets the attach_required of this V1CSIDriverSpec. # noqa: E501103 104 attachRequired indicates this CSI volume driver requires an attach operation (because it implements the CSI ControllerPublishVolume() method), and that the Kubernetes attach detach controller should call the attach volume interface which checks the volumeattachment status and waits until the volume is attached before proceeding to mounting. The CSI external-attacher coordinates with CSI volume driver and updates the volumeattachment status when the attach operation is complete. If the value is specified to false, the attach operation will be skipped. Otherwise the attach operation will be called. This field is immutable. # noqa: E501105 106 :return: The attach_required of this V1CSIDriverSpec. # noqa: E501107 :rtype: bool108 """109 return self._attach_required110 111 @attach_required.setter112 def attach_required(self, attach_required):113 """Sets the attach_required of this V1CSIDriverSpec.114 115 attachRequired indicates this CSI volume driver requires an attach operation (because it implements the CSI ControllerPublishVolume() method), and that the Kubernetes attach detach controller should call the attach volume interface which checks the volumeattachment status and waits until the volume is attached before proceeding to mounting. The CSI external-attacher coordinates with CSI volume driver and updates the volumeattachment status when the attach operation is complete. If the value is specified to false, the attach operation will be skipped. Otherwise the attach operation will be called. This field is immutable. # noqa: E501116 117 :param attach_required: The attach_required of this V1CSIDriverSpec. # noqa: E501118 :type: bool119 """120 121 self._attach_required = attach_required122 123 @property124 def fs_group_policy(self):125 """Gets the fs_group_policy of this V1CSIDriverSpec. # noqa: E501126 127 fsGroupPolicy defines if the underlying volume supports changing ownership and permission of the volume before being mounted. Refer to the specific FSGroupPolicy values for additional details. This field was immutable in Kubernetes < 1.29 and now is mutable. Defaults to ReadWriteOnceWithFSType, which will examine each volume to determine if Kubernetes should modify ownership and permissions of the volume. With the default policy the defined fsGroup will only be applied if a fstype is defined and the volume's access mode contains ReadWriteOnce. # noqa: E501128 129 :return: The fs_group_policy of this V1CSIDriverSpec. # noqa: E501130 :rtype: str131 """132 return self._fs_group_policy133 134 @fs_group_policy.setter135 def fs_group_policy(self, fs_group_policy):136 """Sets the fs_group_policy of this V1CSIDriverSpec.137 138 fsGroupPolicy defines if the underlying volume supports changing ownership and permission of the volume before being mounted. Refer to the specific FSGroupPolicy values for additional details. This field was immutable in Kubernetes < 1.29 and now is mutable. Defaults to ReadWriteOnceWithFSType, which will examine each volume to determine if Kubernetes should modify ownership and permissions of the volume. With the default policy the defined fsGroup will only be applied if a fstype is defined and the volume's access mode contains ReadWriteOnce. # noqa: E501139 140 :param fs_group_policy: The fs_group_policy of this V1CSIDriverSpec. # noqa: E501141 :type: str142 """143 144 self._fs_group_policy = fs_group_policy145 146 @property147 def node_allocatable_update_period_seconds(self):148 """Gets the node_allocatable_update_period_seconds of this V1CSIDriverSpec. # noqa: E501149 150 nodeAllocatableUpdatePeriodSeconds specifies the interval between periodic updates of the CSINode allocatable capacity for this driver. When set, both periodic updates and updates triggered by capacity-related failures are enabled. If not set, no updates occur (neither periodic nor upon detecting capacity-related failures), and the allocatable.count remains static. The minimum allowed value for this field is 10 seconds. This is a beta feature and requires the MutableCSINodeAllocatableCount feature gate to be enabled. This field is mutable. # noqa: E501151 152 :return: The node_allocatable_update_period_seconds of this V1CSIDriverSpec. # noqa: E501153 :rtype: int154 """155 return self._node_allocatable_update_period_seconds156 157 @node_allocatable_update_period_seconds.setter158 def node_allocatable_update_period_seconds(self, node_allocatable_update_period_seconds):159 """Sets the node_allocatable_update_period_seconds of this V1CSIDriverSpec.160 161 nodeAllocatableUpdatePeriodSeconds specifies the interval between periodic updates of the CSINode allocatable capacity for this driver. When set, both periodic updates and updates triggered by capacity-related failures are enabled. If not set, no updates occur (neither periodic nor upon detecting capacity-related failures), and the allocatable.count remains static. The minimum allowed value for this field is 10 seconds. This is a beta feature and requires the MutableCSINodeAllocatableCount feature gate to be enabled. This field is mutable. # noqa: E501162 163 :param node_allocatable_update_period_seconds: The node_allocatable_update_period_seconds of this V1CSIDriverSpec. # noqa: E501164 :type: int165 """166 167 self._node_allocatable_update_period_seconds = node_allocatable_update_period_seconds168 169 @property170 def pod_info_on_mount(self):171 """Gets the pod_info_on_mount of this V1CSIDriverSpec. # noqa: E501172 173 podInfoOnMount indicates this CSI volume driver requires additional pod information (like podName, podUID, etc.) during mount operations, if set to true. If set to false, pod information will not be passed on mount. Default is false. The CSI driver specifies podInfoOnMount as part of driver deployment. If true, Kubelet will pass pod information as VolumeContext in the CSI NodePublishVolume() calls. The CSI driver is responsible for parsing and validating the information passed in as VolumeContext. The following VolumeContext will be passed if podInfoOnMount is set to true. This list might grow, but the prefix will be used. \"csi.storage.k8s.io/pod.name\": pod.Name \"csi.storage.k8s.io/pod.namespace\": pod.Namespace \"csi.storage.k8s.io/pod.uid\": string(pod.UID) \"csi.storage.k8s.io/ephemeral\": \"true\" if the volume is an ephemeral inline volume defined by a CSIVolumeSource, otherwise \"false\" \"csi.storage.k8s.io/ephemeral\" is a new feature in Kubernetes 1.16. It is only required for drivers which support both the \"Persistent\" and \"Ephemeral\" VolumeLifecycleMode. Other drivers can leave pod info disabled and/or ignore this field. As Kubernetes 1.15 doesn't support this field, drivers can only support one mode when deployed on such a cluster and the deployment determines which mode that is, for example via a command line parameter of the driver. This field was immutable in Kubernetes < 1.29 and now is mutable. # noqa: E501174 175 :return: The pod_info_on_mount of this V1CSIDriverSpec. # noqa: E501176 :rtype: bool177 """178 return self._pod_info_on_mount179 180 @pod_info_on_mount.setter181 def pod_info_on_mount(self, pod_info_on_mount):182 """Sets the pod_info_on_mount of this V1CSIDriverSpec.183 184 podInfoOnMount indicates this CSI volume driver requires additional pod information (like podName, podUID, etc.) during mount operations, if set to true. If set to false, pod information will not be passed on mount. Default is false. The CSI driver specifies podInfoOnMount as part of driver deployment. If true, Kubelet will pass pod information as VolumeContext in the CSI NodePublishVolume() calls. The CSI driver is responsible for parsing and validating the information passed in as VolumeContext. The following VolumeContext will be passed if podInfoOnMount is set to true. This list might grow, but the prefix will be used. \"csi.storage.k8s.io/pod.name\": pod.Name \"csi.storage.k8s.io/pod.namespace\": pod.Namespace \"csi.storage.k8s.io/pod.uid\": string(pod.UID) \"csi.storage.k8s.io/ephemeral\": \"true\" if the volume is an ephemeral inline volume defined by a CSIVolumeSource, otherwise \"false\" \"csi.storage.k8s.io/ephemeral\" is a new feature in Kubernetes 1.16. It is only required for drivers which support both the \"Persistent\" and \"Ephemeral\" VolumeLifecycleMode. Other drivers can leave pod info disabled and/or ignore this field. As Kubernetes 1.15 doesn't support this field, drivers can only support one mode when deployed on such a cluster and the deployment determines which mode that is, for example via a command line parameter of the driver. This field was immutable in Kubernetes < 1.29 and now is mutable. # noqa: E501185 186 :param pod_info_on_mount: The pod_info_on_mount of this V1CSIDriverSpec. # noqa: E501187 :type: bool188 """189 190 self._pod_info_on_mount = pod_info_on_mount191 192 @property193 def requires_republish(self):194 """Gets the requires_republish of this V1CSIDriverSpec. # noqa: E501195 196 requiresRepublish indicates the CSI driver wants `NodePublishVolume` being periodically called to reflect any possible change in the mounted volume. This field defaults to false. Note: After a successful initial NodePublishVolume call, subsequent calls to NodePublishVolume should only update the contents of the volume. New mount points will not be seen by a running container. # noqa: E501197 198 :return: The requires_republish of this V1CSIDriverSpec. # noqa: E501199 :rtype: bool200 """201 return self._requires_republish202 203 @requires_republish.setter204 def requires_republish(self, requires_republish):205 """Sets the requires_republish of this V1CSIDriverSpec.206 207 requiresRepublish indicates the CSI driver wants `NodePublishVolume` being periodically called to reflect any possible change in the mounted volume. This field defaults to false. Note: After a successful initial NodePublishVolume call, subsequent calls to NodePublishVolume should only update the contents of the volume. New mount points will not be seen by a running container. # noqa: E501208 209 :param requires_republish: The requires_republish of this V1CSIDriverSpec. # noqa: E501210 :type: bool211 """212 213 self._requires_republish = requires_republish214 215 @property216 def se_linux_mount(self):217 """Gets the se_linux_mount of this V1CSIDriverSpec. # noqa: E501218 219 seLinuxMount specifies if the CSI driver supports \"-o context\" mount option. When \"true\", the CSI driver must ensure that all volumes provided by this CSI driver can be mounted separately with different `-o context` options. This is typical for storage backends that provide volumes as filesystems on block devices or as independent shared volumes. Kubernetes will call NodeStage / NodePublish with \"-o context=xyz\" mount option when mounting a ReadWriteOncePod volume used in Pod that has explicitly set SELinux context. In the future, it may be expanded to other volume AccessModes. In any case, Kubernetes will ensure that the volume is mounted only with a single SELinux context. When \"false\", Kubernetes won't pass any special SELinux mount options to the driver. This is typical for volumes that represent subdirectories of a bigger shared filesystem. Default is \"false\". # noqa: E501220 221 :return: The se_linux_mount of this V1CSIDriverSpec. # noqa: E501222 :rtype: bool223 """224 return self._se_linux_mount225 226 @se_linux_mount.setter227 def se_linux_mount(self, se_linux_mount):228 """Sets the se_linux_mount of this V1CSIDriverSpec.229 230 seLinuxMount specifies if the CSI driver supports \"-o context\" mount option. When \"true\", the CSI driver must ensure that all volumes provided by this CSI driver can be mounted separately with different `-o context` options. This is typical for storage backends that provide volumes as filesystems on block devices or as independent shared volumes. Kubernetes will call NodeStage / NodePublish with \"-o context=xyz\" mount option when mounting a ReadWriteOncePod volume used in Pod that has explicitly set SELinux context. In the future, it may be expanded to other volume AccessModes. In any case, Kubernetes will ensure that the volume is mounted only with a single SELinux context. When \"false\", Kubernetes won't pass any special SELinux mount options to the driver. This is typical for volumes that represent subdirectories of a bigger shared filesystem. Default is \"false\". # noqa: E501231 232 :param se_linux_mount: The se_linux_mount of this V1CSIDriverSpec. # noqa: E501233 :type: bool234 """235 236 self._se_linux_mount = se_linux_mount237 238 @property239 def service_account_token_in_secrets(self):240 """Gets the service_account_token_in_secrets of this V1CSIDriverSpec. # noqa: E501241 242 serviceAccountTokenInSecrets is an opt-in for CSI drivers to indicate that service account tokens should be passed via the Secrets field in NodePublishVolumeRequest instead of the VolumeContext field. The CSI specification provides a dedicated Secrets field for sensitive information like tokens, which is the appropriate mechanism for handling credentials. This addresses security concerns where sensitive tokens were being logged as part of volume context. When \"true\", kubelet will pass the tokens only in the Secrets field with the key \"csi.storage.k8s.io/serviceAccount.tokens\". The CSI driver must be updated to read tokens from the Secrets field instead of VolumeContext. When \"false\" or not set, kubelet will pass the tokens in VolumeContext with the key \"csi.storage.k8s.io/serviceAccount.tokens\" (existing behavior). This maintains backward compatibility with existing CSI drivers. This field can only be set when TokenRequests is configured. The API server will reject CSIDriver specs that set this field without TokenRequests. Default behavior if unset is to pass tokens in the VolumeContext field. # noqa: E501243 244 :return: The service_account_token_in_secrets of this V1CSIDriverSpec. # noqa: E501245 :rtype: bool246 """247 return self._service_account_token_in_secrets248 249 @service_account_token_in_secrets.setter250 def service_account_token_in_secrets(self, service_account_token_in_secrets):251 """Sets the service_account_token_in_secrets of this V1CSIDriverSpec.252 253 serviceAccountTokenInSecrets is an opt-in for CSI drivers to indicate that service account tokens should be passed via the Secrets field in NodePublishVolumeRequest instead of the VolumeContext field. The CSI specification provides a dedicated Secrets field for sensitive information like tokens, which is the appropriate mechanism for handling credentials. This addresses security concerns where sensitive tokens were being logged as part of volume context. When \"true\", kubelet will pass the tokens only in the Secrets field with the key \"csi.storage.k8s.io/serviceAccount.tokens\". The CSI driver must be updated to read tokens from the Secrets field instead of VolumeContext. When \"false\" or not set, kubelet will pass the tokens in VolumeContext with the key \"csi.storage.k8s.io/serviceAccount.tokens\" (existing behavior). This maintains backward compatibility with existing CSI drivers. This field can only be set when TokenRequests is configured. The API server will reject CSIDriver specs that set this field without TokenRequests. Default behavior if unset is to pass tokens in the VolumeContext field. # noqa: E501254 255 :param service_account_token_in_secrets: The service_account_token_in_secrets of this V1CSIDriverSpec. # noqa: E501256 :type: bool257 """258 259 self._service_account_token_in_secrets = service_account_token_in_secrets260 261 @property262 def storage_capacity(self):263 """Gets the storage_capacity of this V1CSIDriverSpec. # noqa: E501264 265 storageCapacity indicates that the CSI volume driver wants pod scheduling to consider the storage capacity that the driver deployment will report by creating CSIStorageCapacity objects with capacity information, if set to true. The check can be enabled immediately when deploying a driver. In that case, provisioning new volumes with late binding will pause until the driver deployment has published some suitable CSIStorageCapacity object. Alternatively, the driver can be deployed with the field unset or false and it can be flipped later when storage capacity information has been published. This field was immutable in Kubernetes <= 1.22 and now is mutable. # noqa: E501266 267 :return: The storage_capacity of this V1CSIDriverSpec. # noqa: E501268 :rtype: bool269 """270 return self._storage_capacity271 272 @storage_capacity.setter273 def storage_capacity(self, storage_capacity):274 """Sets the storage_capacity of this V1CSIDriverSpec.275 276 storageCapacity indicates that the CSI volume driver wants pod scheduling to consider the storage capacity that the driver deployment will report by creating CSIStorageCapacity objects with capacity information, if set to true. The check can be enabled immediately when deploying a driver. In that case, provisioning new volumes with late binding will pause until the driver deployment has published some suitable CSIStorageCapacity object. Alternatively, the driver can be deployed with the field unset or false and it can be flipped later when storage capacity information has been published. This field was immutable in Kubernetes <= 1.22 and now is mutable. # noqa: E501277 278 :param storage_capacity: The storage_capacity of this V1CSIDriverSpec. # noqa: E501279 :type: bool280 """281 282 self._storage_capacity = storage_capacity283 284 @property285 def token_requests(self):286 """Gets the token_requests of this V1CSIDriverSpec. # noqa: E501287 288 tokenRequests indicates the CSI driver needs pods' service account tokens it is mounting volume for to do necessary authentication. Kubelet will pass the tokens in VolumeContext in the CSI NodePublishVolume calls. The CSI driver should parse and validate the following VolumeContext: \"csi.storage.k8s.io/serviceAccount.tokens\": { \"<audience>\": { \"token\": <token>, \"expirationTimestamp\": <expiration timestamp in RFC3339>, }, ... } Note: Audience in each TokenRequest should be different and at most one token is empty string. To receive a new token after expiry, RequiresRepublish can be used to trigger NodePublishVolume periodically. # noqa: E501289 290 :return: The token_requests of this V1CSIDriverSpec. # noqa: E501291 :rtype: list[StorageV1TokenRequest]292 """293 return self._token_requests294 295 @token_requests.setter296 def token_requests(self, token_requests):297 """Sets the token_requests of this V1CSIDriverSpec.298 299 tokenRequests indicates the CSI driver needs pods' service account tokens it is mounting volume for to do necessary authentication. Kubelet will pass the tokens in VolumeContext in the CSI NodePublishVolume calls. The CSI driver should parse and validate the following VolumeContext: \"csi.storage.k8s.io/serviceAccount.tokens\": { \"<audience>\": { \"token\": <token>, \"expirationTimestamp\": <expiration timestamp in RFC3339>, }, ... } Note: Audience in each TokenRequest should be different and at most one token is empty string. To receive a new token after expiry, RequiresRepublish can be used to trigger NodePublishVolume periodically. # noqa: E501300 301 :param token_requests: The token_requests of this V1CSIDriverSpec. # noqa: E501302 :type: list[StorageV1TokenRequest]303 """304 305 self._token_requests = token_requests306 307 @property308 def volume_lifecycle_modes(self):309 """Gets the volume_lifecycle_modes of this V1CSIDriverSpec. # noqa: E501310 311 volumeLifecycleModes defines what kind of volumes this CSI volume driver supports. The default if the list is empty is \"Persistent\", which is the usage defined by the CSI specification and implemented in Kubernetes via the usual PV/PVC mechanism. The other mode is \"Ephemeral\". In this mode, volumes are defined inline inside the pod spec with CSIVolumeSource and their lifecycle is tied to the lifecycle of that pod. A driver has to be aware of this because it is only going to get a NodePublishVolume call for such a volume. For more information about implementing this mode, see https://kubernetes-csi.github.io/docs/ephemeral-local-volumes.html A driver can support one or more of these modes and more modes may be added in the future. This field is beta. This field is immutable. # noqa: E501312 313 :return: The volume_lifecycle_modes of this V1CSIDriverSpec. # noqa: E501314 :rtype: list[str]315 """316 return self._volume_lifecycle_modes317 318 @volume_lifecycle_modes.setter319 def volume_lifecycle_modes(self, volume_lifecycle_modes):320 """Sets the volume_lifecycle_modes of this V1CSIDriverSpec.321 322 volumeLifecycleModes defines what kind of volumes this CSI volume driver supports. The default if the list is empty is \"Persistent\", which is the usage defined by the CSI specification and implemented in Kubernetes via the usual PV/PVC mechanism. The other mode is \"Ephemeral\". In this mode, volumes are defined inline inside the pod spec with CSIVolumeSource and their lifecycle is tied to the lifecycle of that pod. A driver has to be aware of this because it is only going to get a NodePublishVolume call for such a volume. For more information about implementing this mode, see https://kubernetes-csi.github.io/docs/ephemeral-local-volumes.html A driver can support one or more of these modes and more modes may be added in the future. This field is beta. This field is immutable. # noqa: E501323 324 :param volume_lifecycle_modes: The volume_lifecycle_modes of this V1CSIDriverSpec. # noqa: E501325 :type: list[str]326 """327 328 self._volume_lifecycle_modes = volume_lifecycle_modes329 330 def to_dict(self):331 """Returns the model properties as a dict"""332 result = {}333 334 for attr, _ in six.iteritems(self.openapi_types):335 value = getattr(self, attr)336 if isinstance(value, list):337 result[attr] = list(map(338 lambda x: x.to_dict() if hasattr(x, "to_dict") else x,339 value340 ))341 elif hasattr(value, "to_dict"):342 result[attr] = value.to_dict()343 elif isinstance(value, dict):344 result[attr] = dict(map(345 lambda item: (item[0], item[1].to_dict())346 if hasattr(item[1], "to_dict") else item,347 value.items()348 ))349 else:350 result[attr] = value351 352 return result353 354 def to_str(self):355 """Returns the string representation of the model"""356 return pprint.pformat(self.to_dict())357 358 def __repr__(self):359 """For `print` and `pprint`"""360 return self.to_str()361 362 def __eq__(self, other):363 """Returns true if both objects are equal"""364 if not isinstance(other, V1CSIDriverSpec):365 return False366 367 return self.to_dict() == other.to_dict()368 369 def __ne__(self, other):370 """Returns true if both objects are not equal"""371 if not isinstance(other, V1CSIDriverSpec):372 return True373 374 return self.to_dict() != other.to_dict()375 