Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Counting devices not possible #1422

Open
basz opened this issue Jul 4, 2024 · 1 comment
Open

Counting devices not possible #1422

basz opened this issue Jul 4, 2024 · 1 comment

Comments

@basz
Copy link

basz commented Jul 4, 2024

Expected Behavior

I would expect to be able to count devices

Actual Behavior

Error: Unknown pine option: $count

(Typescript compiles and linting is fine with the resolved types)

Steps to Reproduce the Problem

    const countResult = await this.sdk.models.device.getAllByApplication(this.config.fleetSlug, {
        $count: {},
      });

This might be related to #1293

Specifications

  • SDK version: 19.6.1
  • Browser: not applicable
  • Node version: v20.13.1
  • Npm version: 10.5.2
  • OS: MacOS

I guess we are trying to create this request eventually as that works. It could also be that counting should be done entirely different. Please enlighten me :-)

curl -X GET 'https://api.balena-cloud.com/v6/device/$count?$filter=belongs_to__application%20eq%20APP_ID' \
-H "Content-Type: application/json" \
-H "Authorization: Bearer XXXXX"
@basz
Copy link
Author

basz commented Jul 4, 2024

Error: Unknown pine option: $count
     at mergePineOptions (.../node_modules/.pnpm/[email protected]/node_modules/balena-sdk/es2015/util/index.js:88:15)
     at Object.<anonymous> (.../node_modules/.pnpm/[email protected]/node_modules/balena-sdk/es2015/models/device.js:311:65)
     at Generator.next (<anonymous>)
     at fulfilled (.../node_modules/.pnpm/[email protected]/node_modules/tslib/tslib.js:166:62)
     at processTicksAndRejections (node:internal/process/task_queues:95: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

No branches or pull requests

1 participant