Skip to content

Commit

Permalink
docs: rest api
Browse files Browse the repository at this point in the history
  • Loading branch information
bbortt committed Nov 5, 2023
1 parent ea302f2 commit 6164b1e
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 0 deletions.
1 change: 1 addition & 0 deletions simulator-docs/src/main/asciidoc/concepts.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ The simulator automatically loads Spring beans defined in the following location
All beans delineated within these files are seamlessly integrated into the simulator's Spring application context upon loading. This process ensures that all necessary configurations are applied to facilitate the desired behavior of the simulator.
Furthermore, customizations and additional beans can be added to adapt to more complex scenarios or to extend the simulator's capabilities beyond its default configuration set.

include::rest-api.adoc[]
include::scenario-mapper.adoc[]
include::scenarios.adoc[]
include::intermediate-messages.adoc[]
52 changes: 52 additions & 0 deletions simulator-docs/src/main/asciidoc/rest-api.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
[[rest-api]]
== REST API

The simulator comes with an extensive REST API.
Each single entity can be listed and searched through using it.
The following default resources are present:

* `/api/messages`
* `/api/message-headers`
* `/api/scenario-actions`
* `/api/scenario-executions`
* `/api/scenario-parameters`
* `/api/test-parameters`
* `/api/test-results`

For each of the listed resources it is possible to:

* List ALL results using a `GET /` request to the root URI
* Pagination is possible
* Filtering is possible
* Simply count ALL results using the `GET /count` endpoint
* Receive a SINGLE resource when calling the `GET /{id}` endpoint

All REST resources follow this pattern, except a few listed in the following chapter.

[[receive-single-test-result]]
=== Receive SINGLE Test-Parameter

The `TestParameter` entity is identified by a composite key, consisting of the `TestResult` ID and the `TestParameter` key.
Therefore, in order to receive a SINGLE `TestParameter` use can use the `GET /{testResultId}/{key}` endpoint.

[[scenario-resource]]
=== Scenario Resource

The `Scenario` REST resource is an exception as well.
By default, the `GET /` endpoint returns a list of scenarios.
The mainly consist of their unique name, although they each also have a type indicating if it is a `SimulatorScenario` (type: `MESSAGE_TRIGGERED`) or `ScenarioStarter` (type: `STARTER`).
The REST resource supports pagination, but not filtering.

This REST resource has no SINGLE resource endpoint, because that would not offer any more details.
However, you can directly see the parameters of a scenario when calling the `GET /{scenarioName}/parameters` endpoint.

Additionally, you can launch scenarios using the `POST /{scenarioName}/launch` endpoint.
It accepts an array of scenario parameters in the request body.

[[rest-api-pagination]]
=== Pagination



[[rest-api-filtering]]
=== Filtering

0 comments on commit 6164b1e

Please sign in to comment.