Maintenance mode with curl

book

Article ID: 192538

calendar_today

Updated On:

Products

CA Infrastructure Management CA Performance Management - Usage and Administration DX NetOps

Issue/Introduction

How to put a device into maintenance mode with curl?

Environment

CAPM 3.x

Resolution

You can run the following commands anywhere that has curl installed:

 

To put a device into "maintenance mode" run the following command:
curl -k -w "HTTP code: %{http_code}" -u 'admin:<password>' -X PUT http://<capc>:8181/pc/center/webservice/devices/deviceItemId/<deviceItemId number>/lifeCycleState/MAINTENANCE

 

To change the device back to "active mode" run the following command:
curl -sk -o /dev/null -w "%{http_code}" -u 'admin:<password>' -X PUT http://<capc>:8181/pc/center/webservice/devices/deviceItemId/<deviceItemId number>/lifeCycleState/ACTIVE

Additional Information

  • You would likely only need to single quote the username / password if there was a special character in the password
  • The <deviceItemId number> is captured from the CAPC URL after clicking on the device.  Here is an example:

  • In this example <deviceItemId number> would be 1184