pu commands to install a package and restart the robot to many sources by OS

book

Article ID: 225586

calendar_today

Updated On:

Products

DX Infrastructure Management

Issue/Introduction

Have a need to push out a package or probe to many sources and then restart their robots.

Environment

Release : 20.3

Component : PU command

Resolution

- GET A LIST OF ADDRESSES TO POPULATE OUR BATCH FILE

--list of distinct robot addresses for robots by OS
SELECT distinct r.address 
from cm_device cd
join cm_nimbus_robot r on r.dev_id=cd.dev_id 
join cm_computer_system cs on cs.cs_id=cd.cs_id 
where cs.os_name like '%Linux%' 

- PUT THE OUTPUT INTO A FILE CALLED address_list.txt

- CREATED A BATCH FILE THAT CALLS THE LIST:

@echo off
FOR /F "tokens=*" %%A in (address_list.txt)  do (
echo.
echo ---%%A--- ---%%A---
echo.
pu -u administrator -p password /<domain>/<primary_hub>/<primary_hub_robot>/automated_deployment_engine deploy_probe <package_name> <package_version> %%A update
timeout 120
pu -u administrator -p password %%A _stop 
echo ---%%A--- ---%%A---
echo.
)