diff --git a/vmm/src/api/openapi/cloud-hypervisor.yaml b/vmm/src/api/openapi/cloud-hypervisor.yaml index d515b0c91..d1f344b15 100644 --- a/vmm/src/api/openapi/cloud-hypervisor.yaml +++ b/vmm/src/api/openapi/cloud-hypervisor.yaml @@ -607,6 +607,48 @@ components: args: type: string + TokenBucket: + required: + - size + - refill_time + type: object + properties: + size: + type: integer + format: int64 + minimum: 0 + description: The total number of tokens this bucket can hold. + one_time_burst: + type: integer + format: int64 + minimum: 0 + description: The initial size of a token bucket. + refill_time: + type: integer + format: int64 + minimum: 0 + description: The amount of milliseconds it takes for the bucket to refill. + 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. + + RateLimiterConfig: + type: object + properties: + bandwidth: + $ref: '#/components/schemas/TokenBucket' + ops: + $ref: '#/components/schemas/TokenBucket' + 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. + DiskConfig: required: - path @@ -637,6 +679,8 @@ components: poll_queue: type: boolean default: true + rate_limiter_config: + $ref: '#/components/schemas/RateLimiterConfig' id: type: string