Notifications

You can receive notification from the controller allowing you to update your local data.

Notifications endpoints

You can listen the HTTP stream /notifications or the websocket.

We recommend using the websocket.

Available notifications

ping

Keep the connection between client and controller.

{
    "compute_id": 12
}

compute.created

Compute has been created.

{
    "capabilities": {
        "node_types": [],
        "version": null
    },
    "compute_id": "my_compute",
    "connected": false,
    "cpu_usage_percent": null,
    "host": "localhost",
    "memory_usage_percent": null,
    "name": "http://julien@localhost:84",
    "port": 84,
    "protocol": "http",
    "user": "julien"
}

compute.updated

Compute has been updated. You will receive a lot of this event because it’s include change of CPU and memory usage on the compute node.

{
    "capabilities": {
        "node_types": [],
        "version": null
    },
    "compute_id": "my_compute_id",
    "connected": false,
    "cpu_usage_percent": null,
    "host": "localhost",
    "memory_usage_percent": null,
    "name": "http://julien@localhost:84",
    "port": 84,
    "protocol": "https",
    "user": "julien"
}

compute.deleted

Compute has been deleted.

{
    "capabilities": {
        "node_types": [],
        "version": null
    },
    "compute_id": "my_compute_id",
    "connected": false,
    "cpu_usage_percent": null,
    "host": "localhost",
    "memory_usage_percent": null,
    "name": "http://julien@localhost:84",
    "port": 84,
    "protocol": "http",
    "user": "julien"
}

node.created

Node has been created.

{
    "a": "b"
}

node.updated

Node has been updated.

{
    "command_line": "",
    "compute_id": "local",
    "console": 5006,
    "console_host": "localhost",
    "console_type": "telnet",
    "first_port_name": null,
    "height": 59,
    "label": {
        "rotation": 0,
        "style": "font-family: TypeWriter;font-size: 10;font-weight: bold;fill: #000000;fill-opacity: 1.0;",
        "text": "PC2",
        "x": 18,
        "y": -25
    },
    "name": "PC2",
    "node_directory": "/private/var/folders/3s/r2wbv07n7wg4vrsn874lmxxh0000gn/T/pytest-of-noplay/pytest-51/test_open0/project-files/vpcs/748bcd89-624a-40eb-a8d3-1d2e85c99b51",
    "node_id": "748bcd89-624a-40eb-a8d3-1d2e85c99b51",
    "node_type": "vpcs",
    "port_name_format": "Ethernet{0}",
    "port_segment_size": 0,
    "ports": [
        {
            "adapter_number": 0,
            "data_link_types": {
                "Ethernet": "DLT_EN10MB"
            },
            "link_type": "ethernet",
            "name": "Ethernet0",
            "port_number": 0,
            "short_name": "e0"
        }
    ],
    "project_id": "3c1be6f9-b4ba-4737-b209-63c47c23359f",
    "properties": {
        "startup_script": "",
        "startup_script_path": "startup.vpc"
    },
    "status": "stopped",
    "symbol": ":/symbols/computer.svg",
    "width": 65,
    "x": -71,
    "y": -98,
    "z": 1
}

node.deleted

Node has been deleted.

drawing.created

Drawing has been created.

{
    "drawing_id": "377bccc0-779a-44b0-ab5e-98dfd6dc46cd",
    "project_id": "adb641a0-8ec9-4b5a-b8df-cc993638c601",
    "rotation": 0,
    "svg": "<svg height=\"210\" width=\"500\"><line x1=\"0\" y1=\"0\" x2=\"200\" y2=\"200\" style=\"stroke:rgb(255,0,0);stroke-width:2\" /></svg>",
    "x": 10,
    "y": 20,
    "z": 0
}

drawing.updated

Drawing has been updated. To reduce data transfert if the svg field has not change the field is not included.

{
    "drawing_id": "d86ab88f-28bf-4f22-aa4e-e6d3c423b98c",
    "project_id": "8f53f0f7-9967-4a01-884f-36ea1800e5ef",
    "rotation": 0,
    "x": 42,
    "y": 20,
    "z": 0
}

drawing.deleted

Drawing has been deleted.

{
    "drawing_id": "b2f8b12f-a4cc-4621-affc-cf3dcd4ba513",
    "project_id": "24ef7002-5dd6-4054-bf8a-d2aface0885e",
    "rotation": 0,
    "svg": "<svg></svg>",
    "x": 0,
    "y": 0,
    "z": 0
}

project.updated

Project has been updated.

{
    "auto_close": true,
    "auto_open": false,
    "auto_start": false,
    "filename": "test.gns3",
    "name": "test2",
    "path": "/var/folders/3s/r2wbv07n7wg4vrsn874lmxxh0000gn/T/tmpe4g8gdv7/projects/10010203-0405-0607-0809-0a0b0c0d0e0f",
    "project_id": "10010203-0405-0607-0809-0a0b0c0d0e0f",
    "scene_height": 1000,
    "scene_width": 2000,
    "status": "opened"
}

project.closed

Project has been closed.

{
    "auto_close": true,
    "auto_open": false,
    "auto_start": false,
    "filename": "test.gns3",
    "name": "test",
    "path": "/var/folders/3s/r2wbv07n7wg4vrsn874lmxxh0000gn/T/tmp0vixjsro/projects/74bd9388-bd2e-41cc-b8da-d014cfb9f908",
    "project_id": "74bd9388-bd2e-41cc-b8da-d014cfb9f908",
    "scene_height": 1000,
    "scene_width": 2000,
    "status": "closed"
}

snapshot.restored

Snapshot has been restored

log.error

Send an error to the user

{
    "message": "Permission denied on /tmp"
}

log.warning

Send a warning to the user

{
    "message": "Warning ASA 8 is not officialy supported by GNS3"
}

log.info

Send an information to the user

{
    "message": "Image uploaded"
}

settings.updated

GUI settings updated. Will be removed in a later release.

{
    "test": true
}