From 6cfa2c03d77aec728d5fed8fa4f6831dafa8bdc7 Mon Sep 17 00:00:00 2001 From: Nguyen Phuong An Date: Fri, 19 Aug 2016 10:44:34 +0700 Subject: [PATCH] api-ref: Fix descriptions of sec-grp parameters This patch corrects descriptions of request/response parmaters of security-groups api. Partially-Implements: blueprint neutron-in-tree-api-ref Closes-Bug: #1614815 Co-Authored-By: Anindita Das Change-Id: I48df20026118f6f62bbb7da4a216227b89b9bf3d --- api-ref/source/v2/parameters.yaml | 27 +- .../security-group-update-response.json | 2 +- api-ref/source/v2/security-group-rules.inc | 2 + api-ref/source/v2/security-groups.inc | 309 +++++++++--------- 4 files changed, 173 insertions(+), 167 deletions(-) diff --git a/api-ref/source/v2/parameters.yaml b/api-ref/source/v2/parameters.yaml index f64ea1cec..a103354ca 100644 --- a/api-ref/source/v2/parameters.yaml +++ b/api-ref/source/v2/parameters.yaml @@ -211,11 +211,11 @@ rule_id: in: path required: false type: string -security_group_id_2: +security_group-id-path: description: | - The UUID of the security group. + The ID of the security group. in: path - required: false + required: true type: string security_group_rule-id-path: description: | @@ -4290,6 +4290,12 @@ security_group: in: body required: true type: object +security_group-id: + description: | + The ID of the security group. + in: body + required: true + type: string security_group_id: description: | The security group UUID to associate with this @@ -4297,12 +4303,6 @@ security_group_id: in: body required: true type: string -security_group_id_1: - description: | - The UUID of the security group. - in: body - required: true - type: string security_group_rule: description: | A ``security_group_rule`` object. @@ -4325,6 +4325,7 @@ security_group_rule-security_group_id: security_group_rules: description: | A list of ``security_group_rule`` objects. + Refer to :ref:`Security group rules ` for details. in: body required: true type: array @@ -4334,13 +4335,7 @@ security_groups: in: body required: false type: array -security_groups_1: - description: | - The UUIDs of any attached security groups. - in: body - required: true - type: array -security_groups_2: +security_groups-obj: description: | A list of ``security_group`` objects. in: body diff --git a/api-ref/source/v2/samples/security-groups/security-group-update-response.json b/api-ref/source/v2/samples/security-groups/security-group-update-response.json index 36daa5850..c6a77c2c8 100644 --- a/api-ref/source/v2/samples/security-groups/security-group-update-response.json +++ b/api-ref/source/v2/samples/security-groups/security-group-update-response.json @@ -1,6 +1,6 @@ { "security_group": { - "rules": [], + "security_group_rules": [], "project_id": "a52cdb9cc7854a39a23d3af73a40899e", "tenant_id": "a52cdb9cc7854a39a23d3af73a40899e", "id": "01fbade5-b664-42f6-83ae-4e214f4263fa", diff --git a/api-ref/source/v2/security-group-rules.inc b/api-ref/source/v2/security-group-rules.inc index fcbc1d4b9..dac083710 100644 --- a/api-ref/source/v2/security-group-rules.inc +++ b/api-ref/source/v2/security-group-rules.inc @@ -1,5 +1,7 @@ .. -*- rst -*- +.. _security_group_rules: + =========================================== Security group rules (security-group-rules) =========================================== diff --git a/api-ref/source/v2/security-groups.inc b/api-ref/source/v2/security-groups.inc index 358d7ad95..5b7c9edca 100644 --- a/api-ref/source/v2/security-groups.inc +++ b/api-ref/source/v2/security-groups.inc @@ -1,8 +1,4 @@ .. -*- rst -*- -.. needs:method_verification -.. needs:parameter_verification -.. needs:example_verification -.. needs:body_verification ================================= Security groups (security-groups) @@ -11,133 +7,21 @@ Security groups (security-groups) Lists, creates, shows information for, updates, and deletes security groups. -Show security group -=================== - -.. rest_method:: GET /v2.0/security-groups/{security_group_id} - -Shows details for a security group. - -The response contains the description, name, UUID, and security -group rules that are associated with the security group and project. - -Normal response codes: 200 - -Error response codes: 404,401 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - security_group_id: security_group_id - - verbose: verbose - - fields: fields - -Response Parameters -------------------- - -.. rest_parameters:: parameters.yaml - - - remote_group_id: remote_group_id - - direction: direction - - protocol: protocol - - description: description - - ethertype: ethertype - - port_range_max: port_range_max - - security_group_rules: security_group_rules - - security_group_id: security_group_id - - tenant_id: project_id - - project_id: project_id - - port_range_min: port_range_min - - remote_ip_prefix: remote_ip_prefix - - security_group: security_group - - id: id - - name: name - -Response Example ----------------- - -.. literalinclude:: samples/security-groups/security-group-show-response.json - :language: javascript - -Update security group -===================== - -.. rest_method:: PUT /v2.0/security-groups/{security_group_id} - -Updates a security group. - -Normal response codes: 200 - -Error response codes: 413,405,404,403,401,400,503 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - description: description - - name: name - - security_group_id: security_group_id - -Request Example ---------------- - -.. literalinclude:: samples/security-groups/security-group-update-request.json - :language: javascript - -Response Parameters -------------------- - -.. rest_parameters:: parameters.yaml - - - security_group: security_group - - tenant_id: project_id - - project_id: project_id - - description: description - - name: name - - id: id - -Response Example ----------------- - -.. literalinclude:: samples/security-groups/security-group-update-response.json - :language: javascript - -Delete security group -===================== - -.. rest_method:: DELETE /v2.0/security-groups/{security_group_id} - -Deletes an OpenStack Networking security group. - -This operation deletes an OpenStack Networking security group and -its associated security group rules, provided that a port is not -associated with the security group. - -This operation does not require a request body. This operation does -not return a response body. - -Error response codes: 409,404,204,401 - -Request -------- - -.. rest_parameters:: parameters.yaml - - - security_group_id: security_group_id - List security groups ==================== .. rest_method:: GET /v2.0/security-groups -Lists OpenStack Networking security groups that the project has access -to. +Lists OpenStack Networking security groups to which the project has access. -The list shows the UUID for and the rules that are associated with -each security group. +The response is an array of ``security_group`` objects which contains a list of +``security_group_rules`` objects. + +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 `Filtering +and Column Selection `__. Normal response codes: 200 @@ -146,26 +30,22 @@ Error response codes: 401 Request ------- +.. rest_parameters:: parameters.yaml + + - fields: fields + Response Parameters ------------------- .. rest_parameters:: parameters.yaml - - remote_group_id: remote_group_id - - direction: direction - - protocol: protocol - - description: description - - ethertype: ethertype - - port_range_max: port_range_max - - security_group_rules: security_group_rules - - security_group_id: security_group_id + - security_groups: security_groups-obj + - id: security_group-id - tenant_id: project_id - project_id: project_id - - port_range_min: port_range_min - - remote_ip_prefix: remote_ip_prefix - - id: id - - security_groups: security_groups - name: name + - description: description + - security_group_rules: security_group_rules Response Example ---------------- @@ -183,7 +63,9 @@ Creates an OpenStack Networking security group. This operation creates a security group with default security group rules for the IPv4 and IPv6 ether types. -Error response codes: 201,401,400 +Normal response codes: 201 + +Error response codes: 400, 401, 409 Request ------- @@ -192,7 +74,7 @@ Request - security_group: security_group - tenant_id: project_id - - project_id: project_id + - project_id: project_id - description: description - name: name @@ -207,19 +89,146 @@ Response Parameters .. rest_parameters:: parameters.yaml - - remote_group_id: remote_group_id - - direction: direction - - protocol: protocol - - description: description - - ethertype: ethertype - - port_range_max: port_range_max - - security_group_rules: security_group_rules - - security_group_id: security_group_id + - security_group: security_group + - id: security_group-id - tenant_id: project_id - project_id: project_id - - port_range_min: port_range_min - - remote_ip_prefix: remote_ip_prefix + - name: name + - description: description + - security_group_rules: security_group_rules + +Response Example +---------------- + +.. literalinclude:: samples/security-groups/security-group-create-response.json + :language: javascript + +Show security group +=================== + +.. rest_method:: GET /v2.0/security-groups/{security_group_id} + +Shows details for a security group. + +The associated security group rules are contained in the response. + +Normal response codes: 200 + +Error response codes: 401, 404 + +Request +------- + +.. rest_parameters:: parameters.yaml + + - security_group_id: security_group-id-path + - verbose: verbose + - fields: fields + +Request Example +--------------- + +.. literalinclude:: samples/security-groups/security-group-show-request-json-http.txt + :language: javascript + +Response Parameters +------------------- + +.. rest_parameters:: parameters.yaml + - security_group: security_group - - id: id + - id: security_group-id + - tenant_id: project_id + - project_id: project_id + - name: name + - description: description + - security_group_rules: security_group_rules + +Response Example +---------------- + +.. literalinclude:: samples/security-groups/security-group-show-response.json + :language: javascript + +Update security group +===================== + +.. rest_method:: PUT /v2.0/security-groups/{security_group_id} + +Updates a security group. + +Normal response codes: 200 + +Error response codes: 400, 401, 403, 404 + +Request +------- + +.. rest_parameters:: parameters.yaml + + - security_group_id: security_group-id-path + - security_group: security_group + - description: description - name: name +Request Example +--------------- + +.. literalinclude:: samples/security-groups/security-group-update-request.json + :language: javascript + +Response Parameters +------------------- + +.. rest_parameters:: parameters.yaml + + - security_group: security_group + - id: security_group-id + - tenant_id: project_id + - project_id: project_id + - name: name + - description: description + - security_group_rules: security_group_rules + +Response Example +---------------- + +.. literalinclude:: samples/security-groups/security-group-update-response.json + :language: javascript + +Delete security group +===================== + +.. rest_method:: DELETE /v2.0/security-groups/{security_group_id} + +Deletes an OpenStack Networking security group. + +This operation deletes an OpenStack Networking security group and +its associated security group rules, provided that a port is not +associated with the security group. If a port is associated with the security +group 409 (Conflict) is returned. + +This operation does not require a request body. This operation does +not return a response body. + +Normal response codes: 204 + +Error response codes: 401, 404, 409 + +Request +------- + +.. rest_parameters:: parameters.yaml + + - security_group_id: security_group-id-path + +Request Example +--------------- + +.. literalinclude:: samples/security-groups/security-group-delete-request-json-http.txt + :language: javascript + +Response +-------- + +There is no body content for the response of a successful DELETE request.