{
  "description": "Device represents one individual hardware instance that can be selected based on its attributes. Besides the name, exactly one field must be set.",
  "properties": {
    "allNodes": {
      "description": "AllNodes indicates that all nodes have access to the device.\n\nMust only be set if Spec.PerDeviceNodeSelection is set to true. At most one of NodeName, NodeSelector and AllNodes can be set.",
      "type": [
        "boolean",
        "null"
      ]
    },
    "allowMultipleAllocations": {
      "description": "AllowMultipleAllocations marks whether the device is allowed to be allocated to multiple DeviceRequests.\n\nIf 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.",
      "type": [
        "boolean",
        "null"
      ]
    },
    "attributes": {
      "additionalProperties": {
        "description": "DeviceAttribute must have exactly one field set.",
        "properties": {
          "bool": {
            "description": "BoolValue is a true/false value.",
            "type": [
              "boolean",
              "null"
            ]
          },
          "bools": {
            "description": "BoolValues is a non-empty list of true/false values.",
            "items": {
              "type": [
                "boolean",
                "null"
              ]
            },
            "type": [
              "array",
              "null"
            ],
            "x-kubernetes-list-type": "atomic"
          },
          "int": {
            "description": "IntValue is a number.",
            "format": "int64",
            "type": [
              "integer",
              "null"
            ]
          },
          "ints": {
            "description": "IntValues is a non-empty list of numbers.\n\nThis is an alpha field and requires enabling the DRAListTypeAttributes feature gate.",
            "items": {
              "format": "int64",
              "type": [
                "integer",
                "null"
              ]
            },
            "type": [
              "array",
              "null"
            ],
            "x-kubernetes-list-type": "atomic"
          },
          "string": {
            "description": "StringValue is a string. Must not be longer than 64 characters.",
            "type": [
              "string",
              "null"
            ]
          },
          "strings": {
            "description": "StringValues is a non-empty list of strings. Each string must not be longer than 64 characters.\n\nThis is an alpha field and requires enabling the DRAListTypeAttributes feature gate.",
            "items": {
              "type": [
                "string",
                "null"
              ]
            },
            "type": [
              "array",
              "null"
            ],
            "x-kubernetes-list-type": "atomic"
          },
          "version": {
            "description": "VersionValue is a semantic version according to semver.org spec 2.0.0. Must not be longer than 64 characters.",
            "type": [
              "string",
              "null"
            ]
          },
          "versions": {
            "description": "VersionValues is a non-empty list of semantic versions according to semver.org spec 2.0.0. Each version string must not be longer than 64 characters.\n\nThis is an alpha field and requires enabling the DRAListTypeAttributes feature gate.",
            "items": {
              "type": [
                "string",
                "null"
              ]
            },
            "type": [
              "array",
              "null"
            ],
            "x-kubernetes-list-type": "atomic"
          }
        },
        "type": [
          "object",
          "null"
        ]
      },
      "description": "Attributes defines the set of attributes for this device. The name of each attribute must be unique in that set.\n\nThe maximum number of attributes and capacities combined is 32.",
      "type": [
        "object",
        "null"
      ]
    },
    "bindingConditions": {
      "description": "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.\n\nThe maximum number of binding conditions is 4.\n\nThe conditions must be a valid condition type string.\n\nThis is a beta field and requires enabling the DRADeviceBindingConditions and DRAResourceClaimDeviceStatus feature gates.",
      "items": {
        "type": [
          "string",
          "null"
        ]
      },
      "type": [
        "array",
        "null"
      ],
      "x-kubernetes-list-type": "atomic"
    },
    "bindingFailureConditions": {
      "description": "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.\n\nThe maximum number of binding failure conditions is 4.\n\nThe conditions must be a valid condition type string.\n\nThis is a beta field and requires enabling the DRADeviceBindingConditions and DRAResourceClaimDeviceStatus feature gates.",
      "items": {
        "type": [
          "string",
          "null"
        ]
      },
      "type": [
        "array",
        "null"
      ],
      "x-kubernetes-list-type": "atomic"
    },
    "bindsToNode": {
      "description": "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.\n\nThis is a beta field and requires enabling the DRADeviceBindingConditions and DRAResourceClaimDeviceStatus feature gates.",
      "type": [
        "boolean",
        "null"
      ]
    },
    "capacity": {
      "additionalProperties": {
        "description": "DeviceCapacity describes a quantity associated with a device.",
        "properties": {
          "requestPolicy": {
            "description": "CapacityRequestPolicy defines how requests consume device capacity.\n\nMust not set more than one ValidRequestValues.",
            "properties": {
              "default": {
                "oneOf": [
                  {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  {
                    "type": [
                      "number",
                      "null"
                    ]
                  }
                ]
              },
              "validRange": {
                "description": "CapacityRequestPolicyRange defines a valid range for consumable capacity values.\n\nIf the DRAFractionalCapacityRange feature gate is enabled and at least one of Min, Max, or Step is a fractional quantity (i.e. its value is not an integer), milli-unit arithmetic is used instead, supporting values with up to 3 decimal places (e.g. 100m = 0.1). The largest supported value then is 1000 times smaller compared to using 64-bit integers. Otherwise, all comparisons use 64-bit integer arithmetic via resource.Quantity.Value().\n\n  - If the requested amount is less than Min, it is rounded up to the Min value.\n  - If Step is set and the requested amount is between Min and Max but not aligned with Step,\n    it will be rounded up to the next value equal to Min + (n * Step).\n  - If Step is not set, the requested amount is used as-is if it falls within the range Min to Max (if set).\n  - If the requested or rounded amount exceeds Max (if set), the request does not satisfy the policy,\n    and the device cannot be allocated.",
                "properties": {
                  "max": {
                    "oneOf": [
                      {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      {
                        "type": [
                          "number",
                          "null"
                        ]
                      }
                    ]
                  },
                  "min": {
                    "oneOf": [
                      {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      {
                        "type": [
                          "number",
                          "null"
                        ]
                      }
                    ]
                  },
                  "step": {
                    "oneOf": [
                      {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      {
                        "type": [
                          "number",
                          "null"
                        ]
                      }
                    ]
                  }
                },
                "required": [
                  "min"
                ],
                "type": [
                  "object",
                  "null"
                ]
              },
              "validValues": {
                "description": "ValidValues defines a set of acceptable quantity values in consuming requests.\n\nMust not contain more than 10 entries. Must be sorted in ascending order.\n\nIf this field is set, Default must be defined and it must be included in ValidValues list.\n\nIf the requested amount does not match any valid value but smaller than some valid values, the scheduler calculates the smallest valid value that is greater than or equal to the request. That is: min(ceil(requestedValue) \u2208 validValues), where requestedValue \u2264 max(validValues).\n\nIf the requested amount exceeds all valid values, the request violates the policy, and this device cannot be allocated.",
                "items": {
                  "oneOf": [
                    {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    {
                      "type": [
                        "number",
                        "null"
                      ]
                    }
                  ]
                },
                "type": [
                  "array",
                  "null"
                ],
                "x-kubernetes-list-type": "atomic"
              }
            },
            "type": [
              "object",
              "null"
            ]
          },
          "value": {
            "oneOf": [
              {
                "type": [
                  "string",
                  "null"
                ]
              },
              {
                "type": [
                  "number",
                  "null"
                ]
              }
            ]
          }
        },
        "required": [
          "value"
        ],
        "type": [
          "object",
          "null"
        ]
      },
      "description": "Capacity defines the set of capacities for this device. The name of each capacity must be unique in that set.\n\nThe maximum number of attributes and capacities combined is 32.",
      "type": [
        "object",
        "null"
      ]
    },
    "consumesCounters": {
      "description": "ConsumesCounters defines a list of references to sharedCounters and the set of counters that the device will consume from those counter sets.\n\nThere can only be a single entry per counterSet.\n\nThe maximum number of device counter consumptions per device is 2.",
      "items": {
        "description": "DeviceCounterConsumption defines a set of counters that a device will consume from a CounterSet.",
        "properties": {
          "compatibilityGroups": {
            "description": "CompatibilityGroups is a list of opaque group names for this counter set consumption.\n\nDevices that consume counters from the same counter set may only be allocated at the same time (\"co-allocated\") if they all share at least one common group: the intersection of the CompatibilityGroups of all co-allocated devices on that counter set must be non-empty. Devices that consume from different counter sets are never compared via this field.\n\nAn unset field, an explicit nil, and an empty list are equivalent and mean \"no groups\": such a device is only co-allocatable with sibling devices on the same counter set that also have no groups, and is never co-allocatable with a device that declares one or more groups.\n\nGroup names are opaque and meaningful only within the publishing driver's pool.\n\nThe maximum number of groups is 2, and the names must be unique.",
            "items": {
              "type": [
                "string",
                "null"
              ]
            },
            "type": [
              "array",
              "null"
            ],
            "x-kubernetes-list-type": "atomic"
          },
          "counterSet": {
            "description": "CounterSet is the name of the set from which the counters defined will be consumed.",
            "type": "string"
          },
          "counters": {
            "additionalProperties": {
              "description": "Counter describes a quantity associated with a device.",
              "properties": {
                "value": {
                  "oneOf": [
                    {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    {
                      "type": [
                        "number",
                        "null"
                      ]
                    }
                  ]
                }
              },
              "required": [
                "value"
              ],
              "type": [
                "object",
                "null"
              ]
            },
            "description": "Counters defines the counters that will be consumed by the device.\n\nThe maximum number of counters is 32.",
            "type": "object"
          }
        },
        "required": [
          "counterSet",
          "counters"
        ],
        "type": [
          "object",
          "null"
        ]
      },
      "type": [
        "array",
        "null"
      ],
      "x-kubernetes-list-type": "atomic"
    },
    "name": {
      "description": "Name is unique identifier among all devices managed by the driver in the pool. It must be a DNS label.",
      "type": [
        "string",
        "null"
      ]
    },
    "nodeAllocatableResources": {
      "additionalProperties": {
        "description": "NodeAllocatableResource defines the translation between the DRA device/capacity units requested to the corresponding quantity of the node allocatable resource. At least one of Mapping or Overhead must be specified. Not specifying either is an invalid configuration.",
        "properties": {
          "mapping": {
            "description": "NodeAllocatableMapping defines how a DRA allocation directly translates into a node allocatable resource quantity. The mapping can be derived from either the count of allocated devices (via deviceMultiplier) or the specific capacity consumed (via capacityKey and capacityMultiplier). These options are mutually exclusive. Kubelet adds this mapped resource quantity from claim to both requests and limits at the pod-level cgroup, and to limits at the container-level cgroup for each container referencing the claim.",
            "properties": {
              "capacityKey": {
                "description": "CapacityKey references a capacity name defined as a key in the `spec.devices[*].capacity` map. When this field is set, the value associated with this key in the `status.allocation.devices.results[*].consumedCapacity` map (for a specific claim allocation) determines the base quantity for the node allocatable resource. `capacityMultiplier` must also be set and is multiplied with the base quantity. For example, if `spec.devices[*].capacity` has an entry \"dra.example.com/memory\": \"128Gi\", and this field is set to \"dra.example.com/memory\", then for a claim allocation that consumes { \"dra.example.com/memory\": \"4Gi\" } the base quantity for the node allocatable resource mapping will be \"4Gi\". The final node allocatable resource amount is `consumedCapacity[capacityKey]` * `capacityMultiplier`.",
                "type": [
                  "string",
                  "null"
                ]
              },
              "capacityMultiplier": {
                "oneOf": [
                  {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  {
                    "type": [
                      "number",
                      "null"
                    ]
                  }
                ]
              },
              "deviceMultiplier": {
                "oneOf": [
                  {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  {
                    "type": [
                      "number",
                      "null"
                    ]
                  }
                ]
              }
            },
            "type": [
              "object",
              "null"
            ]
          },
          "overhead": {
            "description": "NodeAllocatableOverhead defines auxiliary resource overheads incurred when allocating a device. Overheads can be specified as a fixed cost per pod referencing the claim, a variable cost per container reference, or both. Kubelet accounts for this overhead by adding it to both the pod-level and container-level cgroups of referencing containers.",
            "properties": {
              "perContainer": {
                "oneOf": [
                  {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  {
                    "type": [
                      "number",
                      "null"
                    ]
                  }
                ]
              },
              "perPod": {
                "oneOf": [
                  {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  {
                    "type": [
                      "number",
                      "null"
                    ]
                  }
                ]
              }
            },
            "type": [
              "object",
              "null"
            ]
          }
        },
        "type": [
          "object",
          "null"
        ]
      },
      "description": "NodeAllocatableResources defines the mapping of node resources that are managed by the DRA driver exposing this device. This includes resources currently reported in v1.Node `status.allocatable` that are not extended resources (see https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#extended-resources). Examples include \"cpu\", \"memory\", \"ephemeral-storage\", and hugepages. In addition to standard requests made through the Pod `spec`, these resources can also be requested through claims and allocated by the DRA driver. For example, a CPU DRA driver might allocate exclusive CPUs or auxiliary node memory dependencies of an accelerator device. The keys of this map are the node-allocatable resource names (e.g., \"cpu\", \"memory\"). Extended resource names are not permitted as keys.",
      "type": [
        "object",
        "null"
      ]
    },
    "nodeName": {
      "description": "NodeName identifies the node where the device is available.\n\nMust only be set if Spec.PerDeviceNodeSelection is set to true. At most one of NodeName, NodeSelector and AllNodes can be set.",
      "type": [
        "string",
        "null"
      ]
    },
    "nodeSelector": {
      "description": "A node selector represents the union of the results of one or more label queries over a set of nodes; that is, it represents the OR of the selectors represented by the node selector terms.",
      "properties": {
        "nodeSelectorTerms": {
          "description": "Required. A list of node selector terms. The terms are ORed.",
          "items": {
            "description": "A null or empty node selector term matches no objects. The requirements of them are ANDed. The TopologySelectorTerm type implements a subset of the NodeSelectorTerm.",
            "properties": {
              "matchExpressions": {
                "description": "A list of node selector requirements by node's labels.",
                "items": {
                  "description": "A node selector requirement is a selector that contains values, a key, and an operator that relates the key and values.",
                  "properties": {
                    "key": {
                      "description": "The label key that the selector applies to.",
                      "type": "string"
                    },
                    "operator": {
                      "description": "Represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists, DoesNotExist. Gt, and Lt.",
                      "type": "string"
                    },
                    "values": {
                      "description": "An array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. If the operator is Gt or Lt, the values array must have a single element, which will be interpreted as an integer. This array is replaced during a strategic merge patch.",
                      "items": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "type": [
                        "array",
                        "null"
                      ],
                      "x-kubernetes-list-type": "atomic"
                    }
                  },
                  "required": [
                    "key",
                    "operator"
                  ],
                  "type": [
                    "object",
                    "null"
                  ]
                },
                "type": [
                  "array",
                  "null"
                ],
                "x-kubernetes-list-type": "atomic"
              },
              "matchFields": {
                "description": "A list of node selector requirements by node's fields.",
                "items": {
                  "description": "A node selector requirement is a selector that contains values, a key, and an operator that relates the key and values.",
                  "properties": {
                    "key": {
                      "description": "The label key that the selector applies to.",
                      "type": "string"
                    },
                    "operator": {
                      "description": "Represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists, DoesNotExist. Gt, and Lt.",
                      "type": "string"
                    },
                    "values": {
                      "description": "An array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. If the operator is Gt or Lt, the values array must have a single element, which will be interpreted as an integer. This array is replaced during a strategic merge patch.",
                      "items": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "type": [
                        "array",
                        "null"
                      ],
                      "x-kubernetes-list-type": "atomic"
                    }
                  },
                  "required": [
                    "key",
                    "operator"
                  ],
                  "type": [
                    "object",
                    "null"
                  ]
                },
                "type": [
                  "array",
                  "null"
                ],
                "x-kubernetes-list-type": "atomic"
              }
            },
            "type": [
              "object",
              "null"
            ],
            "x-kubernetes-map-type": "atomic"
          },
          "type": "array",
          "x-kubernetes-list-type": "atomic"
        }
      },
      "required": [
        "nodeSelectorTerms"
      ],
      "type": [
        "object",
        "null"
      ],
      "x-kubernetes-map-type": "atomic"
    },
    "taints": {
      "description": "If specified, these are the driver-defined taints.\n\nThe 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.\n\nThis is a beta field and requires enabling the DRADeviceTaints feature gate.",
      "items": {
        "description": "The device this taint is attached to has the \"effect\" on any claim which does not tolerate the taint and, through the claim, to pods using the claim.",
        "properties": {
          "effect": {
            "description": "The effect of the taint on claims that do not tolerate the taint and through such claims on the pods using them.\n\nValid effects are None, NoSchedule and NoExecute. PreferNoSchedule as used for nodes is not valid here. More effects may get added in the future. Consumers must treat unknown effects like None.",
            "type": "string"
          },
          "key": {
            "description": "The taint key to be applied to a device. Must be a label name.",
            "type": "string"
          },
          "timeAdded": {
            "description": "Time is a wrapper around time.Time which supports correct marshaling to YAML and JSON.  Wrappers are provided for many of the factory methods that the time package offers.",
            "format": "date-time",
            "type": [
              "string",
              "null"
            ]
          },
          "value": {
            "description": "The taint value corresponding to the taint key. Must be a label value.",
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "key",
          "effect"
        ],
        "type": [
          "object",
          "null"
        ]
      },
      "type": [
        "array",
        "null"
      ],
      "x-kubernetes-list-type": "atomic"
    }
  },
  "required": [
    "name"
  ],
  "type": "object",
  "$schema": "http://json-schema.org/schema#"
}