
Cleans up a bunch of the types and descriptions for the parameters. Removes some extraneous unused parameters. Added descriptions for the request and response to point out that group_id and cidr are optional but one or the other is required and depending on what comes in the request influences what comes back in the response. Part of blueprint api-ref-in-rst Change-Id: I1084fa7ec46373cc989d1d93bb667ac59a62e38a
93 lines
2.4 KiB
ReStructuredText
93 lines
2.4 KiB
ReStructuredText
.. -*- rst -*-
|
|
.. needs:example_verification
|
|
.. needs:body_verification
|
|
|
|
====================================================
|
|
Rules for security group (os-security-group-rules)
|
|
====================================================
|
|
|
|
Creates and deletes security group rules.
|
|
|
|
Create Security Group Rule
|
|
==========================
|
|
|
|
.. rest_method:: POST /v2.1/{tenant_id}/os-security-group-rules
|
|
|
|
Creates a rule for a security group. Either ``cidr`` or ``group_id`` must be
|
|
specified when creating a rule.
|
|
|
|
Normal response codes: 200
|
|
|
|
Error response codes: badRequest(400), unauthorized(401), forbidden(403)
|
|
|
|
Request
|
|
-------
|
|
|
|
.. rest_parameters:: parameters.yaml
|
|
|
|
- tenant_id: tenant_id
|
|
- security_group_rule: security_group_rule
|
|
- parent_group_id: parent_group_id
|
|
- ip_protocol: ip_protocol
|
|
- from_port: from_port
|
|
- to_port: to_port
|
|
- cidr: secgroup_rule_cidr
|
|
- group_id: group_id
|
|
|
|
.. TODO(sdague): we currently have no samples here
|
|
**Example Create security group rule: JSON request**
|
|
|
|
.. literalinclude:: ../../doc/api_samples/os-security-group-rules/security-group-rule-create-req.json
|
|
:language: javascript
|
|
|
|
Response
|
|
--------
|
|
|
|
The ``group`` is empty if ``group_id`` was not provided on the request.
|
|
|
|
The ``ip_range`` is empty if ``cidr`` was not provided on the request.
|
|
|
|
.. rest_parameters:: parameters.yaml
|
|
|
|
- security_group_rule: security_group_rule
|
|
- ip_protocol: ip_protocol
|
|
- from_port: from_port
|
|
- to_port: to_port
|
|
- ip_range: secgroup_rule_ip_range
|
|
- cidr: secgroup_rule_cidr
|
|
- id: secgroup_rule_id
|
|
- group: group
|
|
- parent_group_id: parent_group_id
|
|
- name: name
|
|
- tenant_id: secgroup_tenant_id_body
|
|
|
|
.. TODO(sdague): we currently have no samples here
|
|
**Example Create security group rule: JSON response**
|
|
|
|
.. literalinclude:: ../../doc/api_samples/os-security-group-rules/security-group-rule-create-resp.json
|
|
:language: javascript
|
|
|
|
Delete Security Group Rule
|
|
==========================
|
|
|
|
.. rest_method:: DELETE /v2.1/{tenant_id}/os-security-group-rules/{security_group_rule_id}
|
|
|
|
Deletes a security group rule.
|
|
|
|
Normal response codes: 202
|
|
|
|
Error response codes: badRequest(400), unauthorized(401), forbidden(403), itemNotFound(404), conflict(409)
|
|
|
|
Request
|
|
-------
|
|
|
|
.. rest_parameters:: parameters.yaml
|
|
|
|
- tenant_id: tenant_id
|
|
- security_group_rule_id: security_group_rule_id
|
|
|
|
Response
|
|
--------
|
|
|
|
There is no body content for the response of a successful DELETE query.
|