[api-ref] Add api-ref for os-quota-class-sets APIs

This commit adds the api documentation for the
GET/PUT os-quota-class-set APIs (v2 and v3).

Change-Id: Idb51b7b90a081775d2d836bf6d9ec8b9c0399f1b
Closes-Bug: #1602400
This commit is contained in:
Felipe Monteiro 2017-06-27 05:22:00 +01:00
parent d0649c40b0
commit 6932f2a841
12 changed files with 353 additions and 8 deletions

View File

@ -17,6 +17,7 @@ Block Storage API V2 (DEPRECATED)
.. include:: os-vol-pool-v2.inc
.. include:: os-vol-transfer-v2.inc
.. include:: qos-specs-v2-qos-specs.inc
.. include:: quota-classes.inc
.. include:: quota-sets.inc
.. include:: volume-manage.inc
.. include:: volume-type-access.inc

View File

@ -90,6 +90,12 @@ qos_id:
in: path
required: true
type: string
quota_class_name:
description:
The name of the quota class for which to set quotas.
in: path
required: true
type: string
quotas_tenant_id:
description: |
The UUID of the tenant in a multi-tenancy cloud.
@ -903,16 +909,33 @@ maxTotalBackups:
in: body
required: true
type: integer
maxTotalGroups:
description: |
The maximum number of groups.
in: body
required: true
type: integer
maxTotalSnapshots:
description: |
The maximum number of snapshots.
in: body
required: true
type: integer
maxTotalSnapshotsOptional:
description: |
The maximum number of snapshots.
in: body
required: false
type: integer
maxTotalVolumeGigabytes:
description: |
The maximum total amount of volumes, in gibibytes
(GiB).
The maximum total amount of volumes, in gibibytes (GiB).
in: body
required: true
type: integer
maxTotalVolumeGigabytesOptional:
description: |
The maximum total amount of volumes, in gibibytes (GiB).
in: body
required: true
type: integer
@ -922,6 +945,12 @@ maxTotalVolumes:
in: body
required: true
type: integer
maxTotalVolumesOptional:
description: |
The maximum number of volumes.
in: body
required: false
type: integer
meta:
description: |
The metadata key and value pair for the volume.
@ -1307,6 +1336,12 @@ os-volume-replication:extended_status_1:
in: body
required: false
type: string
perVolumeGigabytes:
description: |
The maximum amount of storage per volume, in gibibytes (GiB).
in: body
required: true
type: integer
pool_name:
description: |
The name of the storage pool.
@ -1364,6 +1399,12 @@ QoS_support:
in: body
required: true
type: boolean
quota_class_id:
description:
The name of the quota class set.
in: body
required: true
type: string
quota_set:
description: |
A ``quota_set`` object.
@ -1866,9 +1907,3 @@ volumes:
in: body
required: true
type: array
volumes:
description: |
A list of ``volume`` objects.
in: body
required: true
type: array

View File

