node_file
Manage Docker node files in GNS3 labs by reading, writing, and configuring network interfaces with an automatic node restart to apply changes.
Instructions
Manage Docker node files (CRUD operations)
v0.47.0: CRUD-style consolidation of get_node_file, write_node_file, and configure_node_network.
Actions: - read: Read file from Docker node filesystem - write: Write file to Docker node filesystem (WARNING: does NOT restart node) - configure_network: Configure network interfaces (full workflow: write + restart)
IMPORTANT: Use 'configure_network' for network configuration as it handles the complete workflow (write config → restart node → apply changes).
Returns: JSON with file contents, confirmation message, or configured interfaces
Examples: # Read file >>> node_file(action="read", node_name="A-PROXY", file_path="etc/network/interfaces")
# Write file
>>> node_file(action="write", node_name="A-PROXY",
... file_path="etc/network/interfaces",
... content="auto eth0\niface eth0 inet dhcp")
# Configure network (recommended)
>>> node_file(action="configure_network", node_name="A-PROXY", interfaces=[{
... "name": "eth0",
... "mode": "static",
... "address": "10.199.0.254",
... "netmask": "255.255.255.0",
... "gateway": "10.199.0.1"
... }])Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| action | Yes | Action: 'read' (get file), 'write' (update file), or 'configure_network' (network config workflow) | |
| content | No | File contents (required for 'write') | |
| file_path | No | Path relative to container root (required for 'read' and 'write') | |
| node_name | Yes | Name of the Docker node | |
| interfaces | No | List of interface configs (required for 'configure_network') |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |