diff --git a/operational/flexera/itam/asset_report/itam_asset_report.pt b/operational/flexera/itam/asset_report/itam_asset_report.pt index c1319fbbc6..6a19e58260 100644 --- a/operational/flexera/itam/asset_report/itam_asset_report.pt +++ b/operational/flexera/itam/asset_report/itam_asset_report.pt @@ -62,6 +62,19 @@ credentials "auth_flexera" do tags "provider=flexera" end +############################################################################### +# Pagination +############################################################################### + +pagination "pagination_flexera" do + get_page_marker do + body_path jq(response, "if .total == 0 then null else .offset + 10000 end") + end + set_page_marker do + query "offset" + end +end + ############################################################################### # Datasources & Scripts ############################################################################### @@ -144,13 +157,14 @@ script "js_itam_assets", type: "javascript" do parameters "flexera_api_host", "param_asset_status", "param_asset_type", "param_asset_location", "rs_org_id" result "request" code <<-EOS - query_params = { limit: 100000 } + query_params = { limit: 10000 } if (param_asset_status != "All") { query_params["status"] = param_asset_status } if (param_asset_type != "All") { query_params["assetType"] = param_asset_type } if (param_asset_location.trim() != "") { query_params["location"] = param_asset_location.trim() } var request = { auth: "auth_flexera", + pagination: "pagination_flexera", host: flexera_api_host, path: ["/fnms/v1/orgs/", rs_org_id, "/assets"].join(''), headers: { "User-Agent": "RS Policies" }, diff --git a/operational/flexera/itam/installed_app_report/itam_installed_app_report.pt b/operational/flexera/itam/installed_app_report/itam_installed_app_report.pt index f2173f26b2..1d26b0fde2 100644 --- a/operational/flexera/itam/installed_app_report/itam_installed_app_report.pt +++ b/operational/flexera/itam/installed_app_report/itam_installed_app_report.pt @@ -36,6 +36,19 @@ credentials "auth_flexera" do tags "provider=flexera" end +############################################################################### +# Pagination +############################################################################### + +pagination "pagination_flexera" do + get_page_marker do + body_path jq(response, "if .total == 0 then null else .offset + 10000 end") + end + set_page_marker do + query "offset" + end +end + ############################################################################### # Datasources & Scripts ############################################################################### @@ -110,10 +123,11 @@ script "js_itam_apps", type: "javascript" do code <<-EOS var request = { auth: "auth_flexera", + pagination: "pagination_flexera", host: flexera_api_host, path: ["/fnms/v1/orgs/", rs_org_id, "/installed-applications"].join(''), headers: { "User-Agent": "RS Policies" }, - query_params: { limit: 100000 } + query_params: { limit: 10000 } } EOS end