This page describe the simulator's HTTP API endpoint.
get current scheduler configuration.
GET /api/v1/schedulerconfiguration
code | description |
---|---|
200 |
update scheduler configuration and restart scheduler with new configuration.
POST /api/v1/schedulerconfiguration
empty
code | description |
---|---|
202 | |
500 | something went wrong (see logs of the simulator server) |
clean up all resources and restore the initial scheduler configuration.
(If you didn't pass the initial scheduler configuration via KUBE_SCHEDULER_CONFIG_PATH
, the default scheduler configuration will be restored.)
PUT /api/v1/reset
empty
empty
code | description |
---|---|
202 | |
500 | something went wrong (see logs of the simulator server) |
Get all resources and current scheduler configuration.
GET /api/v1/export
You can find sample requests/responses here
code | description |
---|---|
200 | |
500 | something went wrong (see logs of the simulator server) |
Apply resources and scheduler configuration.
POST /api/v1/import
You can find sample requests/responses here
code | description |
---|---|
200 | |
500 | something went wrong (see logs of the simulator server) |
Watch individual changes to all k8s resources in the simulator. This endpoint uses Server-Sent Events
.
Once this API is called, the server will be continuously sending WatchEvent every time the event happens.
GET /api/v1/listwatchresources
You can specify the lastResourceVersion
of each resource, which can be retrieved using the list
API of each resource.
If you won't specify it, this API calls the list
and returns the result as "ADDED" Events before starting watch.
We recommend to call the list
API before the calling and to use XXXlastResourceVersion
parameters.
The ResourceVersion
must be treated as opaque by clients and passed unmodified back to the server.
See also this page.
parameter | requirement | description |
---|---|---|
podslastResourceVersion | OPTIONAL | If not specified, all resources are returned as ADDED Events first and then start to watch. |
nodeslastResourceVersion | OPTIONAL | If not specified, all resources are returned as ADDED Events first and then start to watch. |
pvslastResourceVersion | OPTIONAL | If not specified, all resources are returned as ADDED Events first and then start to watch. |
pvcslastResourceVersion | OPTIONAL | If not specified, all resources are returned as ADDED Events first and then start to watch. |
scslastResourceVersion | OPTIONAL | If not specified, all resources are returned as ADDED Events first and then start to watch. |
pcslastResourceVersion | OPTIONAL | If not specified, all resources are returned as ADDED Events first and then start to watch. |
e.g.)
/api/v1/listwatchresources?podslastResourceVersion=213&nodeslastResourceVersion=213&pvslastResourceVersion=213&pvcslastResourceVersion=213&scslastResourceVersion=213&pcslastResourceVersion=213
code | description |
---|---|
200 | The response is server push. You should catch the WatchEvent and then handle the data each by each. |