save_network
Persist edited EPANET network state to an INP or .net file, re-validating through the engine before writing. Allows later reload with load_network.
Instructions
Write the current state of a loaded network (including any set_* edits applied so far) to a file in the server's data directory: EPANET INP text (format 'inp', default) or the app's .net container (format 'net', which embeds the INP text — load_network reads both). The model is re-validated through the EPANET engine before writing, and existing files are not overwritten unless overwrite: true. Use this to persist edits: after saving, load_network can read the file back on a fresh session or server restart.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| format | No | Output format: 'inp' (EPANET text, the default) or 'net' (the app's .net container, which embeds the INP text). | |
| networkId | Yes | The network id returned by load_network. | |
| overwrite | No | Allow replacing an existing file. Default false: saving over an existing file is refused unless this is true. | |
| outputFile | No | File name to write, relative to the server's data directory (absolute paths must still resolve inside it). Defaults to '<networkId>.inp' (or '<networkId>.net' for format 'net'). |