I am not the DBA. I'm not even sure if I'm as good as I think I am after tackling this task.
I am a web user of the AssetManager web service. I can query this using point and click -
Branching out - I requested access to same - using the API.
I wrote a bit of powershell code to connect to the DB/Table 'amPorfolio' - and can query assets and get back meaningful responses.
My sticking point is filtering on the server side in the API. How does one compose a URI containing a compound filter?
The filter that works for me is "&filter=(attribute = 'value')"
How I use it:
$AMSERVER = 'http://MYSERVER:8080/'
$AMDBTABLE = 'AssetManagerWebService/rs/db/amPortFolio/'
$AMFILTER = "&filter=(DeviceType = 'Server')"
$fin = Invoke-RestMethod "$($AMSERVER)$($AMDBTABLE)$($AMFIELDS)$($AMFILTER)" `
-SessionVariable websession `
-Credential $User_cred `
-Headers @{"SOAPAction" = "Retrieve"; "Authorization" = "Basic "}
... and I am looking for something similar to the example below, where the PowerShell URI filter can include "IS this or that value"
... and to extend that - a method for leveraging something like
"&filter=(field0 = 'this' -and/or (field1 = 'this -and/or 'that')"
"&filter=startswith/endswith(attribute , 'value')" or
"&filter=contains(deviceName , 'partialna')"
is such a capability present? Is there an accessible document available that fleshes that API out a bit more?
I'm just not tripping over the right syntax if its in the API without some sort of guidance.
Function testReadFromAM() { var table = "amAsset"; var fields = "lAstId,Label,lModelId"; var where = "Where AssetTag LIKE 'CPU00001%' AND lTenantId = 12345";
example above from: Call Asset Manager 9.40 RESTful API from Service Manager 9.40 - Service Manager / Service Center User Discussions - SMA-Service Manager Suite (microfocus.com)