DX Infrastructure Manager

Expand all | Collapse all

REST call to search on multiple fields?

  • 1.  REST call to search on multiple fields?

    Posted 02-13-2019 05:43 PM

    So we have SNOW and were thinking about setting up a workflow w/in SNOW when anyone creates a change control window. We figured out what the corresponding UIM REST Maintenance call would be made to create the Maintenance Schedule but the issue we have was finding all the cs_id's of all the devices that correspond to a specific device.

    So you can have multiple entries in the UIM DB for one devices and they all have different cs_ids.

    Or you could have the same named devices at multiple different hubs(clients) (example:  exch01)

    Are there any REST calls that can search for devices so that it returns a list of CS_ID's also based on origin? 

    We can do it easily with a SQL query but we don't have that add-on in SNOW to do sql queries so we are left with what's available in the UIM REST library. 

     

    I only see this GET rest call :  

                   http://ump/rest/computer_systems/cs_name/exch01?contains=true

    where it returns all entries that contain "exch01" but if we need a specific exhc01 at ORIGIN = YYYY is there a way to do this?

    Are there any REST calls in UIM that can search for "name like XXXX" and "origin like YYYY" searching two fields? Can we overload  the REST call 

     

          http://ump/rest/computer_systems/cs_name/exch01?contains=true/origin/clientA?contains=true

     

    ^This didn't work but is there a way to do this?

     

    TIA...



  • 2.  Re: REST call to search on multiple fields?

    Posted 02-14-2019 07:37 PM

    Hi Dan,

     

    Here is a document that may be helpful, but I would suggest opening a support case so we can follow up with engineering on your requirement.

     

    https://docops.ca.com/ca-unified-infrastructure-management/8-31/br/files/232219617/430317168/1/1439579811602/UIM_RESTWeb… 

     

    Steve



  • 3.  Re: REST call to search on multiple fields?

    Posted 02-15-2019 12:34 PM

    I was looking at this and it appears we do not have a way to add further filtering criteria with the Webservices_Rest calls.

     

    http://<umpserver>/rest/application.wadl

    webservices_rest application.wadl

     

     

    It does however appear that this can be accomplished in UIM 9.0.2 using the uimapi

     

    http://<primaryhub>/uimapi/devices?type=master&name=polgr01-robot&origins=primaryHub

    Which then returns the properties for the one device including cs_id

    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>

    <devices>
      <device>
        <alias>polgr01-robot</alias>
        <correlationNames>polgr01-robot</correlationNames>
        <id>7</id>
        <ipAddresses>10.10.10.17</ipAddresses>
        <label>polgr01-robot</label>
        <macAddresses>02-00-E4-4A-3D-4D</macAddresses>
        <name>polgr01-robot</name>
        <origins>primaryHub</origins>
        <osDescription>Service Pack 0 Build 9600</osDescription>
        <osType>WindowsServer-2012-R2</osType>
        <primaryIpAddress>10.10.10.17</primaryIpAddress>
        <primaryMacAddress>02-00-E4-4A-3D-4D</primaryMacAddress>
        <primaryRole>Host</primaryRole>
        <probeProperties>
          <key>CorrelationId</key>
          <value>D9FD4FE13EE1F6BF0F88800EEEE4F90A9</value>
        </probeProperties>
        <roles>Device</roles>
        <roles>Host</roles>
      </device>
    </devices>

     

     

    -Greg