Reference For: developers

API: traffic

Operations of the traffic tag of the native REST API.

Monthly traffic per VM and tenant, limits, threshold webhooks, throttling and extra packages (L-127)

GET /v1/tenants/{tenant}/network-usage

Network usage of a tenant in a period: traffic per server, public addresses per server (merged into GET /v1/tenants/{t}/usage by the tenancy module).

CLI
kyvernon traffic tenant <tenant>

Parameters

NameInTypeRequiredDescription
tenantpathstringyesId of the tenant (tenant-N)
monthquerystring or nullPeriod that starts in this month (YYYY-MM); absent: the current one.

Responses

StatusDescriptionSchema
200OKTenantNetworkUsage
503Temporarily unavailable (not the leader, or the service is off)ErrorBody

GET /v1/traffic

Monthly traffic per VM and per tenant.

CLI
kyvernon traffic report

Parameters

NameInTypeRequiredDescription
tenantquerystring or nullOnly this tenant (its anchor day applies).
vmquerystring or nullOnly this VM.
monthquerystring or nullPeriod that starts in this month (YYYY-MM); absent: the current one.

Responses

StatusDescriptionSchema
200OKTrafficReport
400Invalid argument; the error body names the fieldErrorBody
503Temporarily unavailable (not the leader, or the service is off)ErrorBody

GET /v1/vms/{id}/traffic

A VM's traffic in a period: totals, limit, throttle state and bytes per day.

CLI
kyvernon traffic vm <vm>

Parameters

NameInTypeRequiredDescription
idpathstringyesId of the virtual machine (vm-N)
monthquerystring or nullPeriod that starts in this month (YYYY-MM); absent: the current one.

Responses

StatusDescriptionSchema
200OKVmTrafficView
503Temporarily unavailable (not the leader, or the service is off)ErrorBody

POST /v1/vms/{id}/traffic-packages

Adds an extra traffic package to the VM's current period (raises the limit; lifts a throttle when the new limit is above the use).

CLI
kyvernon traffic package <vm> --bytes <n>

Parameters

NameInTypeRequiredDescription
idpathstringyesId of the virtual machine (vm-N)

Request body

application/json: PackageBody

NameTypeRequiredDescription
bytesinteger (int64)yesBytes added to the current period's limit.
referencestring or nullOrder reference; the same reference adds a package once per period.

Responses

StatusDescriptionSchema
200OKTrafficPolicy
412Failed precondition; the error body says whichErrorBody

GET /v1/vms/{id}/traffic-policy

The traffic limit of a VM.

CLI
kyvernon traffic policy get <vm>

Parameters

NameInTypeRequiredDescription
idpathstringyesId of the virtual machine (vm-N)

Responses

StatusDescriptionSchema
200OKTrafficPolicy
404Not found (or not visible to the caller)ErrorBody

PUT /v1/vms/{id}/traffic-policy

Sets the traffic limit of a VM (from its plan).

CLI
kyvernon traffic policy set <vm>

Parameters

NameInTypeRequiredDescription
idpathstringyesId of the virtual machine (vm-N)

Request body

application/json: PolicyInput

NameTypeRequiredDescription
actionTrafficActionAction at 100 %.
anchorDayinteger (int32) or nullAnchor day (1 to 28); absent: the tenant's or the 1st.
monthlyLimitBytesinteger (int64) or nullBytes per period; absent: no limit.
tenantstring or nullTenant (events).
throttleKbpsinteger (int64) or nullThrottle rate (kbit/s); absent: the site default.

Responses

StatusDescriptionSchema
200OKTrafficPolicy
400Invalid argument; the error body names the fieldErrorBody

DELETE /v1/vms/{id}/traffic-policy

Removes the traffic limit of a VM (accounting continues; a throttle is lifted).

CLI
kyvernon traffic policy delete <vm>

Parameters

NameInTypeRequiredDescription
idpathstringyesId of the virtual machine (vm-N)

Responses

StatusDescriptionSchema
204Done; no body

Version 0.1.