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 V1beta1BasicDevice(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 'all_nodes': 'bool',37 'allow_multiple_allocations': 'bool',38 'attributes': 'dict(str, V1beta1DeviceAttribute)',39 'binding_conditions': 'list[str]',40 'binding_failure_conditions': 'list[str]',41 'binds_to_node': 'bool',42 'capacity': 'dict(str, V1beta1DeviceCapacity)',43 'consumes_counters': 'list[V1beta1DeviceCounterConsumption]',44 'node_name': 'str',45 'node_selector': 'V1NodeSelector',46 'taints': 'list[V1beta1DeviceTaint]'47 }48 49 attribute_map = {50 'all_nodes': 'allNodes',51 'allow_multiple_allocations': 'allowMultipleAllocations',52 'attributes': 'attributes',53 'binding_conditions': 'bindingConditions',54 'binding_failure_conditions': 'bindingFailureConditions',55 'binds_to_node': 'bindsToNode',56 'capacity': 'capacity',57 'consumes_counters': 'consumesCounters',58 'node_name': 'nodeName',59 'node_selector': 'nodeSelector',60 'taints': 'taints'61 }62 63 def __init__(self, all_nodes=None, allow_multiple_allocations=None, attributes=None, binding_conditions=None, binding_failure_conditions=None, binds_to_node=None, capacity=None, consumes_counters=None, node_name=None, node_selector=None, taints=None, local_vars_configuration=None): # noqa: E50164 """V1beta1BasicDevice - a model defined in OpenAPI""" # noqa: E50165 if local_vars_configuration is None:66 local_vars_configuration = Configuration()67 self.local_vars_configuration = local_vars_configuration68 69 self._all_nodes = None70 self._allow_multiple_allocations = None71 self._attributes = None72 self._binding_conditions = None73 self._binding_failure_conditions = None74 self._binds_to_node = None75 self._capacity = None76 self._consumes_counters = None77 self._node_name = None78 self._node_selector = None79 self._taints = None80 self.discriminator = None81 82 if all_nodes is not None:83 self.all_nodes = all_nodes84 if allow_multiple_allocations is not None:85 self.allow_multiple_allocations = allow_multiple_allocations86 if attributes is not None:87 self.attributes = attributes88 if binding_conditions is not None:89 self.binding_conditions = binding_conditions90 if binding_failure_conditions is not None:91 self.binding_failure_conditions = binding_failure_conditions92 if binds_to_node is not None:93 self.binds_to_node = binds_to_node94 if capacity is not None:95 self.capacity = capacity96 if consumes_counters is not None:97 self.consumes_counters = consumes_counters98 if node_name is not None:99 self.node_name = node_name100 if node_selector is not None:101 self.node_selector = node_selector102 if taints is not None:103 self.taints = taints104 105 @property106 def all_nodes(self):107 """Gets the all_nodes of this V1beta1BasicDevice. # noqa: E501108 109 AllNodes indicates that all nodes have access to the device. Must only be set if Spec.PerDeviceNodeSelection is set to true. At most one of NodeName, NodeSelector and AllNodes can be set. # noqa: E501110 111 :return: The all_nodes of this V1beta1BasicDevice. # noqa: E501112 :rtype: bool113 """114 return self._all_nodes115 116 @all_nodes.setter117 def all_nodes(self, all_nodes):118 """Sets the all_nodes of this V1beta1BasicDevice.119 120 AllNodes indicates that all nodes have access to the device. Must only be set if Spec.PerDeviceNodeSelection is set to true. At most one of NodeName, NodeSelector and AllNodes can be set. # noqa: E501121 122 :param all_nodes: The all_nodes of this V1beta1BasicDevice. # noqa: E501123 :type: bool124 """125 126 self._all_nodes = all_nodes127 128 @property129 def allow_multiple_allocations(self):130 """Gets the allow_multiple_allocations of this V1beta1BasicDevice. # noqa: E501131 132 AllowMultipleAllocations marks whether the device is allowed to be allocated to multiple DeviceRequests. If AllowMultipleAllocations is set to true, the device can be allocated more than once, and all of its capacity is consumable, regardless of whether the requestPolicy is defined or not. # noqa: E501133 134 :return: The allow_multiple_allocations of this V1beta1BasicDevice. # noqa: E501135 :rtype: bool136 """137 return self._allow_multiple_allocations138 139 @allow_multiple_allocations.setter140 def allow_multiple_allocations(self, allow_multiple_allocations):141 """Sets the allow_multiple_allocations of this V1beta1BasicDevice.142 143 AllowMultipleAllocations marks whether the device is allowed to be allocated to multiple DeviceRequests. If AllowMultipleAllocations is set to true, the device can be allocated more than once, and all of its capacity is consumable, regardless of whether the requestPolicy is defined or not. # noqa: E501144 145 :param allow_multiple_allocations: The allow_multiple_allocations of this V1beta1BasicDevice. # noqa: E501146 :type: bool147 """148 149 self._allow_multiple_allocations = allow_multiple_allocations150 151 @property152 def attributes(self):153 """Gets the attributes of this V1beta1BasicDevice. # noqa: E501154 155 Attributes defines the set of attributes for this device. The name of each attribute must be unique in that set. The maximum number of attributes and capacities combined is 32. # noqa: E501156 157 :return: The attributes of this V1beta1BasicDevice. # noqa: E501158 :rtype: dict(str, V1beta1DeviceAttribute)159 """160 return self._attributes161 162 @attributes.setter163 def attributes(self, attributes):164 """Sets the attributes of this V1beta1BasicDevice.165 166 Attributes defines the set of attributes for this device. The name of each attribute must be unique in that set. The maximum number of attributes and capacities combined is 32. # noqa: E501167 168 :param attributes: The attributes of this V1beta1BasicDevice. # noqa: E501169 :type: dict(str, V1beta1DeviceAttribute)170 """171 172 self._attributes = attributes173 174 @property175 def binding_conditions(self):176 """Gets the binding_conditions of this V1beta1BasicDevice. # noqa: E501177 178 BindingConditions defines the conditions for proceeding with binding. All of these conditions must be set in the per-device status conditions with a value of True to proceed with binding the pod to the node while scheduling the pod. The maximum number of binding conditions is 4. The conditions must be a valid condition type string. This is an alpha field and requires enabling the DRADeviceBindingConditions and DRAResourceClaimDeviceStatus feature gates. # noqa: E501179 180 :return: The binding_conditions of this V1beta1BasicDevice. # noqa: E501181 :rtype: list[str]182 """183 return self._binding_conditions184 185 @binding_conditions.setter186 def binding_conditions(self, binding_conditions):187 """Sets the binding_conditions of this V1beta1BasicDevice.188 189 BindingConditions defines the conditions for proceeding with binding. All of these conditions must be set in the per-device status conditions with a value of True to proceed with binding the pod to the node while scheduling the pod. The maximum number of binding conditions is 4. The conditions must be a valid condition type string. This is an alpha field and requires enabling the DRADeviceBindingConditions and DRAResourceClaimDeviceStatus feature gates. # noqa: E501190 191 :param binding_conditions: The binding_conditions of this V1beta1BasicDevice. # noqa: E501192 :type: list[str]193 """194 195 self._binding_conditions = binding_conditions196 197 @property198 def binding_failure_conditions(self):199 """Gets the binding_failure_conditions of this V1beta1BasicDevice. # noqa: E501200 201 BindingFailureConditions defines the conditions for binding failure. They may be set in the per-device status conditions. If any is true, a binding failure occurred. The maximum number of binding failure conditions is 4. The conditions must be a valid condition type string. This is an alpha field and requires enabling the DRADeviceBindingConditions and DRAResourceClaimDeviceStatus feature gates. # noqa: E501202 203 :return: The binding_failure_conditions of this V1beta1BasicDevice. # noqa: E501204 :rtype: list[str]205 """206 return self._binding_failure_conditions207 208 @binding_failure_conditions.setter209 def binding_failure_conditions(self, binding_failure_conditions):210 """Sets the binding_failure_conditions of this V1beta1BasicDevice.211 212 BindingFailureConditions defines the conditions for binding failure. They may be set in the per-device status conditions. If any is true, a binding failure occurred. The maximum number of binding failure conditions is 4. The conditions must be a valid condition type string. This is an alpha field and requires enabling the DRADeviceBindingConditions and DRAResourceClaimDeviceStatus feature gates. # noqa: E501213 214 :param binding_failure_conditions: The binding_failure_conditions of this V1beta1BasicDevice. # noqa: E501215 :type: list[str]216 """217 218 self._binding_failure_conditions = binding_failure_conditions219 220 @property221 def binds_to_node(self):222 """Gets the binds_to_node of this V1beta1BasicDevice. # noqa: E501223 224 BindsToNode indicates if the usage of an allocation involving this device has to be limited to exactly the node that was chosen when allocating the claim. If set to true, the scheduler will set the ResourceClaim.Status.Allocation.NodeSelector to match the node where the allocation was made. This is an alpha field and requires enabling the DRADeviceBindingConditions and DRAResourceClaimDeviceStatus feature gates. # noqa: E501225 226 :return: The binds_to_node of this V1beta1BasicDevice. # noqa: E501227 :rtype: bool228 """229 return self._binds_to_node230 231 @binds_to_node.setter232 def binds_to_node(self, binds_to_node):233 """Sets the binds_to_node of this V1beta1BasicDevice.234 235 BindsToNode indicates if the usage of an allocation involving this device has to be limited to exactly the node that was chosen when allocating the claim. If set to true, the scheduler will set the ResourceClaim.Status.Allocation.NodeSelector to match the node where the allocation was made. This is an alpha field and requires enabling the DRADeviceBindingConditions and DRAResourceClaimDeviceStatus feature gates. # noqa: E501236 237 :param binds_to_node: The binds_to_node of this V1beta1BasicDevice. # noqa: E501238 :type: bool239 """240 241 self._binds_to_node = binds_to_node242 243 @property244 def capacity(self):245 """Gets the capacity of this V1beta1BasicDevice. # noqa: E501246 247 Capacity defines the set of capacities for this device. The name of each capacity must be unique in that set. The maximum number of attributes and capacities combined is 32. # noqa: E501248 249 :return: The capacity of this V1beta1BasicDevice. # noqa: E501250 :rtype: dict(str, V1beta1DeviceCapacity)251 """252 return self._capacity253 254 @capacity.setter255 def capacity(self, capacity):256 """Sets the capacity of this V1beta1BasicDevice.257 258 Capacity defines the set of capacities for this device. The name of each capacity must be unique in that set. The maximum number of attributes and capacities combined is 32. # noqa: E501259 260 :param capacity: The capacity of this V1beta1BasicDevice. # noqa: E501261 :type: dict(str, V1beta1DeviceCapacity)262 """263 264 self._capacity = capacity265 266 @property267 def consumes_counters(self):268 """Gets the consumes_counters of this V1beta1BasicDevice. # noqa: E501269 270 ConsumesCounters defines a list of references to sharedCounters and the set of counters that the device will consume from those counter sets. There can only be a single entry per counterSet. The maximum number of device counter consumptions per device is 2. # noqa: E501271 272 :return: The consumes_counters of this V1beta1BasicDevice. # noqa: E501273 :rtype: list[V1beta1DeviceCounterConsumption]274 """275 return self._consumes_counters276 277 @consumes_counters.setter278 def consumes_counters(self, consumes_counters):279 """Sets the consumes_counters of this V1beta1BasicDevice.280 281 ConsumesCounters defines a list of references to sharedCounters and the set of counters that the device will consume from those counter sets. There can only be a single entry per counterSet. The maximum number of device counter consumptions per device is 2. # noqa: E501282 283 :param consumes_counters: The consumes_counters of this V1beta1BasicDevice. # noqa: E501284 :type: list[V1beta1DeviceCounterConsumption]285 """286 287 self._consumes_counters = consumes_counters288 289 @property290 def node_name(self):291 """Gets the node_name of this V1beta1BasicDevice. # noqa: E501292 293 NodeName identifies the node where the device is available. Must only be set if Spec.PerDeviceNodeSelection is set to true. At most one of NodeName, NodeSelector and AllNodes can be set. # noqa: E501294 295 :return: The node_name of this V1beta1BasicDevice. # noqa: E501296 :rtype: str297 """298 return self._node_name299 300 @node_name.setter301 def node_name(self, node_name):302 """Sets the node_name of this V1beta1BasicDevice.303 304 NodeName identifies the node where the device is available. Must only be set if Spec.PerDeviceNodeSelection is set to true. At most one of NodeName, NodeSelector and AllNodes can be set. # noqa: E501305 306 :param node_name: The node_name of this V1beta1BasicDevice. # noqa: E501307 :type: str308 """309 310 self._node_name = node_name311 312 @property313 def node_selector(self):314 """Gets the node_selector of this V1beta1BasicDevice. # noqa: E501315 316 317 :return: The node_selector of this V1beta1BasicDevice. # noqa: E501318 :rtype: V1NodeSelector319 """320 return self._node_selector321 322 @node_selector.setter323 def node_selector(self, node_selector):324 """Sets the node_selector of this V1beta1BasicDevice.325 326 327 :param node_selector: The node_selector of this V1beta1BasicDevice. # noqa: E501328 :type: V1NodeSelector329 """330 331 self._node_selector = node_selector332 333 @property334 def taints(self):335 """Gets the taints of this V1beta1BasicDevice. # noqa: E501336 337 If specified, these are the driver-defined taints. The maximum number of taints is 16. If taints are set for any device in a ResourceSlice, then the maximum number of allowed devices per ResourceSlice is 64 instead of 128. This is an alpha field and requires enabling the DRADeviceTaints feature gate. # noqa: E501338 339 :return: The taints of this V1beta1BasicDevice. # noqa: E501340 :rtype: list[V1beta1DeviceTaint]341 """342 return self._taints343 344 @taints.setter345 def taints(self, taints):346 """Sets the taints of this V1beta1BasicDevice.347 348 If specified, these are the driver-defined taints. The maximum number of taints is 16. If taints are set for any device in a ResourceSlice, then the maximum number of allowed devices per ResourceSlice is 64 instead of 128. This is an alpha field and requires enabling the DRADeviceTaints feature gate. # noqa: E501349 350 :param taints: The taints of this V1beta1BasicDevice. # noqa: E501351 :type: list[V1beta1DeviceTaint]352 """353 354 self._taints = taints355 356 def to_dict(self):357 """Returns the model properties as a dict"""358 result = {}359 360 for attr, _ in six.iteritems(self.openapi_types):361 value = getattr(self, attr)362 if isinstance(value, list):363 result[attr] = list(map(364 lambda x: x.to_dict() if hasattr(x, "to_dict") else x,365 value366 ))367 elif hasattr(value, "to_dict"):368 result[attr] = value.to_dict()369 elif isinstance(value, dict):370 result[attr] = dict(map(371 lambda item: (item[0], item[1].to_dict())372 if hasattr(item[1], "to_dict") else item,373 value.items()374 ))375 else:376 result[attr] = value377 378 return result379 380 def to_str(self):381 """Returns the string representation of the model"""382 return pprint.pformat(self.to_dict())383 384 def __repr__(self):385 """For `print` and `pprint`"""386 return self.to_str()387 388 def __eq__(self, other):389 """Returns true if both objects are equal"""390 if not isinstance(other, V1beta1BasicDevice):391 return False392 393 return self.to_dict() == other.to_dict()394 395 def __ne__(self, other):396 """Returns true if both objects are not equal"""397 if not isinstance(other, V1beta1BasicDevice):398 return True399 400 return self.to_dict() != other.to_dict()401 