@ -0,0 +1,100 @@
.. -*- rst -*-
Quota class set extension (os-quota-class-sets)
===============================================
Administrators only, depending on policy settings.
Shows and updates quota classes for a tenant.
Show quota classes
~~~~~~~~~~~~~~~~~~
.. rest_method:: GET /v2/{admin_tenant_id}/os-quota-class-sets/{quota_class_name}
Shows quota class set for a tenant. If no specific value for the quota class
resource exists, then the default value will be reported.
Normal response codes: 200
Error response codes: 403, 404
Request
-------
.. rest_parameters:: parameters.yaml
- quota_class_name: quota_class_name
- admin_tenant_id: admin_tenant_id
Response Parameters
-------------------
.. rest_parameters:: parameters.yaml
- backup_gigabytes: maxTotalBackupGigabytes
- backups: maxTotalBackups
- gigabytes: maxTotalVolumeGigabytes
- groups: maxTotalGroups
- per_volume_gigabytes: perVolumeGigabytes
- snapshots: maxTotalSnapshots
- volumes: maxTotalVolumes
- id: quota_class_id
Response Example
----------------
.. literalinclude:: ./samples/quota-classes-show-response.json
:language: javascript
Update quota classes
~~~~~~~~~~~~~~~~~~~~
.. rest_method:: PUT /v2/{admin_tenant_id}/os-quota-class-sets/{quota_class_name}
Updates quota class set for a tenant. If the ``quota_class_name`` key does not
exist, then the API will create one.
Normal response codes: 200
Error response codes: 400, 403, 404
Request
-------
.. rest_parameters:: parameters.yaml
- admin_tenant_id: admin_tenant_id
- quota_class_name: quota_class_name
- gigabytes: maxTotalVolumeGigabytesOptional
- snapshots: maxTotalSnapshotsOptional
- volumes: maxTotalVolumesOptional
- volume-type: volume_type
Request Example
---------------
.. literalinclude:: ./samples/quota-classes-update-request.json
:language: javascript
Response Parameters
-------------------
.. rest_parameters:: parameters.yaml
- backup_gigabytes: maxTotalBackupGigabytes
- backups: maxTotalBackups
- gigabytes: maxTotalVolumeGigabytes
- groups: maxTotalGroups
- per_volume_gigabytes: perVolumeGigabytes
- snapshots: maxTotalSnapshots
- volumes: maxTotalVolumes
Response Example
----------------
.. literalinclude:: ./samples/quota-classes-update-response.json
:language: javascript

View File

@ -0,0 +1,15 @@
{
"quota_class_set": {
"per_volume_gigabytes": -1,
"volumes_lvmdriver-1": -1,
"groups": 10,
"gigabytes": 1000,
"backup_gigabytes": 1000,
"snapshots": 10,
"gigabytes_lvmdriver-1": -1,
"volumes": 10,
"snapshots_lvmdriver-1": -1,
"backups": 10,
"id": "default"
}
}

View File

@ -0,0 +1,7 @@
{
"quota_class_set": {
"volumes_lmv": 10,
"gigabytes_lmv": 1000,
"snapshots_lmv": 10
}
}

View File

@ -0,0 +1,14 @@
{
"quota_class_set": {
"per_volume_gigabytes": -1,
"volumes_lvmdriver-1": -1,
"groups": 10,
"gigabytes": 1000,
"backup_gigabytes": 1000,
"snapshots": 10,
"gigabytes_lvmdriver-1": -1,
"volumes": 10,
"snapshots_lvmdriver-1": -1,
"backups": 10
}
}

View File

@ -46,4 +46,5 @@ Block Storage API V3 (CURRENT)
.. include:: qos-specs-v3-qos-specs.inc
.. quota-sets should arguably live closer to limits, but that would mess up
our nice alphabetical ordering
.. include:: quota-classes.inc
.. include:: quota-sets.inc

View File

@ -126,6 +126,12 @@ qos_id:
in: path
required: true
type: string
quota_class_name:
description:
The name of the quota class for which to set quotas.
in: path
required: true
type: string
quotas_project_id:
description: |
The UUID of the tenant in a multi-tenancy cloud.
@ -1235,12 +1241,24 @@ maxTotalBackups:
in: body
required: true
type: integer
maxTotalGroups:
description: |
The maximum number of groups.
in: body
required: true
type: integer
maxTotalSnapshots:
description: |
The maximum number of snapshots.
in: body
required: true
type: integer
maxTotalSnapshotsOptional:
description: |
The maximum number of snapshots.
in: body
required: false
type: integer
maxTotalVolumeGigabytes:
description: |
The maximum total amount of volumes, in gibibytes
@ -1248,12 +1266,24 @@ maxTotalVolumeGigabytes:
in: body
required: true
type: integer
maxTotalVolumeGigabytesOptional:
description: |
The maximum total amount of volumes, in gibibytes (GiB).
in: body
required: true
type: integer
maxTotalVolumes:
description: |
The maximum number of volumes.
in: body
required: true
type: integer
maxTotalVolumesOptional:
description: |
The maximum number of volumes.
in: body
required: false
type: integer
message_level:
description: |
The level of the message, possible value is
@ -1780,6 +1810,12 @@ QoS_support:
in: body
required: true
type: boolean
quota_class_id:
description:
The name of the quota class set.
in: body
required: true
type: string
quota_set:
description: |
A ``quota_set`` object.

