Skip to content

Conversation

@cofl
Copy link

@cofl cofl commented Jul 19, 2018

Discovered while testing against the asset list on a local SnipeIT install.

In EndPointManager.GetAll, when there are fewer than 1000 assets in the system, only 50 assets (the default limit) would be included in the ResponseCollection, though the Total would still show the correct number.

In EndPointManager.FindAll, when a limit is not provided, again at most only 50 assets would be included in the ResponseCollection, even when the results should have more, such as when retrieving all assets of a certain manufacturer.

Replication steps

I did my testing in PowerShell.

  1. Have a SnipeIT instance with more than 50 but fewer than 1000 assets, where approximately 160 of those assets have a manufacturer.
  2. PowerShell log attached (paths removed):
PS C:\> $api = [SnipeSharp.SnipeItApi]::new(); $api.ApiSettings.ApiToken = $token; $api.ApiSettings.BaseUrl = $url
PS C:\> $api.AssetManager.GetAll() | select Total, @{Name='Actual';Expression={$_.Rows.Count}}

Total Actual
----- ------
  602     50

PS C:\> $filter = [SnipeSharp.Endpoints.SearchFilters.AssetSearchFilter]::new()
PS C:\> $filter.Manufacturer = $api.ManufacturerManager.Get("Lenovo")
PS C:\> $api.ManufacturerManager.Get("Lenovo").AssetsCount
167
PS C:\> $api.AssetManager.FindAll($filter) | select Total, @{Name='Actual';Expression={$_.Rows.Count}}

Total Actual
----- ------
  167     50

@cofl cofl changed the base branch from master to Develop July 19, 2018 14:25
@cofl
Copy link
Author

cofl commented Jul 19, 2018

This addresses #5.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants