Issues icon indicating copy to clipboard operation
Issues copied to clipboard

Filtering on the machines endpoint incorrectly filters on `IsDisabled`

Open benPearce1 opened this issue 1 year ago • 1 comments

Severity

Blocking some customers, no workaround available

Version

Didn't check earlier versions

Latest Version

I could reproduce the problem in the latest build

What happened?

When calling the Machines List endpoint and filtering by IsDisabled the results are incorrect when setting IsDisabled=false.

Reproduction

For my current test setup: image

http://localhost:8066/api/Spaces-1/machines?skip=0&take=2147483647&isDisabled=false returns all six targets

{
  ItemType: "Machine",
  TotalResults: 6,
  ItemsPerPage: 2147483647,
  NumberOfPages: 1,
  LastPageNumber: 0,
  Items: [ ... ]
}

http://localhost:8066/api/Spaces-1/machines?skip=0&take=2147483647&isDisabled=true returns just the two disabled ones:

{
  ItemType: "Machine",
  TotalResults: 2,
  ItemsPerPage: 2147483647,
  NumberOfPages: 1,
  LastPageNumber: 0,
  Items: [ ... ]

Error and Stacktrace

None errors produced

More Information

This is affecting the use of the Target Datasources in Terraform https://github.com/OctopusDeployLabs/terraform-provider-octopusdeploy/issues/624

Workaround

Filter on the client side, if possible.

benPearce1 avatar Jul 18 '24 00:07 benPearce1