Hi,
I'm playing around with deployment of automation scripts and i ran into some weird behaviour when using parameters. See script below:
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Text;
using Skyline.DataMiner.Automation;
/// <summary>
/// DataMiner Script Class.
/// </summary>
class Script
{
/// <summary>
/// The Script entry point.
/// </summary>
/// <param name="engine">Link with SLScripting process.</param>
public void Run(Engine engine)
{
engine.GenerateInformation(engine.GetScriptParam("feed").Value);
engine.GenerateInformation(engine.GetScriptParam("feed2").Value);
}
}
When i start it by hand i can enter a value and in the information event i get the direct value i entered.
However when i deploy this script and i test this from the build in tester i get the following information:
POST /api/deploy/scripts/_logtoinformation HTTP/1.1
Host: <dmatestip>:5000
Token:
Content-Type: application/json; charset=utf-8
Content-Length: 59
{
"PARAMETER:1": "value1",
"PARAMETER:2": "value2"
}
and as result:
["-2147220815",
"Could not start script: there's no script parameter value provided for id 2"
]
if i remove feed2 as parameter so only feed will log:
i get as result: {} (as expected since i dont output any information)
and in the information events i find:
{
"PARAMETER:1": "value1"
} (Script 'logtoinformation')
What is the recomended aproach (since i want to send an Json string and parse that, i've got it working when i remove just the Json string but i'm uncertain if that is the general aproach)
Hi Gerwin,
I believe that deployments are by default of type 'JSON' right now. That means only one script parameter can be present and that the full HTTP body of the trigger request will be contained in that parameter. Cube does not detect this correctly in the tester right now.
That’s indeed what my testing showed. Just wanted to make sure that this indeed was the case.