cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

API 400 error when using BETWEEN_TIMES parameter on LITE account

Lyubo.Dimitrov
Builder

Hey guys,

 

Recently I found an issue when using the AppDynamics API to retrieve metrics or events on a LITE account. I know about the restriction on the last 1440 minutes and I comply with it by requesting data for less that.

However the API still returns the 400 error with body:
"HTTP Status 400 - For LITE Account only last 1440 minutes of data could be extracted"

 

It is weird because I request less than the limit, for example the request that I use is:

GET /controller/rest/applications/9077/metric-data?output=JSON&metric-path=Overall+Application+Performance%7C*&time-range-type=BETWEEN_TIMES&start-time=1596446430281&end-time=1596446434281&rollup=false HTTP/1.1

 

The time range defined between the start-time and end-time parameters is only a few seconds and it is just a minute in the past relative to the time of initiating the request, so it fits in the limit of last 1440 minutes, however I still have the error...

 

If I try to request data using the BEFORE_NOW parameter, like:
GET /controller/rest/applications/9077/metric-data?output=JSON&metric-path=Overall+Application+Performance%7C*&time-range-type=BEFORE_NOW&duration-in-mins=10&rollup=false HTTP/1.1

 

I get successful response.

BUT I don't see anywhere on the documentation that the 

 

I did look on the documentation and I don't BETWEEN_TIMES time range type is not supported on LITE accounts.

 

So bottom line the questions is why the BETWEEN_TIMES range type does not work on my LITE account?

2 REPLIES 2

Mario.Morelli
Architect

Hi

 

As per the documentation, you can only access the last 1440 minutes of data.

 

The start and end dates cannot be used when using accessing the data via that API call from what I know, if on LITE version.

 

On a side note, if you use developer options in your browser, in the UI by setting start & end date e.g in metric browser, it should possibly give you a working query you can maybe use if you really need to use start and end dates.

 

As you only have access to the last 1440 minutes, is there a reason you are trying to use start & end dates?



Found something helpful? Click the Accept as Solution button to help others find answers faster.
Liked something? Click the Thumbs Up button.

Learn more about me in the Community Member Spotlight Q & A

Hi Mario,

 

Thanks for your comment, I had another look on the UI, inspecting the requests through the developer console and what I found is that on LITE account, on the Metric Browser page the Custom time range is not available. So the queries are only with BEFORE_NOW time range type.

If I check the same on a PRO instance, I have the Custom time frame on the UI and the request on the background is actually using BETWEEN_TIMES parameter.

So I tend to agree that the BETWEEN_TIMES parameter is actually not allowed for LITE version, though it is not clearly stated... It would make much more sense to either get a more descriptive error from the API or at least  note it in the documentation.

 

And just to comment, the use case I need the start/end time for is an integration. So using the start/end parameters on scheduled queries is the best way from integration perspective. Using the last n could cause either performance issues or gaps in the data.

 

Another thing I noticed by inspecting the network requests is that the frontend is using a match better API request for retrieving the metrics data which would be really good if exposed in documentation and supported.

 

THanks,

Lyubo

On-Demand Webinar
Discover new Splunk integrations and AI innovations for Cisco AppDynamics.


Register Now!

Observe and Explore
Dive into our Community Blog for the Latest Insights and Updates!


Read the blog here