Add v2 Quota API section

This patch adds the quota section to the v2 API reference.

Change-Id: I23cd2c4a65e4d7bf3c85f176a3042fefe0fb35b9
Partial-Bug: #1558385
This commit is contained in:
johnsom 2017-06-27 17:39:01 -07:00
parent debcbc50c8
commit 2ca2b8076d
14 changed files with 424 additions and 0 deletions

View File

@ -43,6 +43,12 @@ path-pool-id:
in: path
required: true
type: string
path-project-id:
description: |
The ID of the project to query.
in: path
required: true
type: string
###############################################################################
# Query fields
###############################################################################
@ -787,6 +793,80 @@ provisioning_status:
in: body
required: true
type: string
quota-health_monitor:
description: |
The configured health monitor quota limit. A setting of ``null`` means it
is using the deployment default quota. A setting of ``-1``
means unlimited.
in: body
required: true
type: integer
quota-health_monitor-optional:
description: |
The configured health monitor quota limit. A setting of ``null`` means it
is using the deployment default quota. A setting of ``-1`` means
unlimited.
in: body
required: false
type: integer
quota-listener:
description: |
The configured listener quota limit. A setting of ``null`` means it is
using the deployment default quota. A setting of ``-1`` means unlimited.
in: body
required: true
type: integer
quota-listener-optional:
description: |
The configured listener quota limit. A setting of ``null`` means it is
using the deployment default quota. A setting of ``-1`` means unlimited.
in: body
required: true
type: integer
quota-load_balancer:
description: |
The configured load balancer quota limit. A setting of ``null`` means it
is using the deployment default quota. A setting of ``-1`` means
unlimited.
in: body
required: true
type: integer
quota-load_balancer-optional:
description: |
The configured load balancer quota limit. A setting of ``null`` means it
is using the deployment default quota. A setting of ``-1`` means
unlimited.
in: body
required: true
type: integer
quota-member:
description: |
The configured member quota limit. A setting of ``null`` means it is using
the deployment default quota. A setting of ``-1`` means unlimited.
in: body
required: true
type: integer
quota-member-optional:
description: |
The configured member quota limit. A setting of ``null`` means it is using
the deployment default quota. A setting of ``-1`` means unlimited.
in: body
required: true
type: integer
quota-pool:
description: |
The configured pool quota limit. A setting of ``null`` means it is using
the deployment default quota. A setting of ``-1`` means unlimited.
in: body
required: true
type: integer
quota-pool-optional:
description: |
The configured pool quota limit. A setting of ``null`` means it is using
the deployment default quota. A setting of ``-1`` means unlimited.
in: body
required: true
type: integer
request_errors:
description: |
The total requests that were unable to be fulfilled.

View File

@ -0,0 +1 @@
curl -X DELETE -H "X-Auth-Token: <token>" http://198.51.100.10:9876/v2.0/lbaas/quotas/e3cd678b11784734bc366148aa37580e

View File

@ -0,0 +1 @@
curl -X GET -H "X-Auth-Token: <token>" http://198.51.100.10:9876/v2.0/lbaas/quotas/e3cd678b11784734bc366148aa37580e

View File

@ -0,0 +1 @@
curl -X PUT -H "Content-Type: application/json" -H "X-Auth-Token: <token>" -d '{"quota":{"load_balancer":10,"listener":-1,"member":50,"pool":-1,"health_monitor":-1}}' http://198.51.100.10:9876/v2.0/lbaas/quotas/e3cd678b11784734bc366148aa37580e

View File

@ -0,0 +1,9 @@
{
"quota": {
"load_balancer": 10,
"listener": -1,
"member": 50,
"pool": -1,
"health_monitor": -1
}
}

View File

@ -0,0 +1,9 @@
{
"quota": {
"load_balancer": 10,
"listener": -1,
"member": 50,
"pool": -1,
"health_monitor": -1
}
}

View File

@ -0,0 +1 @@
curl -X GET -H "X-Auth-Token: <token>" http://198.51.100.10:9876/v2.0/lbaas/quotas/defaults

View File

@ -0,0 +1,9 @@
{
"quota": {
"load_balancer": 50,
"listener": -1,
"member": -1,
"pool": -1,
"health_monitor": -1
}
}

View File

@ -0,0 +1 @@
curl -X GET -H "X-Auth-Token: <token>" http://198.51.100.10:9876/v2.0/lbaas/quotas?project_id=e3cd678b11784734bc366148aa37580e

View File

@ -0,0 +1,12 @@
{
"quotas": [
{
"load_balancer": 5,
"member": 50,
"health_monitor": -1,
"listener": null,
"project_id": "e3cd678b11784734bc366148aa37580e",
"pool": null
}
]
}

View File

@ -0,0 +1,9 @@
{
"quota": {
"load_balancer": 5,
"listener": -1,
"member": 50,
"pool": -1,
"health_monitor": -1
}
}

View File

@ -45,3 +45,8 @@ L7 Policies
L7 Rules
--------
.. include:: l7rule.inc
------
Quotas
------
.. include:: quota.inc

281
api-ref/source/v2/quota.inc Normal file
View File

