Add api-ref for quotas and quota_classes
Change-Id: I51ce4eaaa6495f17b0792cd6517d455fc7a39f9d Partial-Implements: blueprint quota-support
This commit is contained in:
parent
671bbf2134
commit
85f3f3877b
@ -11,3 +11,5 @@
|
||||
.. include:: images.inc
|
||||
.. include:: services.inc
|
||||
.. include:: hosts.inc
|
||||
.. include:: quotas.inc
|
||||
.. include:: quota_classes.inc
|
||||
|
@ -17,6 +17,12 @@ host_ident:
|
||||
in: path
|
||||
required: true
|
||||
type: string
|
||||
quota_class_name:
|
||||
description: |
|
||||
The name of quota class
|
||||
in: path
|
||||
required: true
|
||||
type: string
|
||||
request_ident:
|
||||
description: |
|
||||
The ID of the request.
|
||||
@ -235,6 +241,12 @@ timestamps:
|
||||
in: query
|
||||
required: false
|
||||
type: boolean
|
||||
usages:
|
||||
description: |
|
||||
Whether to show in_use in the quotas
|
||||
in: query
|
||||
required: false
|
||||
type: boolean
|
||||
user_id_query:
|
||||
description: |
|
||||
Filters the response by user ID.
|
||||
@ -309,6 +321,19 @@ command-request:
|
||||
in: body
|
||||
required: false
|
||||
type: string
|
||||
container-request:
|
||||
description: |
|
||||
The number of containers
|
||||
in: body
|
||||
required: false
|
||||
type: int
|
||||
container-response:
|
||||
description: |
|
||||
The object of detailed containers quota, including in_use,
|
||||
limit of number of instances.
|
||||
in: body
|
||||
required: true
|
||||
type: object
|
||||
container_action:
|
||||
description: |
|
||||
The container action object.
|
||||
@ -360,6 +385,13 @@ cpu-request:
|
||||
in: body
|
||||
required: false
|
||||
type: float
|
||||
cpu-response:
|
||||
description: |
|
||||
The object of detailed cpu set quota, including in_use,
|
||||
limit of number of cpu set.
|
||||
in: body
|
||||
required: true
|
||||
type: object
|
||||
created_at:
|
||||
description: |
|
||||
The date and time when the resource was created.
|
||||
@ -397,6 +429,19 @@ disabled_reason:
|
||||
in: body
|
||||
required: true
|
||||
type: string
|
||||
disk-request:
|
||||
description: |
|
||||
The number of gigabytes of container disk
|
||||
required: false
|
||||
in: body
|
||||
type: int
|
||||
disk-response:
|
||||
description: |
|
||||
The object of detailed disk quota, including in_use,
|
||||
limit of disk.
|
||||
required: true
|
||||
in: body
|
||||
type: object
|
||||
environment:
|
||||
description: |
|
||||
The environment variables.
|
||||
@ -743,6 +788,13 @@ memory-request:
|
||||
in: body
|
||||
required: false
|
||||
type: integer
|
||||
memory-response:
|
||||
description: |
|
||||
The object of detailed memory quota, including in_use,
|
||||
limit number of memory.
|
||||
in: body
|
||||
required: true
|
||||
type: object
|
||||
message:
|
||||
description: |
|
||||
The error message message about this action when error occurred.
|
||||
|
103
api-ref/source/quota_classes.inc
Normal file
103
api-ref/source/quota_classes.inc
Normal file
@ -0,0 +1,103 @@
|
||||
.. -*- rst -*-
|
||||
|
||||
=====================
|
||||
Manage Quota Classes
|
||||
=====================
|
||||
|
||||
Get, updates quota classes
|
||||
|
||||
Create or Update Quotas for Quota Class
|
||||
=======================================
|
||||
|
||||
.. rest_method:: PUT /v1/quota_classes/{quota_class_name}
|
||||
|
||||
Update the quotas for the Quota Class. If the requested Quota Class is not
|
||||
found in the DB, then the API will create the one.
|
||||
|
||||
Response Codes
|
||||
--------------
|
||||
|
||||
.. rest_status_code:: success status.yaml
|
||||
|
||||
- 200
|
||||
|
||||
.. rest_status_code:: error status.yaml
|
||||
|
||||
- 400
|
||||
- 401
|
||||
- 403
|
||||
|
||||
Request
|
||||
-------
|
||||
|
||||
.. rest_parameters:: parameters.yaml
|
||||
|
||||
- quota_class_name: quota_class_name
|
||||
- containers: container-request
|
||||
- memory: memory-request
|
||||
- cpu: cpu-request
|
||||
- disk: disk-request
|
||||
|
||||
Request Example
|
||||
---------------
|
||||
|
||||
.. literalinclude:: samples/quota-classes-update-req.json
|
||||
:language: javascript
|
||||
|
||||
Response
|
||||
--------
|
||||
|
||||
.. rest_parameters:: parameters.yaml
|
||||
|
||||
- containers: container-response
|
||||
- memory: memory-response
|
||||
- cpu: cpu-response
|
||||
- disk: disk-response
|
||||
|
||||
Response Example
|
||||
----------------
|
||||
|
||||
.. literalinclude:: samples/quota-classes-update-resp.json
|
||||
:language: javascript
|
||||
|
||||
List quotas for Quota Class
|
||||
===========================
|
||||
|
||||
.. rest_method:: GET /v1/quota_classes/{quota_class_name}
|
||||
|
||||
List quotas for Quota Class
|
||||
|
||||
Response Codes
|
||||
--------------
|
||||
|
||||
.. rest_status_code:: success status.yaml
|
||||
|
||||
- 200
|
||||
|
||||
.. rest_status_code:: error status.yaml
|
||||
|
||||
- 401
|
||||
- 403
|
||||
|
||||
Request
|
||||
-------
|
||||
|
||||
.. rest_parameters:: parameters.yaml
|
||||
|
||||
- quota_class_name: quota_class_name
|
||||
|
||||
Response
|
||||
--------
|
||||
|
||||
.. rest_parameters:: parameters.yaml
|
||||
|
||||
- containers: container-response
|
||||
- memory: memory-response
|
||||
- cpu: cpu-response
|
||||
- disk: disk-response
|
||||
|
||||
Response Example
|
||||
----------------
|
||||
|
||||
.. literalinclude:: samples/quota-classes-get-resp.json
|
||||
:language: javascript
|
163
api-ref/source/quotas.inc
Normal file
163
api-ref/source/quotas.inc
Normal file
@ -0,0 +1,163 @@
|
||||
.. -*- rst -*-
|
||||
|
||||
==============
|
||||
Manage Quotas
|
||||
==============
|
||||
|
||||
Gets, updates, gets default and deletes quotas for a project.
|
||||
|
||||
Update quotas for a project
|
||||
===========================
|
||||
|
||||
.. rest_method:: PUT /v1/quotas
|
||||
|
||||
Update the quotas for a project
|
||||
|
||||
Response Codes
|
||||
--------------
|
||||
|
||||
.. rest_status_code:: success status.yaml
|
||||
|
||||
- 200
|
||||
|
||||
.. rest_status_code:: error status.yaml
|
||||
|
||||
- 400
|
||||
- 401
|
||||
- 403
|
||||
|
||||
Request
|
||||
-------
|
||||
|
||||
.. rest_parameters:: parameters.yaml
|
||||
|
||||
- containers: container-request
|
||||
- memory: memory-request
|
||||
- cpu: cpu-request
|
||||
- disk: disk-request
|
||||
|
||||
Request Example
|
||||
---------------
|
||||
|
||||
.. literalinclude:: samples/quotas-update-req.json
|
||||
:language: javascript
|
||||
|
||||
Response
|
||||
--------
|
||||
|
||||
.. rest_parameters:: parameters.yaml
|
||||
|
||||
- containers: container-response
|
||||
- memory: memory-response
|
||||
- cpu: cpu-response
|
||||
- disk: disk-response
|
||||
|
||||
Response Example
|
||||
----------------
|
||||
|
||||
.. literalinclude:: samples/quotas-update-resp.json
|
||||
:language: javascript
|
||||
|
||||
Get quotas for a project
|
||||
========================
|
||||
|
||||
.. rest_method:: GET /v1/quotas
|
||||
|
||||
Get quotas for a project
|
||||
|
||||
Response Codes
|
||||
--------------
|
||||
|
||||
.. rest_status_code:: success status.yaml
|
||||
|
||||
- 200
|
||||
|
||||
.. rest_status_code:: error status.yaml
|
||||
|
||||
- 400
|
||||
- 401
|
||||
- 403
|
||||
|
||||
Request
|
||||
-------
|
||||
|
||||
Response
|
||||
--------
|
||||
|
||||
.. rest_parameters:: parameters.yaml
|
||||
|
||||
- usages: usages
|
||||
- containers: container-response
|
||||
- memory: memory-response
|
||||
- cpu: cpu-response
|
||||
- disk: disk-response
|
||||
|
||||
Response Example
|
||||
----------------
|
||||
|
||||
.. literalinclude:: samples/quotas-get-resp.json
|
||||
:language: javascript
|
||||
|
||||
Get Default quotas for a project
|
||||
================================
|
||||
|
||||
.. rest_method:: GET /v1/quotas/defaults
|
||||
|
||||
Get the default quotas for a project
|
||||
|
||||
Response Codes
|
||||
--------------
|
||||
|
||||
.. rest_status_code:: success status.yaml
|
||||
|
||||
- 200
|
||||
|
||||
.. rest_status_code:: error status.yaml
|
||||
|
||||
- 400
|
||||
- 401
|
||||
- 403
|
||||
|
||||
Request
|
||||
-------
|
||||
|
||||
Response
|
||||
--------
|
||||
|
||||
.. rest_parameters:: parameters.yaml
|
||||
|
||||
- usages: usages
|
||||
- containers: container-response
|
||||
- memory: memory-response
|
||||
- cpu: cpu-response
|
||||
- disk: disk-response
|
||||
|
||||
Response Example
|
||||
----------------
|
||||
|
||||
.. literalinclude:: samples/quotas-get-defaults-resp.json
|
||||
:language: javascript
|
||||
|
||||
Revert Quotas to defaults
|
||||
=========================
|
||||
|
||||
.. rest_method:: DELETE /v1/quotas
|
||||
|
||||
Reverts the quotas to default values for a project
|
||||
|
||||
.. rest_status_code:: success status.yaml
|
||||
|
||||
- 202
|
||||
|
||||
.. rest_status_code:: error status.yaml
|
||||
|
||||
- 401
|
||||
- 403
|
||||
|
||||
Request
|
||||
-------
|
||||
|
||||
Response
|
||||
--------
|
||||
|
||||
There is no body content for the response of a successful DELETE operation.
|
6
api-ref/source/samples/quota-classes-get-resp.json
Normal file
6
api-ref/source/samples/quota-classes-get-resp.json
Normal file
@ -0,0 +1,6 @@
|
||||
{
|
||||
"disk": 100,
|
||||
"cpu": 20,
|
||||
"containers": 40,
|
||||
"memory": 51200
|
||||
}
|
6
api-ref/source/samples/quota-classes-update-req.json
Normal file
6
api-ref/source/samples/quota-classes-update-req.json
Normal file
@ -0,0 +1,6 @@
|
||||
{
|
||||
"disk": 200,
|
||||
"cpu": 30,
|
||||
"containers": 50,
|
||||
"memory": 102400
|
||||
}
|
6
api-ref/source/samples/quota-classes-update-resp.json
Normal file
6
api-ref/source/samples/quota-classes-update-resp.json
Normal file
@ -0,0 +1,6 @@
|
||||
{
|
||||
"disk": 200,
|
||||
"cpu": 30,
|
||||
"containers": 50,
|
||||
"memory": 102400
|
||||
}
|
6
api-ref/source/samples/quotas-get-defaults-resp.json
Normal file
6
api-ref/source/samples/quotas-get-defaults-resp.json
Normal file
@ -0,0 +1,6 @@
|
||||
{
|
||||
"disk": 100,
|
||||
"cpu": 20,
|
||||
"containers": 40,
|
||||
"memory": 51200
|
||||
}
|
18
api-ref/source/samples/quotas-get-resp.json
Normal file
18
api-ref/source/samples/quotas-get-resp.json
Normal file
@ -0,0 +1,18 @@
|
||||
{
|
||||
"disk": {
|
||||
"limit": 100,
|
||||
"in_use": 0
|
||||
},
|
||||
"cpu": {
|
||||
"limit": 20,
|
||||
"in_use": 4
|
||||
},
|
||||
"containers": {
|
||||
"limit": 40,
|
||||
"in_use": 5
|
||||
},
|
||||
"memory": {
|
||||
"limit": 51200,
|
||||
"in_use": 2048
|
||||
}
|
||||
}
|
6
api-ref/source/samples/quotas-update-req.json
Normal file
6
api-ref/source/samples/quotas-update-req.json
Normal file
@ -0,0 +1,6 @@
|
||||
{
|
||||
"disk": 200,
|
||||
"cpu": 30,
|
||||
"containers": 80,
|
||||
"memory": 102400
|
||||
}
|
6
api-ref/source/samples/quotas-update-resp.json
Normal file
6
api-ref/source/samples/quotas-update-resp.json
Normal file
@ -0,0 +1,6 @@
|
||||
{
|
||||
"disk": 200,
|
||||
"cpu": 30,
|
||||
"containers": 80,
|
||||
"memory": 102400
|
||||
}
|
Loading…
Reference in New Issue
Block a user