DX NetOps

Expand all | Collapse all

Has anyone successfully used PC webservice  to "RETIRE" a device life cycle state?  per https://docops.ca.com

Jump to Best Answer
  • 1.  Has anyone successfully used PC webservice  to "RETIRE" a device life cycle state?  per https://docops.ca.com

    Posted 09-04-2018 02:13 PM

    On page Update the Device Life Cycle State - CA Performance Management - 3.0 - CA Technologies Documentation 

    It shows an example of the URL syntax to make a "PUT" call to the devices/webservice.   I used "get id names" as it recommends, and the only value showing is  "deviceItemId",  so when I build my curl statement as follows.

    GET ID NAMES : returns

    <idNames>
    <idName value="deviceItemId"/>
    </idNames>
    so my PUT call to the webservice uses the idName value, and the ID for the model to RETIRE.

    curl --verbose --insecure -u "user:Password" -X PUT "https://ecpm.mydomain.com:8181/pc/center/webservice/devices/deviceitemId/1504620/lifeCycleState/RETIRED"

     

    I get the following response   HTTP/1.1 500 Server Error.

     

    * About to connect() to ecpm.cso.nasa.gov port 8181 (#0)
    * Trying 1xx.1xx.1xx.x... connected
    * Connected to ecpm.mydomain.com (1xx.1xx.xx.1xx) port 8181 (#0)
    * Initializing NSS with certpath: sql:/etc/pki/nssdb
    * warning: ignoring value of ssl.verifyhost
    * skipping SSL peer certificate verification
    * SSL connection using TLS_RSA_WITH_AES_256_CBC_SHA256
    * Server certificate:
    * subject: CN=ecpm.mydomain.com,OU=Services,OU=MYCOMPANY,O=irrelevant,C=US
    * start date: Jun 07 13:10:30 2017 GMT
    * expire date: Jun 07 13:40:30 2020 GMT
    * common name: ecpm.mydomain.com
    * issuer: ******************************************************
    * Server auth using Basic with user 'user'
    > PUT /pc/center/webservice/devices/deviceItemId/1504620/lifeCycleState/RETIRED HTTP/1.1
    > Authorization: Basic YWRtaW46SGFua0Bhcm9uMQ==
    > User-Agent: curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.27.1 zlib/1.2.3 libidn/1.18 libssh2/1.4.2
    > Host: ecpm.mydomain.com:8181
    > Accept: */*
    >
    < HTTP/1.1 500 Server Error
    < Set-Cookie: JSESSIONID=16vdiad119cxx1ladhnc9kkyfq;Path=/pc;Secure
    < Connection: close
    < Server: Jetty(9.3.5.v20151012)
    <
    * Closing connection #0



  • 2.  Re: Has anyone successfully used PC webservice  to "RETIRE" a device life cycle state?  per https://docops.ca.com
    Best Answer

    Broadcom Employee
    Posted 09-05-2018 11:14 AM

    Wayne,

     

    I was able to get it to work with the below command:

     

    curl -verbose -k -u "admin:admin" -X PUT "https://pcHostname:8182/pc/center/webservice/devices/deviceItemId/369/lifeCycleState/RETIRED"

     

    I first went to the below URL in a browser to get the PC item id of a device to change (remember this is the PC id, NOT the id shown in Monitored Devices, that is the DA id of the device).

     

    https://pcHostname:8182/pc/center/webservice/devices/

     

    I also used -k instead of -insecure as it would not work to allow me to access the REST interface as I am using a self-signed certificate.

     

    Troy



  • 3.  Re: Has anyone successfully used PC webservice  to "RETIRE" a device life cycle state?  per https://docops.ca.com

    Posted 09-06-2018 09:51 AM

    Thank you Troy.   Many hours spent trying to figure this out.

    My issue was that I was using the GUI / Administration / monitored devices / "Details" tab - the "Item ID" shown on that page  (was my mistake in assuming)  IS NOT the same number as the device/ItemID number returned from the "GET" devices xml output.

    Once I used the correct number, everything works just like the documentation says.

     

    I owe you one.   Many Thanks!