Modify API ref for per-project-user quotas CRUD methods

**tenant** is an entity that owns the resources,
sometines called a project, sometimes the same as
a user

In addition to the owning entity (tenant), openstack
stores the entity performing the action as the **user**.

1st tenant ID in the URI, is the ID of the admin user
2ed tenant ID in the URI, is the project ID/Name
User ID is specified vis query string.
(I tried my best to express what I mean using the
current WADL markup.)

Changed the url path structure.
http://api.openstack.org/api-ref-compute.html#os-quota-sets

Changed the sample responses to point to the new ones in
/api_samples/os-user-quotas/

For the other part, in the original bug description:
Add commands for project user quotas management.
     - Show user quotas:
       nova-manage project quota --project <Project name>
       --user <User name>
     - Update/Create user quotas:
       nova-manage project quota --project <Project name>
       --user <User name> --key <key> --value <value>
I found this page:
https://wiki.openstack.org/wiki/NovaManage
"The nova-manage isn't properly documented, but it's going away
in Folsom, so using this wiki page for quick docs on it."

Looks like the usage of this method still needs further
validation, so dose the API call.
It may need to be futher documented in
docs.openstack.org/trunk/openstack-ops/content/quotas.html

In the response:
"fixed_ips": -1
Does not seem to be right to have negative value for number
of IPs.
docs.openstack.org/user-guide-admin/content/cli_set_quotas.html
"Number of fixed IP addresses allowed per tenant. This number
must be equal to or greater than the number of allowed
instances."

Change-Id: Id4e08170ebf04ebb4ba846bf8b576a228b91441b
Closes-Bug: #1187277
This commit is contained in:
Miranda Zhang 2013-12-30 08:03:41 +00:00 committed by Diane Fleming
parent 27bf719357
commit 838718c807
1 changed files with 49 additions and 20 deletions

View File

@ -9,7 +9,7 @@
xmlns:wadl="http://wadl.dev.java.net/2009/02">
<resources base="https://servers.api.openstack.com">
<resource id="version" type="#VersionDetails" path="v2/">
<resource id="tenantID" path="{tenant_id}">
<resource id="tenant_id" path="{tenant_id}">
<param name="tenant_id" style="template"
type="xsd:string" required="true">
<wadl:doc xmlns="http://docbook.org/ns/docbook"
@ -23,21 +23,49 @@
<resource path="defaults" id="defaults">
<method href="#getDefaults"/>
</resource>
<resource path="{user_id}" id="user_id">
<param name="user_id" style="template"
type="csapi:UUID" required="true">
<resource path="{tenant_id}" id="tenantID">
<param name="tenant_id" style="template"
type="xsd:string" required="true">
<wadl:doc
xmlns="http://docbook.org/ns/docbook"
xml:lang="EN" title="User ID">
<para>The user ID. Specify in the URI
as
<code>user_id={user_id}</code>.</para>
xml:lang="EN" title="Project ID">
<para>The ID for the tenant for which
you want to show quotas. This ID is
different from the first tenant ID
that you specify in the URI: That
ID is for the admin tenant.</para>
</wadl:doc>
</param>
<method href="#showQuotaUser"/>
<method href="#updateQuotaUser"/>
<resource id="user_id"
path="?user_id={user_id}">
<param name="user_id" style="template"
type="xsd:string" required="true">
<wadl:doc
xmlns="http://docbook.org/ns/docbook"
xml:lang="EN" title="User ID">
<para>The user ID. Specify in the
URI as a query string, like
<code>user_id={user_id}</code>.</para>
</wadl:doc>
</param>
<method href="#showQuotaUser"/>
<method href="#updateQuotaUser"/>
</resource>
<resource id="detail" path="detail">
<method href="#showQuotaDetailUser"/>
<resource id="user_id-detail"
path="?user_id={user_id}">
<param name="user_id" style="template"
type="xsd:string" required="true">
<wadl:doc
xmlns="http://docbook.org/ns/docbook"
xml:lang="EN" title="User ID">
<para>The user ID. Specify in the
URI as a query string, like
<code>user_id={user_id}</code>.</para>
</wadl:doc>
</param>
<method href="#showQuotaDetailUser"/>
</resource>
</resource>
</resource>
</resource>
@ -140,8 +168,9 @@
</method>
<method name="GET" id="showQuotaUser">
<wadl:doc xml:lang="EN" xmlns="http://docbook.org/ns/docbook"
title="Show quotas for user"><para role="shortdesc">Shows
quotas for a specified tenant and user.</para>
title="Show quotas for user"><para role="shortdesc"
>Enables an admin user to show quotas for a specified
tenant and user.</para>
</wadl:doc>
<response status="200"> &quotaSetsRespParameters;
<representation mediaType="application/json">
@ -149,7 +178,7 @@
xml:lang="EN"
title="Show quotas for user: JSON response">
<xsdxt:code
href="../api_samples/os-quota-sets/quotas-user-show-get-resp.json"
href="../api_samples/os-user-quotas/user-quotas-show-get-resp.json"
/>
</wadl:doc>
</representation>
@ -158,7 +187,7 @@
xml:lang="EN"
title="Show quotas for user: XML response">
<xsdxt:code
href="../api_samples/os-quota-sets/quotas-user-show-get-resp.xml"
href="../api_samples/os-user-quotas/user-quotas-show-get-resp.xml"
/>
</wadl:doc>
</representation>
@ -168,7 +197,7 @@
<wadl:doc xml:lang="EN" xmlns="http://docbook.org/ns/docbook"
title="Update quotas for user">
<para role="shortdesc">Updates quotas for a specified
tenant and user.</para>
tenant/project and user.</para>
</wadl:doc>
<request> &quotaSetsReqParameters; <representation
mediaType="application/json">
@ -176,7 +205,7 @@
xml:lang="EN"
title="Update quotas for user: JSON request">
<xsdxt:code
href="../api_samples/os-quota-sets/quotas-update-post-req.json"
href="../api_samples/os-user-quotas/user-quotas-update-post-req.json"
/>
</wadl:doc>
</representation>
@ -185,7 +214,7 @@
xml:lang="EN"
title="Update quotas for user: XML request">
<xsdxt:code
href="../api_samples/os-quota-sets/quotas-update-post-req.xml"
href="../api_samples/os-user-quotas/user-quotas-update-post-req.xml"
/>
</wadl:doc>
</representation>
@ -196,7 +225,7 @@
xml:lang="EN"
title="Update quotas for user: JSON response">
<xsdxt:code
href="../api_samples/os-quota-sets/quotas-update-post-resp.json"
href="../api_samples/os-user-quotas/user-quotas-update-post-resp.json"
/>
</wadl:doc>
</representation>
@ -205,7 +234,7 @@
xml:lang="EN"
title="Show quotas for user: XML response">
<xsdxt:code
href="../api_samples/os-quota-sets/quotas-update-post-resp.xml"
href="../api_samples/os-user-quotas/user-quotas-update-post-resp.xml"
/>
</wadl:doc>
</representation>