Advance simulation and evaluate assertions
curl --request POST \
--url http://localhost:3917/probe \
--header 'Content-Type: application/json' \
--data '
{
"ticks": 1,
"assertions": [
"<string>"
],
"snapshot_after": true,
"snapshot_before": true
}
'import requests
url = "http://localhost:3917/probe"
payload = {
"ticks": 1,
"assertions": ["<string>"],
"snapshot_after": True,
"snapshot_before": True
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
ticks: 1,
assertions: ['<string>'],
snapshot_after: true,
snapshot_before: true
})
};
fetch('http://localhost:3917/probe', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "3917",
CURLOPT_URL => "http://localhost:3917/probe",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'ticks' => 1,
'assertions' => [
'<string>'
],
'snapshot_after' => true,
'snapshot_before' => true
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "http://localhost:3917/probe"
payload := strings.NewReader("{\n \"ticks\": 1,\n \"assertions\": [\n \"<string>\"\n ],\n \"snapshot_after\": true,\n \"snapshot_before\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("http://localhost:3917/probe")
.header("Content-Type", "application/json")
.body("{\n \"ticks\": 1,\n \"assertions\": [\n \"<string>\"\n ],\n \"snapshot_after\": true,\n \"snapshot_before\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:3917/probe")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"ticks\": 1,\n \"assertions\": [\n \"<string>\"\n ],\n \"snapshot_after\": true,\n \"snapshot_before\": true\n}"
response = http.request(request)
puts response.read_bodySnapshots and probes
Advance simulation and evaluate assertions
Body: {
"ticks": 300, // how many ticks to advance (0 = evaluate at current state)
"assertions": ["hero-alive", "towers-attack"], // optional: only evaluate named assertions
"snapshot_before": true, // optional: capture a snapshot before advancing
"snapshot_after": true, // optional: capture a snapshot after advancing
}
POST
/
probe
Advance simulation and evaluate assertions
curl --request POST \
--url http://localhost:3917/probe \
--header 'Content-Type: application/json' \
--data '
{
"ticks": 1,
"assertions": [
"<string>"
],
"snapshot_after": true,
"snapshot_before": true
}
'import requests
url = "http://localhost:3917/probe"
payload = {
"ticks": 1,
"assertions": ["<string>"],
"snapshot_after": True,
"snapshot_before": True
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
ticks: 1,
assertions: ['<string>'],
snapshot_after: true,
snapshot_before: true
})
};
fetch('http://localhost:3917/probe', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "3917",
CURLOPT_URL => "http://localhost:3917/probe",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'ticks' => 1,
'assertions' => [
'<string>'
],
'snapshot_after' => true,
'snapshot_before' => true
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "http://localhost:3917/probe"
payload := strings.NewReader("{\n \"ticks\": 1,\n \"assertions\": [\n \"<string>\"\n ],\n \"snapshot_after\": true,\n \"snapshot_before\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("http://localhost:3917/probe")
.header("Content-Type", "application/json")
.body("{\n \"ticks\": 1,\n \"assertions\": [\n \"<string>\"\n ],\n \"snapshot_after\": true,\n \"snapshot_before\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:3917/probe")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"ticks\": 1,\n \"assertions\": [\n \"<string>\"\n ],\n \"snapshot_after\": true,\n \"snapshot_before\": true\n}"
response = http.request(request)
puts response.read_bodyBody
application/json
Request body for POST /probe.
Number of ticks to advance before evaluating assertions.
Required range:
x >= 0Optional subset of assertion names to evaluate (all, if omitted).
Capture a snapshot after advancing.
Capture a snapshot before advancing.
Response
200 - application/json
Simulation advanced + assertions evaluated in one call.