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

Quota evaluation missing for request amount. #147

Merged
merged 2 commits into from
Dec 19, 2012
Merged

Conversation

unakatsuo
Copy link
Contributor

Quota evaluation looks up missing value for the resources to be created/updated. Only current resource total is compared to the limit so that the user has chance to add larger resource which should not be accepted.

We say the newly created resource size the request amount. Since the request amount can be retrieved in different way based on API call, the quota definition syntax for each Sinatra endpoint method will be extended as below.

quota 'instance.quota_weight' do
  request_amount do
     # returns value from quota_weight query string.
     params[:quota_weight]
  end
end
post '/instaces' do
.....

@k-oyakata
Copy link
Member

8494225#L2R75
8494225#L2R102

Is "quota_value.to_i <= (fetch_value + req_value)" a mistake?

"quota_value.to_i < (fetch_value + req_value) " is right?

@unakatsuo
Copy link
Contributor Author

Quota limit: 10
Having already (fetch_value): 8
Requesting amount (req_value): 2

10 < 8+2

Should the request be rejected you mean?

@k-oyakata
Copy link
Member

+1

unakatsuo pushed a commit that referenced this pull request Dec 19, 2012
Quota evaluation missing for request amount.
@unakatsuo unakatsuo merged commit 098d68b into master Dec 19, 2012
rakshasa added a commit that referenced this pull request Jun 11, 2013
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

Successfully merging this pull request may close these issues.

None yet

2 participants