Skip to content

TPT-4487: Add quota_type and has_usage attributes to object storage quota data sources#2374

Merged
zliang-akamai merged 6 commits into
linode:devfrom
zliang-akamai:zhiwei/quota-type-and-has-usage-attributes
Jul 9, 2026
Merged

TPT-4487: Add quota_type and has_usage attributes to object storage quota data sources#2374
zliang-akamai merged 6 commits into
linode:devfrom
zliang-akamai:zhiwei/quota-type-and-has-usage-attributes

Conversation

@zliang-akamai

Copy link
Copy Markdown
Member

📝 Description

Add quota_type and has_usage attributes to Object Storage quota data sources

✔️ How to Test

make test-int PKG_NAME=objquota
make test-int PKG_NAME=objquotas

@zliang-akamai
zliang-akamai requested review from a team as code owners June 4, 2026 18:50
@zliang-akamai
zliang-akamai requested review from mawilk90 and mgwoj and removed request for a team June 4, 2026 18:50
@zliang-akamai zliang-akamai changed the title feat: add quota_type and has_usage attributes to Object Storage quota data sources TPT-4487: add quota_type and has_usage attributes to Object Storage quota data sources Jun 4, 2026
@zliang-akamai zliang-akamai changed the title TPT-4487: add quota_type and has_usage attributes to Object Storage quota data sources TPT-4487: add quota_type and has_usage attributes to object storage quota data sources Jun 4, 2026
@zliang-akamai zliang-akamai changed the title TPT-4487: add quota_type and has_usage attributes to object storage quota data sources TPT-4487: Add quota_type and has_usage attributes to object storage quota data sources Jun 4, 2026
@zliang-akamai
zliang-akamai requested review from a team, Copilot and lgarber-akamai and removed request for a team July 8, 2026 15:29

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_type and has_usage attributes to both linode_object_storage_quota and linode_object_storage_quotas.
  • Avoid calling the quota-usage API when has_usage is false, and set quota_usage to null in 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.

Comment thread linode/objquota/framework_models.go
Comment thread docs/data-sources/object_storage_quotas.md
@zliang-akamai
zliang-akamai force-pushed the zhiwei/quota-type-and-has-usage-attributes branch from 47a6df4 to dad5931 Compare July 9, 2026 16:03
@zliang-akamai
zliang-akamai merged commit 2b66fff into linode:dev Jul 9, 2026
9 checks passed
@zliang-akamai
zliang-akamai deleted the zhiwei/quota-type-and-has-usage-attributes branch July 9, 2026 17:48
@ezilber-akamai ezilber-akamai added the new-feature for new features in the changelog. label Jul 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

new-feature for new features in the changelog.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants