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
| Name | In | Type | Required | Description |
|---|
tenant | path | string | yes | Id of the tenant (tenant-N) |
|---|
month | query | string or null | | Period that starts in this month (YYYY-MM); absent: the current one. |
|---|
Responses
GET /v1/traffic
Monthly traffic per VM and per tenant.
- CLI
kyvernon traffic report
Parameters
| Name | In | Type | Required | Description |
|---|
tenant | query | string or null | | Only this tenant (its anchor day applies). |
|---|
vm | query | string or null | | Only this VM. |
|---|
month | query | string or null | | Period that starts in this month (YYYY-MM); absent: the current one. |
|---|
Responses
| Status | Description | Schema |
|---|
| 200 | OK | TrafficReport |
|---|
| 400 | Invalid argument; the error body names the field | ErrorBody |
|---|
| 503 | Temporarily 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
| Name | In | Type | Required | Description |
|---|
id | path | string | yes | Id of the virtual machine (vm-N) |
|---|
month | query | string or null | | Period that starts in this month (YYYY-MM); absent: the current one. |
|---|
Responses
| Status | Description | Schema |
|---|
| 200 | OK | VmTrafficView |
|---|
| 503 | Temporarily 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
| Name | In | Type | Required | Description |
|---|
id | path | string | yes | Id of the virtual machine (vm-N) |
|---|
Request body
application/json: PackageBody
| Name | Type | Required | Description |
|---|
bytes | integer (int64) | yes | Bytes added to the current period's limit. |
|---|
reference | string or null | | Order reference; the same reference adds a package once per period. |
|---|
Responses
GET /v1/vms/{id}/traffic-policy
The traffic limit of a VM.
- CLI
kyvernon traffic policy get <vm>
Parameters
| Name | In | Type | Required | Description |
|---|
id | path | string | yes | Id of the virtual machine (vm-N) |
|---|
Responses
PUT /v1/vms/{id}/traffic-policy
Sets the traffic limit of a VM (from its plan).
- CLI
kyvernon traffic policy set <vm>
Parameters
| Name | In | Type | Required | Description |
|---|
id | path | string | yes | Id of the virtual machine (vm-N) |
|---|
Request body
application/json: PolicyInput
| Name | Type | Required | Description |
|---|
action | TrafficAction | | Action at 100 %. |
|---|
anchorDay | integer (int32) or null | | Anchor day (1 to 28); absent: the tenant's or the 1st. |
|---|
monthlyLimitBytes | integer (int64) or null | | Bytes per period; absent: no limit. |
|---|
tenant | string or null | | Tenant (events). |
|---|
throttleKbps | integer (int64) or null | | Throttle rate (kbit/s); absent: the site default. |
|---|
Responses
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
| Name | In | Type | Required | Description |
|---|
id | path | string | yes | Id of the virtual machine (vm-N) |
|---|
Responses
| Status | Description | Schema |
|---|
| 204 | Done; no body | |
|---|
Version 0.1.