Computer Type called in RestAPI

I am trying to create a query that calls a bunch of random property data. Some of the properties were manually created and others include Reserved properties. I am specifically having issues calling Computer Type, I have no issues pulling other reserved properties (like ComputerID or Last Report Time).

So I start off with this query

https://A.B.C.D:52311/api/query?relevance=(id of it, device type of it, name of it | “[name not reported]”, last report time of it) of (members of bes computer group whose (name of it = “All Windows Workstations”))

<Tuple>
<Answer type="integer">713</Answer>
<Answer type="string">Laptop</Answer>
<Answer type="string">ABC123</Answer>
<Answer type="time">Thu, 06 Feb 2020 07:43:22 -0500</Answer>
</Tuple>

when I try to add computer type to the query it I get not defined error message
https://A.B.C.D:52311/api/query?relevance=(id of it, device type of it, computer type of it, name of it | “[name not reported]”, last report time of it) of (members of bes computer group whose (name of it = “All Windows Workstations”))

<Error>The operator "computer type" is not defined.</Error>

If I try it by calling the property directly it also does not return value (just the return)
https://A.B.C.D:52311/api/query?relevance=(id of it, device type of it, (concatenation " " of values of result (it, bes properties “Computer Type”) | “[Unknown]”), name of it | “[name not reported]”, last report time of it) of (members of bes computer group whose (name of it = “All Windows Workstations”))

<Tuple>
<Answer type="integer">713</Answer>
<Answer type="string">Laptop</Answer>
<Answer type="string">[Unknown]</Answer>
<Answer type="string">ABC123</Answer>
<Answer type="time">Thu, 06 Feb 2020 07:43:22 -0500</Answer>
</Tuple>

I ran the /api/properties and see Computer Type IsReserved is 1

<Name>Computer Type</Name>
<ID>307703</ID>
<IsReserved>1</IsReserved>

Any Ideas why this one property is not reporting back properly? I am hoping I am just missing something little here.

The “Computer type” appears to be a reserved property of the analyses “Physical / Virtual Computer Type Analysis” of site “Inventory and License”. To activate it follow the instruction at:

https://www.ibm.com/developerworks/community/wikis/home?lang=en#!/wiki/Tivoli%20Endpoint%20Manager/page/Collecting%20information%20about%20computer%20type%20(BES%20Inventory%20and%20License)

The following relevance shows the results of a specific computer on my environment:

(id of it, device type of it, (concatenation " " of values of result (it, bes properties “Computer Type”) ), name of it , last report time of it) of bes computer whose (name of it = “NC1474172”)

The results on my test environment are as follow:
540969469, Server, Virtual, NC1474172, ( Fri, 07 Feb 2020 16:56:57 +0100 )

Note that if you target a group of computers and the above anlyses doesn’ exist on all computers, then the query will return the error “the operator “computer type” is not defined”. This behaviour is debatable, since the computer type can be retrived from the global property as it is shown in the console. However consider that the property in the console could not be as accurated as the one retrived from the scanner of the “Inventory and License” site.

There can be times (as likely is the case here), where it is not sufficient to refer to a property by name since there may be multiple with the same name. There are various ways of being more specific in your relevance query (such as querying by property ID, or filtering on analysis or site name, or even other flags such as ‘reserved’). Try something like the following:

(id of it, device type of it, (concatenation " " of values of result (it, bes properties "Computer Type" whose (reserved flag of it)) | "[Unknown]"), name of it | "[name not reported]", last report time of it) of (members of bes computer group whose (name of it = "All Windows Workstations"))

1 Like

Having the same issue. Did you get a resolution? I tried Aram’s whose(reserved flag of it) clause and that didn’t work for me in the context of a REST API query. I don’t intend on using the hardware scanner at this point.

I was never able to get it to work properly with the reserved property. I ended up going path of least resistance and created a “Computer Type - Physical Virtual” property that is just a copy of the reserved property. Since its something that does not change frequently I changed the evaluate period to be 1 day. I then call the new property in my API with no issues.