diff --git a/api-ref/source/v2/index.rst b/api-ref/source/v2/index.rst index 71b9c50f4ed..eabe9de6a30 100644 --- a/api-ref/source/v2/index.rst +++ b/api-ref/source/v2/index.rst @@ -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 diff --git a/api-ref/source/v2/parameters.yaml b/api-ref/source/v2/parameters.yaml index 42aa2fd368c..1a1668aa774 100644 --- a/api-ref/source/v2/parameters.yaml +++ b/api-ref/source/v2/parameters.yaml @@ -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. diff --git a/api-ref/source/v2/quota-classes.inc b/api-ref/source/v2/quota-classes.inc new file mode 100644 index 00000000000..a182e645aa9 --- /dev/null +++ b/api-ref/source/v2/quota-classes.inc @@ -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 diff --git a/api-ref/source/v2/samples/quota-classes-show-response.json b/api-ref/source/v2/samples/quota-classes-show-response.json new file mode 100644 index 00000000000..d30e4eef1ac --- /dev/null +++ b/api-ref/source/v2/samples/quota-classes-show-response.json @@ -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" + } +} \ No newline at end of file diff --git a/api-ref/source/v2/samples/quota-classes-update-request.json b/api-ref/source/v2/samples/quota-classes-update-request.json new file mode 100644 index 00000000000..d257967265d --- /dev/null +++ b/api-ref/source/v2/samples/quota-classes-update-request.json @@ -0,0 +1,7 @@ +{ + "quota_class_set": { + "volumes_lmv": 10, + "gigabytes_lmv": 1000, + "snapshots_lmv": 10 + } +} \ No newline at end of file diff --git a/api-ref/source/v2/samples/quota-classes-update-response.json b/api-ref/source/v2/samples/quota-classes-update-response.json new file mode 100644 index 00000000000..130467c4034 --- /dev/null +++ b/api-ref/source/v2/samples/quota-classes-update-response.json @@ -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 + } +} \ No newline at end of file diff --git a/api-ref/source/v3/index.rst b/api-ref/source/v3/index.rst index 0ad6f3ae174..086cf0703f6 100644 --- a/api-ref/source/v3/index.rst +++ b/api-ref/source/v3/index.rst @@ -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 diff --git a/api-ref/source/v3/parameters.yaml b/api-ref/source/v3/parameters.yaml index 9cbe6dba119..ebd5c579202 100644 --- a/api-ref/source/v3/parameters.yaml +++ b/api-ref/source/v3/parameters.yaml @@ -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. @@ -1243,12 +1249,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 @@ -1256,12 +1274,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 @@ -1788,6 +1818,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. diff --git a/api-ref/source/v3/quota-classes.inc b/api-ref/source/v3/quota-classes.inc new file mode 100644 index 00000000000..dc19136c7eb --- /dev/null +++ b/api-ref/source/v3/quota-classes.inc @@ -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 diff --git a/api-ref/source/v3/samples/quota-classes-show-response.json b/api-ref/source/v3/samples/quota-classes-show-response.json new file mode 100644 index 00000000000..d30e4eef1ac --- /dev/null +++ b/api-ref/source/v3/samples/quota-classes-show-response.json @@ -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" + } +} \ No newline at end of file diff --git a/api-ref/source/v3/samples/quota-classes-update-request.json b/api-ref/source/v3/samples/quota-classes-update-request.json new file mode 100644 index 00000000000..d257967265d --- /dev/null +++ b/api-ref/source/v3/samples/quota-classes-update-request.json @@ -0,0 +1,7 @@ +{ + "quota_class_set": { + "volumes_lmv": 10, + "gigabytes_lmv": 1000, + "snapshots_lmv": 10 + } +} \ No newline at end of file diff --git a/api-ref/source/v3/samples/quota-classes-update-response.json b/api-ref/source/v3/samples/quota-classes-update-response.json new file mode 100644 index 00000000000..130467c4034 --- /dev/null +++ b/api-ref/source/v3/samples/quota-classes-update-response.json @@ -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 + } +} \ No newline at end of file