Add api-ref about SG rule bulk create

Neutron support bulk create of security group rules, but that's
undocumented in the api-ref. This commit fixes that by adding the docs
and examples of these calls.

Change-Id: I32ce8b3501a01552fed67ba24602e891c3c01cd4
This commit is contained in:
Michał Dulko 2024-01-11 12:51:56 +01:00
parent 9e3a3a6086
commit b2aca16705
3 changed files with 126 additions and 0 deletions

View File

@ -0,0 +1,22 @@
{
"security_group_rules": [
{
"direction": "ingress",
"port_range_min": "80",
"ethertype": "IPv4",
"port_range_max": "80",
"protocol": "tcp",
"remote_group_id": "85cc3048-abc3-43cc-89b3-377341426ac5",
"security_group_id": "a7734e61-b545-452d-a3cd-0189cbd9747a"
},
{
"direction": "ingress",
"port_range_min": "443",
"ethertype": "IPv4",
"port_range_max": "443",
"protocol": "tcp",
"remote_group_id": "85cc3048-abc3-43cc-89b3-377341426ac5",
"security_group_id": "a7734e61-b545-452d-a3cd-0189cbd9747a"
}
]
}

View File

@ -0,0 +1,40 @@
{
"security_group_rules": [
{
"direction": "ingress",
"ethertype": "IPv4",
"id": "2bc0accf-312e-429a-956e-e4407625eb62",
"port_range_max": 80,
"port_range_min": 80,
"protocol": "tcp",
"remote_group_id": "85cc3048-abc3-43cc-89b3-377341426ac5",
"remote_ip_prefix": null,
"security_group_id": "a7734e61-b545-452d-a3cd-0189cbd9747a",
"project_id": "e4f50856753b4dc6afee5fa6b9b6c550",
"revision_number": 1,
"tenant_id": "e4f50856753b4dc6afee5fa6b9b6c550",
"created_at": "2018-03-19T19:16:56Z",
"updated_at": "2018-03-19T19:16:56Z",
"description": "",
"belongs_to_default_sg": false
},
{
"direction": "ingress",
"ethertype": "IPv4",
"id": "4d4a5704-749a-4525-958e-93844d1dd9a4",
"port_range_max": 443,
"port_range_min": 443,
"protocol": "tcp",
"remote_group_id": "85cc3048-abc3-43cc-89b3-377341426ac5",
"remote_ip_prefix": null,
"security_group_id": "a7734e61-b545-452d-a3cd-0189cbd9747a",
"project_id": "e4f50856753b4dc6afee5fa6b9b6c550",
"revision_number": 1,
"tenant_id": "e4f50856753b4dc6afee5fa6b9b6c550",
"created_at": "2018-03-19T19:16:56Z",
"updated_at": "2018-03-19T19:16:56Z",
"description": "",
"belongs_to_default_sg": false
}
]
}

View File

@ -153,6 +153,70 @@ Response Example
.. literalinclude:: samples/security-groups/security-group-rule-create-response.json
:language: javascript
Bulk create security group rule
===============================
.. rest_method:: POST /v2.0/security-group-rules
Creates multiple OpenStack Networking security group rules in a single request. Specify a list of security group rules in the request body.
Guarantees the atomic completion of the bulk operation.
Normal response codes: 201
Error response codes: 400, 401, 404, 409
Request
-------
.. rest_parameters:: parameters.yaml
- security_group_rules: security_group_rules
- remote_group_id: remote_group_id-request
- direction: direction
- protocol: protocol-request
- ethertype: ethertype-request
- port_range_max: port_range_max-request
- security_group_id: security_group_rule-security_group_id
- port_range_min: port_range_min-request
- remote_ip_prefix: remote_ip_prefix-request
- description: description-request
Request Example
---------------
.. literalinclude:: samples/security-groups/security-group-rule-bulk-create-request.json
:language: javascript
Response Parameters
-------------------
.. rest_parameters:: parameters.yaml
- security_group_rules: security_group_rules
- remote_group_id: remote_group_id
- direction: direction
- protocol: protocol
- ethertype: ethertype
- port_range_max: port_range_max
- security_group_id: security_group_rule-security_group_id
- tenant_id: project_id
- project_id: project_id
- port_range_min: port_range_min
- remote_ip_prefix: remote_ip_prefix
- created_at: created_at_resource
- updated_at: updated_at_resource
- revision_number: revision_number
- id: security_group_rule-id
- description: description
- belongs_to_default_sg: security_group_rule-belongs-to-default-sg
Response Example
----------------
.. literalinclude:: samples/security-groups/security-group-rule-bulk-create-response.json
:language: javascript
Show security group rule
========================