View File

@ -0,0 +1,100 @@
.. -*- rst -*-
Quota class set extension (os-quota-class-sets)
===============================================
Administrators only, depending on policy settings.
Shows and updates quota classes for a project.
Show quota classes for a project
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. rest_method:: GET /v3/{admin_project_id}/os-quota-class-sets/{quota_class_name}
Shows quota class set for a project. If no specific value for the quota class
resource exists, then the default value will be reported.
Normal response codes: 200
Error response codes: 403, 404
Request
-------
.. rest_parameters:: parameters.yaml
- quota_class_name: quota_class_name
- admin_project_id: admin_project_id
Response Parameters
-------------------
.. rest_parameters:: parameters.yaml
- backup_gigabytes: maxTotalBackupGigabytes
- backups: maxTotalBackups
- gigabytes: maxTotalVolumeGigabytes
- groups: maxTotalGroups
- per_volume_gigabytes: per_volume_gigabytes
- snapshots: maxTotalSnapshots
- volumes: maxTotalVolumes
- id: quota_class_id
Response Example
----------------
.. literalinclude:: ./samples/quota-classes-show-response.json
:language: javascript
Update quota classes for a project
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. rest_method:: PUT /v3/{admin_project_id}/os-quota-class-sets/{quota_class_name}
Updates quota class set for a tenant. If the ``quota_class_name`` key does not
exist, then the API will create one.
Normal response codes: 200
Error response codes: 400, 403, 404
Request
-------
.. rest_parameters:: parameters.yaml
- admin_project_id: admin_project_id
- quota_class_name: quota_class_name
- gigabytes: maxTotalVolumeGigabytesOptional
- snapshots: maxTotalSnapshotsOptional
- volumes: maxTotalVolumesOptional
- volume-type: volume_type
Request Example
---------------
.. literalinclude:: ./samples/quota-classes-update-request.json
:language: javascript
Response Parameters
-------------------
.. rest_parameters:: parameters.yaml
- backup_gigabytes: maxTotalBackupGigabytes
- backups: maxTotalBackups
- gigabytes: maxTotalVolumeGigabytes
- groups: maxTotalGroups
- per_volume_gigabytes: per_volume_gigabytes
- snapshots: maxTotalSnapshots
- volumes: maxTotalVolumes
Response Example
----------------
.. literalinclude:: ./samples/quota-classes-update-response.json
:language: javascript

View File

@ -0,0 +1,15 @@
{
"quota_class_set": {
"per_volume_gigabytes": -1,
"volumes_lvmdriver-1": -1,
"groups": 10,
"gigabytes": 1000,
"backup_gigabytes": 1000,
"snapshots": 10,
"gigabytes_lvmdriver-1": -1,
"volumes": 10,
"snapshots_lvmdriver-1": -1,
"backups": 10,
"id": "default"
}
}

View File

@ -0,0 +1,7 @@
{
"quota_class_set": {
"volumes_lmv": 10,
"gigabytes_lmv": 1000,
"snapshots_lmv": 10
}
}

View File

@ -0,0 +1,14 @@
{
"quota_class_set": {
"per_volume_gigabytes": -1,
"volumes_lvmdriver-1": -1,
"groups": 10,
"gigabytes": 1000,
"backup_gigabytes": 1000,
"snapshots": 10,
"gigabytes_lvmdriver-1": -1,
"volumes": 10,
"snapshots_lvmdriver-1": -1,
"backups": 10
}
}