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 V1ResourceSliceSpec(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 'devices': 'list[V1Device]',38 'driver': 'str',39 'node_name': 'str',40 'node_selector': 'V1NodeSelector',41 'per_device_node_selection': 'bool',42 'pool': 'V1ResourcePool',43 'shared_counters': 'list[V1CounterSet]'44 }45 46 attribute_map = {47 'all_nodes': 'allNodes',48 'devices': 'devices',49 'driver': 'driver',50 'node_name': 'nodeName',51 'node_selector': 'nodeSelector',52 'per_device_node_selection': 'perDeviceNodeSelection',53 'pool': 'pool',54 'shared_counters': 'sharedCounters'55 }56 57 def __init__(self, all_nodes=None, devices=None, driver=None, node_name=None, node_selector=None, per_device_node_selection=None, pool=None, shared_counters=None, local_vars_configuration=None): # noqa: E50158 """V1ResourceSliceSpec - 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._all_nodes = None64 self._devices = None65 self._driver = None66 self._node_name = None67 self._node_selector = None68 self._per_device_node_selection = None69 self._pool = None70 self._shared_counters = None71 self.discriminator = None72 73 if all_nodes is not None:74 self.all_nodes = all_nodes75 if devices is not None:76 self.devices = devices77 self.driver = driver78 if node_name is not None:79 self.node_name = node_name80 if node_selector is not None:81 self.node_selector = node_selector82 if per_device_node_selection is not None:83 self.per_device_node_selection = per_device_node_selection84 self.pool = pool85 if shared_counters is not None:86 self.shared_counters = shared_counters87 88 @property89 def all_nodes(self):90 """Gets the all_nodes of this V1ResourceSliceSpec. # noqa: E50191 92 AllNodes indicates that all nodes have access to the resources in the pool. Exactly one of NodeName, NodeSelector, AllNodes, and PerDeviceNodeSelection must be set. # noqa: E50193 94 :return: The all_nodes of this V1ResourceSliceSpec. # noqa: E50195 :rtype: bool96 """97 return self._all_nodes98 99 @all_nodes.setter100 def all_nodes(self, all_nodes):101 """Sets the all_nodes of this V1ResourceSliceSpec.102 103 AllNodes indicates that all nodes have access to the resources in the pool. Exactly one of NodeName, NodeSelector, AllNodes, and PerDeviceNodeSelection must be set. # noqa: E501104 105 :param all_nodes: The all_nodes of this V1ResourceSliceSpec. # noqa: E501106 :type: bool107 """108 109 self._all_nodes = all_nodes110 111 @property112 def devices(self):113 """Gets the devices of this V1ResourceSliceSpec. # noqa: E501114 115 Devices lists some or all of the devices in this pool. Must not have more than 128 entries. If any device uses taints or consumes counters the limit is 64. Only one of Devices and SharedCounters can be set in a ResourceSlice. # noqa: E501116 117 :return: The devices of this V1ResourceSliceSpec. # noqa: E501118 :rtype: list[V1Device]119 """120 return self._devices121 122 @devices.setter123 def devices(self, devices):124 """Sets the devices of this V1ResourceSliceSpec.125 126 Devices lists some or all of the devices in this pool. Must not have more than 128 entries. If any device uses taints or consumes counters the limit is 64. Only one of Devices and SharedCounters can be set in a ResourceSlice. # noqa: E501127 128 :param devices: The devices of this V1ResourceSliceSpec. # noqa: E501129 :type: list[V1Device]130 """131 132 self._devices = devices133 134 @property135 def driver(self):136 """Gets the driver of this V1ResourceSliceSpec. # noqa: E501137 138 Driver identifies the DRA driver providing the capacity information. A field selector can be used to list only ResourceSlice objects with a certain driver name. Must be a DNS subdomain and should end with a DNS domain owned by the vendor of the driver. It should use only lower case characters. This field is immutable. # noqa: E501139 140 :return: The driver of this V1ResourceSliceSpec. # noqa: E501141 :rtype: str142 """143 return self._driver144 145 @driver.setter146 def driver(self, driver):147 """Sets the driver of this V1ResourceSliceSpec.148 149 Driver identifies the DRA driver providing the capacity information. A field selector can be used to list only ResourceSlice objects with a certain driver name. Must be a DNS subdomain and should end with a DNS domain owned by the vendor of the driver. It should use only lower case characters. This field is immutable. # noqa: E501150 151 :param driver: The driver of this V1ResourceSliceSpec. # noqa: E501152 :type: str153 """154 if self.local_vars_configuration.client_side_validation and driver is None: # noqa: E501155 raise ValueError("Invalid value for `driver`, must not be `None`") # noqa: E501156 157 self._driver = driver158 159 @property160 def node_name(self):161 """Gets the node_name of this V1ResourceSliceSpec. # noqa: E501162 163 NodeName identifies the node which provides the resources in this pool. A field selector can be used to list only ResourceSlice objects belonging to a certain node. This field can be used to limit access from nodes to ResourceSlices with the same node name. It also indicates to autoscalers that adding new nodes of the same type as some old node might also make new resources available. Exactly one of NodeName, NodeSelector, AllNodes, and PerDeviceNodeSelection must be set. This field is immutable. # noqa: E501164 165 :return: The node_name of this V1ResourceSliceSpec. # noqa: E501166 :rtype: str167 """168 return self._node_name169 170 @node_name.setter171 def node_name(self, node_name):172 """Sets the node_name of this V1ResourceSliceSpec.173 174 NodeName identifies the node which provides the resources in this pool. A field selector can be used to list only ResourceSlice objects belonging to a certain node. This field can be used to limit access from nodes to ResourceSlices with the same node name. It also indicates to autoscalers that adding new nodes of the same type as some old node might also make new resources available. Exactly one of NodeName, NodeSelector, AllNodes, and PerDeviceNodeSelection must be set. This field is immutable. # noqa: E501175 176 :param node_name: The node_name of this V1ResourceSliceSpec. # noqa: E501177 :type: str178 """179 180 self._node_name = node_name181 182 @property183 def node_selector(self):184 """Gets the node_selector of this V1ResourceSliceSpec. # noqa: E501185 186 187 :return: The node_selector of this V1ResourceSliceSpec. # noqa: E501188 :rtype: V1NodeSelector189 """190 return self._node_selector191 192 @node_selector.setter193 def node_selector(self, node_selector):194 """Sets the node_selector of this V1ResourceSliceSpec.195 196 197 :param node_selector: The node_selector of this V1ResourceSliceSpec. # noqa: E501198 :type: V1NodeSelector199 """200 201 self._node_selector = node_selector202 203 @property204 def per_device_node_selection(self):205 """Gets the per_device_node_selection of this V1ResourceSliceSpec. # noqa: E501206 207 PerDeviceNodeSelection defines whether the access from nodes to resources in the pool is set on the ResourceSlice level or on each device. If it is set to true, every device defined the ResourceSlice must specify this individually. Exactly one of NodeName, NodeSelector, AllNodes, and PerDeviceNodeSelection must be set. # noqa: E501208 209 :return: The per_device_node_selection of this V1ResourceSliceSpec. # noqa: E501210 :rtype: bool211 """212 return self._per_device_node_selection213 214 @per_device_node_selection.setter215 def per_device_node_selection(self, per_device_node_selection):216 """Sets the per_device_node_selection of this V1ResourceSliceSpec.217 218 PerDeviceNodeSelection defines whether the access from nodes to resources in the pool is set on the ResourceSlice level or on each device. If it is set to true, every device defined the ResourceSlice must specify this individually. Exactly one of NodeName, NodeSelector, AllNodes, and PerDeviceNodeSelection must be set. # noqa: E501219 220 :param per_device_node_selection: The per_device_node_selection of this V1ResourceSliceSpec. # noqa: E501221 :type: bool222 """223 224 self._per_device_node_selection = per_device_node_selection225 226 @property227 def pool(self):228 """Gets the pool of this V1ResourceSliceSpec. # noqa: E501229 230 231 :return: The pool of this V1ResourceSliceSpec. # noqa: E501232 :rtype: V1ResourcePool233 """234 return self._pool235 236 @pool.setter237 def pool(self, pool):238 """Sets the pool of this V1ResourceSliceSpec.239 240 241 :param pool: The pool of this V1ResourceSliceSpec. # noqa: E501242 :type: V1ResourcePool243 """244 if self.local_vars_configuration.client_side_validation and pool is None: # noqa: E501245 raise ValueError("Invalid value for `pool`, must not be `None`") # noqa: E501246 247 self._pool = pool248 249 @property250 def shared_counters(self):251 """Gets the shared_counters of this V1ResourceSliceSpec. # noqa: E501252 253 SharedCounters defines a list of counter sets, each of which has a name and a list of counters available. The names of the counter sets must be unique in the ResourcePool. Only one of Devices and SharedCounters can be set in a ResourceSlice. The maximum number of counter sets is 8. # noqa: E501254 255 :return: The shared_counters of this V1ResourceSliceSpec. # noqa: E501256 :rtype: list[V1CounterSet]257 """258 return self._shared_counters259 260 @shared_counters.setter261 def shared_counters(self, shared_counters):262 """Sets the shared_counters of this V1ResourceSliceSpec.263 264 SharedCounters defines a list of counter sets, each of which has a name and a list of counters available. The names of the counter sets must be unique in the ResourcePool. Only one of Devices and SharedCounters can be set in a ResourceSlice. The maximum number of counter sets is 8. # noqa: E501265 266 :param shared_counters: The shared_counters of this V1ResourceSliceSpec. # noqa: E501267 :type: list[V1CounterSet]268 """269 270 self._shared_counters = shared_counters271 272 def to_dict(self):273 """Returns the model properties as a dict"""274 result = {}275 276 for attr, _ in six.iteritems(self.openapi_types):277 value = getattr(self, attr)278 if isinstance(value, list):279 result[attr] = list(map(280 lambda x: x.to_dict() if hasattr(x, "to_dict") else x,281 value282 ))283 elif hasattr(value, "to_dict"):284 result[attr] = value.to_dict()285 elif isinstance(value, dict):286 result[attr] = dict(map(287 lambda item: (item[0], item[1].to_dict())288 if hasattr(item[1], "to_dict") else item,289 value.items()290 ))291 else:292 result[attr] = value293 294 return result295 296 def to_str(self):297 """Returns the string representation of the model"""298 return pprint.pformat(self.to_dict())299 300 def __repr__(self):301 """For `print` and `pprint`"""302 return self.to_str()303 304 def __eq__(self, other):305 """Returns true if both objects are equal"""306 if not isinstance(other, V1ResourceSliceSpec):307 return False308 309 return self.to_dict() == other.to_dict()310 311 def __ne__(self, other):312 """Returns true if both objects are not equal"""313 if not isinstance(other, V1ResourceSliceSpec):314 return True315 316 return self.to_dict() != other.to_dict()317 