Symptoms
- You are using Rest API and trying to "update offering items"
- You send PUT /api/2/tenants/<tenant_id>/offering_items with PUT JSON Body data holding incorrect quota "version" values in the "quota" objects that are only present to countable/quantity type offering items. Example of a default "quota" object holding initial values for Unlimited quota:
"quota": {
"overage": null,
"version": 0,
"value": null
} - If "version" value does not match, you receive the following error: "Error code: [status code] 426 [reason phrase] Upgrade Required"
Cause
Before build C22.10, quota version was ignored by the API. Any value was allowed to be sent in the PUT /api/2/tenants/<tenant_id>/offering_items request and it would succeed. This behavior is fixed now to satisfy the original by design behavior where quota "version" is always required with its current version value. Now, "Status 426 Upgrade Required" will be shown, if the OI's quota version in the request is different than its actual current version. This code was added to suggest that the correct "version" value should be provided in the "quota" object for the PUT request.
Solution
Provide the correct quota "version" in the PUT request:
- Do a GET /api/2/tenants/<tenant_id>/offering_items call to get a response with all available OIs for the tenant with current values
- Check the "version" value inside the "quota" object of the offering item that needs to be updated, or to multiple selected offering items
- Use exactly the same version value of the selected item/items in the PUT /api/2/tenants/<tenant_id>/offering_items call used to update the quota or status of the offering item.
More information
- By default this value should be 0 for the newly created tenants before it is being incremented. This means on newly created tenants the GET call is not required, it is supposed to be 0 when you first enable the OI/OIs.
- When setting the quota value to Unlimited with "value": null, any previously incremented version value for a limited quota will reset back to 0, because we store version in quota record for limited values only, which is absent when set to Unlimited.