Escript handling

Upload escript

POST /api/megaload/upload_escript_file/:familyUUID

Input

HTTP multipart request with Content-Type : application/octet-stream

Example

-----------------------------18036622772727284871017578311
Content-Disposition: form-data; name="files[]"; filename="empty.es"
Content-Type: application/octet-stream

#!/usr/bin/env escript

main([]) ->
    ok.

init_load_regulation_metrics() ->
    {ok, []}.

load_regulation_targets(_Metrics, OldTargets) ->
    {ok, OldTargets}.

-----------------------------18036622772727284871017578311--

Returns

The identifier generated by Megaload for the uploaded escript. If the escript is invalid, it returns a 409 response code with an error message explaining the reason.

Example response

Status: 200 OK
"escript_test_1421315152830"

Get all escript filenames

GET /api/megaload/escripts/:familyUUID

Returns

List of escript filenames. The filename, without extension, is the identifier generated by Megaload on the upload of the escript.

Example request

curl http://localhost:8080/api/megaload/escripts/c719a664-83cb-4ab5-b02f-0f91f3e6f512

Example response

Status: 200 OK
["megaload_escript_1421314324910.es", "megaload_escript_1421314325432.es"]

Get escript file

GET /api/megaload/escript/:familyUUID/:escriptFilename

Returns

The escript file in binary format.

Example request

curl http://localhost:8080/api/megaload/escript/c719a664-83cb-4ab5-b02f-0f91f3e6f512/megaload_escript_1421314325432.es

Example response

Status: 200 OK
#!/usr/bin/env escript

main([]) ->
    ok.

init_load_regulation_metrics() ->
    {ok, []}.

load_regulation_targets(_Metrics, OldTargets) ->
    {ok, OldTargets}.