Clarity Service Management

Expand all | Collapse all

Rest API Update Inactive CI

Jump to Best Answer
  • 1.  Rest API Update Inactive CI

    Posted 03-13-2018 11:31 AM

    Hi Community,

     

    I'm working on a process to synchronize our SCCM environment with the CMDB using the RESTful API.  One problem I found is I'm not able to edit inactive CIs via REST but can update them in the UI and via SOAP.  Wondering if anyone else has noticed this and if there's a solution?  I opened a support case already but want to post here in case it's a simple fix.  The option allow_updates_to_inactive_ci is installed and set to Yes.

     

    Here's an example of a working PUT operation (CI is Active).

    PUT /caisd-rest/nr/U'7E2BF755E00C6248ACD5BA6CC045019D' HTTP/1.1
    Host: hostname:8050
    Content-Type: application/xml;charset=UTF-8
    X-AccessKey: 1726620906
    X-Obj-Attrs: delete_flag
    Cache-Control: no-cache
    Postman-Token: 09fd3093-042e-49d0-a4b2-c4ac8e089978
    <nr id="U'7E2BF755E00C6248ACD5BA6CC045019D'">
    <description>test</description>
    </nr>

     

    I'm able to inactivate the CI

    PUT /caisd-rest/nr/U'7E2BF755E00C6248ACD5BA6CC045019D' HTTP/1.1
    Host: hostname:8050
    Content-Type: application/xml;charset=UTF-8
    X-AccessKey: 1726620906
    X-Obj-Attrs: delete_flag
    Cache-Control: no-cache
    Postman-Token: f79dd85a-6f98-47f1-a95c-3f426c162e29
    <nr id="U'7E2BF755E00C6248ACD5BA6CC045019D'">
    <delete_flag COMMON_NAME="Inactive"/>
    </nr>

     

    However, once it's inactive I can't update it.  The following PUT operation returns a HTTP 500 error with this error in the logs.

    03/13 08:26:29.872 [http-nio-8050-exec-8] ERROR SDMCRUDServiceImpl 2061 Invalid number of rows (0) affected by the operation. Expecting (1). [UPDATE nr SET delete_flag=0 WHERE id = U'7E2BF755E00C6248ACD5BA6CC045019D'] {http://hostname:8050/caisd-rest/nr/U%277E2BF755E00C6248ACD5BA6CC045019D%27} 

     

    PUT /caisd-rest/nr/U'7E2BF755E00C6248ACD5BA6CC045019D' HTTP/1.1
    Host: hostname:8050
    Content-Type: application/xml;charset=UTF-8
    X-AccessKey: 1726620906
    X-Obj-Attrs: delete_flag
    Cache-Control: no-cache
    Postman-Token: 266c1aa9-6de5-4f29-950f-c20ddef56ae9
    <nr id="U'7E2BF755E00C6248ACD5BA6CC045019D'">
    <delete_flag COMMON_NAME="Active"/>
    </nr>


  • 2.  Re: Rest API Update Inactive CI
    Best Answer

    Posted 03-13-2018 06:15 PM

    Well, I found a defect..  It'll be fixed in a future cumulative.  Tested 17.0 and 17.1 and both versions have this defect.  I'll add a single SOAP operating into my PAM process which is otherwise using the REST API.



  • 3.  Re: Rest API Update Inactive CI

    Posted 01-21-2019 05:10 AM

    DE39091 resolved in Rollup 1 for 17.1



  • 4.  Re: Rest API Update Inactive CI

    Posted 01-21-2019 05:11 AM


  • 5.  Re: Rest API Update Inactive CI

    Posted 03-13-2018 06:19 PM

    Grant, please open a Support case so CA Support and you can work together to get to the bottom of this. From the description above, your second call to activate it should work. Thanks _Chi



  • 6.  Re: Rest API Update Inactive CI

    Posted 03-13-2018 06:20 PM

    Wow, we wrote  at the same time...gbruneau



  • 7.  Re: Rest API Update Inactive CI

    Posted 03-13-2018 06:24 PM

    Yep, thanks Chi.  I had submitted a case before posting this thread as I assumed it was a defect.  Alex picked this one up and confirmed it.