Jump to: navigation, search

Difference between revisions of "APIs for Domain Quota Driver"

(Implementation)
(Implementation)
Line 9: Line 9:
 
= Implementation =
 
= Implementation =
  
Currently, the following APIs are implemented for Read/GET and DELETE operation on Quotas for Domain, Project and User respectively. These APIs can be used by admin (i.e with role admin) to get the quota limits of any domain/project/user. A non-admin user can only use these APIs to see the quotas of a domain to which he/she belongs or of a project in which he/she is a member. In addition the non-admin user can see his/her own quota limits. To make this possible, Keystone V3 auth tokens needs to be used. The context provided by the token has domain_id, project_id and user_id respectively.  
+
Please check the following table for the APIs to manage Quotas for Domain, Project and User respectively. These APIs can be used by admin (i.e with role admin) to get the quota limits of any domain/project/user. A non-admin user can only use these APIs to see the quotas of a domain to which he/she belongs or of a project in which he/she is a member. In addition the non-admin user can see his/her own quota limits. To make this possible, Keystone V3 auth tokens needs to be used. The context provided by the token has domain_id, project_id and user_id respectively.  
  
 
{| class="wikitable"
 
{| class="wikitable"
Line 28: Line 28:
 
|-
 
|-
 
| DELETE || v2/{tenant_id}/domain-quota-sets/{domain_id}?project_id={project_id}&user_id={user_id} || Delete quotas for a User in a Project
 
| DELETE || v2/{tenant_id}/domain-quota-sets/{domain_id}?project_id={project_id}&user_id={user_id} || Delete quotas for a User in a Project
 +
|-
 +
| PUT || v2/{tenant_id}/domain-quota-sets/{domain_id} || Creates or Updates quotas for the domain
 +
|-
 +
| PUT || v2/{tenant_id}/domain-quota-sets/{domain_id}?project_id={project_id} || Creates or Updates quotas for a Project
 +
|-
 +
| PUT || v2/{tenant_id}/domain-quota-sets/{domain_id}?project_id={project_id}&user_id={user_id} || Creates or Updates quotas for a User in a Project
 
|}
 
|}
 
Note: The work on implementing other operations like PUT (CREATE or UPDATE) is in progress.
 

Revision as of 16:00, 10 February 2014

Introduction

The existing DbQuotaDriver in Nova allows to set the Quotas at Project/Tenant and User Level. But there is a need to enforce the quotas at Domain Level as well. A new driver called "Domain Quota Driver" is available to enforce domain quotas in Nova. To use this driver, a new set of APIs are required for CRUD operations on quotas at domain, project and user level.

Quotas in Nova

Currently, OpenStack services make usage of quotas to limit the resources for a project or for a user. For example, the “Instances” quota represents the number of instances that can be created in a project or by a user. Through Domain Quota Driver, the same options for Quotas are available in the context of domain. To read more about Domain Quota Driver and see the available options for quotas, check https://wiki.openstack.org/wiki/DomainQuotaDriver

Implementation

Please check the following table for the APIs to manage Quotas for Domain, Project and User respectively. These APIs can be used by admin (i.e with role admin) to get the quota limits of any domain/project/user. A non-admin user can only use these APIs to see the quotas of a domain to which he/she belongs or of a project in which he/she is a member. In addition the non-admin user can see his/her own quota limits. To make this possible, Keystone V3 auth tokens needs to be used. The context provided by the token has domain_id, project_id and user_id respectively.

Method URI Description
GET v2/{tenant_id}/domain-quota-sets/{domain_id} Shows quotas for a Domain
GET v2/{tenant_id}/domain-quota-sets/{domain_id}/defaults Shows default quotas for a Domain
GET v2/{tenant_id}/domain-quota-sets/{domain_id}?project_id={project_id} Shows quotas for a Project
GET v2/{tenant_id}/domain-quota-sets/{domain_id}?project_id={project_id}&user_id={user_id} Shows quotas for a User in a Project
DELETE v2/{tenant_id}/domain-quota-sets/{domain_id} Deletes quotas for the domain and for all the projects in this domain (In addition deletes quota for all the users in the projects)
DELETE v2/{tenant_id}/domain-quota-sets/{domain_id}?project_id={project_id} Deletes quotas for a Project and for all the Users in that Project
DELETE v2/{tenant_id}/domain-quota-sets/{domain_id}?project_id={project_id}&user_id={user_id} Delete quotas for a User in a Project
PUT v2/{tenant_id}/domain-quota-sets/{domain_id} Creates or Updates quotas for the domain
PUT v2/{tenant_id}/domain-quota-sets/{domain_id}?project_id={project_id} Creates or Updates quotas for a Project
PUT v2/{tenant_id}/domain-quota-sets/{domain_id}?project_id={project_id}&user_id={user_id} Creates or Updates quotas for a User in a Project