File upload configuration

Customize the files transfer to a backend storage.

Properties

To control all aspects of the file upload behavior.

PropertyTypeDefaultDescription
featureIdstringAutoUploadableFeature unique identifier in the scope of the edge digital twin
typestringfileType of the files that are uploaded by this feature
contextstringedgeContext of the files that are uploaded by this feature, unique in the scope of the type
filesstringGlob pattern to select the files for upload
modestringstrictRestriction on files that can be dynamically selected for an upload, the supported modes are: strict, lax and scoped
singleUploadboolfalseForbid triggering of new uploads when there is an upload in progress
checksumboolfalseSend MD5 checksum for uploaded files to ensure data integrity
stopTimeoutstring30sTime to wait for running uploads to finish as a sequence of decimal numbers, each with optional fraction and a unit suffix, such as: 300ms, 1.5h, 10m30s, etc., time units are: ns, us (or µs), ms, s, m, h
deleteboolfalseDelete successfully uploaded files
Upload - TLS
serverCertstringPEM encoded certificate file for secure uploads
Auto upload
activeboolfalseActivate periodic uploads
activeFromstringTime from which periodic uploads should be active, in RFC 3339 format, if omitted (and active flag is set) current time will be used as start of the periodic uploads
activeTillstringTime till which periodic uploads should be active, in RFC 3339 format, if omitted (and active flag is set) periodic uploads will be active indefinitely
periodstring10hUpload period as a sequence of decimal numbers, each with optional fraction and a unit suffix, such as: 300ms, 1.5h, 10m30s, etc., time units are: ns, us (or µs), ms, s, m, h
Local connectivity
brokerstringtcp://localhost:1883Address of the MQTT server/broker that the file upload will connect for the local communication, the format is: scheme://host:port
usernamestringUsername that is a part of the credentials
passwordstringPassword that is a part of the credentials
Local connectivity - TLS
caCertstringPEM encoded CA certificates file
certstringPEM encoded certificate file to authenticate to the MQTT server/broker
keystringPEM encoded unencrypted private key file to authenticate to the MQTT server/broker
Logging
logFilestringlog/file-upload.logPath to the file where log messages are written
logLevelstringINFOAll log messages at this or higher level will be logged, the log levels in descending order are: ERROR, WARN, INFO, DEBUG and TRACE
logFileCountint5Log file maximum rotations count
logFileMaxAgeint28Log file rotations maximum age in days, use 0 to not remove old log files
logFileSizeint2Log file size in MB before it gets rotated

Example

The minimal required configuration that sets the file type to log.

{
    "type": "log",
    "files": "/var/tmp/file-upload/*.*",
    "logFile": "/var/log/file-upload/file-upload.log"
}

Template

The configuration can be further adjusted according to the use case. The following template illustrates all possible properties with their default values.

{
    "featureId": "AutoUploadable",
    "type": "file",
    "context": "edge",
    "files": "",
    "mode": "strict",
    "singleUpload": false,
    "checksum": false,
    "stopTimeout": "30s",
    "delete": false,
    "serverCert": "",
    "active": false,
    "activeFrom": "",
    "activeTill": "",
    "period": "10h",
    "broker": "tcp://localhost:1883",
    "username": "",
    "password": "",
    "caCert": "",
    "cert": "",
    "key": "",
    "logFile": "log/file-upload.log",
    "logLevel": "INFO",
    "logFileCount": 5,
    "logFileMaxAge": 28,
    "logFileSize": 2
}
Last modified June 28, 2024