CA Service Management

 View Only
  • 1.  Can the har_worx object be updated directly using REST?

    Posted May 17, 2018 01:52 PM

    I have the following line of code that works to update the nr object(the main table for CIs) using the put method.

    string putBody = "<nr>" + "<zRelayMachine>1</zRelayMachine>" + "<description>" + "</description>" + "</nr>";

     

    when I tried to change it to update the extension table har_worx where the additional work station specific fields live I keep getting a 400 bad request error.

     

    Here's an example of a call that's failing using the put method:

    putBody: <har_worx><proc_type>2500%20MHz%20Core%20i7%2D2860QM<proc_type></har_worx>

     

    Any thoughts on what I'm missing or doing incorrectly?

     

    Elwynn



  • 2.  Re: Can the har_worx object be updated directly using REST?

    Broadcom Employee
    Posted May 17, 2018 02:22 PM

    did yo try

    <har_worx><proc_type>2500 MHz Core i7-D2860QM<proc_type></har_worx>

    ?



  • 3.  Re: Can the har_worx object be updated directly using REST?

    Posted May 21, 2018 08:09 AM

    I discovered I was missing the / to close the proc_type tag :-/



  • 4.  Re: Can the har_worx object be updated directly using REST?
    Best Answer

    Posted May 17, 2018 02:27 PM

    Hi Elwynn,

     

    Yes, you can use PUT requests to update the associated har_worx record.  Tthe har_worx record doesn't need to be created directly, creating the NR record with the class Hardware.Workstation will automatically create the har_worx record.

     

    Here's an example PUT URL/Body.

     

    Request type: PUT

    URL https://dns:port/caisd-rest/har_worx/U'F890E113065C61448777628E21581E9B

    Body

    <har_worx>
    <processor_count>2</processor_count>
    <phys_mem>8192</phys_mem>
    </har_worx>

     



  • 5.  Re: Can the har_worx object be updated directly using REST?

    Posted May 17, 2018 02:29 PM

    Also, you don't need to encode the content body, just the URL.



  • 6.  Re: Can the har_worx object be updated directly using REST?

    Broadcom Employee
    Posted May 18, 2018 08:21 AM

    Elwynn.........

     

    Did the information provided by gbruneau help you?

     

    If so, please mark Grant's response as correct so that this thread can be closed.