Highlighted
Valued Contributor.. Valued Contributor..
Valued Contributor..
287 views

REST API:: [ErrorCode [153] type of property and type of value don't match]

Hi to all,

I try to request all software installations (that are not a candidate for deletion) for a device via REST API.

This is my payload

{
    "nodes":  [
                  {
                      "attributeConditions":  [
                                                  {
                                                      "logicalOperator":  "and"
                                                  },
                                                  {
                                                      "operator":  "equals",
                                                      "value":  "4c7ee81cb37e7580904bef32d1f52516",
                                                      "attribute":  "root_container"
                                                  },
                                                  {
                                                      "operator":  "equals",
                                                      "value":  "false",
                                                      "attribute":  "root_iscandidatefordeletion"
                                                  }
                                              ],
                      "layout":  [
                                     "discovered_vendor",
                                     "name",
                                     "version",
                                     "last_modified_time"
                                 ],
                      "queryIdentifier":  "installed_software",
                      "type":  "installed_software",
                      "visible":  "true"
                  }
              ]
}

But I got the following error

2019-03-07 10:39:06,732 [qtp1916657318-144736] ERROR Failed to execute query
appilog.framework.shared.manage.impl.MamResponseException: [ErrorCode [153] type of property and type of value don't match]
com.mercury.topaz.cmdb.shared.base.CmdbException: [ErrorCode [153] type of property and type of value don't match]
appilog.framework.shared.manage.impl.MamResponseException: [ErrorCode [153] type of property and type of value don't match]
CMDB Operation Internal Error: class com.mercury.topaz.cmdb.shared.base.CmdbException : Pattern [AdHocRESTQuery_698710835374291] not valid. com.mercury.topaz.cmdb.shared.tql.exception.TqlValidationException: [ErrorCode [153] type of property and type of value don't match]
Condition value:false type:class java.lang.String is invalid to property of type:class java.lang.Boolean : operation Tql Query: Get Ad Hoc Map (By Pattern). Pattern [AdHocRESTQuery_698710835374291] : class com.mercury.topaz.cmdb.shared.base.CmdbException :
CMDB Internal Error: Error while handling request: {request: ID='4285d9a1aceb84d9aaeb9cb4d398a52f' Message='General CMDB request' Operation='com.mercury.topaz.cmdb.shared.tql.operation.query.impl.TqlQueryGetAdHocMap@6391be33' Customer ID='1'
Context='CMDB Context: Customer id = '1' , User ID = '1' , Caller Application = 'REST,loggedInUser:{sysadmin###UCMDB}''}
        at com.mercury.topaz.cmdb.server.manage.rpm.RequestProcessor.createCmdbResponseOnCmdbError(RequestProcessor.java:513)
        at com.mercury.topaz.cmdb.server.manage.rpm.RequestProcessor.processRequest(RequestProcessor.java:237)
        at com.mercury.topaz.cmdb.server.manage.rpm.RequestProcessor.handleRequest(RequestProcessor.java:141)
        at com.mercury.topaz.cmdb.server.manage.Framework.handleRequest(Framework.java:838)
        at com.mercury.topaz.cmdb.client.manage.api.impl.AbstractCmdbApi.executeCMDBOperation(AbstractCmdbApi.java:38)
        at com.mercury.topaz.cmdb.client.manage.api.impl.AbstractCmdbApi.executeOperation(AbstractCmdbApi.java:57)
        at com.mercury.topaz.cmdb.client.manage.api.impl.InternalApi.executeOperation(InternalApi.java:32)
        at com.mercury.topaz.cmdb.client.manage.api.impl.InternalApi.executeCMDBOperation(InternalApi.java:24)
        at com.mercury.topaz.cmdb.server.manage.ServerApiFacade.executeOperation(ServerApiFacade.java:56)
        at com.mercury.topaz.cmdb.server.manage.ServerApiFacade.executeOperation(ServerApiFacade.java:34)
        at com.hp.ucmdb.rest.OperationExecutor.execute(OperationExecutor.java:52)
        at com.hp.ucmdb.rest.bridge.topology.TopologyService.executeQuery(TopologyService.java:156)
        at com.hp.ucmdb.rest.uiserver.modelingstudio.controllers.TopologyQueryController.executeQuery(TopologyQueryController.java:66)
        at sun.reflect.GeneratedMethodAccessor234.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.glassfish.jersey.server.model.internal.ResourceMethodInvocationHandlerFactory$1.invoke(ResourceMethodInvocationHandlerFactory.java:81)
        at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher$1.run(AbstractJavaResourceMethodDispatcher.java:144)
        at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.invoke(AbstractJavaResourceMethodDispatcher.java:161)
        at ...

If I remove

{
      "operator":  "equals",
      "value":  "false",
      "attribute":  "root_iscandidatefordeletion"
 }

everything works well.

Can someone explain how to request a boolean attribute such as "root_iscandidatefordeletion"

Thanks,

Achim

4 Replies
Highlighted
Acclaimed Contributor.. Acclaimed Contributor..
Acclaimed Contributor..

Re: REST API:: [ErrorCode [153] type of property and type of value don't match]

Hi Achim,

I don't think the problem is in candidate for deletion.

It looks like you are setting condition on "root_container" of node. While the property exists, I'm not sure what the meaning of query is.

On attached CIs like CPU, that can't exist without host, root container is pointing to host.

Could you try restricting Host by Name or UCMDBId and add condition on candidate for deltion?

Regards
-Dmitry Gomel, PMP
Click the Like button at the bottom to say 'Thanks'.
0 Likes
Highlighted
Valued Contributor.. Valued Contributor..
Valued Contributor..

Re: REST API:: [ErrorCode [153] type of property and type of value don't match]

Hello Dmitry,

The condition is on root_container in installed_software.

I want to read each software installation from a given node. The root_container is the represenation of the ucmdb_id of a node.

Kind regards,

Achim

0 Likes
Highlighted
Acclaimed Contributor.
Acclaimed Contributor.

Re: REST API:: [ErrorCode [153] type of property and type of value don't match]

root_iscandidatefordeletion is a boolean. You are sending it as a string. check if you can send 1 or 0 without quotation marks. 

 

Cheers,

Petko Popadiyski

Freelance Microfocus CMS UCMDB Consulting

Likes are appreciated!
0 Likes
Highlighted
Valued Contributor.. Valued Contributor..
Valued Contributor..

Re: REST API:: [ErrorCode [153] type of property and type of value don't match]

Hi,
Sorry for my delay. I will try it asap.
Thx
Achim
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.