From cc4afb9aad1b54f33726e38636808b4ba216bd6e Mon Sep 17 00:00:00 2001 From: junboli Date: Mon, 26 Feb 2018 10:00:46 +0800 Subject: [PATCH] Add docs for quota_class_set API We have implemented quota-classes-show and quota-classes-update api, but no api-ref is documented. This patch is to add api-ref in the docs. Change-Id: I275ee4fe048607a49368c4f985c055ab3a3bbfb6 Closes-bug: #1751683 --- api-ref/source/index.rst | 1 + api-ref/source/parameters.yaml | 68 ++++++++++++ api-ref/source/quota-classes.inc | 104 ++++++++++++++++++ .../samples/quota-classes-show-response.json | 12 ++ .../samples/quota-classes-update-request.json | 6 + .../quota-classes-update-response.json | 11 ++ 6 files changed, 202 insertions(+) create mode 100644 api-ref/source/quota-classes.inc create mode 100644 api-ref/source/samples/quota-classes-show-response.json create mode 100644 api-ref/source/samples/quota-classes-update-request.json create mode 100644 api-ref/source/samples/quota-classes-update-response.json diff --git a/api-ref/source/index.rst b/api-ref/source/index.rst index 1f47ea49a1..3ed2707063 100644 --- a/api-ref/source/index.rst +++ b/api-ref/source/index.rst @@ -26,6 +26,7 @@ Shared File Systems API .. include:: availability-zones.inc .. include:: os-share-manage.inc .. include:: quota-sets.inc +.. include:: quota-classes.inc .. include:: user-messages.inc ====================================== diff --git a/api-ref/source/parameters.yaml b/api-ref/source/parameters.yaml index d508968377..e8d0e224b0 100644 --- a/api-ref/source/parameters.yaml +++ b/api-ref/source/parameters.yaml @@ -26,6 +26,12 @@ message_id: in: path required: false type: string +quota_class_name: + description: + The name of the quota class for which to set quotas. + in: path + required: true + type: string security_service_id_path: description: | The UUID of the security service. @@ -1636,6 +1642,28 @@ maxTotalShareGigabytes: in: body required: true type: integer +maxTotalShareGigabytesOptional: + description: | + The total maximum number of share gigabytes that + are allowed in a project. You cannot request a share that exceeds + the allowed gigabytes quota. + in: body + required: false + type: integer +maxTotalShareGroups: + description: | + The maximum number of share groups. + in: body + required: true + type: integer + min_version: 2.40 +maxTotalShareGroupSnapshots: + description: | + The maximum number of share group snapshots. + in: body + required: true + type: integer + min_version: 2.40 maxTotalShareNetworks: description: | The total maximum number of share-networks that @@ -1643,6 +1671,13 @@ maxTotalShareNetworks: in: body required: true type: integer +maxTotalShareNetworksOptional: + description: | + The total maximum number of share-networks that + are allowed in a project. + in: body + required: false + type: integer maxTotalShares: description: | The total maximum number of shares that are @@ -1657,6 +1692,20 @@ maxTotalShareSnapshots: in: body required: true type: integer +maxTotalShareSnapshotsOptional: + description: | + The total maximum number of share snapshots that + are allowed in a project. + in: body + required: false + type: integer +maxTotalSharesOptional: + description: | + The total maximum number of shares that are + allowed in a project. + in: body + required: false + type: integer maxTotalSnapshotGigabytes: description: | The total maximum number of snapshot gigabytes @@ -1664,6 +1713,13 @@ maxTotalSnapshotGigabytes: in: body required: true type: integer +maxTotalSnapshotGigabytesOptional: + description: | + The total maximum number of snapshot gigabytes + that are allowed in a project. + in: body + required: false + type: integer message_level_body: in: body required: true @@ -1997,6 +2053,18 @@ qos: in: body required: true type: boolean +quota_class_id: + description: | + A ``quota_class_set`` id. + in: body + required: true + type: string +quota_class_set: + description: | + A ``quota_class_set`` object. + in: body + required: true + type: object quota_gigabytes: description: | The number of gigabytes allowed for each tenant. diff --git a/api-ref/source/quota-classes.inc b/api-ref/source/quota-classes.inc new file mode 100644 index 0000000000..410b36a5b0 --- /dev/null +++ b/api-ref/source/quota-classes.inc @@ -0,0 +1,104 @@ +.. -*- rst -*- + +=============== +Quota class set +=============== + +Quota classes can be shown and updated for a project. + +Show quota classes for a project +================================ + +.. rest_method:: GET /v2/{tenant_id}/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: forbidden(403), itemNotFound(404) + + +Request +------- + +.. rest_parameters:: parameters.yaml + + - tenant_id: tenant_id + - quota_class_name: quota_class_name + + +Response Parameters +------------------- + +.. rest_parameters:: parameters.yaml + + - quota_class_set: quota_class_set + - share_groups: maxTotalShareGroups + - gigabytes: maxTotalShareGigabytes + - share_group_snapshots: maxTotalShareGroupSnapshots + - snapshots: maxTotalShareSnapshots + - snapshot_gigabytes: maxTotalSnapshotGigabytes + - shares: maxTotalShares + - id: quota_class_id + - share_networks: maxTotalShareNetworks + +Response Example +---------------- + +.. literalinclude:: ./samples/quota-classes-show-response.json + :language: javascript + + +Update quota classes for a project +================================== + +.. rest_method:: PUT /v2/{tenant_id}/quota-class-sets/{quota_class_name} + +Updates quota class set for a project. If the ``quota_class_name`` key does not +exist, then the API will create one. + +Normal response codes: 200 + +Error response codes: badRequest(400), forbidden(403), itemNotFound(404) + + +Request +------- + +.. rest_parameters:: parameters.yaml + + - tenant_id: tenant_id + - quota_class_name: quota_class_name + - shares: maxTotalSharesOptional + - snapshots: maxTotalShareSnapshotsOptional + - gigabytes: maxTotalShareGigabytesOptional + - snapshot-gigabytes: maxTotalSnapshotGigabytesOptional + - share-networks: maxTotalShareNetworksOptional + +Request Example +--------------- + +.. literalinclude:: ./samples/quota-classes-update-request.json + :language: javascript + + +Response Parameters +------------------- + +.. rest_parameters:: parameters.yaml + + - quota_class_set: quota_class_set + - share_groups: maxTotalShareGroups + - gigabytes: maxTotalShareGigabytes + - share_group_snapshots: maxTotalShareGroupSnapshots + - snapshots: maxTotalShareSnapshots + - snapshot_gigabytes: maxTotalSnapshotGigabytes + - shares: maxTotalShares + - share_networks: maxTotalShareNetworks + +Response Example +---------------- + +.. literalinclude:: ./samples/quota-classes-update-response.json + :language: javascript diff --git a/api-ref/source/samples/quota-classes-show-response.json b/api-ref/source/samples/quota-classes-show-response.json new file mode 100644 index 0000000000..275941913c --- /dev/null +++ b/api-ref/source/samples/quota-classes-show-response.json @@ -0,0 +1,12 @@ +{ + "quota_class_set": { + "share_groups": 50, + "gigabytes": 1000, + "share_group_snapshots": 50, + "snapshots": 50, + "snapshot_gigabytes": 1000, + "shares": 50, + "id": "default", + "share_networks": 10 + } +} diff --git a/api-ref/source/samples/quota-classes-update-request.json b/api-ref/source/samples/quota-classes-update-request.json new file mode 100644 index 0000000000..921111958b --- /dev/null +++ b/api-ref/source/samples/quota-classes-update-request.json @@ -0,0 +1,6 @@ +{ + "quota_class_set": { + "class_name": "test-qupta-class-update", + "gigabytes": 20 + } +} diff --git a/api-ref/source/samples/quota-classes-update-response.json b/api-ref/source/samples/quota-classes-update-response.json new file mode 100644 index 0000000000..28183c70c5 --- /dev/null +++ b/api-ref/source/samples/quota-classes-update-response.json @@ -0,0 +1,11 @@ +{ + "quota_class_set": { + "share_groups": 50, + "gigabytes": 20, + "share_group_snapshots": 50, + "snapshots": 50, + "snapshot_gigabytes": 1000, + "shares": 50, + "share_networks": 10 + } +}