| Configure the Server from the Command Line |
87
response.getOutputStream().println(jsonObject.toString());
response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
}
else {
JsonObject jsonObject = new JsonObject();
jsonObject.addProperty("success", true);
jsonObject.addProperty("data", "File is ok to transfer");
jsonObject.addProperty("code", 1);
response.getOutputStream().println(jsonObject.toString());
response.setStatus(HttpServletResponse.SC_OK);
}
return;
}
}
Inline File Validation with Lua Script
To use a Lua script for inline file validation, the administrator creates a base-64 encoded Lua action script and sets the
path to that script in the
<transfer>
section of
aspera.conf
. During the inline validation,
ascp
automatically
generates a request; the parameters for the Lua call are passed to a Lua script defined in
aspera.conf
.
The parameters for Lua calls are passed to Lua scripts by using the array
'env_table'
. The following is an
example request body:
env_table["startstop"] = "running"
env_table["xfer_id"] = "AAAA-BBBB"
env_table["session_id"] = "1111-2222"
env_table["host"] = "10.0.258.12"
env_table["client_ip"] = "10.0.125.04"
env_table["user"] = "admin"
env_table["userid"] = 24
env_table["direction"] = "send"
env_table["target_rate_kbps"] = 0
env_table["min_rate_kbps"] = 0
env_table["rate_policy"] = "fair"
env_table["cipher"] = "aes-128"
env_table["cookie"] = "xyz"
env_table["manifest_file"] = "/data/manifests/aspera-transfer-1234.txt"
env_table["file"] = "/data/home/luke/test.mpg"
env_table["size"] = 1000000
env_table["start_byte"] = 0
env_table["bytes_written"] = 0
env_table["tags"] = "
tags
"
env_table["file_name_encoding"] = "utf8"
env_table["file_csum"] = "a1000abf882"
env_table["file_csum_type"] = "sha2-256"
Lua Request Body Parameters and Values
Field
Description
Values
"startstop"
Sets the type of validation
start
,
stop
, or
running
"xfer_id"
Value used to identify a transfer
session
String