Good Day All,
Based on the example push within the documentation below, does anyone know what step I use to define a priority?
If I submit via REST API it works:
*curl --request POST *
*–url http://localhost:8042/transfers/send *
–data ‘{“Compression”:“gzip”,“Peer”:“PEER”,“Priority”:1,“Resources”:[{“ID”:“acb77278-83f605d4-3ebcf7de-67r0e5a0-a0b87337”,“Level”:“Study”}]}’
But within my Lua script, I am getting this failure only when including Priority:
E0403 15:07:08.195671 PluginsErrorDictionary.cpp:111] Exception inside the plugin engine: Bad file format
E0403 15:07:08.195671 LuaScripting.cpp:358] Lua: Bad file format
E0403 15:07:08.195671 LuaScripting.cpp:361] Lua: Error in RestApiPost() for URI: /transfers/send
I have defined within Lua:
local transfer = {}
transfer[‘Resources’] = {}
transfer[‘Resources’][1] = {}
transfer[‘Resources’][1][‘Level’] = ‘Study’
transfer[‘Resources’][1][‘ID’] = studyId
transfer[‘Priority’] = ‘1’
transfer[‘Compression’] = ‘gzip’
transfer[‘Peer’] = ‘PEER’
PrintRecursive(DumpJson(transfer))
local job = ParseJson(RestApiPost(‘/transfers/send’, DumpJson(transfer, true)))
which submits the JSON below, which is the same as the CURL above, but still fails. But only when Priority is within it.
W0403 15:07:08.194670 LuaContext.cpp:103] Lua says: string, {“Compression”:“gzip”,“Peer”:“PEER”,“Priority”:1,“Resources”:[{“ID”:“acb77278-83f605d4-3ebcf7de-67r0e5a0-a0b87337”,“Level”:“Study”}]}
I am assuming this is a variable/integer issue? Has anyone run into this and know how to resolve it? Thanks!