CA Service Management

  • 1.  Using UUIDs in REST Web Services

    Posted Aug 29, 2017 01:44 PM

    I have a current project, where the customers sends 'device name and problem description' to our automation processor.

    I am supposed to:

          1. lookup the device UUID in MDB.  (specifically the "affected_resource")

                   select [own_resource_uuid] FROM [mdb].[dbo].[ca_owned_resource]

          2. create incident ticket with the information

                   I am attempting to update the Configuration Item attribute "affected_resource", 

                   but to do this with REST Web Services I must have the UUID of the device.

                         <affected_resource COMMON_NAME="<deviceName>" REL_ATTR="<UUID>">

                                                       or

                         <affected_resource COMMON_NAME="<deviceName>" REL_ATTR="U'<UUID>'">

     

    When I retrieve the UUID from the MDB, it is being converted.  

     I have tried rs.getString(), rs.getBytes, rs.getAsciiStream and all seem to have an invalid UUID.

    How do I prevent this from happening?

    I have seen posts to convert UUID to string and such.

          select [own_resource_uuid]

           ,dbo.unhex([own_resource_uuid]) AS UnHexed

           ,dbo.uuid_to_char(own_resource_uuid) AS uuidToChar

           ,[own_resource_uuid] AS sString

           ,CONVERT(varchar(max),[own_resource_uuid],2) AS myConvert

       FROM [mdb].[dbo].[ca_owned_resource]

       Where host_name = '<deviceName>'

     

    But none of these processes seem to work when rebuilding the UUID to be used in the Web Service call.

    I looked at pdm_deref, but that is un-practical for this application.

    Is there a way to retrieve a UUID from the MDB, using a java program and MS-SQL, maintain the integrity of the UUID and then use the UUID in a subsuquent REST web services call?

     

     

    Any help here would be appreciated, I seem to be going in circles.

    Bottom line, I need to get a UUID from a DB query and then use the UUID in a REST Services create incident call.

     

    Thanks



  • 2.  Re: Using UUIDs in REST Web Services

    Posted Aug 29, 2017 02:54 PM

    Hello, most probably you are receiving uuid in 6B23356F23E9BD4EA5A1046BA194503E, but you need to pass it in U'6B23356F23E9BD4EA5A1046BA194503E' format.



  • 3.  Re: Using UUIDs in REST Web Services
    Best Answer

    Posted Aug 29, 2017 03:10 PM

    Found my solution, knew I would as soon as I wrote this.

    Thanks.