How to increase the number or results allowed for a REST API call in AAI
search cancel

How to increase the number or results allowed for a REST API call in AAI

book

Article ID: 259898

calendar_today

Updated On:

Products

Automic Automation Intelligence

Issue/Introduction

Is there a way to get a row beyond 10,000 results using the AAI REST API?

If I use startIndex greater than 9999 then it returns the error below:  

 

{

  "message": "javax.ws.rs.WebApplicationException: HTTP 401 Unauthorized",

  "stackTrace": "com.termalabs.server.restapi.writer.CollectionMBWriter.writeJsonResponse(CollectionMBWriter.java:204)\n\tcom.termalabs.server.restapi.writer.CollectionMBWriter.writeTo(CollectionMBWriter.java:100)\n\tcom.termalabs.server.restapi.writer.CollectionMBWriter.writeTo(CollectionMBWriter.java:45)\n\torg.jboss.resteasy.core.interception.AbstractWriterInterceptorContext.writeTo(AbstractWriterInterceptorContext.java:136)\n\torg.jboss.resteasy.core.interception.ServerWriterInterceptorContext.writeTo(ServerWriterInterceptorContext.java:62)\n\torg.jboss.resteasy.core.interception.AbstractWriterInterceptorContext.proceed(AbstractWriterInterceptorContext.java:124)\n\torg.jboss.resteasy.security.doseta.DigitalSigningInterceptor.aroundWriteTo(DigitalSigningInterceptor.java:145)\n\torg.jboss.resteasy.core.interception.AbstractWriterInterceptorContext.proceed(AbstractWriterInterceptorContext.java:129)\n\torg.jboss.resteasy.plugins.interceptors.encoding.GZIPEncodingInterceptor.aroundWriteTo(GZIPEncodingInterceptor.java:103)\n\torg.jboss.resteasy.core.interception.AbstractWriterInterceptorContext.proceed(AbstractWriterInterceptorContext.java:129)\n\torg.jboss.resteasy.core.ServerResponseWriter.writeNomapResponse(ServerResponseWriter.java:106)\n\torg.jboss.resteasy.core.SynchronousDispatcher.writeResponse(SynchronousDispatcher.java:473)\n\torg.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:422)\n\torg.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:209)\n\torg.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.service(ServletContainerDispatcher.java:221)\n\torg.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:56)\n\torg.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:51)\n\tjavax.servlet.http.HttpServlet.service(HttpServlet.java:790)\n\tio.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:85)\n\tio.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:129)\n\tcom.termalabs.server.restapi.authentication.AuthenticationFilter.doFilter(AuthenticationFilter.java:154)\n\tio.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61)\n\tio.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)\n\tcom.termalabs.server.restapi.CacheControlFilter.doFilter(CacheControlFilter.java:27)\n\tio.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61)\n\tio.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)\n\tio.undertow.servlet.handlers.FilterHandler.handleRequest(FilterHandler.java:84)\n\tio.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:62)\n\tio.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36)\n\torg.wildfly.extension.undertow.security.SecurityContextAssociationHandler.handleRequest(SecurityContextAssociationHandler.java:78)\n\tio.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)\n\tio.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:131)\n\tio.undertow.servlet.handlers.security.ServletAuthenticationCallHandler.handleRequest(ServletAuthenticationCallHandler.java:57)\n\tio.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)\n\tio.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:46)\n\tio.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintHandler.java:64)\n\tio.undertow.security.handlers.AuthenticationMechanismsHandler.handleRequest(AuthenticationMechanismsHandler.java:60)\n\tio.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:77)\n\tio.undertow.security.handlers.NotificationReceiverHandler.handleRequest(NotificationReceiverHandler.java:50)\n\tio.undertow.security.handlers.AbstractSecurityContextAssociationHandler.handleRequest(AbstractSecurityContextAssociationHandler.java:43)\n\tio.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)\n\torg.wildfly.extension.undertow.security.jacc.JACCContextIdHandler.handleRequest(JACCContextIdHandler.java:61)\n\tio.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)\n\tio.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)\n\tio.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:285)\n\tio.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:264)\n\tio.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:81)\n\tio.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:175)\n\tio.undertow.server.Connectors.executeRootHandler(Connectors.java:324)\n\tio.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:803)\n\tjava.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)\n\tjava.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)\n\tjava.lang.Thread.run(Thread.java:750)\n",

  "exceptionClass": "javax.ws.rs.WebApplicationException",

  "exceptionMessage": "HTTP 401 Unauthorized"

}

 

 

 

Thanks,

Ryan

 

 

Environment

Release : 6.4.5

Resolution

 
The default limit is 10,000 results, which can be increased by updating the  restApiSearchResultLimit parameter in the AAI Configuration tool.
 
 
This is in the configuration tool->parameters tab.


Once you update the value, click apply and the changes will take place without having to restart any services.