ResourceQuantity

pydantic model controller.models.v1.lab.ResourceQuantity

A Kubernetes resource request or limit.

Parameters:

data (Any)

Show JSON schema
{
   "title": "ResourceQuantity",
   "description": "A Kubernetes resource request or limit.",
   "type": "object",
   "properties": {
      "cpu": {
         "description": "Number of CPU cores",
         "examples": [
            1.5
         ],
         "title": "CPU",
         "type": "number"
      },
      "memory": {
         "description": "Amount of memory in bytes. Also accepts strings with SI suffixes, which will be converted to bytes. Be sure to use the suffix with ``i`` to indicate powers of two (1024 rather than 1000) if that is desired.",
         "examples": [
            1073741824,
            "1Gi"
         ],
         "title": "Memory",
         "type": "integer"
      }
   },
   "required": [
      "cpu",
      "memory"
   ]
}

Fields:
field cpu: Annotated[float, Field(title='CPU', description='Number of CPU cores', examples=[1.5])] [Required]

Number of CPU cores

field memory: Annotated[int, Field(title='Memory', description='Amount of memory in bytes. Also accepts strings with SI suffixes, which will be converted to bytes. Be sure to use the suffix with i to indicate powers of two (1024 rather than 1000) if that is desired.', examples=[1073741824, '1Gi']), BeforeValidator(lambda v: memory_to_bytes(v) if isinstance(v, str) else v)] [Required]

Amount of memory in bytes. Also accepts strings with SI suffixes, which will be converted to bytes. Be sure to use the suffix with i to indicate powers of two (1024 rather than 1000) if that is desired.

Constraints:
  • func = <function <lambda> at 0x7f78b8f93c40>

  • json_schema_input_type = PydanticUndefined