Snapshot specifications
Introduction
The snapshot it is a way to save the testbed configuration when a job is run. The files are generated dynamically when in the initial phases of job run and saved in the folder that will compressed in the job completed archive the user later download.
The aim of the snapshot are two: first provide the information about the nodes and provide them in a way it can used in post processing by automatic tools. The information included in the file are:
- node Id
- zone where is installed
- the platform name and its information:
- the coordinates of the platform
- the address of that platform
The format provided are two: CSV or python. The structure of the files is described in the following sections:
CSV format
The CSV format is provided as collection of information reusable from all coding/scripting languages. It is generated in UTF-8 coding with all fields quoted.
The fields of the file in order are:
- Zone
- NodeId
- Platform
- Coordinate X
- Coordinate Y
- Address
To have a plane structure of file each line represent a specific platform and common information (e.g. zone, nodeId, ...) are repeated.
Here an example:
"Zone","NodeId","Platform","Coordinate X","Coordinate Y","Address"
"disi","1","bluetooth","76.0","3.97",""
"disi","1","evb1000","76.0","3.97","04:32:51:02:01:64:13:9a"
"disi","1","firefly","76.0","3.97","00:12:4B:00:18:D6:F7:9C"
"disi","2","bluetooth","72.74","6.6",""
"disi","2","evb1000","72.74","6.6","10:20:5f:13:10:00:19:15"
"disi","2","firefly","72.74","6.6","00:12:4B:00:14:B5:D9:76"
In that example both node have three different platform.
Python format
In Python format to structure the information have been used the dictionaries. With a bottom-top approach the information are organized per node in a dictionary as the following:
{'id': 1, 'zone': 'disi', 'platforms': {
'bluetooth': {'address': 'None', 'coordinates': [76.0, 3.97]},
'evb1000': {'address': '04:32:51:02:01:64:13:9a', 'coordinates': [76.0, 3.97]},
'firefly': {'address': '00:12:4B:00:18:D6:F7:9C', 'coordinates': [76.0, 3.97]},
}
}
The node's information are key/value pair a top level:
- node id: key
id
with a numeric value zone: key
zone
with astr
valueThe platform information are in specific dictionary (accessible with key
platforms
in node dictionary. Each element of this dictionary has as key the platform name (i.e. evb1000) asstr
and the value is another dictionary that contains:- platform address: key
address
with astr
value (in general a sequence of byte coded in hex numbers) - coordinates: key
coordinates
a list of numeric value in the format[ X, Y]
- platform address: key
All nodes dictionary are contained in two dictionary:
nodesById
: the keys are the node id and the value the nodes dictionarynodesByAddr
: the keys are all the platforms address of the nodes and the value the node dictionary. This means that wit the address of two platform of same node the value is the same python object.
A third dictionary for convenience is provided: platformByAddr
where the keys are the platform address and the value are the platform dictionary contained in platforms
element of node dictionary.
NOTE: the nodesByAddr
dictionary is generated while nodesByAddr
and platformByAddr
are computed from
the first.