Server & Run Routes

1figure
4min read
Sheet 38 of 47 · Automation

The routes that start and stop processes, talk to the server, batch calls, stream events, and run scenarios, crawls, recorders and load runs. Some of them need the API token. On this sheet that is /start, /run, /stop, /console, /shutdown, /takeover, /release, /rcon, /batch, /server/install-agent and some other /server/... routes, /scenario/save, /scenario/run, /diff/snapshot, /visual/check, /record/scenario/start, /record/scenario/stop and /load/start. The rest, /crawl and /crawl/start included, work without it. The full list is on HTTP API.

The Processes page, the window side of the process routes.
The Processes page with server Start and Stop, a client launcher, a Run a command box and one running Paper server holding 1.1 GB

Processes

EndpointParametersReturns
/processesmanaged processes with their RAM trees
/startwhat=server or client (user, w, h for the client)the new process
/runcmd, dirruns a command. Gradle launches get --no-daemon, and gradlew in a dir with a wrapper jar starts the jar directly
/stopid, kill=1 to skip the graceful stop
/consolec, optional id of another process, wait=500sends a line to the server console, returns the output that followed
/takeover, /releasebotsee Takeover. The first takeover downloads the client, so give it a long timeout. /takeover returns the client version, proxied and the serverVersion the proxy talks to
/screenshotbot, scale=1 (0.05 to 1), save=1a PNG of the takeover client window, or with save=1 the saved file's path
/record/startbot, fps=10 (1 to 20), scale=0.5, max=60 (s, up to 300)starts a GIF recording of the client window
/record/stopbot, save=1the GIF, or with save=1 its path and frame count. A recording that hit max or lost its window still comes back here
/status, /shutdowntool state, and a clean exit

Config keysession.lockThe server guard refuses to start a server when its port is already taken or its world session.lock is held.

Server, RCON, batches and events

EndpointParametersReturns
/server/<endpoint>see Server Agentthe agent's answer
/server/install-agentdir (a plugins folder)where the agent jar went, its config.yml gets the tool's agent token
/rconcthe command's output over RCON
/batch (POST)body [{"path": "/act", "params": {...}}, ...], stopOnError=1one result per call, run in order in one request
/eventsbot, types=chat,packet,hud, filter (packet name part), seconds=60server-sent events, one data: {json} line per chat line, packet or HUD event

/batch saves round trips when several calls belong together. Inside it every call that fails still answers {"error":"..."} in the list.

Scenarios over HTTP

EndpointParameters
/scenario/list
/scenario/getname
/scenario/save (POST)name ending in .json, .yml or .yaml (the extension picks the format), the scenario as the body
/scenario/runname, or the scenario as a POST body with format=yml for YAML. timeout=600 (s), after which the run is cancelled

Whole folders run through /suite/run, see Short Loop & Result Cache.

Crawler, diff, recorder and load runs

EndpointParametersReturns
/crawlbot, root (one command, or several split by |), depth=2, skip (regex), allow (regex), safe=1, maxMenus=150, mode=events|fixed, commandWait=2500, clickWait=2000, settle=60, pages=10, next, previous, pageLore=0, prompt, answers, answer=cancel, timeout=1800 (s)the graph, once the crawl ends
/crawl/startsame as /crawl{"job":"crawl-1",...} right away
/crawl/statusjobstate, progress, and stats and errors once done
/crawl/resultjobthe graph of a finished crawl
/crawl/canceljobstops the crawl, what it found so far stays
/crawl/jobsevery crawl this session
/crawl/exportjob or snapshot, format=explorer|studio|graph, namewebsite explorer JSON, a GUI Studio project, or the raw graph
/diff/snapshotname, then job or the /crawl parameterscrawls (or takes a finished crawl) and saves it under the name
/diff/listsaved snapshots
/diff/comparea, b, format=json|text|htmlwhat changed from a to b
/visual/checkjob or snapshot, baseline (folder), update=1, renderUrl, report (folder), tolerance=0 (percent), threshold=24, scale=2the visual report, see Visual regression
/record/scenario/startbot, name, by=name|slotstarts recording that bot
/record/scenario/stopbotsaves the scenario and returns its YAML
/record/scenario/statusbots being recorded and their step counts
/load/startcount, pattern=Load_{n}, actions, cmd, duration=60s, interval=3s, stagger=250, health=auto, host, port{"job":"load-1",...}
/load/statusjob, default the latestprogress and live numbers
/load/stopjobends the run early, the report is still written
/load/reportjob, format=json|htmlthe finished report
/jobsevery crawl and load job

What each run does is on its own sheet:

Loading the index

Enter openUp Down moveEsc close