2016-06-21 11:47:22 +03:00
|
|
|
General
|
2018-03-12 08:38:50 +02:00
|
|
|
#######
|
2016-06-21 11:47:22 +03:00
|
|
|
|
2016-06-23 11:09:21 +03:00
|
|
|
Architecture
|
|
|
|
============
|
|
|
|
|
2018-03-12 08:38:50 +02:00
|
|
|
GNS3 can be divided in four part:
|
2016-06-23 11:09:21 +03:00
|
|
|
|
2018-03-12 08:38:50 +02:00
|
|
|
* the user interface or GUI (gns3-gui or gns3-web projects)
|
|
|
|
* the controller (gns3-server project)
|
|
|
|
* the compute (part of the gns3-server project)
|
|
|
|
* the emulators (Qemu, Dynamips, VirtualBox...)
|
2016-06-23 11:09:21 +03:00
|
|
|
|
|
|
|
|
2018-03-12 08:38:50 +02:00
|
|
|
The controller pilots everything, it manages the state
|
|
|
|
of each project. Only one controller should run.
|
2016-06-23 11:09:21 +03:00
|
|
|
|
2018-03-12 08:38:50 +02:00
|
|
|
The GUI displays a topology representing a project on a canvas and allow to
|
|
|
|
perform actions on given project, sending API requests to the controller.
|
2016-06-23 11:09:21 +03:00
|
|
|
|
2018-03-12 08:38:50 +02:00
|
|
|
The compute controls emulators to run nodes. A compute that is on
|
|
|
|
the same server as the controller is the same process.
|
2016-06-23 11:09:21 +03:00
|
|
|
|
2018-03-12 08:38:50 +02:00
|
|
|
The compute usually starts an emulator instance for each node.
|
2016-06-23 11:09:21 +03:00
|
|
|
|
|
|
|
|
|
|
|
A small schema::
|
|
|
|
|
|
|
|
+---------------+ +----------+ +------+
|
|
|
|
| | | COMPUTE +-----> QEMU |
|
|
|
|
| GNS3 GUI | +---> SERVER 1 | +------+
|
|
|
|
| QT interface +-----+ | +----------+
|
|
|
|
| | | | +---+
|
|
|
|
+---------------+ +v--------++ +--->IOU|
|
|
|
|
|CONTROLLER| | +---+
|
|
|
|
+---------+ +^--------++ +---------+ |
|
|
|
|
| GNS3 WEB+-----+ | | COMPUTE +--+
|
|
|
|
+---------+ +---> SERVER 2+--+ +--------+
|
|
|
|
+---------+ +--->DYNAMIPS|
|
|
|
|
+--------+
|
|
|
|
|
|
|
|
|
2018-03-12 08:38:50 +02:00
|
|
|
Use the controller API to work with the GNS3 backend
|
2016-06-23 11:09:21 +03:00
|
|
|
|
|
|
|
|
2015-02-18 12:06:13 +02:00
|
|
|
Communications
|
2018-03-12 08:38:50 +02:00
|
|
|
==============
|
2015-02-18 12:06:13 +02:00
|
|
|
|
2018-03-12 08:38:50 +02:00
|
|
|
All communication are done over HTTP using the JSON format.
|
2015-02-18 12:06:13 +02:00
|
|
|
|
2015-01-14 02:05:26 +02:00
|
|
|
Errors
|
|
|
|
======
|
|
|
|
|
2018-03-12 08:38:50 +02:00
|
|
|
A standard HTTP error is sent in case of an error:
|
2015-01-14 02:05:26 +02:00
|
|
|
|
|
|
|
.. code-block:: json
|
|
|
|
|
|
|
|
{
|
|
|
|
"status": 409,
|
|
|
|
"message": "Conflict"
|
|
|
|
}
|
2015-02-25 10:47:55 +02:00
|
|
|
|
2016-06-08 19:12:22 +03:00
|
|
|
|
2015-02-25 10:47:55 +02:00
|
|
|
Limitations
|
|
|
|
============
|
|
|
|
|
|
|
|
Concurrency
|
|
|
|
------------
|
|
|
|
|
2018-03-12 08:38:50 +02:00
|
|
|
A node cannot processes multiple requests at the same time. However,
|
|
|
|
multiple requests on multiple nodes can be executed concurrently.
|
|
|
|
This should be transparent for clients since internal locks are used inside the server,
|
|
|
|
so it is safe to send multiple requests at the same time and let the server
|
|
|
|
manage the concurrency.
|
2015-02-25 10:47:55 +02:00
|
|
|
|
|
|
|
|
2016-03-25 19:35:55 +03:00
|
|
|
Authentication
|
2018-03-12 08:38:50 +02:00
|
|
|
--------------
|
2015-02-25 11:29:20 +02:00
|
|
|
|
2018-03-12 08:38:50 +02:00
|
|
|
HTTP basic authentication can be used to prevent unauthorized API requests.
|
|
|
|
It is recommended to set up a VPN if the communication between clients and the server must be encrypted.
|
2015-02-25 11:29:20 +02:00
|
|
|
|
|
|
|
|
2015-06-26 15:41:58 +03:00
|
|
|
Notifications
|
|
|
|
=============
|
|
|
|
|
2016-06-30 11:55:47 +03:00
|
|
|
|
2018-03-12 08:38:50 +02:00
|
|
|
Notifications can be received from the server by listening to a HTTP stream or via a Websocket.
|
2015-06-26 15:41:58 +03:00
|
|
|
|
2018-08-16 17:40:51 +03:00
|
|
|
Read :doc:`controller_notifications` and `project_notifications` for more information
|
2015-06-26 15:41:58 +03:00
|
|
|
|
2016-03-07 18:57:12 +02:00
|
|
|
Previous versions
|
|
|
|
=================
|
|
|
|
|
|
|
|
API version 1
|
|
|
|
-------------
|
2018-03-12 08:38:50 +02:00
|
|
|
|
2016-06-16 10:11:50 +03:00
|
|
|
Shipped with GNS3 1.3, 1.4 and 1.5.
|
2018-03-12 08:38:50 +02:00
|
|
|
This API doesn't support the controller architecture.
|
2016-03-07 18:57:12 +02:00
|
|
|
|