In order to get information about scenarios, you must already have a hapi object (see hapi). These methods are available to interact with the voisus server scenarios.
example:
var nVoisus = require('voisus');
var hapi = nVoisus.createHapi('IPAddress');
hapi."method"(args, function(err, result) {
...
});
This function returns a scenario object. (see Scenario Object)
Arguments
-
scenarioName:
String
-
callback(err, results) - A callback which is called after the function has finished, or an error has occurred.
Returns
Scenario Object
(see Scenario Object)
This function returns a scenario object. (see Scenario Object)
Arguments
-
scenarioId:
String
-
callback(err, results) - A callback which is called after the function has finished, or an error has occurred.
Returns
Scenario Object
(see Scenario Object)
This function gets the scenarios of the voisus server.
Arguments
- callback(err, results) - A callback which is called after the function has finished, or an error has occurred.
Results
Array
:
[
{
"id": 'e673f38989514ccda3bf0ffc82083f17',
"data_type": 'scenario',
"rev": '3-e3c0ed1914aa0b4c95eef2dd76669740',
"scenario_id": 'e673f38989514ccda3bf0ffc82083f17',
"version": 'v5.8.0-567-gbee9459c',
"description": '',
"name": 'Basic_Example',
"isactive": false,
"url": 'https://URL/api/scenarios/e673f38989514ccda3bf0ffc82083f17/'
},
...
]
This function runs the scenario.
Arguments
-
scenarioId:
String
-
callback(err, results) - A callback which is called after the function has finished, or an error has occurred.
Results
JSON
:
{
"install_status": [ 100, 'install finished' ],
"cloud_id": 'voisus',
"scenario_id": 'e62acd5c62874f0aaf4dee7411436460',
"session_id": '114eea8da5014c6ebb468b0a0595b2cd',
"session_errors": [],
"install_state": 'INSTALLED',
"scenario_name": 'scenarioName',
"scenario_host": 'nvoisus.local'
}
This function runs the scenario asynchronously.
Arguments
-
scenarioId:
String
-
callback(err, results) - A callback which is called after the function has finished, or an error has occurred.
Results
JSON
:
{
"install_status": [ 1, 'starting install' ],
"cloud_id": 'voisus',
"scenario_id": null,
"session_id": null,
"session_errors": [],
"install_state": 'INSTALLING',
"scenario_name": null,
"scenario_host": null
}
This function stops the scenario.
Arguments
-
scenarioId:
String
-
callback(err, results) - A callback which is called after the function has finished, or an error has occurred.
Results
JSON
:
{
"install_status": [ 100, 'uninstall finished' ],
"cloud_id": 'voisus',
"scenario_id": null,
"session_id": null,
"session_errors": [],
"install_state": 'UNINSTALLED',
"scenario_name": null,
"scenario_host": null }
}
This function deletes the scenario.
Arguments
-
scenarioId:
String
-
callback(err, results) - A callback which is called after the function has finished, or an error has occurred.
Results
JSON
:
{}
This function gets the scenario templates from the voisus server.
Arguments
- callback(err, results) - A callback which is called after the function has finished, or an error has occurred.
Results
Array
:
[
'Army_Example',
'Basic_Example',
'Construct_Example',
'EmergencyMgmt_Example',
'HWPanel_Example',
'Intercom_Example',
'Maritime_Example',
'Office_Example',
'RadioBridge16',
'RadioBridge4',
'RadioBridge8',
'SeriousGame_Example',
'TOC_Example'
]
This function creates a scenario object from an existing scenario.
Arguments
-
scenarioId:
String
-
callback(err, results) - A callback which is called after the function has finished, or an error has occurred.
Results
Scenario Object
(see Scenario Object)
In order to perform actions on a given scenarios, you must already have a scenario object (see Create Scenario). These methods are available to interact with the the scenario.
Contains:
"573c9a1b6346475894b0f3f341e82907"
This function gets the dis domains of the scenario.
Arguments
- callback(err, results) - A callback which is called after the function has finished, or an error has occurred.
Results
Array
:
[
{
"data_type": 'dis_domains',
"rev": '1-1345161e69ce495c12368a2a6f93a924',
"editable": false,
"name": 'default_domain',
"version": 'v5.15.0-518-g53fb19f8',
"id": 'e99157c13ea04571912e60cdfbd8c0ba',
"exercise": 1,
"description": ''
},
...
]
This function updates a dis domain.
Arguments
- dDomId:
String
"32777a46fddf41eb9b654f2ede349c0a"
- dDomObj:
JSON
{
"name": "HAPI"
}
- callback(err, results) - A callback which is called after the function has finished, or an error has occurred.
Results
JSON
:
{
"data_type": 'dis_domains',
"rev": '2-24a3c10c832848aba730d0e36568e73d',
"editable": false,
"name": 'HAPI',
"version": 'v5.15.0-518-g53fb19f8',
"id": '32777a46fddf41eb9b654f2ede349c0a',
"exercise": 1,
"description": ''
}
This function creates a new dis domain.
Arguments
- dDomObj:
JSON
{
"name": "HAPI"
}
- callback(err, results) - A callback which is called after the function has finished, or an error has occurred.
Results
JSON
:
{
"data_type": 'dis_domains',
"rev": '1-eeea44bc7c84224f67ac00889ee9f84f',
"editable": true,
"name": 'HAPI',
"version": 'v5.15.0-518-g53fb19f8',
"id": '433df52113254dbf933598082a79e6de',
"exercise": 0,
"description": ''
}
This function deletes a dis domain.
Arguments
- dDomId:
String
"433df52113254dbf933598082a79e6de"
- callback(err, results) - A callback which is called after the function has finished, or an error has occurred.
Results
Null
:
null
This function gets the dis of the scenario.
Arguments
- callback(err, results) - A callback which is called after the function has finished, or an error has occurred.
Results
JSON
:
{
"dis_moving_threshold": 500,
"rev": '1-c45e21fd8430d7cd5e037063999125cf',
"pdu_signal": 'broadcast',
"dis_timeout_moving": 2,
"mcast_addr": '',
"id": 'dis',
"description": '',
"pdu_rx": 'broadcast',
"parent": null,
"pdu_entity_mcast_addr": '',
"ip_mode": 'broadcast',
"pdu_tx_mcast_addr": '',
"dis_app_id": 0,
"version": 'v5.15.0-518-g53fb19f8',
"ucast_addr": '',
"pdu_tx": 'broadcast',
"pdu_signal_mcast_addr": '',
"dis_site_id": 0,
"mcast_addr_start": '',
"network_modulations": {},
"data_type": 'dis',
"setup_type": 'basic',
"udp_port": 3000,
"dis_timeout_normal": 5,
"pdu_entity": 'broadcast',
"domain_exid_map": {},
"dis_id_mode": 'derived',
"pdu_rx_mcast_addr": '',
"name": '',
"dis_version": 6,
"radio_tx_period": 20,
"radio_holdoff": 24,
"eth": 'eth0'
}
This function updates the dis.
Arguments
- dObj: 'JSON'
{
"udp_port": 3002
}
- callback(err, results) - A callback which is called after the function has finished, or an error has occurred.
Results
JSON
:
{
"dis_moving_threshold": 500,
"rev": '2-d072e90f3c2d0ab5ca65743009a4299a',
"pdu_signal": 'broadcast',
"dis_timeout_moving": 2,
"mcast_addr": '',
"id": 'dis',
"description": '',
"pdu_rx": 'broadcast',
"pdu_entity_mcast_addr": '',
"ip_mode": 'broadcast',
"pdu_tx_mcast_addr": '',
"dis_app_id": 0,
"version": 'v5.15.0-518-g53fb19f8',
"ucast_addr": '',
"pdu_tx": 'broadcast',
"pdu_signal_mcast_addr": '',
"dis_site_id": 0,
"mcast_addr_start": '',
"network_modulations": {},
"data_type": 'dis',
"setup_type": 'basic',
"udp_port": 3002,
"dis_timeout_normal": 5,
"pdu_entity": 'broadcast',
"domain_exid_map": {},
"dis_id_mode": 'derived',
"pdu_rx_mcast_addr": '',
"name": '',
"dis_version": 6,
"radio_tx_period": 20,
"radio_holdoff": 24,
"eth": 'eth0'
}
This function deletes the dis.
Arguments
- callback(err, results) - A callback which is called after the function has finished, or an error has occurred.
Results
Null
:
null
This function gets the nets of the scenario.
Arguments
- callback(err, results) - A callback which is called after the function has finished, or an error has occurred.
Results
Array
:
[
{
"txfrequency": 0,
"rev": "1-3fc0c0d64f6815caef50e56bfd13930f",
"crypto": null,
"name": "Recon",
"data_type": "nets",
"frequency": 214050000,
"satcom": null,
"version": "v5.9.0-292-g875bb23c",
"freqhop": null,
"id": "d4771081d2584779b6e1fd6fb2d0f2e0",
"description": ""
},
...
]
This function updates a net.
Arguments
- netID:
String
"d4771081d2584779b6e1fd6fb2d0f2e0"
- netObj:
JSON
{
"name": 'UNHAPI'
}
- callback(err, results) - A callback which is called after the function has finished, or an error has occurred.
Results
JSON
:
{
"txfrequency": 0,
"rev": '2-35715d1f21149a2fbe0f1360d1e53bef',
"crypto": null,
"name": 'UNHAPI',
"data_type": 'nets',
"frequency": 0,
"satcom": null,
"version": 'v5.15.0-518-g53fb19f8',
"freqhop": null,
"id": 'd3b340ebecb046c5882cf9706f1e0882',
"description": ''
}
This function creates a net.
Arguments
- netObj:
JSON
{
"name": 'HAPI'
}
- callback(err, results) - A callback which is called after the function has finished, or an error has occurred.
Results
JSON
:
{
"txfrequency": 0,
"rev": '1-6dd782fc6b44676ec2dc52b06ac54e82',
"crypto": null,
"name": 'HAPI',
"data_type": 'nets',
"waveform": null,
"frequency": 0,
"satcom": null,
"version": 'v5.15.0-518-g53fb19f8',
"freqhop": null,
"id": 'b1ae95e7c2f3444f90553cee79143b78',
"description": ''
}
This function deletes a net.
Arguments
- netId:
String
"b1ae95e7c2f3444f90553cee79143b78"
- callback(err, results) - A callback which is called after the function has finished, or an error has occurred.
Results
Null
:
null
This function gets the roles of the scenario.
Arguments
- callback(err, results) - A callback which is called after the function has finished, or an error has occurred.
Results
Array
:
[
{
"description": '',
"data_type": 'roles',
"rev": '2-69471f394e52837b7c7033dc2ef4853f',
"id": '59868c1b66ac497fb081cad598426c31',
"version": 'v5.15.0-518-g53fb19f8',
"shared": false,
"autotune_enabled": false,
"name": 'UNHAPI',
"radiohw": 0,
"calling_enabled": true,
"chat_enabled": false
},
...
]
This function updates a role.
Arguments
- roleId:
String
"59868c1b66ac497fb081cad598426c31"
- roleObj:
JSON
{
"name": 'UNHAPI'
}
- callback(err, results) - A callback which is called after the function has finished, or an error has occurred.
Results
JSON
:
{
"description": '',
"data_type": 'roles',
"rev": '2-69471f394e52837b7c7033dc2ef4853f',
"id": '59868c1b66ac497fb081cad598426c31',
"version": 'v5.15.0-518-g53fb19f8',
"shared": false,
"autotune_enabled": false,
"name": 'UNHAPI',
"radiohw": 0,
"calling_enabled": true,
"chat_enabled": false
}
This function creates a new role.
Arguments
- roleObj:
JSON
{
"name": 'HAPI'
}
- callback(err, results) - A callback which is called after the function has finished, or an error has occurred.
Results
JSON
:
{
description: '',
data_type: 'roles',
rev: '1-b3e37ae656be3222ca3db8bc60078d2c',
id: 'cfca635af1214d258788debce4abf088',
version: 'v5.15.0-518-g53fb19f8',
shared: false,
autotune_enabled: false,
name: 'HAPI',
radiohw: 0,
calling_enabled: true,
chat_enabled: false
}
This function deletes a role.
Arguments
- roleId:
String
"59868c1b66ac497fb081cad598426c31"
- callback(err, results) - A callback which is called after the function has finished, or an error has occurred.
Results
Null
:
null
This function gets the generic radios of the role.
Arguments
- roleId:
String
"59868c1b66ac497fb081cad598426c31"
- callback(err, results) - A callback which is called after the function has finished, or an error has occurred.
Results
Array
:
[
{
"name": "Generic_radio-3",
"shared": false,
"rev": "1-795e72fef8041ec36c6e01818196d503",
"data_type": "generic_radio",
"version": "v5.8.0-567-gbee9459c",
"default_fill": null,
"net_lock": false,
"sqtail_disabled": false,
"id": "173a1435ace54804bedd58180ff739c8",
"cipher_enabled": true,
"description": ""
},
...
]
This function creates a generic radios in the role.
Arguments
- roleId:
String
"59868c1b66ac497fb081cad598426c31"
- radioObj:
JSON
{
"name": 'HAPI'
}
- callback(err, results) - A callback which is called after the function has finished, or an error has occurred.
Results
JSON
:
{
"name": 'HAPI',
"shared": false,
"rev": '1-5be09d5ed816937f65672bd912797ee9',
"data_type": 'generic_radio',
"version": 'v5.15.0-518-g53fb19f8',
"default_fill": null,
"net_lock": false,
"sqtail_disabled": false,
"id": 'a9fae710d3a84cb6a71c3b51d05bb4bc',
"cipher_enabled": true,
"description": ''
}
This function gets the comm panel template of the role.
Arguments
- roleId:
String
"59868c1b66ac497fb081cad598426c31"
- callback(err, results) - A callback which is called after the function has finished, or an error has occurred.
Results
Array
:
[
{
"data_type": 'commpanel_tmpl',
"rev": '1-68783a01b8382f0eb7a1421d06b5c9b6',
"name": 'HAPI',
"channels": [
{
"tx_select": false,
"balance": 0,
"rxtx_lock": false,
"rx_select": false,
"ptt": 1
}
],
"version": 'v5.17.0-57-g936b8e71',
"id": 'cdeb9b606a44443998ca8d13b53c299b',
"description": ''
},
...
]
This function creates a comm panel template in the role.
Arguments
- roleId:
String
"59868c1b66ac497fb081cad598426c31"
- commObj:
JSON
{
"name": 'HAPI'
}
- callback(err, results) - A callback which is called after the function has finished, or an error has occurred.
Results
JSON
:
{
"data_type": 'commpanel_tmpl',
"rev": '1-68783a01b8382f0eb7a1421d06b5c9b6',
"name": 'HAPI',
"channels": [
{
"tx_select": false,
"balance": 0,
"rxtx_lock": false,
"rx_select": false,
"ptt": 1
}
],
"version": 'v5.17.0-57-g936b8e71',
"id": 'cdeb9b606a44443998ca8d13b53c299b',
"description": ''
}
This function gets the fills of the scenario.
Arguments
- callback(err, results) - A callback which is called after the function has finished, or an error has occurred.
Results
Array
:
[
{
"single_net_container": false,
"data_type": 'fills',
"description": '',
"rev": '1-7165deb8e08597a13acd8041a4b7826c',
"version": 'v5.15.0-518-g53fb19f8',
"id": '4d15207ebfdd46b78393190768f97e45',
"name": 'HAPI'
},
...
]
This function updates a fill.
Arguments
- fillId:
String
"4d15207ebfdd46b78393190768f97e45"
- fillObj:
JSON
{
"name": 'UNHAPI'
}
- callback(err, results) - A callback which is called after the function has finished, or an error has occurred.
Results
Array
:
{
"single_net_container": false,
"data_type": 'fills',
"description": '',
"rev": '2-32babf9ae0f30b68109b4d6295052e2d',
"version": 'v5.15.0-518-g53fb19f8',
"id": '40f64b7c43d04e3daf9885a90aaf3742',
"name": 'UNHAPI'
}
This function creates a fill.
Arguments
- fillObj:
JSON
{
"name": 'HAPI'
}
- callback(err, results) - A callback which is called after the function has finished, or an error has occurred.
Results
Array
:
{
"single_net_container": false,
"data_type": 'fills',
"description": '',
"rev": '1-7165deb8e08597a13acd8041a4b7826c',
"version": 'v5.15.0-518-g53fb19f8',
"id": '6abe0ea97c1e4f25b1964f7916bd143b',
"name": 'HAPI'
}
This function deletes a fill.
Arguments
- fillId:
String
"4d15207ebfdd46b78393190768f97e45"
- callback(err, results) - A callback which is called after the function has finished, or an error has occurred.
Results
Null
:
null
This function gets the waveforms of the scenario.
Arguments
- callback(err, results) - A callback which is called after the function has finished, or an error has occurred.
Results
Array
:
[
{
"description": '',
"encoding": "PCM",
"rev": '4-bda1c0b4a7c6fe7d60f8c01a997ab0d6',
"bandwidth": 25000,
"data_type": 'waveforms',
"propagation": 'NONE',
"rate": 16000,
"version": 'v5.17.0-57-g936b8e71',
"power": 1.0,
"mode": 'INTERCOM',
"modkey": '',
"id": 'b679ac4a9ea24df5ae555035d0feea81',
"name": 'Waveform-1
},
...
]
This function updates a fill.
Arguments
- waveformId:
String
"b679ac4a9ea24df5ae555035d0feea81"
- waveformObj:
JSON
{
"name": 'Waveform-2'
}
- callback(err, results) - A callback which is called after the function has finished, or an error has occurred.
Results
Array
:
{
"description": '',
"encoding": "PCM",
"rev": '4-bda1c0b4a7c6fe7d60f8c01a997ab0d6',
"bandwidth": 25000,
"data_type": 'waveforms',
"propagation": 'NONE',
"rate": 16000,
"version": 'v5.17.0-57-g936b8e71',
"power": 1.0,
"mode": 'INTERCOM',
"modkey": '',
"id": 'b679ac4a9ea24df5ae555035d0feea81',
"name": 'Waveform-2'
}
This function creates a fill.
Arguments
- waveformObj:
JSON
{
"name": 'HAPI'
}
- callback(err, results) - A callback which is called after the function has finished, or an error has occurred.
Results
Array
:
{
"description": '',
"encoding": "PCM",
"rev": '4-bda1c0b4a7c6fe7d60f8c01a997ab0d6',
"bandwidth": 25000,
"data_type": 'waveforms',
"propagation": 'NONE',
"rate": 16000,
"version": 'v5.17.0-57-g936b8e71',
"power": 1.0,
"mode": 'INTERCOM',
"modkey": '',
"id": 'b679ac4a9ea24df5ae555035d0feea81',
"name": 'HAPI'
}
This function deletes a fill.
Arguments
- waveformId:
String
"b679ac4a9ea24df5ae555035d0feea81"
- callback(err, results) - A callback which is called after the function has finished, or an error has occurred.
Results
Null
:
null
for more documentation about the Voisus Server API see support.