@ -0,0 +1,281 @@
.. -*- rst -*-
List Quota
==========
.. rest_method:: GET /v2.0/lbaas/quotas
Lists all quotas for the project.
Use the ``fields`` query parameter to control which fields are
returned in the response body. Additionally, you can filter results
by using query string parameters. For information, see :ref:`filtering`.
Administrative users can specify a project ID that is different than their own
to list quotas for other projects.
If the quota is listed as ``null`` the quota is using the deployment default
quota settings.
A quota of ``-1`` means the quota is unlimited.
The list might be empty.
.. rest_status_code:: success ../http-status.yaml
- 200
.. rest_status_code:: error ../http-status.yaml
- 400
- 401
- 500
Request
-------
.. rest_parameters:: ../parameters.yaml
- fields: fields
- project_id: project_id_query
Curl Example
------------
.. literalinclude:: examples/quotas-list-curl
:language: bash
Response Parameters
-------------------
.. rest_parameters:: ../parameters.yaml
- health_monitor: quota-health_monitor
- listener: quota-listener
- load_balancer: quota-load_balancer
- member: quota-member
- pool: quota-pool
- project_id: project_id
Response Example
----------------
.. literalinclude:: examples/quotas-list-response.json
:language: javascript
Show Quota Defaults
===================
.. rest_method:: GET /v2.0/lbaas/quotas/defaults
Show the quota defaults configured for the deployment.
A quota of ``-1`` means the quota is unlimited.
.. rest_status_code:: success ../http-status.yaml
- 200
.. rest_status_code:: error ../http-status.yaml
- 400
- 401
- 500
Request
-------
There are no request parameters for the show quota defaults API.
Curl Example
------------
.. literalinclude:: examples/quotas-defaults-curl
:language: bash
Response Parameters
-------------------
.. rest_parameters:: ../parameters.yaml
- health_monitor: quota-health_monitor
- listener: quota-listener
- load_balancer: quota-load_balancer
- member: quota-member
- pool: quota-pool
Response Example
----------------
.. literalinclude:: examples/quotas-defaults-response.json
:language: javascript
Show Project Quota
==================
.. rest_method:: GET /v2.0/lbaas/quotas/{project_id}
Show the quota for the project.
Use the ``fields`` query parameter to control which fields are
returned in the response body. Additionally, you can filter results
by using query string parameters. For information, see :ref:`filtering`.
Administrative users can specify a project ID that is different than their own
to show quota for other projects.
A quota of ``-1`` means the quota is unlimited.
.. rest_status_code:: success ../http-status.yaml
- 200
.. rest_status_code:: error ../http-status.yaml
- 400
- 401
- 500
Request
-------
.. rest_parameters:: ../parameters.yaml
- fields: fields
- project_id: path-project-id
Curl Example
------------
.. literalinclude:: examples/quota-show-curl
:language: bash
Response Parameters
-------------------
.. rest_parameters:: ../parameters.yaml
- health_monitor: quota-health_monitor
- listener: quota-listener
- load_balancer: quota-load_balancer
- member: quota-member
- pool: quota-pool
Response Example
----------------
.. literalinclude:: examples/quotas-show-response.json
:language: javascript
Update a Quota
==============
.. rest_method:: PUT /v2.0/lbaas/quotas/{project_id}
Updates a quota for a project.
If the request is valid, the service returns the ``Accepted (202)``
response code.
This operation returns the updated quota object.
If the quota is specified as ``null`` the quota will use the deployment default
quota settings.
Specifying a quota of ``-1`` means the quota is unlimited.
Specifying a quota of ``0`` means the project cannot create any of the
resource.
.. rest_status_code:: success ../http-status.yaml
- 202
.. rest_status_code:: error ../http-status.yaml
- 400
- 401
- 403
- 404
- 409
- 500
Request
-------
.. rest_parameters:: ../parameters.yaml
- health_monitor: quota-health_monitor-optional
- listener: quota-listener-optional
- load_balancer: quota-load_balancer-optional
- member: quota-member-optional
- pool: quota-pool-optional
- project_id: path-project-id
Request Example
---------------
.. literalinclude:: examples/quota-update-request.json
:language: javascript
Curl Example
------------
.. literalinclude:: examples/quota-update-curl
:language: bash
Response Parameters
-------------------
.. rest_parameters:: ../parameters.yaml
- health_monitor: quota-health_monitor
- listener: quota-listener
- load_balancer: quota-load_balancer
- member: quota-member
- pool: quota-pool
Response Example
----------------
.. literalinclude:: examples/quota-update-response.json
:language: javascript
Remove a Quota
==============
.. rest_method:: DELETE /v2.0/lbaas/quotas/{project_id}
Resets a project quota to use the deployment default quota.
.. rest_status_code:: success ../http-status.yaml
- 204
.. rest_status_code:: error ../http-status.yaml
- 400
- 401
- 403
- 404
- 409
- 500
Request
-------
.. rest_parameters:: ../parameters.yaml
- project_id: path-project-id
Curl Example
------------
.. literalinclude:: examples/quota-delete-curl
:language: bash
Response
--------
There is no body content for the response of a successful DELETE request.

View File

@ -0,0 +1,5 @@
---
other:
- |
Octavia now has an up to date API reference for the Octavia v2 API.
It is available at: https://developer.openstack.org/api-ref/load-balancer/