node
Perform CRUD operations on GNS3 nodes: list, create, delete, and set state (start, stop, suspend, reload, restart). Supports wildcard patterns for bulk operations.
Instructions
Manage GNS3 nodes (CRUD operations)
v0.47.0: CRUD-style consolidation of create_node, delete_node, and set_node. v0.40.0: Enhanced with wildcard and bulk operation support.
Actions: - list: List nodes in a project - create: Create new node from template at specified coordinates - delete: Delete node from project (WARNING: destructive, cannot be undone) - set: Configure node properties and/or control state (supports wildcards/bulk)
Wildcard Patterns (for 'set' and 'delete'): - Single node: "Router1" - All nodes: "" - Prefix match: "Router" (matches Router1, Router2, RouterCore) - Suffix match: "*-Core" (matches Router-Core, Switch-Core) - Character class: "R[123]" (matches R1, R2, R3) - JSON array: '["Router1", "Router2", "Switch1"]'
Validation Rules: - name parameter requires node to be stopped - Hardware properties (ram, cpus, hdd_disk_image, adapters) apply to QEMU/IOU/Docker/Dynamips - For IOU nodes, 'adapters' maps to 'ethernet_adapters' automatically - ports parameter applies to ethernet_switch nodes only - state_action values: start, stop, suspend, reload, restart
Returns: Single node: Status message Multiple nodes: BatchOperationResult JSON with per-node success/failure
Examples: # List nodes in project >>> node(action="list", project_id="abc-123") >>> node(action="list", project_id="abc-123", format="json")
# Create new node
>>> node(action="create", template_name="Alpine Linux", x=100, y=200)
>>> node(action="create", template_name="Cisco IOSv", x=300, y=400, node_name="R1", properties={"ram": 1024})
# Delete node
>>> node(action="delete", node_name="Router1")
# Start all nodes
>>> node(action="set", node_name="*", state_action="start")
# Stop all routers
>>> node(action="set", node_name="Router*", state_action="stop")
# Configure node properties
>>> node(action="set", node_name="R1", x=100, y=200, ram=2048)Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| x | No | X coordinate (top-left corner of node icon) | |
| y | No | Y coordinate (top-left corner of node icon) | |
| z | No | Z-order layer for overlapping nodes | |
| ram | No | RAM in MB (QEMU nodes only) | |
| cpus | No | Number of CPUs (QEMU nodes only) | |
| name | No | New name (REQUIRES node stopped) | |
| ports | No | Number of ports (ethernet_switch nodes only) | |
| action | Yes | Action: 'list' (list nodes), 'create' (new node), 'delete' (remove node), or 'set' (configure/control node) | |
| format | No | Output format: 'table' (default) or 'json' (for 'list' action) | table |
| locked | No | Lock position to prevent GUI moves | |
| adapters | No | Network adapters (QEMU: adapters, IOU: ethernet_adapters) | |
| parallel | No | Execute operations concurrently (default: True for start/stop/suspend) | |
| node_name | No | Node name, wildcard pattern ('*', 'Router*', 'R[123]'), or JSON array ('["R1","R2"]'). Required for 'delete' and 'set' | |
| compute_id | No | Compute server ID (for 'create') | local |
| project_id | No | Project ID (required for 'list') | |
| properties | No | Override template properties for 'create' (e.g., {'ram': 512}) | |
| console_type | No | Console type: telnet/vnc/spice | |
| state_action | No | State control action for 'set': 'start' (boot), 'stop' (shutdown), 'suspend' (pause), 'reload' (reboot), 'restart' (stop then start) | |
| template_name | No | Template name (required for 'create', e.g., 'Alpine Linux', 'Cisco IOSv') | |
| hdd_disk_image | No | HDD disk image path (QEMU nodes only) |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |