Mission uploader
Besides manually creating missions, you can automate the process and upload a large number of content files, whether they are available locally or uploaded from a remote location.
OS
- Windows (64 bit)
- Linux (64 bit)
StServerUploader usage
Windows
stserveruploader.exe -i ./data/missionList.csv -s http://yourServerUrl -u userName -p password
Linux
./stserveruploader.run -i ./data/missionList.csv -s http://yourServerUrl -u userName -p password
Arguments
Flag | Name | Description |
---|---|---|
-i | --input | Input configuration file path |
-s | --server | Server url |
-u | --user | User name |
-p | --password | Password |
--printUsage | Print args description (true/false) |
A configuration file (.csv or .json) provides a list of missions to create and the location of the content to upload. The upload utility first checks for the specified files on your local machine and uploads them if found. If not, it treats the file path as a local path on the server and tries to locate the files there. This method can be used instead of uploading files over http. For example, you can upload the files using ftp and reference them in the .csv or .json.
Note
If the server runs in Docker, you must map your upload directory so that the server can find it while running in the container.
Configuring upload directories with Docker
Let's assume that you've configured the ftp server on a host computer to upload your video content to ~/Movies folder.
Set the HOST_UPLOAD environmental variable (in the .env file) to that location and STANAG On Demand Server will map it as a volume.
HOST_UPLOAD=~/Movies/
By default, the server will set /app/upload/ inside the container as a folder for upload.
So, now you can simply reference the video to this directory (including the subdirectories) in the .csv or .json
Mission._id,Mission.name,Mission.description,Mission.tags,Mission.usergroups,Mission.platform.name,Mission.platform.type,Mission.securityClassification,Mission.sensors.0.name,Mission.sensors.0.description,Mission.sensors.0.type,Mission.sensors.0.tags,Mission.sensors.0.sampling,Mission.sensors.0.files
,TestMission,Test Mission,"flight,test","Demo, Group1",Heron,Plane,UNCLASSIFIED,EO/IR,Main EO/IR,video,camera,200, ./uploadme/test.ts
Data format
StServerUploader supports 2 text formats:
- csv
- json
CSV configuration file format
CSV configuration is essentially a flat text representation of missions (like in json format), where every mission can have multiple sensors. In order to express the hierarchical nature of json, a "." (1dot) prefix is used. First line represents the fields.
For example:
Mission._id,Mission.name,Mission.description,Mission.tags,Mission.usergroups,Mission.platform.name,Mission.platform.type,Mission.securityClassification,Mission.sensors.0.name,Mission.sensors.0.description,Mission.sensors.0.type,Mission.sensors.0.tags,Mission.sensors.0.sampling,Mission.sensors.0.files
,TestMission,Test Mission,"flight,test","Demo, Group1",Heron,Plane,UNCLASSIFIED,EO/IR,Main EO/IR,video,camera,200,D:/Movie/ArcGIS/Truck.ts
,TestMission2,Test Mission2,"flight,test","Demo, Group1",Heron,Plane,UNCLASSIFIED,EO/IR,Main EO/IR,video,camera,200,D:\Movie\DeadSea-1-1080p-6M-A.ts
JSON configuration file format
Json configuration is an array of missions, where every mission can have an array of sensors.
For example:
[
{
"name": "Mission-1",
"description": "Test Mission 1",
"tags": "flight,test",
"usergroups": "Demo, Group1",
"platform": {
"name": "Heron",
"type": "Plane"
},
"securityClassification": "UNCLASSIFIED",
"sensors": [
{
"name": "EO/IR",
"description": "Main EO/IR",
"type": "video",
"tags": "camera",
"sampling": "200",
"files": "/home/user/Movies/video1.ts"
}
]
},
{
"name": "Mission-2",
"description": "Test Mission 2",
"tags": "flight,test",
"usergroups": "Demo, Group1",
"platform": {
"name": "Heron",
"type": "Plane"
},
"securityClassification": "UNCLASSIFIED",
"sensors": [
{
"name": "EO/IR",
"description": "Main EO/IR",
"type": "video",
"tags": "camera",
"sampling": "200",
"files": "/home/user/Movies/video2.ts"
}
]
}
]
Your mission can have bookmarks and other information:
[
{
"name": "2T",
"description": "Test",
"thumbnail": "Video-sm.jpg",
"state": "Ready",
"creationTime": "2021-10-10T09:22:55.186Z",
"startTime": "2012-09-19T20:50:26.484Z",
"endTime": "2012-09-19T20:52:54.296Z",
"usergroups": [
"Demo"
],
"platform": {
"name": "Platform",
"type": "Plane",
"presentation": {
"icon": "glyphicon-picture",
"color": "#004dcf",
"weight": 2
}
},
"country_name": "Israel",
"country_code": "IL",
"sensors": [
{
"name": "EO-IR",
"description": "Sensor",
"type": "video",
"views": 6,
"tags": [],
"hlsProps": {
"segmentDuration": 10,
"width": 1920,
"height": 1080
},
"endTime": "2012-09-19T20:52:54.296Z",
"startTime": "2012-09-19T20:50:26.484Z",
"assets": [
"/home/myuser/Movies/video1.ts"
]
}
],
"bookmarks": [
{
"title": "BM1",
"text": "BM1Text",
"tags": [],
"author": "alexc",
"editor": "alexc",
"startTime": "2012-09-19T20:50:58.925Z",
"position": 11.72,
"color": "blue"
},
{
"missionName": "2T",
"sensorName": "EO-IR",
"title": "BM2",
"text": "BM2",
"tags": [],
"author": "alexc",
"editor": "alexc",
"startTime": "2012-09-19T20:51:35.865Z",
"position": 42.4,
"color": "blue"
}
],
"rating": 2,
"tags": [
"Test"
],
"sortOrder": 2000
}
]
Platform options:
Platform type can be one of the following:
- Plane
- Helicopter
- Quadcopter
- Camera
- ROV
- Diver
default: Plane