TPT-4487: Add quota_type and has_usage attributes to object storage quota data sources#2374
Merged
zliang-akamai merged 6 commits intoJul 9, 2026
Conversation
zliang-akamai
requested review from
mawilk90 and
mgwoj
and removed request for
a team
June 4, 2026 18:50
quota_type and has_usage attributes to object storage quota data sources
mawilk90
approved these changes
Jun 8, 2026
zliang-akamai
requested review from
a team,
Copilot and
lgarber-akamai
and removed request for
a team
July 8, 2026 15:29
Contributor
There was a problem hiding this comment.
Pull request overview
This PR extends the Object Storage quota data sources (single quota and quota list) to expose the API’s quota_type and has_usage fields, and updates the single-quota data source to only request usage data when the quota reports usage is available. It also updates integration tests and documentation to cover the new attributes and the quota_usage = null behavior when has_usage is false.
Changes:
- Add
quota_typeandhas_usageattributes to bothlinode_object_storage_quotaandlinode_object_storage_quotas. - Avoid calling the quota-usage API when
has_usageis false, and setquota_usagetonullin that case. - Update acceptance tests and docs to validate/describe the new attributes and behavior.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| linode/objquotas/framework_model.go | Adds quota_type and has_usage to the list model and flattens them from the API response. |
| linode/objquotas/framework_datasource_schema.go | Exposes quota_type / has_usage in schema and allows filtering on them. |
| linode/objquotas/datasource_test.go | Extends list data source acceptance test to assert the new fields exist. |
| linode/objquota/framework_models.go | Adds quota_type / has_usage to the single-quota model and nulls quota_usage when usage isn’t available. |
| linode/objquota/framework_datasource.go | Conditionally fetches usage only when quota.HasUsage is true; improves diagnostic messages. |
| linode/objquota/framework_datasource_schema.go | Exposes quota_type / has_usage in the single-quota data source schema. |
| linode/objquota/datasource_test.go | Makes the single-quota acceptance test resilient when no quotas have usage; asserts new fields and conditional quota_usage. |
| docs/data-sources/object_storage_quotas.md | Documents new exported attributes and filterable fields for the list data source. |
| docs/data-sources/object_storage_quota.md | Documents new attributes and clarifies quota_usage is null when has_usage is false. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
zliang-akamai
force-pushed
the
zhiwei/quota-type-and-has-usage-attributes
branch
from
July 9, 2026 16:03
47a6df4 to
dad5931
Compare
ezilber-akamai
approved these changes
Jul 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📝 Description
Add
quota_typeandhas_usageattributes to Object Storage quota data sources✔️ How to Test