Querying Security Group Rules¶
Function¶
This API is used to query security group rules using search criteria and to display the security group rules in a list.
URI¶
GET /v1/{project_id}/security-group-rules
Example:
GET https://{Endpoint}/v1/{project_id}/security-group-rules?security_group_id=a7734e61-b545-452da3cd-0189cbd9747a&limit=10&marker=4779ab1c-7c1a-44b1-a02e-93dfc361b32d
Table 1 describes the parameters.
Name | Mandatory | Type | Description |
---|---|---|---|
project_id | Yes | String | Specifies the project ID. For details about how to obtain a project ID, see Obtaining a Project ID. |
marker | No | String | Specifies a resource ID for pagination query, indicating that the query starts from the next record of the specified resource ID. This parameter can work together with the parameter limit.
|
limit | No | Integer | Specifies the number of records that will be returned on each page. The value is from 0 to intmax (2^31-1). The default value is 2000. limit can be used together with marker. For details, see the parameter description of marker. |
security_group_id | No | String | Specifies the security group ID. |
Request Parameters¶
None
Example Request¶
GET https://{Endpoint}/v1/{project_id}/security-group-rules
Response Parameters¶
Name | Type | Description |
---|---|---|
security_group_rules | Array of security_group_rule objects | Specifies the security group rule objects. For details, see Table 2. |
Name | Type | Description |
---|---|---|
id | String | Specifies the security group rule ID, which uniquely identifies the security group rule. |
description | String |
|
security_group_id | String | Specifies the security group rule ID, which uniquely identifies the security group rule. |
direction | String |
|
ethertype | String |
|
protocol | String |
|
port_range_min | Integer |
|
port_range_max | Integer |
|
remote_ip_prefix | String |
|
remote_group_id | String |
|
tenant_id | String |
|
Example Response¶
{
"security_group_rules": [
{
"direction": "egress",
"ethertype": "IPv6",
"id": "3c0e45ff-adaf-4124-b083-bf390e5482ff",
"description": "",
"port_range_max": null,
"port_range_min": null,
"protocol": null,
"remote_group_id": null,
"remote_ip_prefix": null,
"security_group_id": "85cc3048-abc3-43cc-89b3-377341426ac5",
"tenant_id": "e4f50856753b4dc6afee5fa6b9b6c550"
},
{
"direction": "egress",
"ethertype": "IPv4",
"id": "93aa42e5-80db-4581-9391-3a608bd0e448",
"description": "",
"port_range_max": null,
"port_range_min": null,
"protocol": null,
"remote_group_id": null,
"remote_ip_prefix": null,
"security_group_id": "85cc3048-abc3-43cc-89b3-377341426ac5",
"tenant_id": "e4f50856753b4dc6afee5fa6b9b6c550"
},
{
"direction": "ingress",
"ethertype": "IPv6",
"id": "c0b09f00-1d49-4e64-a0a7-8a186d928138",
"description": "",
"port_range_max": null,
"port_range_min": null,
"protocol": null,
"remote_group_id": "85cc3048-abc3-43cc-89b3-377341426ac5",
"remote_ip_prefix": null,
"security_group_id": "85cc3048-abc3-43cc-89b3-377341426ac5",
"tenant_id": "e4f50856753b4dc6afee5fa6b9b6c550"
},
{
"direction": "ingress",
"ethertype": "IPv4",
"id": "f7d45c89-008e-4bab-88ad-d6811724c51c",
"description": "",
"port_range_max": null,
"port_range_min": null,
"protocol": null,
"remote_group_id": "85cc3048-abc3-43cc-89b3-377341426ac5",
"remote_ip_prefix": null,
"security_group_id": "85cc3048-abc3-43cc-89b3-377341426ac5",
"tenant_id": "e4f50856753b4dc6afee5fa6b9b6c550"
}
]
}
Status Code¶
See Status Codes.
Error Code¶
See Error Codes.