Uploaded image for project: 'Opsgenie'
  1. Opsgenie
  2. OPSGENIE-549

As a user, I want to have the Node.JS library implemented to deal with pagination itself, or have a field in the list alert result indicating the total amount of entries

XMLWordPrintable

    • 0
    • Our product teams collect and evaluate feedback from a number of different sources. To learn more about how we use customer feedback in the planning process, check out our new feature policy.

      User Goals

      In the current design, there's no direct pagination in the Opsgenie API or the Node.JS library for an easy way to craft the snippet for automation to list out all the alerts matching the designated filter.

      Because the max value for the limit is 100 per API call, the only way is to code the function to fetch the offset value in the last field nested under the paging object in the 1st API call as a reference to determine how many API calls are required.

      It will be relatively not easy to tailor the script and may consume more CPU cycles to accomplish the objective.

      Possible Solutions

      From the customer's perspective, It would be great if:

      1. Direct pagination is implemented in the Node.js library and the Opsgenie API endpoint.
      2. Get a total results field of some kind added to the response object.

      Known Workarounds

      In the result of the 1st API call, there is an object, paging, at the end of the result.

      Among the child fields within paging, the field, last, contains the URL for the final API call which reveals the total amount of entries in the query result by leveraging the offset value.

      The developer may tailor their snippet to fetch this value from the 1st API call to define the number of API calls they should make each time.

              Unassigned Unassigned
              dlee4@atlassian.com Darryl Lee
              Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated: