sleep

The sleep command pauses for a specified interval of time and automatically generates a pyATS Blitz ‘sleep’ action snippet.

Basic usage

To pause for few seconds, simply use the sleep command with the desired number of seconds as an argument. For example, to pause for 5 seconds, use the following command:

(lamp-host1) sleep 5
2024-07-29 16:49:29: %LAMP-INFO: +------------------------------------------------------------------------------+
2024-07-29 16:49:29: %LAMP-INFO: :                           Sleeping for 5 seconds                             :
2024-07-29 16:49:29: %LAMP-INFO: +------------------------------------------------------------------------------+
(lamp-host1)

The autogenerated Blitz ‘sleep’ action snippet:

(lamp-host1) list 1
sleep:
  sleep_time: 5
(lamp-host1)

No-wait option

The optional --no-wait option to sleep command creates the Blitz snippet without waiting. This is useful when the required delay has already occurred and there is no need to wait for the delay to complete.

(lamp-host1) sleep 5 --no-wait
2024-07-29 16:59:29: %LAMP-INFO: +------------------------------------------------------------------------------+
2024-07-29 16:59:29: %LAMP-INFO: :                Generating 'sleep' blitz action for 5 seconds                 :
2024-07-29 16:59:29: %LAMP-INFO: +------------------------------------------------------------------------------+
(lamp-host1) list 1
sleep:
  sleep_time: 5
(lamp-host1)