{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/firecracker/json-schema/firecracker-partial-pmem-schema.json",
  "title": "PartialPmem",
  "description": "Defines a partial pmem device structure, used to update the rate limiter for that device, after microvm start.",
  "x-generated": "2026-11-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/firecracker-pmem-api-openapi.yml#/components/schemas/PartialPmem",
  "type": "object",
  "required": [
    "id"
  ],
  "properties": {
    "id": {
      "type": "string"
    },
    "rate_limiter": {
      "$ref": "#/$defs/RateLimiter"
    }
  },
  "$defs": {
    "RateLimiter": {
      "type": "object",
      "description": "Defines an IO rate limiter with independent bytes/s and ops/s limits. Limits are defined by configuring each of the _bandwidth_ and _ops_ token buckets. This field is optional for virtio-block config and should be omitted for vhost-user-block configuration.",
      "properties": {
        "bandwidth": {
          "$ref": "#/$defs/TokenBucket",
          "description": "Token bucket with bytes as tokens"
        },
        "ops": {
          "$ref": "#/$defs/TokenBucket",
          "description": "Token bucket with operations as tokens"
        }
      }
    },
    "TokenBucket": {
      "type": "object",
      "description": "Defines a token bucket with a maximum capacity (size), an initial burst size (one_time_burst) and an interval for refilling purposes (refill_time). The refill-rate is derived from size and refill_time, and it is the constant rate at which the tokens replenish. The refill process only starts happening after the initial burst budget is consumed. Consumption from the token bucket is unbounded in speed which allows for bursts bound in size by the amount of tokens available. Once the token bucket is empty, consumption speed is bound by the refill_rate.",
      "required": [
        "refill_time",
        "size"
      ],
      "properties": {
        "one_time_burst": {
          "type": "integer",
          "format": "int64",
          "description": "The initial size of a token bucket.",
          "minimum": 0
        },
        "refill_time": {
          "type": "integer",
          "format": "int64",
          "description": "The amount of milliseconds it takes for the bucket to refill.",
          "minimum": 0
        },
        "size": {
          "type": "integer",
          "format": "int64",
          "description": "The total number of tokens this bucket can hold.",
          "minimum": 0
        }
      }
    }
  }
}