Appearance
Learning and positive model API Since v0.1
Suggestions are never applied without an approve call. For the keys, see Files, positive model, virtual patches and validation policy.
For the base URL, sign-in, roles and error format, see Management API. Except sign-in, a route answers 401 without credentials and 403 when the role is too low.
Routes
Positive model
| Method | Path | Minimum role | What it does | Main fields |
|---|---|---|---|---|
GET | /v1/apps/{name}/positive | viewer | Returns positive model settings. | Returns the current values with base_version. |
PUT | /v1/apps/{name}/positive | operator | Changes positive model settings. | Body: set (key to value; empty string resets the key), base_version (required), comment, dry_run. |
GET | /v1/apps/{name}/learning | viewer | Returns learning status and counts. | none |
POST | /v1/apps/{name}/learning/reset | operator | Clears what the model has learned. | none |
GET | /v1/apps/{name}/learning/model | viewer | Returns the learned model. | none |
GET | /v1/apps/{name}/learning/model/endpoint | viewer | Returns the learned model of one endpoint. | none |
GET | /v1/apps/{name}/learning/violations | viewer | Lists requests the model flagged. | none |
GET | /v1/apps/{name}/learning/events/{id} | viewer | Returns one flagged request with its recorded samples. Viewers see masked samples. | none |
Suggestions
| Method | Path | Minimum role | What it does | Main fields |
|---|---|---|---|---|
GET | /v1/apps/{name}/learning/suggestions | viewer | Lists suggested model changes. | none |
POST | /v1/apps/{name}/learning/suggestions/preview | viewer | Shows the effect of suggestions on past traffic. | Body: days, enforcement. |
POST | /v1/apps/{name}/learning/suggestions/approve | operator | Adds approved suggestions to the configuration. | Body: ids, all, rules, base_version, comment, dry_run. |
POST | /v1/apps/{name}/learning/suggestions/reject | operator | Rejects suggestions so they are not offered again. | Body: ids. |
POST | /v1/apps/{name}/learning/suggestions/restore | operator | Restores rejected suggestions. | Body: ids. |
Learned schemas
| Method | Path | Minimum role | What it does | Main fields |
|---|---|---|---|---|
GET | /v1/apps/{name}/learning/schema Since v0.2 | viewer | Returns the schemas learned per endpoint. | none |
GET | /v1/apps/{name}/learning/schema/openapi Since v0.2 | viewer | Exports the learned schemas as an OpenAPI description. | none |
GET | /v1/apps/{name}/learning/schema/suggestions Since v0.2 | viewer | Lists suggested schemas. | none |
POST | /v1/apps/{name}/learning/schema/suggestions/approve Since v0.2 | operator | Adds approved schemas to the configuration. | Body: ids, all, base_version, comment, dry_run. |
POST | /v1/apps/{name}/learning/schema/suggestions/reject Since v0.2 | operator | Rejects suggested schemas. | Body: ids, all. |
POST | /v1/apps/{name}/learning/schema/suggestions/restore Since v0.2 | operator | Restores rejected schemas. | Body: ids, all. |
Example
sh
curl -sk -H "Authorization: Bearer waap_EXAMPLE" https://127.0.0.1:9443/v1/apps/shop/learning/suggestions