Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
XOmniverse committed Dec 30, 2024
1 parent 0c00872 commit 9693844
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 2 deletions.
16 changes: 15 additions & 1 deletion operational/flexera/itam/asset_report/itam_asset_report.pt
Original file line number Diff line number Diff line change
Expand Up @@ -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
###############################################################################
Expand Down Expand Up @@ -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" },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
###############################################################################
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 9693844

Please sign in to comment.