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

Add GET /usage endpoint for document count, storage size, and webhook count #305

Open
reganwolfrom opened this issue Nov 28, 2024 · 0 comments
Labels
enhancement New feature or request
Milestone

Comments

@reganwolfrom
Copy link
Member

reganwolfrom commented Nov 28, 2024

As sites have some limits that can be labeled (currently max number of documents, max storage size, max number of webhooks), it would be helpful to have an endpoint that provides the current stats and maximums (-1 if no maximums); this would also be good in general, as some users have requested.

GET /usage?siteId={siteId}

Response:

{
  "documentCount": 12345,
  "documentCountMax": 50000,
  "totalObjectStorageSize": 678901234, // in bytes
  "totalObjectStorageSizeMax": 2147483648, // in bytes (2 GB)
  "webhookCount": 67,
  "webhookCountMax": 200
}

NOTE: GET /sites/:siteId/configuration uses different properties, maxDocuments, maxContentLengthBytes, and maxWebhooks, so we could do numDocuments instead of documentCount, but ideally we would use objectStorage vs. contentLength here, if possible, to clarify that it is a storage figure, not a response size setting.

@reganwolfrom reganwolfrom added this to the v1.16.1 milestone Nov 28, 2024
@reganwolfrom reganwolfrom added the enhancement New feature or request label Nov 28, 2024
@reganwolfrom reganwolfrom changed the title Add document count endpoint Add GET /usage endpoint for document count, storage size, and webhook count Nov 28, 2024
@reganwolfrom reganwolfrom modified the milestones: v1.16.1, v1.17.0 Dec 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant