No there isn't. However, when you take it down to SSH, then you're likely sending CLI commands from a shell script? In that case, you can simply use the shell scripting equivalent.
For linux/unix, it is simply "sleep ##p", where the '##' is replacing with an amount and 'p' is the time period, such as 's' for seconds, 'm' for minutes. So to sleep for one second, you'd add "sleep 1s" to the script.
For PowerShell, use the "Start-Sleep" command, which also comes with a time period and a number, but in reverse, such as "Start-Sleep -Seconds 1".
On a side note, KumbaSoft just added a "sleep" command to their CLI implementation in their DPAA (DataPower Administrator's Assistant) tool, where it creates a simulation of a DataPower sleep.
Original Message:
Sent: Fri January 03, 2025 12:18 PM
From: Gosha Belenkiy
Subject: DataPower sleep CLI
The question is if sleep/wait exists as a DataPower CLI (or SSH for that matter).
------------------------------
Gosha Belenkiy
Solution Architect | Cloud | Integration
Original Message:
Sent: Fri January 03, 2025 08:39 AM
From: Hermann Stamm-Wilbrandt
Subject: DataPower sleep CLI
> ... There is no sleep in XSLT but ...
>
You can call any GatewayScript directly from XSLT:
https://www.ibm.com/docs/en/datapower-gateway/10.5.0?topic=functions-dpgatewayscript
You can even call in the other direction, call XQuery from XSLT, and XSLT being called from GatewayScript:
https://stamm-wilbrandt.de/en/blog/3lang.js
$ coproc2 happy.js <("") http://dp-hermann-work.fyre.ibm.com:2227; echo
2025
$ cat happy.js
for(var sum=0,i=1;i<=9;++i){sum+=i*i*i}
session.output.write(sum);
$
------------------------------
Hermann Stamm-Wilbrandt
Compiler Level 3 support, IBM DataPower Gateways
IBM
Boeblingen
Original Message:
Sent: Sun December 29, 2024 08:31 AM
From: Ivan Heninger
Subject: DataPower sleep CLI
Actually, there is sleep() and setTimeout() both in gateway-script(GwS). There is no sleep in XSLT but you can do hacky things like ping an unreachable ip addr which gives a 6 second delay.
I did a rather interesting study of GwS sleep using asynchronous and synchronous callbacks a few years ago. I did this study because my requirements included very precise latency for use as backend in "fixed latency" performance testing. The results showed the async callback latency has very wide variance while the synchronous approach is much more precise and blocks a thread while sleeping.
First is async approach:
function sleep(ms) {
return new Promise(resolve => setTimeout(resolve, ms));
}
// Introduce latency if requested
if (min_latency_ms != 0 || max_latency_ms != 0) {
sleep_ms = Math.floor(Math.random() * (max_latency_ms - min_latency_ms + 1) + min_latency_ms);
await sleep(sleep_ms);
}
Above is async, below is synchronous---------------------------------------------------
// Callback for setTimeout()
function timeout_expired_callback() {
//Do something
}
if (min_latency_ms != 0 || max_latency_ms != 0) {
sleep_ms = Math.floor(Math.random() * (max_latency_ms - min_latency_ms + 1) + min_latency_ms);
setTimeout(timeout_expired_callback, sleep_ms);
}
If you can accept a few mS of variance in the callback then the async approach is recommended in order to avoid occupying a GwS runtime engine while sleeping. You can monitor the GwS engine availability using the gatewayscript-status CLI which is also available from the rest-mgmt, xml-mgmt and GUI interfaces.
dp809:idg(config)# sh gatewayscript-st
Available run times: 64
In-use run times: 0
Queued work: 0
Runtime failures: 0
Hope this helps.
-Ivanh
------------------------------
Ivan Heninger
Original Message:
Sent: Sat December 28, 2024 12:35 PM
From: Joseph Morgan
Subject: DataPower sleep CLI
Unfortunately, no. However, with that said, what is your use case?
------------------------------
Joseph Morgan
CEO - Independent
Dallas TX
Original Message:
Sent: Fri December 27, 2024 04:49 PM
From: Gosha Belenkiy
Subject: DataPower sleep CLI
Team,
Is there a wait / sleep DataPower CLI?
Thanks.
------------------------------
Gosha Belenkiy
Solution Architect | Cloud | Integration
------------------------------