Jump to: navigation, search

Difference between revisions of "APIs for Domain Quota Driver"

(APIs for Domain Quota Driver)
 
m (added to the Compute category)
 
(18 intermediate revisions by one other user not shown)
Line 5: Line 5:
 
== Quotas in Nova==
 
== Quotas in Nova==
 
Currently, OpenStack services make usage of quotas to limit the resources for a project or for a user.
 
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. The table below summarizes the existing project/user quotas.
+
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
Through Domain Quota Driver, the same options for Quotas are available in the context of domain.
+
 
 +
= Implementation =
 +
 
 +
=== V2 APIs ===
 +
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"
 
|-
 
|-
! quotas !! type !! default values !! description
+
! Method || URI || Description
 +
|-
 +
| GET || v2/{tenant_id}/os-domain-quota-sets/{domain_id} || Shows quotas for a Domain
 +
|-
 +
| GET || v2/{tenant_id}/os-domain-quota-sets/{domain_id}/defaults || Shows default quotas for a Domain
 +
|-
 +
| GET || v2/{tenant_id}/os-domain-quota-sets/{domain_id}?project_id={project_id} || Shows quotas for a Project
 +
|-
 +
| GET || v2/{tenant_id}/os-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}/os-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}/os-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}/os-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}/os-domain-quota-sets/{domain_id} || Creates or Updates quotas for the domain
 +
|-
 +
| PUT || v2/{tenant_id}/os-domain-quota-sets/{domain_id}?project_id={project_id} || Creates or Updates quotas for a Project
 
|-
 
|-
| instances || reservable|| 10|| number of instances allowed per project
+
| PUT || v2/{tenant_id}/os-domain-quota-sets/{domain_id}?project_id={project_id}&user_id={user_id} || Creates or Updates quotas for a User in a Project
 +
|}
 +
 
 +
=== V3 APIs ===
 +
 
 +
{| class="wikitable"
 
|-
 
|-
| cores|| reservable|| 20|| number of instance cores allowed per project
+
! Method || URI || Description
 
|-
 
|-
| ram || reservable || 50*1024|| megabytes of instance ram allowed per project
+
| GET || v3/os-domain-quota-sets/{domain_id} || Shows quotas for a Domain
 
|-
 
|-
| floating_ips || reservable || 10 || number of floating ips allowed per project
+
| GET || v3/os-domain-quota-sets/{domain_id}/defaults || Shows default quotas for a Domain
 
|-
 
|-
| fixed_ips|| reservable|| -1 || number of fixed ips allowed per project
+
| GET || v3/os-domain-quota-sets/{domain_id}?project_id={project_id} || Shows quotas for a Project
 
|-
 
|-
| metadata_items|| absolute || 128|| number of metadata items allowed per instance
+
| GET || v3/os-domain-quota-sets/{domain_id}?project_id={project_id}&user_id={user_id} || Shows quotas for a User in a Project
 
|-
 
|-
| injected_files || absolute|| 5 || number of injected files allowed
+
| DELETE || v3/os-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)
 
|-
 
|-
| injected_files_content_bytes|| absolute || 10*1024 || number of bytes allowed per injected file
+
| DELETE || v3/os-domain-quota-sets/{domain_id}?project_id={project_id} || Deletes quotas for a Project and for all the Users in that Project
 
|-
 
|-
| nova.injected_file_path_bytes || absolute|| 255 || number of bytes allowed per injected file path
+
| DELETE || v3/os-domain-quota-sets/{domain_id}?project_id={project_id}&user_id={user_id} || Delete quotas for a User in a Project
 
|-
 
|-
| nova.security_groups || reservable || 10 || number of security groups per project
+
| PUT || v3/os-domain-quota-sets/{domain_id} || Creates or Updates quotas for the domain
 
|-
 
|-
| nova.security_groups_rules || countable || 20 || number of security rules per security group
+
| PUT || v3/os-domain-quota-sets/{domain_id}?project_id={project_id} || Creates or Updates quotas for a Project
 
|-
 
|-
| nova.key_pairs|| countable || 100 || number of key pairs per user
+
| PUT || v3/os-domain-quota-sets/{domain_id}?project_id={project_id}&user_id={user_id} || Creates or Updates quotas for a User in a Project
 
|}
 
|}
 +
 +
[[Category:Compute]]

Latest revision as of 19:13, 30 September 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

V2 APIs

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}/os-domain-quota-sets/{domain_id} Shows quotas for a Domain
GET v2/{tenant_id}/os-domain-quota-sets/{domain_id}/defaults Shows default quotas for a Domain
GET v2/{tenant_id}/os-domain-quota-sets/{domain_id}?project_id={project_id} Shows quotas for a Project
GET v2/{tenant_id}/os-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}/os-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}/os-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}/os-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}/os-domain-quota-sets/{domain_id} Creates or Updates quotas for the domain
PUT v2/{tenant_id}/os-domain-quota-sets/{domain_id}?project_id={project_id} Creates or Updates quotas for a Project
PUT v2/{tenant_id}/os-domain-quota-sets/{domain_id}?project_id={project_id}&user_id={user_id} Creates or Updates quotas for a User in a Project

V3 APIs

Method URI Description
GET v3/os-domain-quota-sets/{domain_id} Shows quotas for a Domain
GET v3/os-domain-quota-sets/{domain_id}/defaults Shows default quotas for a Domain
GET v3/os-domain-quota-sets/{domain_id}?project_id={project_id} Shows quotas for a Project
GET v3/os-domain-quota-sets/{domain_id}?project_id={project_id}&user_id={user_id} Shows quotas for a User in a Project
DELETE v3/os-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 v3/os-domain-quota-sets/{domain_id}?project_id={project_id} Deletes quotas for a Project and for all the Users in that Project
DELETE v3/os-domain-quota-sets/{domain_id}?project_id={project_id}&user_id={user_id} Delete quotas for a User in a Project
PUT v3/os-domain-quota-sets/{domain_id} Creates or Updates quotas for the domain
PUT v3/os-domain-quota-sets/{domain_id}?project_id={project_id} Creates or Updates quotas for a Project
PUT v3/os-domain-quota-sets/{domain_id}?project_id={project_id}&user_id={user_id} Creates or Updates quotas for a User in a Project