pt_server_http
Toggles HTTP/HTTPS services and replaces the content of existing pages on a Packet Tracer Server-PT device, letting you edit served web pages directly.
Instructions
A Server-PT's Services > HTTP: switches HTTP/HTTPS and edits pages.
pages: {"index.html": "..."} replaces the content of pages that ALREADY exist on the server (a Server-PT has index.html). New pages cannot be created: PT 9.0.0 answers "File not exist" (9.0.1 unverified). Such a page comes back in not_applied with ok=false; the other pages and switches are still applied.
enable / https_enable: True/False/None (None = leave alone); enable defaults to True.
PT 9.0.0 hangs and crashes if one call turns HTTP/HTTPS on or writes pages while both are off, so such a call changes nothing and returns ok=false: turn one on in the server's Services > HTTP tab first. Turning things off is always allowed. Check it with pt_web_browser(host, "http://").
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"device": "<device>"
},
"name": "pt_server_http"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| show | No | ||
| pages | No | ||
| device | Yes | ||
| enable | No | ||
| capture | No | ||
| output_dir | No | screenshots | |
| https_enable | No |