Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes14kdownloads
v1_device.py430 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 V1Device(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, V1DeviceAttribute)',39        'binding_conditions': 'list[str]',40        'binding_failure_conditions': 'list[str]',41        'binds_to_node': 'bool',42        'capacity': 'dict(str, V1DeviceCapacity)',43        'consumes_counters': 'list[V1DeviceCounterConsumption]',44        'name': 'str',45        'node_name': 'str',46        'node_selector': 'V1NodeSelector',47        'taints': 'list[V1DeviceTaint]'48    }49 50    attribute_map = {51        'all_nodes': 'allNodes',52        'allow_multiple_allocations': 'allowMultipleAllocations',53        'attributes': 'attributes',54        'binding_conditions': 'bindingConditions',55        'binding_failure_conditions': 'bindingFailureConditions',56        'binds_to_node': 'bindsToNode',57        'capacity': 'capacity',58        'consumes_counters': 'consumesCounters',59        'name': 'name',60        'node_name': 'nodeName',61        'node_selector': 'nodeSelector',62        'taints': 'taints'63    }64 65    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, name=None, node_name=None, node_selector=None, taints=None, local_vars_configuration=None):  # noqa: E50166        """V1Device - 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._all_nodes = None72        self._allow_multiple_allocations = None73        self._attributes = None74        self._binding_conditions = None75        self._binding_failure_conditions = None76        self._binds_to_node = None77        self._capacity = None78        self._consumes_counters = None79        self._name = None80        self._node_name = None81        self._node_selector = None82        self._taints = None83        self.discriminator = None84 85        if all_nodes is not None:86            self.all_nodes = all_nodes87        if allow_multiple_allocations is not None:88            self.allow_multiple_allocations = allow_multiple_allocations89        if attributes is not None:90            self.attributes = attributes91        if binding_conditions is not None:92            self.binding_conditions = binding_conditions93        if binding_failure_conditions is not None:94            self.binding_failure_conditions = binding_failure_conditions95        if binds_to_node is not None:96            self.binds_to_node = binds_to_node97        if capacity is not None:98            self.capacity = capacity99        if consumes_counters is not None:100            self.consumes_counters = consumes_counters101        self.name = name102        if node_name is not None:103            self.node_name = node_name104        if node_selector is not None:105            self.node_selector = node_selector106        if taints is not None:107            self.taints = taints108 109    @property110    def all_nodes(self):111        """Gets the all_nodes of this V1Device.  # noqa: E501112 113        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: E501114 115        :return: The all_nodes of this V1Device.  # noqa: E501116        :rtype: bool117        """118        return self._all_nodes119 120    @all_nodes.setter121    def all_nodes(self, all_nodes):122        """Sets the all_nodes of this V1Device.123 124        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: E501125 126        :param all_nodes: The all_nodes of this V1Device.  # noqa: E501127        :type: bool128        """129 130        self._all_nodes = all_nodes131 132    @property133    def allow_multiple_allocations(self):134        """Gets the allow_multiple_allocations of this V1Device.  # noqa: E501135 136        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: E501137 138        :return: The allow_multiple_allocations of this V1Device.  # noqa: E501139        :rtype: bool140        """141        return self._allow_multiple_allocations142 143    @allow_multiple_allocations.setter144    def allow_multiple_allocations(self, allow_multiple_allocations):145        """Sets the allow_multiple_allocations of this V1Device.146 147        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: E501148 149        :param allow_multiple_allocations: The allow_multiple_allocations of this V1Device.  # noqa: E501150        :type: bool151        """152 153        self._allow_multiple_allocations = allow_multiple_allocations154 155    @property156    def attributes(self):157        """Gets the attributes of this V1Device.  # noqa: E501158 159        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: E501160 161        :return: The attributes of this V1Device.  # noqa: E501162        :rtype: dict(str, V1DeviceAttribute)163        """164        return self._attributes165 166    @attributes.setter167    def attributes(self, attributes):168        """Sets the attributes of this V1Device.169 170        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: E501171 172        :param attributes: The attributes of this V1Device.  # noqa: E501173        :type: dict(str, V1DeviceAttribute)174        """175 176        self._attributes = attributes177 178    @property179    def binding_conditions(self):180        """Gets the binding_conditions of this V1Device.  # noqa: E501181 182        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: E501183 184        :return: The binding_conditions of this V1Device.  # noqa: E501185        :rtype: list[str]186        """187        return self._binding_conditions188 189    @binding_conditions.setter190    def binding_conditions(self, binding_conditions):191        """Sets the binding_conditions of this V1Device.192 193        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: E501194 195        :param binding_conditions: The binding_conditions of this V1Device.  # noqa: E501196        :type: list[str]197        """198 199        self._binding_conditions = binding_conditions200 201    @property202    def binding_failure_conditions(self):203        """Gets the binding_failure_conditions of this V1Device.  # noqa: E501204 205        BindingFailureConditions defines the conditions for binding failure. They may be set in the per-device status conditions. If any is set to \"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: E501206 207        :return: The binding_failure_conditions of this V1Device.  # noqa: E501208        :rtype: list[str]209        """210        return self._binding_failure_conditions211 212    @binding_failure_conditions.setter213    def binding_failure_conditions(self, binding_failure_conditions):214        """Sets the binding_failure_conditions of this V1Device.215 216        BindingFailureConditions defines the conditions for binding failure. They may be set in the per-device status conditions. If any is set to \"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: E501217 218        :param binding_failure_conditions: The binding_failure_conditions of this V1Device.  # noqa: E501219        :type: list[str]220        """221 222        self._binding_failure_conditions = binding_failure_conditions223 224    @property225    def binds_to_node(self):226        """Gets the binds_to_node of this V1Device.  # noqa: E501227 228        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: E501229 230        :return: The binds_to_node of this V1Device.  # noqa: E501231        :rtype: bool232        """233        return self._binds_to_node234 235    @binds_to_node.setter236    def binds_to_node(self, binds_to_node):237        """Sets the binds_to_node of this V1Device.238 239        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: E501240 241        :param binds_to_node: The binds_to_node of this V1Device.  # noqa: E501242        :type: bool243        """244 245        self._binds_to_node = binds_to_node246 247    @property248    def capacity(self):249        """Gets the capacity of this V1Device.  # noqa: E501250 251        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: E501252 253        :return: The capacity of this V1Device.  # noqa: E501254        :rtype: dict(str, V1DeviceCapacity)255        """256        return self._capacity257 258    @capacity.setter259    def capacity(self, capacity):260        """Sets the capacity of this V1Device.261 262        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: E501263 264        :param capacity: The capacity of this V1Device.  # noqa: E501265        :type: dict(str, V1DeviceCapacity)266        """267 268        self._capacity = capacity269 270    @property271    def consumes_counters(self):272        """Gets the consumes_counters of this V1Device.  # noqa: E501273 274        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: E501275 276        :return: The consumes_counters of this V1Device.  # noqa: E501277        :rtype: list[V1DeviceCounterConsumption]278        """279        return self._consumes_counters280 281    @consumes_counters.setter282    def consumes_counters(self, consumes_counters):283        """Sets the consumes_counters of this V1Device.284 285        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: E501286 287        :param consumes_counters: The consumes_counters of this V1Device.  # noqa: E501288        :type: list[V1DeviceCounterConsumption]289        """290 291        self._consumes_counters = consumes_counters292 293    @property294    def name(self):295        """Gets the name of this V1Device.  # noqa: E501296 297        Name is unique identifier among all devices managed by the driver in the pool. It must be a DNS label.  # noqa: E501298 299        :return: The name of this V1Device.  # noqa: E501300        :rtype: str301        """302        return self._name303 304    @name.setter305    def name(self, name):306        """Sets the name of this V1Device.307 308        Name is unique identifier among all devices managed by the driver in the pool. It must be a DNS label.  # noqa: E501309 310        :param name: The name of this V1Device.  # noqa: E501311        :type: str312        """313        if self.local_vars_configuration.client_side_validation and name is None:  # noqa: E501314            raise ValueError("Invalid value for `name`, must not be `None`")  # noqa: E501315 316        self._name = name317 318    @property319    def node_name(self):320        """Gets the node_name of this V1Device.  # noqa: E501321 322        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: E501323 324        :return: The node_name of this V1Device.  # noqa: E501325        :rtype: str326        """327        return self._node_name328 329    @node_name.setter330    def node_name(self, node_name):331        """Sets the node_name of this V1Device.332 333        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: E501334 335        :param node_name: The node_name of this V1Device.  # noqa: E501336        :type: str337        """338 339        self._node_name = node_name340 341    @property342    def node_selector(self):343        """Gets the node_selector of this V1Device.  # noqa: E501344 345 346        :return: The node_selector of this V1Device.  # noqa: E501347        :rtype: V1NodeSelector348        """349        return self._node_selector350 351    @node_selector.setter352    def node_selector(self, node_selector):353        """Sets the node_selector of this V1Device.354 355 356        :param node_selector: The node_selector of this V1Device.  # noqa: E501357        :type: V1NodeSelector358        """359 360        self._node_selector = node_selector361 362    @property363    def taints(self):364        """Gets the taints of this V1Device.  # noqa: E501365 366        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: E501367 368        :return: The taints of this V1Device.  # noqa: E501369        :rtype: list[V1DeviceTaint]370        """371        return self._taints372 373    @taints.setter374    def taints(self, taints):375        """Sets the taints of this V1Device.376 377        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: E501378 379        :param taints: The taints of this V1Device.  # noqa: E501380        :type: list[V1DeviceTaint]381        """382 383        self._taints = taints384 385    def to_dict(self):386        """Returns the model properties as a dict"""387        result = {}388 389        for attr, _ in six.iteritems(self.openapi_types):390            value = getattr(self, attr)391            if isinstance(value, list):392                result[attr] = list(map(393                    lambda x: x.to_dict() if hasattr(x, "to_dict") else x,394                    value395                ))396            elif hasattr(value, "to_dict"):397                result[attr] = value.to_dict()398            elif isinstance(value, dict):399                result[attr] = dict(map(400                    lambda item: (item[0], item[1].to_dict())401                    if hasattr(item[1], "to_dict") else item,402                    value.items()403                ))404            else:405                result[attr] = value406 407        return result408 409    def to_str(self):410        """Returns the string representation of the model"""411        return pprint.pformat(self.to_dict())412 413    def __repr__(self):414        """For `print` and `pprint`"""415        return self.to_str()416 417    def __eq__(self, other):418        """Returns true if both objects are equal"""419        if not isinstance(other, V1Device):420            return False421 422        return self.to_dict() == other.to_dict()423 424    def __ne__(self, other):425        """Returns true if both objects are not equal"""426        if not isinstance(other, V1Device):427            return True428 429        return self.to_dict() != other.to_dict()430