From 2ca2b8076de13242b2f8ad878b9d30d69bc690cb Mon Sep 17 00:00:00 2001 From: johnsom Date: Tue, 27 Jun 2017 17:39:01 -0700 Subject: [PATCH] Add v2 Quota API section This patch adds the quota section to the v2 API reference. Change-Id: I23cd2c4a65e4d7bf3c85f176a3042fefe0fb35b9 Partial-Bug: #1558385 --- api-ref/source/parameters.yaml | 80 +++++ api-ref/source/v2/examples/quota-delete-curl | 1 + api-ref/source/v2/examples/quota-show-curl | 1 + api-ref/source/v2/examples/quota-update-curl | 1 + .../v2/examples/quota-update-request.json | 9 + .../v2/examples/quota-update-response.json | 9 + .../source/v2/examples/quotas-defaults-curl | 1 + .../v2/examples/quotas-defaults-response.json | 9 + api-ref/source/v2/examples/quotas-list-curl | 1 + .../v2/examples/quotas-list-response.json | 12 + .../v2/examples/quotas-show-response.json | 9 + api-ref/source/v2/index.rst | 5 + api-ref/source/v2/quota.inc | 281 ++++++++++++++++++ .../add_API_reference-81d84d0c8598b764.yaml | 5 + 14 files changed, 424 insertions(+) create mode 100644 api-ref/source/v2/examples/quota-delete-curl create mode 100644 api-ref/source/v2/examples/quota-show-curl create mode 100644 api-ref/source/v2/examples/quota-update-curl create mode 100644 api-ref/source/v2/examples/quota-update-request.json create mode 100644 api-ref/source/v2/examples/quota-update-response.json create mode 100644 api-ref/source/v2/examples/quotas-defaults-curl create mode 100644 api-ref/source/v2/examples/quotas-defaults-response.json create mode 100644 api-ref/source/v2/examples/quotas-list-curl create mode 100644 api-ref/source/v2/examples/quotas-list-response.json create mode 100644 api-ref/source/v2/examples/quotas-show-response.json create mode 100644 api-ref/source/v2/quota.inc create mode 100644 releasenotes/notes/add_API_reference-81d84d0c8598b764.yaml diff --git a/api-ref/source/parameters.yaml b/api-ref/source/parameters.yaml index e8e0b17f7d..ee5cee6067 100644 --- a/api-ref/source/parameters.yaml +++ b/api-ref/source/parameters.yaml @@ -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. diff --git a/api-ref/source/v2/examples/quota-delete-curl b/api-ref/source/v2/examples/quota-delete-curl new file mode 100644 index 0000000000..08ce90d538 --- /dev/null +++ b/api-ref/source/v2/examples/quota-delete-curl @@ -0,0 +1 @@ +curl -X DELETE -H "X-Auth-Token: " http://198.51.100.10:9876/v2.0/lbaas/quotas/e3cd678b11784734bc366148aa37580e diff --git a/api-ref/source/v2/examples/quota-show-curl b/api-ref/source/v2/examples/quota-show-curl new file mode 100644 index 0000000000..2d52b1f95c --- /dev/null +++ b/api-ref/source/v2/examples/quota-show-curl @@ -0,0 +1 @@ +curl -X GET -H "X-Auth-Token: " http://198.51.100.10:9876/v2.0/lbaas/quotas/e3cd678b11784734bc366148aa37580e diff --git a/api-ref/source/v2/examples/quota-update-curl b/api-ref/source/v2/examples/quota-update-curl new file mode 100644 index 0000000000..24596934a8 --- /dev/null +++ b/api-ref/source/v2/examples/quota-update-curl @@ -0,0 +1 @@ +curl -X PUT -H "Content-Type: application/json" -H "X-Auth-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 diff --git a/api-ref/source/v2/examples/quota-update-request.json b/api-ref/source/v2/examples/quota-update-request.json new file mode 100644 index 0000000000..9718df68a9 --- /dev/null +++ b/api-ref/source/v2/examples/quota-update-request.json @@ -0,0 +1,9 @@ +{ + "quota": { + "load_balancer": 10, + "listener": -1, + "member": 50, + "pool": -1, + "health_monitor": -1 + } +} diff --git a/api-ref/source/v2/examples/quota-update-response.json b/api-ref/source/v2/examples/quota-update-response.json new file mode 100644 index 0000000000..9718df68a9 --- /dev/null +++ b/api-ref/source/v2/examples/quota-update-response.json @@ -0,0 +1,9 @@ +{ + "quota": { + "load_balancer": 10, + "listener": -1, + "member": 50, + "pool": -1, + "health_monitor": -1 + } +} diff --git a/api-ref/source/v2/examples/quotas-defaults-curl b/api-ref/source/v2/examples/quotas-defaults-curl new file mode 100644 index 0000000000..3444b9d504 --- /dev/null +++ b/api-ref/source/v2/examples/quotas-defaults-curl @@ -0,0 +1 @@ +curl -X GET -H "X-Auth-Token: " http://198.51.100.10:9876/v2.0/lbaas/quotas/defaults diff --git a/api-ref/source/v2/examples/quotas-defaults-response.json b/api-ref/source/v2/examples/quotas-defaults-response.json new file mode 100644 index 0000000000..c149c97b7d --- /dev/null +++ b/api-ref/source/v2/examples/quotas-defaults-response.json @@ -0,0 +1,9 @@ +{ + "quota": { + "load_balancer": 50, + "listener": -1, + "member": -1, + "pool": -1, + "health_monitor": -1 + } +} diff --git a/api-ref/source/v2/examples/quotas-list-curl b/api-ref/source/v2/examples/quotas-list-curl new file mode 100644 index 0000000000..7218f5de73 --- /dev/null +++ b/api-ref/source/v2/examples/quotas-list-curl @@ -0,0 +1 @@ +curl -X GET -H "X-Auth-Token: " http://198.51.100.10:9876/v2.0/lbaas/quotas?project_id=e3cd678b11784734bc366148aa37580e diff --git a/api-ref/source/v2/examples/quotas-list-response.json b/api-ref/source/v2/examples/quotas-list-response.json new file mode 100644 index 0000000000..d24bef9cc4 --- /dev/null +++ b/api-ref/source/v2/examples/quotas-list-response.json @@ -0,0 +1,12 @@ +{ + "quotas": [ + { + "load_balancer": 5, + "member": 50, + "health_monitor": -1, + "listener": null, + "project_id": "e3cd678b11784734bc366148aa37580e", + "pool": null + } + ] +} diff --git a/api-ref/source/v2/examples/quotas-show-response.json b/api-ref/source/v2/examples/quotas-show-response.json new file mode 100644 index 0000000000..da31e2e712 --- /dev/null +++ b/api-ref/source/v2/examples/quotas-show-response.json @@ -0,0 +1,9 @@ +{ + "quota": { + "load_balancer": 5, + "listener": -1, + "member": 50, + "pool": -1, + "health_monitor": -1 + } +} diff --git a/api-ref/source/v2/index.rst b/api-ref/source/v2/index.rst index 1604512954..a354614210 100644 --- a/api-ref/source/v2/index.rst +++ b/api-ref/source/v2/index.rst @@ -45,3 +45,8 @@ L7 Policies L7 Rules -------- .. include:: l7rule.inc + +------ +Quotas +------ +.. include:: quota.inc diff --git a/api-ref/source/v2/quota.inc b/api-ref/source/v2/quota.inc new file mode 100644 index 0000000000..afc1562869 --- /dev/null +++ b/api-ref/source/v2/quota.inc @@ -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. + diff --git a/releasenotes/notes/add_API_reference-81d84d0c8598b764.yaml b/releasenotes/notes/add_API_reference-81d84d0c8598b764.yaml new file mode 100644 index 0000000000..14d14ede59 --- /dev/null +++ b/releasenotes/notes/add_API_reference-81d84d0c8598b764.yaml @@ -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/